The idea: one connection, several paths

A plain TCP connection is tied to one pair of IP addresses. A phone that leaves Wi-Fi gets a new address on LTE, and its TCP connections break. Multipath TCP (MPTCP, RFC 8684) fixes that. One MPTCP connection is a group of ordinary TCP connections, called subflows, one per path. The app opens one socket and never sees the subflows. MPTCP can use all paths at once, and it keeps going when one of them dies.

A phone app with one MPTCP socket. Under it, subflow 1 runs over Wi-Fi (RTT 20 ms) and subflow 2 over LTE (RTT 80 ms) to the server's MPTCP socket on 203.0.113.10:443, which hands one byte stream to the server app.
The app sees one socket; underneath, each path carries its own TCP subflow.

The page follows one phone (host A) with Wi-Fi 192.168.1.20 and LTE 10.64.0.7, and one server (host B) at 203.0.113.10:443. In the model, Wi-Fi takes 10 ms one way (RTT 20 ms) and LTE 40 ms (RTT 80 ms). Each subflow may have 2 segments of 1000 bytes in flight. This window stands in for TCP's congestion window.

Opening: MP_CAPABLE and the keys

The first subflow is a normal three-way handshake with one extra TCP option, MP_CAPABLE, in all three segments (Demo 1: first subflow with MP_CAPABLE):

SegmentMP_CAPABLE carriesPhone stateServer state
SYNversion 1, flags, no keySYN_SENTSYN_RCVD when it arrives
SYN/ACKkey B (64 bits)ESTABLISHED when it arrivesSYN_RCVD
ACKkey A and key BESTABLISHEDESTABLISHED when it arrives

Each side picks a random 64-bit key. From its key it works out two numbers with SHA-256. The token is the top 32 bits of the hash; it names the connection. The IDSN (initial data sequence number) is the low 64 bits of the hash. The page uses toy keys but real hashes: key A = 0x9C4E1F2A7B3D5068 gives token A = 0x4C046942, and key B = 0x31D7A4E09B6C2F85 gives token B = 0xB6D5F122. If the server does not echo MP_CAPABLE, for example because a middlebox removed the option, the phone simply carries on with plain TCP.

See also the TCP three-way handshake for the states and the listen queues of a single subflow.

Adding a path: MP_JOIN

When the phone's path manager sees a second interface, it opens a new TCP subflow from the LTE address to the same server address and port, with the MP_JOIN option (Demo 2: LTE joins with MP_JOIN). The keys never travel again. Instead, each side proves it knows them with an HMAC (HMAC-SHA256) over two fresh nonces.

Time-down diagram of MP_JOIN over LTE: SYN with token B, nonce R_A and address ID 1; SYN/ACK with the truncated HMAC_B and nonce R_B; ACK with the full HMAC_A, the phone in PRE_ESTABLISHED; a fourth ACK from the server, then both sides ESTABLISHED.
MP_JOIN takes four segments: the token picks the connection, the two HMACs prove both sides know the keys.
  • SYN: token B (which connection to join), the phone's nonce R_A and its address ID 1.
  • SYN/ACK: the leftmost 64 bits of HMAC_B = HMAC(key B + key A, R_B + R_A), and the server's nonce R_B.
  • ACK: 160 bits of HMAC_A = HMAC(key A + key B, R_A + R_B). The phone's subflow is PRE_ESTABLISHED: it may not send data yet.
  • A fourth ACK from the server says the HMAC was right. Now the subflow is ESTABLISHED on both sides.

An attacker who only saw the token cannot compute the HMACs, so it cannot add its own path to someone else's connection. See also HMAC for how an HMAC is built.

Two sequence numbers: DSN and subflow

Every data segment carries two numbers. The TCP header holds the subflow sequence number (ssn): each subflow counts its own bytes, so each one looks like normal TCP to the routers and firewalls on its path. The DSS option (Data Sequence Signal) holds the data sequence number (DSN): where the bytes belong in the connection's single byte stream. The page shows DSNs relative to the IDSN, starting at 0.

The receiver acknowledges at both levels. The TCP ACK confirms the subflow's bytes. The DATA_ACK in the DSS option says "I have every byte of the connection below this DSN". The sender may free a byte from its send buffer only when DATA_ACK covers it.

The scheduler: lowest RTT first

The scheduler decides which subflow gets the next segment. The default scheduler in Linux sends on the subflow with the lowest round-trip time that has room in its window; a slower path gets data only when the faster ones are full. In Demo 3: data split over both paths, reordered:

t (ms)What happensServer DATA_ACK
0dsn 0, 1000 on Wi-Fi (lowest RTT); its window is full, so dsn 2000, 3000 go on LTE0
10dsn 0, 1000 arrive; the app reads 2000 bytes2000
20Wi-Fi's ACK is back: dsn 4000, 5000 go on Wi-Fi again2000
30dsn 4000, 5000 arrive before 2000, 3000: held in the receive buffer2000
40dsn 2000, 3000 arrive over LTE and fill the gap; the app reads 4000 bytes at once6000
80LTE's ACK reaches the phone: every byte is acknowledged6000

Segments on the fast path overtake segments on the slow path, so the receiver must reorder by DSN. That costs buffer memory, and with very different RTTs a slow path can hold up the whole stream. Real schedulers and congestion control (coupled, such as LIA or OLIA, so that MPTCP is no greedier than one TCP flow on a shared bottleneck) try to limit that. See also TCP congestion control for the window each subflow really has.

Losing a path

In Demo 4: Wi-Fi drops, LTE carries on, the phone walks out of Wi-Fi range at t = 25 ms while dsn 4000 and 5000 are on the Wi-Fi path. They are lost. The phone closes subflow 1 and tells the server with REMOVE_ADDR (address ID 0) on the LTE subflow. Because no DATA_ACK covers dsn 4000 and 5000, they are still in the send buffer. As soon as LTE's window has room (t = 80 ms), the phone re-injects them on LTE: same DSN, but LTE's own subflow numbers (ssn 2001 and 3001). They arrive at t = 120 ms, the DATA_ACK reaches 6000, and the app on the server never notices the switch.

Inside one subflow, a lost segment is re-sent by normal TCP retransmission on that same subflow (see TCP reliable delivery). Re-injection is the MPTCP level on top: data stuck on a dead path is sent again on a live one.

Closing: DATA_FIN

A FIN on one subflow only closes that path. To close the connection, a host sets the DATA_FIN flag in the DSS option; it takes one number of the data sequence space, so the answer is DATA_ACK = last DSN + 1 (6001 in Demo 5: one path only, then DATA_FIN). The server answers with its own DATA_FIN, the phone acknowledges it, and only then do the subflows close with ordinary FINs. For an abrupt close there is MP_FASTCLOSE, the MPTCP version of a reset.

MPTCP and SCTP

SCTP (RFC 9260) is an older transport protocol with a similar goal, built as a new protocol instead of an extension of TCP. It has multihoming: each end lists several addresses in the association. But plain SCTP sends new data on one primary path and uses the others as standbys (and for retransmissions), while MPTCP uses all paths at the same time. SCTP also has multi-streaming: one association carries several independent message streams, so a loss in one stream does not block the others. MPTCP keeps TCP's single in-order byte stream.

Left, MPTCP: data segments flow on both paths at once into one byte stream. Right, SCTP: data flows on the primary path only, the second path is a standby, and the association carries three separate streams.
MPTCP spreads one byte stream over all paths; SCTP sends on a primary path, keeps the others as standbys, and carries several streams.
MPTCPSCTP
Built asTCP options; each subflow looks like TCPIts own IP protocol (number 132)
Several addressesYes: subflows, added with MP_JOIN and ADD_ADDRYes: multihoming, addresses listed in INIT
Paths used at onceAll of themOne primary path; the others for failover
StreamsOne in-order byte streamSeveral message streams, no head-of-line blocking between them
Through NATs and firewallsWorks, falls back to TCPOften blocked; usually run over UDP or DTLS (WebRTC data channels)
Where it is usedApple Siri and Maps, Linux 5.6+, ATSSS in 5GTelecom signalling (SIGTRAN, Diameter), WebRTC

QUIC took the stream idea of SCTP into a protocol over UDP; see the QUIC handshake, and TCP vs UDP for the two classic transports.

What the page leaves out

Real congestion windows and coupled congestion control (LIA, OLIA, BALIA), ADD_ADDR (a server announcing extra addresses), backup subflows (the B flag) and MP_PRIO, the DSS checksum and fallback to plain TCP when a middlebox changes the payload, MP_FASTCLOSE and MP_TCPRST, TCP-level retransmission inside a subflow, the 64-bit DSN mapping of a data range to a subflow range, and the server's own data direction. SCTP is compared in the text only: the page does not animate it.

On the mind map

Open the Networking mind mapNetworkingLayers & links: frames on one local networkLayers & linksIP & routing: packets hop between networksIP & routingCore services: address, name and timeCore servicesTCP, UDP & sockets: end to end between two portsTCP, UDP & socketsHTTP & TLS: what a browser does per requestHTTP & TLSAPIs & push: how apps talk to serversAPIs & pushProxies & edge: boxes in the middle of the pathProxies & edgeContainers: virtual networks from Linux partsContainersReal-time media: voice and video over UDPReal-time mediaSecurity at the edge: filter traffic at the borderSecurity at the edgeTCP vs UDPTCP vs UDPTCP orders and retransmits; UDP does notThree-way handshakeThree-way handshakeSYN, SYN/ACK, ACK; then accept queueTCP Reliable DeliveryTCP Reliable Delivery3 dup ACKs resend before the RTOARQ protocolsARQ protocolsGo-Back-N resends all; selective repeat oneTCP flow controlTCP flow controlrwnd: never overrun the receiverTCP congestion controlTCP congestion controlslow start doubles, AIMD halves on lossMultipath TCPOne connection, subflows per path, DSN orderLinux TCP socketLinux TCP socketbind, listen, accept; a buffer each waySocket programmingSocket programmingaccept() returns a new socket per clientListen backlogListen backlogfull queues drop SYNs: 1 s, 3 s delaysUnix socket vs loopback TCPUnix socket vs loopback TCPunix socket skips the TCP/IP stackReno vs CUBIC vs BBRReno vs CUBIC vs BBRReno, CUBIC back off on loss; BBR pacesOpen the Networking mind mapNetworkingend to end between two portsTCP, UDP & socketsTCP vs UDPTCP vs UDPTCP orders and retransmits; UDP does notThree-way handshakeThree-way handshakeSYN, SYN/ACK, ACK; then accept queueTCP Reliable DeliveryTCP Reliable Delivery3 dup ACKs resend before the RTOARQ protocolsARQ protocolsGo-Back-N resends all; selective repeat oneTCP flow controlTCP flow controlrwnd: never overrun the receiverTCP congestion controlTCP congestion controlslow start doubles, AIMD halves on lossMultipath TCPOne connection, subflows per path, DSN orderLinux TCP socketLinux TCP socketbind, listen, accept; a buffer each waySocket programmingSocket programmingaccept() returns a new socket per clientListen backlogListen backlogfull queues drop SYNs: 1 s, 3 s delaysUnix socket vs loopback TCPUnix socket vs loopback TCPunix socket skips the TCP/IP stackReno vs CUBIC vs BBRReno vs CUBIC vs BBRReno, CUBIC back off on loss; BBR paces
This page on the Networking mind map · 83 pages in 10 branches · open it to see the whole map and test yourself in recall mode.