Comparing Link Aggregation, Policy Routing, and Multipath TCP
Standard TCP binds every socket to a single four-tuple: source IP, source port, destination IP, and destination port. If that physical path drops, your connection breaks with it. Long-running rsync jobs fail, database replication halts, and live video streams freeze instantly.
Network engineers generally turn to three distinct tools when juggling multiple uplinks:
- Link Aggregation / Bonding (LACP, 802.3ad): Operates strictly at Layer 2. It requires matching switch configs and identical broadcast domains. While it works reliably inside a local server rack, it cannot bond two separate commercial ISPs with different subnets and distinct upstream gateways.
- Policy-Based Routing (ip rule + routing tables): Operates at Layer 3. You can split outgoing connections across WAN links using firewall marks or IP hashing. Even so, each individual TCP session remains pinned to a single interface. If WAN1 goes down mid-download, every session established on WAN1 aborts immediately.
- Multipath TCP (MPTCP, RFC 8684): Operates cleanly at Layer 4. MPTCP breaks a single transport connection into multiple underlying TCP subflows across separate network interfaces. If your fiber drops, traffic shifts to the 5G modem seamlessly. The application socket stays open the entire time.
Operational Trade-Offs of Multipath TCP
Before rolling out MPTCP across your fleet, weigh its functional strengths against its deployment constraints:
Advantages
- Zero-Downtime Failover: Subflows handle packet loss and link dropouts in hardware. Moving between interfaces happens without resetting the parent application socket, maintaining sub-100ms recovery times.
- True Bandwidth Aggregation: Concurrent subflows push packets across both interfaces simultaneously. Combining a 1 Gbps fiber line and a 300 Mbps backup link can deliver aggregate throughput topping 1.2 Gbps on single bulk transfers.
- Heterogeneous Network Support: You can pair a static datacenter IP with a dynamic cellular link assigned via DHCP. The upstream ISPs do not need to coordinate with each other.
Limitations
- End-to-End Requirement: Both endpoints must speak RFC 8684. If the remote server lacks MPTCP support, the connection automatically falls back to standard single-path TCP without breaking.
- Middlebox Interference: Outdated enterprise firewalls and restrictive DPI boxes occasionally drop TCP Option 30 (the header used by MPTCP) or strip unrecognized flags entirely.
- Reassembly Buffer Pressure: If path latencies diverge sharply—say, 8ms on metro fiber versus 75ms over 5G—the receiving kernel must buffer out-of-order packets in RAM before handing them to user space.
Recommended Setup: The In-Kernel MPTCP Stack
Linux distributions shipping kernel 5.15 LTS and newer—such as Ubuntu 22.04+, Debian 12, and RHEL 9—include native upstream MPTCP support out of the box. You no longer need the legacy, out-of-tree kernel patches from the older mptcp.org project.
This architecture pays off in production environments like live 4K broadcast rigs, mobile edge compute nodes, and off-site backup servers. The target layout uses two network cards (eth0 and eth1), separate default gateways, policy routing tables, and the kernel path manager via ip mptcp.
Step-by-Step Implementation Guide
Step 1: Verify Kernel Support and Enable MPTCP sysctl
First, confirm that your running kernel includes MPTCP compilation flags:
grep -E "CONFIG_MPTCP(=| )" /boot/config-$(uname -r)
You should see CONFIG_MPTCP=y in the output. Next, turn on MPTCP and raise subflow limits across the networking subsystem:
sudo sysctl -w net.mptcp.enabled=1
sudo sysctl -w net.mptcp.add_addr_accepted_limit=4
sudo sysctl -w net.mptcp.subflow_limit=4
Persist these changes across reboots by writing them to a sysctl drop-in file:
cat <<EOF | sudo tee /etc/sysctl.d/99-mptcp.conf
net.mptcp.enabled = 1
net.mptcp.add_addr_accepted_limit = 4
net.mptcp.subflow_limit = 4
EOF
sudo sysctl --system
Step 2: Inspect Network Interfaces and IP Addressing
This guide assumes a dual-homed host with the following IP configuration:
- eth0 (Primary ISP): IP
192.168.10.50/24, Gateway192.168.10.1 - eth1 (Secondary ISP / LTE): IP
10.0.0.50/24, Gateway10.0.0.1
Confirm the adapter state on your machine:
ip -br addr show
Step 3: Configure Source-Based Policy Routing
By default, Linux routes all outbound internet traffic through a single default gateway on eth0. If a packet leaves eth1 using the gateway on eth0, upstream ISP filters will discard it as spoofed traffic. You must ensure reply and secondary subflow packets exit via their own physical gateway.
Add a custom routing table for the second provider:
# Add the isp2 table ID if missing
if ! grep -q "200 isp2" /etc/iproute2/rt_tables; then
echo "200 isp2" | sudo tee -a /etc/iproute2/rt_tables
fi
# Configure routes and rules for eth1
sudo ip route add 10.0.0.0/24 dev eth1 proto kernel scope link src 10.0.0.50 table isp2
sudo ip route add default via 10.0.0.1 dev eth1 table isp2
sudo ip rule add from 10.0.0.50 table isp2 priority 100
Step 4: Configure Kernel Path Manager Endpoints
The Linux path manager decides which addresses to advertise and when to launch secondary subflows. Manage these endpoints using the ip mptcp command:
# Designate eth0 as a valid subflow path
sudo ip mptcp endpoint add 192.168.10.50 dev eth0 subflow
# Tell eth1 to actively establish subflows and announce its IP to peers
sudo ip mptcp endpoint add 10.0.0.50 dev eth1 signal subflow
Confirm the registered endpoints:
ip mptcp endpoint show
You will see both addresses listed with their assigned flags (subflow and signal).
Step 5: Bind Existing Applications Using mptcpize
Standard Linux applications call socket(AF_INET, SOCK_STREAM, 0), which creates a plain TCP socket with protocol number 6. Multipath TCP sockets require protocol 284 (IPPROTO_MPTCP).
You do not need to rebuild your binaries from source. The mptcpize utility uses dynamic library preloading (LD_PRELOAD) to hijack standard socket calls and transparently upgrade them to MPTCP:
# On Ubuntu / Debian
sudo apt-get update && sudo apt-get install -y mptcpize
# On RHEL / AlmaLinux / Fedora
sudo dnf install -y mptcpize
Wrap any command-line tool or network test with mptcpize:
# Run an MPTCP-capable iperf3 server
mptcpize run iperf3 -s
# Connect to the server from a client over MPTCP
mptcpize run iperf3 -c 192.168.10.50 -t 30
To convert background services such as Nginx or a database replica, apply a systemd drop-in override:
sudo mptcpize enable nginx
sudo systemctl restart nginx
Step 6: Verify Active Subflows and Test Failover
While transmitting data between hosts, inspect active subflows using ss:
# List established MPTCP connections and subflow counts
ss -M
# Display detailed TCP socket internals on iperf3's port
ss -tnei '( dport = :5201 or sport = :5201 )'
Look for the mptcp token in the output. You should see both IP endpoints active and moving packets. To test resilience, disconnect the primary eth0 interface during a live 10 GB file download. Traffic drops briefly for 40 to 80 ms, moves entirely to eth1, and completes the transfer without throwing an error.

