Multipath TCP (MPTCP), standardized in RFC8684 [1], is a TCP extension that enables a TCP connection to use different paths.
Multipath TCP has been used for several use cases. On smartphones, MPTCP enables seamless handovers between cellular and Wi-Fi networks while preserving established connections. This use-case is what pushed Apple to use MPTCP since 2013 in multiple applications [2]. On dual-stack hosts, Multipath TCP enables the TCP connection to automatically use the best performing path, either IPv4 or IPv6. If one path fails, MPTCP automatically uses the other path. To benefit from MPTCP, both the client and the server have to support it. Multipath TCP is a backward-compatible TCP extension that is enabled by default on recent Linux distributions (Debian, Ubuntu, Redhat, ...). Multipath TCP is included in the Linux kernel since version 5.6 [3]. To use it on Linux, an application must explicitly enable it when creating the socket. No need to change anything else in the application. Link: https://www.rfc-editor.org/rfc/rfc8684.html [1] Link: https://www.tessares.net/apples-mptcp-story-so-far/ [2] Link: https://www.mptcp.dev [3] --- Changelog: v2: - Patch 1: (new) - Separated the changes to str2sa_range into a different patch (https://www.mail-archive.com/[email protected]/msg45229.html). This function adds a new "alt" parameter that can be used to get an alternate protocol to use. (Willy) - Patch 2: (new) - Add a protocol field to the server, and fill its value with the modified version of str2sa_range that accepts an "alt" parameter. (Willy) - Patch 3: (new) - Modify the call to create the socket, by passing the protocol used. (Willy) - Patch 4: - Regrouped the changes related to MPTCP and included the changes about TCP_MAXSEG being not supported (yet) with IPPROTO_MPTCP. (Willy) v1: - Patch 1: - Duplicate the mptcp(4|6) protocol structures from their tcp equivalent, instead of using a function that creates them by copying tcp structures - Add support for MPTCP on the backend side (between the proxy and the servers) - Patch 2: - Fix a warning about TCP_MAXSEG not being supported while MPTCP is used by declaring new constants sock_inet(6)_mptcp_maxseg_default. Those constants represent the MSS supported by MPTCP (== -1 for the moment, as long as TCP_MAXSEG is not supported). For the moment, MPTCP doesn't support TCP_MAXSEG socket option, mainly because it has apparently never been requested before, apparently. It should not be difficult to implement it, but is it an important option for HAProxy? - https://www.mail-archive.com/[email protected]/msg45224.html v0: (Dorian & Matthieu) - https://www.mail-archive.com/[email protected]/msg44871.html Aperence (4): FEATURE: extend str2sa_range to add an alt parameter FEATURE: add a alt_proto field for server REORG: use protocol when creating socket FEATURE: add MPTCP per address support doc/configuration.txt | 21 +++++++ examples/mptcp-backend.py | 22 ++++++++ examples/mptcp.cfg | 23 ++++++++ include/haproxy/compat.h | 10 ++++ include/haproxy/protocol.h | 4 +- include/haproxy/server-t.h | 1 + include/haproxy/sock_inet.h | 5 ++ include/haproxy/tools.h | 2 +- src/backend.c | 3 +- src/cfgparse-listen.c | 8 ++- src/cfgparse.c | 6 +- src/check.c | 2 +- src/cli.c | 2 +- src/hlua.c | 3 +- src/http_client.c | 2 +- src/log.c | 2 +- src/proto_tcp.c | 109 +++++++++++++++++++++++++++++++++++- src/protocol.c | 3 +- src/resolvers.c | 3 +- src/server.c | 10 ++-- src/sock.c | 7 ++- src/sock_inet.c | 30 ++++++++++ src/ssl_ocsp.c | 2 +- src/tcpcheck.c | 3 +- src/tools.c | 36 +++++++++++- 25 files changed, 289 insertions(+), 30 deletions(-) create mode 100644 examples/mptcp-backend.py create mode 100644 examples/mptcp.cfg -- 2.46.0

