Documentation
¶
Overview ¶
Package multipath provides a simple way to aggregate multiple network paths between a pair of hosts to form a single connection from the upper layer perspective, for throughput and resilience.
The term connection, path and subflow used here are the same as mentioned in MP-TCP https://www.rfc-editor.org/rfc/rfc8684.html#name-terminology
Each subflow is a bidirectional byte stream each side in the following form until being disrupted or the connection ends. When establishing the very first subflow, the client sends an all-zero connnection ID (CID) and the server sends the assigned CID back. Subsequent subflows use the same CID.
---------------------------------------------------- | version(1) | cid(16) | frames (...) | ----------------------------------------------------
There are two types of frames. Data frame carries application data while ack frame carries acknowledgement to the frame just received. When one data frame is not acked in time, it is sent over another subflow, until all available subflows have been tried. Payload size and frame number uses variable-length integer encoding as described here: https://tools.ietf.org/html/draft-ietf-quic-transport-29#section-16
-------------------------------------------------------- | payload size(1-8) | frame number (1-8) | payload | -------------------------------------------------------- --------------------------------------- | 00000000 | ack frame number (1-8) | ---------------------------------------
Ack frames with frame number < 10 are reserved for control. For now only 0 and 1 are used, for ping and pong frame respectively. They are for updating RTT on inactive subflows and detecting recovered subflows.
Ping frame:
------------------------- | 00000000 | 00000000 | -------------------------
Pong frame:
------------------------- | 00000000 | 00000001 | -------------------------
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func NewListener ¶
func NewListener(listeners []net.Listener, stats []StatsTracker) net.Listener
func ReadVarInt ¶
func ReadVarInt(b io.ByteReader) (uint64, error)
ReadVarInt reads a number in the QUIC varint format
func WriteVarInt ¶
WriteVarInt writes a number in the QUIC varint format
Types ¶
type Dialer ¶
Dialer is the interface each subflow dialer needs to satisify. It is also the type of the multipath dialer.
type NullTracker ¶
type NullTracker struct{}
func (NullTracker) OnRecv ¶
func (st NullTracker) OnRecv(uint64)
func (NullTracker) OnRetransmit ¶
func (st NullTracker) OnRetransmit(uint64)
func (NullTracker) OnSent ¶
func (st NullTracker) OnSent(uint64)
func (NullTracker) UpdateRTT ¶
func (st NullTracker) UpdateRTT(time.Duration)