Chapter 24. Getting started with Multipath TCP
Multipath TCP (MPTCP) is an extension to the original TCP protocol (single-path). MPTCP enables a transport connection to operate across multiple paths simultaneously, and brings network connection redundancy to user endpoint devices.
24.1. Understanding MPTCP Copy linkLink copied to clipboard!
The Multipath TCP (MPTCP) protocol provides simultaneous usage of multiple paths between connection endpoints. The protocol design improves connection stability and also brings other benefits compared to the single-path TCP.
In MPTCP terminology, links are considered as paths.
The following are some of the advantages of using MPTCP:
- It allows a connection to simultaneously use multiple network interfaces.
- In case a connection is bound to a link speed, the usage of multiple links can increase the connection throughput. Note, that in case of the connection is bound to a CPU, the usage of multiple links causes the connection slowdown.
- It increases the resilience to link failures.
24.2. Permanently configuring multiple paths for MPTCP applications Copy linkLink copied to clipboard!
You can configure MultiPath TCP (MPTCP) by using the nmcli command to permanently establish multiple subflows between a source and destination system.
The subflows can use different resources, different routes to the destination, and even different networks. Such as Ethernet, cellular, wifi, and so on. As a result, you achieve combined connections, which increase network resilience and throughput.
The server uses the following network interfaces in our example:
-
enp4s0:
192.0.2.1/24 -
enp1s0:
198.51.100.1/24 -
enp7s0:
192.0.2.3/24
The client uses the following network interfaces in our example:
-
enp4s0f0:
192.0.2.2/24 -
enp4s0f1:
198.51.100.2/24 -
enp6s0:
192.0.2.5/24
Prerequisites
- You configured the default gateway on the relevant interfaces.
Procedure
Enable MPTCP sockets in the kernel:
echo "net.mptcp.enabled=1" > /etc/sysctl.d/90-enable-MPTCP.conf sysctl -p /etc/sysctl.d/90-enable-MPTCP.conf
# echo "net.mptcp.enabled=1" > /etc/sysctl.d/90-enable-MPTCP.conf # sysctl -p /etc/sysctl.d/90-enable-MPTCP.confCopy to Clipboard Copied! Toggle word wrap Toggle overflow Optional: The RHEL kernel default for subflow limit is 2. If you require more:
Create the
/etc/systemd/system/set_mptcp_limit.servicefile with the following content:Copy to Clipboard Copied! Toggle word wrap Toggle overflow The oneshot unit executes the
ip mptcp limits set subflows 3command after your network (network.target) is operational during every boot process.The
ip mptcp limits set subflows 3command sets the maximum number of additional subflows for each connection, so 4 in total. It is possible to add maximally 3 additional subflows.Enable the
set_mptcp_limitservice:systemctl enable --now set_mptcp_limit
# systemctl enable --now set_mptcp_limitCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Enable MPTCP on all connection profiles that you want to use for connection aggregation:
nmcli connection modify <profile_name> connection.mptcp-flags signal,subflow,also-without-default-route
# nmcli connection modify <profile_name> connection.mptcp-flags signal,subflow,also-without-default-routeCopy to Clipboard Copied! Toggle word wrap Toggle overflow The
connection.mptcp-flagsparameter configures MPTCP endpoints and the IP address flags. If MPTCP is enabled in a NetworkManager connection profile, the setting will configure the IP addresses of the relevant network interface as MPTCP endpoints.By default, NetworkManager does not add MPTCP flags to IP addresses if there is no default gateway. If you want to bypass that check, you need to use the
also-without-default-routeflag.
Verification
Verify that you enabled the MPTCP kernel parameter:
sysctl net.mptcp.enabled
# sysctl net.mptcp.enabled net.mptcp.enabled = 1Copy to Clipboard Copied! Toggle word wrap Toggle overflow Verify that you set the subflow limit correctly, in case the default was not enough:
ip mptcp limit show
# ip mptcp limit show add_addr_accepted 2 subflows 3Copy to Clipboard Copied! Toggle word wrap Toggle overflow Verify that you configured the per-address MPTCP setting correctly:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
24.3. Configuring mptcpd Copy linkLink copied to clipboard!
The mptcpd service is a component for configuring Multipath TCP (MPTCP) endpoints. It automatically creates and dynamically updates a list of subflow endpoints for each IP address on the host, providing an alternative to the ip utility for enabling multiple paths.
Prerequisites
-
The
mptcpdpackage installed
Procedure
Enable
mptcp.enabledoption in the kernel with the following command:echo "net.mptcp.enabled=1" > /etc/sysctl.d/90-enable-MPTCP.conf sysctl -p /etc/sysctl.d/90-enable-MPTCP.conf
# echo "net.mptcp.enabled=1" > /etc/sysctl.d/90-enable-MPTCP.conf # sysctl -p /etc/sysctl.d/90-enable-MPTCP.confCopy to Clipboard Copied! Toggle word wrap Toggle overflow Enable and start the
mptcpdservice:systemctl enable --now mptcp.service
# systemctl enable --now mptcp.serviceCopy to Clipboard Copied! Toggle word wrap Toggle overflow To configure
mptcpdservice manually, modify the/etc/mptcpd/mptcpd.confconfiguration file.Note, that the endpoint, which mptcpd service creates, lasts till the host shutdown.
Verification
Verify endpoint creation:
ip mptcp endpoint
# ip mptcp endpointCopy to Clipboard Copied! Toggle word wrap Toggle overflow