Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use MPTCP included in linux kernel 5.6.x?

Tags:

I am trying to use MPTCP that is included in linux-5.6.x. I assume this is a version of https://www.multipath-tcp.org/ but it does not seem to be the same.

Does the in-kernel MPTCP correspond to any version of https://www.multipath-tcp.org/ ?

To test I use a small program mptcp.c and a VM setup like;

enter image description here

According to wireshark MPTCP is used but only one sub-flow over the default path (upper).

What must I do (configure?) to make MPTCP aware that the second path exist and make use of it?

like image 557
lgekman Avatar asked May 14 '20 12:05

lgekman


1 Answers

As already noted multi-subflow was not supported in linux-5.6.x but is supported in linux-5.7.x. I found no documentation but new test programs are added;

linux-5.7 > ls ./tools/testing/selftests/net/mptcp
config    mptcp_connect.c    mptcp_join.sh*  pm_nl_ctl.c
Makefile  mptcp_connect.sh*  pm_netlink.sh*  settings

The pm_nl_ctl I guess stands for path-manager-netlink-control.

These scripts and programs can be examined to get a hint on how to configure a subflow.

In the config above the server runs on vm-001 and a client connects from vm-221;

# On vm-001
pm_nl_ctl limits 2 2
mptcp server
# On vm-221
pm_nl_ctl limits 2 2
pm_nl_ctl add 192.168.6.221 flags subflow
mptcp client vm-001 7000

Now a subflow is setup on the lower path. Here is a capture from vm-202;

    4   0.000999 192.168.6.221 → 192.168.1.1  MPTCP 86 40241 → 7000 [SYN] Seq=0 Win=64240 Len=0 MSS=1460 SACK_PERM=1 TSval=1993176738 TSecr=0 WS=128
    5   0.001453 192.168.6.221 → 192.168.1.1  MPTCP 86 [TCP Out-Of-Order] 40241 → 7000 [SYN] Seq=0 Win=64240 Len=0 MSS=1460 SACK_PERM=1 TSval=1993176738 TSecr=0 WS=128
    6   0.003474 192.168.6.221 → 192.168.1.1  MPTCP 90 40241 → 7000 [ACK] Seq=1 Ack=1 Win=64256 Len=0 TSval=1993176744 TSecr=4157473679
    7   0.003987 192.168.6.221 → 192.168.1.1  MPTCP 90 [TCP Dup ACK 6#1] 40241 → 7000 [ACK] Seq=1 Ack=1 Win=64256 Len=0 TSval=1993176744 TSecr=4157473679
    8   2.015314 192.168.6.221 → 192.168.1.1  MPTCP 94 40241 → 7000 [FIN, ACK] Seq=1 Ack=1 Win=64256 Len=0 TSval=1993178755 TSecr=4157473682
    9   2.016525 192.168.6.221 → 192.168.1.1  MPTCP 94 [TCP Out-Of-Order] 40241 → 7000 [FIN, ACK] Seq=1 Ack=1 Win=64256 Len=0 TSval=1993178755 TSecr=4157473682
   10   2.021198 192.168.6.221 → 192.168.1.1  MPTCP 78 40241 → 7000 [ACK] Seq=2 Ack=2 Win=64256 Len=0 TSval=1993178762 TSecr=4157475697
   11   2.021811 192.168.6.221 → 192.168.1.1  MPTCP 78 [TCP Dup ACK 10#1] 40241 → 7000 [ACK] Seq=2 Ack=2 Win=64256 Len=0 TSval=1993178762 TSecr=4157475697

Also nstat on vm-001 shows the join;

$ nstat -as
...
MPTcpExtMPCapableSYNRX          1                  0.0
MPTcpExtMPCapableACKRX          1                  0.0
MPTcpExtMPJoinSynRx             1                  0.0
MPTcpExtMPJoinAckRx             1                  0.0

It is a bit tricky to compile pm_nl_ctl.c on a machine that does not have the linux-5.7 headers installed (which you most likely don't have). You must install the headers and use them;

# In the kernel (or kernel-obj) dir do;
make INSTALL_HDR_PATH=(some-dir) headers_install
# Build;
gcc -o pm_nl_ctl -I(some-dir)/include pm_nl_ctl.c 

The traffic data still only uses the first subflow and there is no fail-over if the upper data-path is disabled. So there are more issues for a useful MPTCP but that is another question.

like image 95
lgekman Avatar answered Sep 30 '22 19:09

lgekman