How Linux Handles Multipath TCP Connections
Multipath TCP (MPTCP) in Linux enables a single transport-layer connection to transmit data concurrently across multiple physical network interfaces, such as Wi-Fi, Ethernet, and cellular. By managing aggregated bandwidth, link redundancy, and transparent failover at the kernel level, Linux abstracts multiple distinct network paths into what appears as a standard TCP stream to user-space applications. This article explains how the Linux kernel natively orchestrates MPTCP, covering socket creation, path management, packet scheduling, and congestion control.
Native Kernel Implementation
MPTCP support was integrated upstream starting in Linux kernel version 5.6. Rather than rewriting the core networking stack, Linux implements MPTCP as a coordination layer sitting directly on top of traditional TCP.
When an application requests an MPTCP connection using the
IPPROTO_MPTCP socket protocol, the kernel creates an MPTCP
master socket. Underneath this master socket, the kernel can spin up
multiple standard TCP sockets, referred to as subflows.
To the application, the interface operates identically to a standard
POSIX socket API (read, write,
send, recv), but the kernel distributes data
across the underlying subflows transparently.
If a remote peer does not support MPTCP, the Linux kernel gracefully falls back to standard single-path TCP during the initial three-way handshake by stripping MPTCP options.
Path Management
Path management dictates how subflows are established, maintained, and torn down across available network interfaces. Linux supports two primary path management modes:
- In-Kernel Path Manager: A lightweight, kernel-space
implementation ideal for basic multi-homing. It automatically monitors
system network interfaces, listens for new IP addresses, and establishes
subflows or advertises addresses to the remote host using MPTCP
ADD_ADDRandREMOVE_ADDRoptions. - Userspace Path Manager: Designed for advanced,
policy-driven network environments. Linux exposes a Netlink interface
that allows userspace daemons, such as
mptcpd, to define complex routing policies, dictate interface priorities (such as preferring Wi-Fi over metered cellular), and manage subflow creation dynamically.
Packet Scheduling
Once multiple subflows are active, the Linux packet scheduler determines which subflow transmits each piece of outgoing data. The scheduler operates on the master socket's write queue and selects subflows based on specific algorithms:
- Default / Lowest RTT: Directs packets to the path with the lowest Round-Trip Time (RTT) until its congestion window is full, spilling over to higher-latency links only when necessary.
- Round-Robin: Distributes data evenly across all active subflows, prioritizing maximum throughput when links have comparable bandwidth and latency.
- Redundant: Transmits the exact same data across multiple links simultaneously to provide zero-latency failover and minimal jitter for mission-critical traffic.
Linux allows custom schedulers to be loaded via eBPF (Extended Berkeley Packet Filter), providing granular control over subflow selection based on real-time network metrics.
Coupled Congestion Control
Operating multiple TCP streams simultaneously risks consuming an unfair share of bandwidth when bottleneck links are shared with standard TCP traffic. To prevent this, Linux utilizes coupled congestion control algorithms, such as:
- OLIA (Opportunistic Linked Increases Algorithm)
- BALIA (Balanced Linked Adaptation Algorithm)
- wVegas (Delay-based Congestion Control)
These algorithms link the congestion windows of all subflows belonging to the same MPTCP connection. If packet loss or latency spikes occur on one interface, the kernel slows down transmissions on that path while shifting traffic to healthier paths, ensuring network fairness across shared bottlenecks.
System Configuration and Tooling
MPTCP in Linux is managed directly via standard network configuration utilities:
- Sysctl: Administrators enable and configure core
behavior via variables located in
/proc/sys/net/mptcp/, such asnet.mptcp.enabled. - iproute2 (
ip mptcp): Network administrators manage endpoints, limits, and flags using theip mptcpcommand suite. For instance, setting an endpoint flag tosubfloworbackupdictates whether an interface actively aggregates throughput or waits in standby mode for redundancy.