Skip to content

Conversation

@matttbe
Copy link
Contributor

@matttbe matttbe commented May 21, 2024

Multipath TCP (MPTCP), standardized in RFC8684 [1], is a TCP extension that enables a TCP connection to use different paths. It allows a device to make use of multiple interfaces at once to send and receive TCP packets over a single MPTCP connection. MPTCP can aggregate the bandwidth of multiple interfaces or prefer the one with the lowest latency, it also allows a fail-over if one path is down, and the traffic is seamlessly re-injected on other paths.

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 [2]. To use it on Linux, an application must explicitly enable it when creating the socket:

int sd = socket(AF_INET(6), SOCK_STREAM, IPPROTO_MPTCP);

No need to change anything else in the application.

This patch allows MPTCP protocol in the Socket unit configuration. So now, a <unit>.socket can contain this to use MPTCP instead of TCP:

[Socket]
SocketProtocol=mptcp

MPTCP support has been allowed similarly to what has been already done to allow SCTP: just one line in core/socket.c, a very simple addition thanks to the flexible architecture already in place.

On top of that, IPPROTO_MPTCP has also been added in the list of allowed protocols in 2 other places and in the doc. It has also been added to the missing_network.h file, for systems with an old libc -- note that it was also required to include <netinet/in.h> in this file to avoid redefinition errors.

Link: https://www.rfc-editor.org/rfc/rfc8684.html [1]
Link: https://www.mptcp.dev [2]

@github-actions github-actions bot added documentation util-lib tests please-review PR is ready for (re-)review by a maintainer labels May 21, 2024
@github-actions
Copy link

Important

An -rc1 tag has been created and a release is being prepared, so please note that PRs introducing new features and APIs will be held back until the new version has been released.

@YHNdnzj YHNdnzj added the pid1 label May 21, 2024
@matttbe
Copy link
Contributor Author

matttbe commented May 21, 2024

About the CI results:

@yuwata yuwata added reviewed/needs-rework 🔨 PR has been reviewed and needs another round of reworks and removed please-review PR is ready for (re-)review by a maintainer labels May 21, 2024
@github-actions github-actions bot added please-review PR is ready for (re-)review by a maintainer and removed reviewed/needs-rework 🔨 PR has been reviewed and needs another round of reworks labels May 21, 2024
@matttbe matttbe changed the title core/socket: add MPTCP support core/socket: allow MPTCP protocol May 22, 2024
@matttbe
Copy link
Contributor Author

matttbe commented May 22, 2024

(sorry for the last push, I just wanted to sync with the main branch to see if it would help regarding the errors reported by the CI)

@poettering
Copy link
Member

lgtm

@poettering poettering added good-to-merge/after-next-release and removed please-review PR is ready for (re-)review by a maintainer labels May 22, 2024
@yuwata yuwata added this to the v257 milestone May 22, 2024
Multipath TCP (MPTCP), standardized in RFC8684 [1], is a TCP extension
that enables a TCP connection to use different paths. It allows a device
to make use of multiple interfaces at once to send and receive TCP
packets over a single MPTCP connection. MPTCP can aggregate the
bandwidth of multiple interfaces or prefer the one with the lowest
latency, it also allows a fail-over if one path is down, and the traffic
is seamlessly re-injected on other paths.

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 [2]. To
use it on Linux, an application must explicitly enable it when creating
the socket:

  int sd = socket(AF_INET(6), SOCK_STREAM, IPPROTO_MPTCP);

No need to change anything else in the application.

This patch allows MPTCP protocol in the Socket unit configuration. So
now, a <unit>.socket can contain this to use MPTCP instead of TCP:

  [Socket]
  SocketProtocol=mptcp

MPTCP support has been allowed similarly to what has been already done
to allow SCTP: just one line in core/socket.c, a very simple addition
thanks to the flexible architecture already in place.

On top of that, IPPROTO_MPTCP has also been added in the list of allowed
protocols in two other places, and in the doc. It has also been added to
the missing_network.h file, for systems with an old libc -- note that it
was also required to include <netinet/in.h> in this file to avoid
redefinition errors.

Link: https://www.rfc-editor.org/rfc/rfc8684.html [1]
Link: https://www.mptcp.dev [2]
@bluca bluca merged commit 3f69070 into systemd:main Jun 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

6 participants