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.
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):
| Segment | MP_CAPABLE carries | Phone state | Server state |
|---|---|---|---|
| SYN | version 1, flags, no key | SYN_SENT | SYN_RCVD when it arrives |
| SYN/ACK | key B (64 bits) | ESTABLISHED when it arrives | SYN_RCVD |
| ACK | key A and key B | ESTABLISHED | ESTABLISHED 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.
- 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 happens | Server DATA_ACK |
|---|---|---|
| 0 | dsn 0, 1000 on Wi-Fi (lowest RTT); its window is full, so dsn 2000, 3000 go on LTE | 0 |
| 10 | dsn 0, 1000 arrive; the app reads 2000 bytes | 2000 |
| 20 | Wi-Fi's ACK is back: dsn 4000, 5000 go on Wi-Fi again | 2000 |
| 30 | dsn 4000, 5000 arrive before 2000, 3000: held in the receive buffer | 2000 |
| 40 | dsn 2000, 3000 arrive over LTE and fill the gap; the app reads 4000 bytes at once | 6000 |
| 80 | LTE's ACK reaches the phone: every byte is acknowledged | 6000 |
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.
| MPTCP | SCTP | |
|---|---|---|
| Built as | TCP options; each subflow looks like TCP | Its own IP protocol (number 132) |
| Several addresses | Yes: subflows, added with MP_JOIN and ADD_ADDR | Yes: multihoming, addresses listed in INIT |
| Paths used at once | All of them | One primary path; the others for failover |
| Streams | One in-order byte stream | Several message streams, no head-of-line blocking between them |
| Through NATs and firewalls | Works, falls back to TCP | Often blocked; usually run over UDP or DTLS (WebRTC data channels) |
| Where it is used | Apple Siri and Maps, Linux 5.6+, ATSSS in 5G | Telecom 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.