Skip to content

About

A production-ready Multipath QUIC implementation in pure Go

Resources

Security policy

Stars

1 star

Watchers

0 watching

Forks

 
 

Latest commit

 

History

7,229 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mp-quic-go: QUIC with Multipath Support

github.com/qoke/mp-quic-go is a maintained fork of quic-go with Multipath QUIC (draft-ietf-quic-multipath-21). It continues the original mp-quic-go by AeonDave, which added multipath support to quic-go. All credit for the QUIC implementation goes to the quic-go authors, and for the original multipath work to the authors of mp-quic-go.

quic-go implements QUIC (RFC 9000, RFC 9001, RFC 9002) in Go, with support for HTTP/3 (RFC 9114), QPACK (RFC 9204), the Extensible Prioritization Scheme for HTTP (RFC 9218), and HTTP Datagrams (RFC 9297).

Multipath is opt-in. When it is not negotiated, a connection is standard single-path QUIC and behaves like quic-go.

docs/COMPLIANCE.md lists every MUST statement of the implemented RFCs and drafts with the code and the tests that cover it, the SHOULD and MAY statements that are not followed, and the results of the conformance tests (QUIC interop runner, h3spec, multipath interop with picoquic, fuzzing).

Installation

go get github.com/qoke/mp-quic-go@latest
import (
	quic "github.com/qoke/mp-quic-go"
	"github.com/qoke/mp-quic-go/http3"
)

This module is based on quic-go v0.63.0. Its API is that of quic-go, extended with multipath configuration fields and types. To switch from quic-go, replace the import paths.

Go 1.26 or later is required.

Multipath Features

  • IETF Multipath QUIC (draft-ietf-quic-multipath-21), negotiated with the initial_max_path_id transport parameter, using the code points registered by IANA
  • Paths opened by the client with Conn.AddPath or Conn.AddPathFromAddr, or automatically from all local addresses
  • Per-path packet number spaces, loss recovery, RTT estimation, congestion control, ECN validation and MTU discovery
  • Path status (available or backup), path abandonment and per-path migration of the client's address
  • Path scheduling: RoundRobin, LowLatency and MinRTT schedulers, or a custom MultipathController
  • Congestion control: an uncoupled Reno controller per path (the controller quic-go uses), or coupled OLIA controllers (opt-in)
  • Duplication of selected frames on other paths, and reinjection of lost frames on a selected path
  • Optional multi-socket manager for multiple local addresses and interface changes
  • Optional address advertisement (ADD_ADDRESS), negotiated separately: a server announces its other addresses, and the client opens paths to them
  • QUIC Address Discovery (draft-ietf-quic-address-discovery-01, OBSERVED_ADDRESS), with and without multipath: an endpoint learns the address its peer observes on every path, e.g. the address of a NAT (see docs/ADDRESS_DISCOVERY.md)

Multipath is used if both endpoints configure a multipath controller. Versions of this module up to v0.2.x (v0.2.0 to v0.2.3) used an incompatible multipath protocol of their own: connections with them fall back to a single path, using standard QUIC (see the changelog). The address advertisement extension is negotiated separately, and only used together with IETF Multipath QUIC.

Quick Start

// client
config := &quic.Config{
	MaxPaths: 3,
	MultipathController: quic.NewDefaultMultipathController(
		quic.NewRoundRobinScheduler(),
	),
}

conn, err := quic.DialAddr(context.Background(), "localhost:4242", tlsConf, config)
if err != nil {
	// handle error
}
if !conn.ConnectionState().SupportsMultipath {
	// the server doesn't support multipath: the connection uses a single path
}

// open a second path, sending from another socket
udpConn, _ := net.ListenUDP("udp", &net.UDPAddr{IP: net.IPv4zero})
path, err := conn.AddPath(&quic.Transport{Conn: udpConn})
if err != nil {
	// handle error
}
if err := path.Probe(context.Background()); err != nil {
	// handle error
}

A controller keeps per-connection state. On a server, use Config.MultipathControllerFactory to create one controller per connection:

// server
config := &quic.Config{
	MultipathControllerFactory: func() quic.MultipathController {
		return quic.NewDefaultMultipathController(quic.NewRoundRobinScheduler())
	},
}
ln, err := quic.ListenAddr("0.0.0.0:4242", tlsConf, config)

example/multipath is a complete example, and docs/MULTIPATH_EXAMPLES.md shows automatic paths, path status, custom controllers, duplication, reinjection and the multi-socket manager.

Standard QUIC Features

For use in FIPS 140-3 environments, see FIPS140.md.

Documentation

Testing

go test ./...

Multipath tests only:

go test -run Multipath ./...

Interoperability with picoquic (needs Docker and Linux):

go test -tags picoquic -count=1 ./interop/multipath/...

docs/MAINTAINING.md describes the other conformance tests: the QUIC interop runner, h3spec and fuzzing.

License

The code is licensed under the MIT license. The logo and brand assets are excluded from the MIT license. See assets/LICENSE.md for the full usage policy and details.

About

A production-ready Multipath QUIC implementation in pure Go

Resources

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages