Mptcpize OpenVPN from init script

I have compiled 23.05.0 with MPTCP support in the kernel.

mptcpize run openvpn --config /var/etc/openvpn-myvpn.conf works as expected and I am able to utilise both the WANs.

But in the init script when I change to PROG="mptcpize run /usr/sbin/openvpn" it doesn't start and there is nothing in the logs or on stdout.

Any pointers on what I need to do to mptcpize applications from their init scripts?

Replying to myself.

...
...
USE_PROCD=1
PROG=/usr/sbin/openvpn
LIB_MPTCPWRAP=/usr/lib/mptcpize/libmptcpwrap.so.0.0.1
...
...

and

...
...
procd_open_instance "$name"
        procd_set_param env LD_PRELOAD=${LIB_MPTCPWRAP}
        procd_set_param command "$PROG" \
...
...
1 Like

Hi, there!

Would you mind telling how could you get mptcpize binary in your openwrt? I've compiled with kernel support for MPTCPv1, but, unfortunately, it did not come with mptcpize.

Tks in advance

mptcpize is part of mptcpd package in openmptcprouter.

I added this to feeds.conf:

src-git openmptcprouter_feeds https://github.com/Ysurac/openmptcprouter-feeds.git;v0.59.1

And then,

./script feeds update
./script feeds install -d y -p openmptcprouter_feeds mptcp mptcpd

Edit: Added ./script feeds update on 05th August 2024

1 Like

It worked like a charm! Thanks a lot!

Is there a x86_64 version of mptcpize? I attempted to use the instructions above but have been unsuccessful.

I have followed your instruction to add src-git openmptcprouter_feeds https://github.com/Ysurac/openmptcprouter-feeds.git;v0.59.1 into my feeds.config.default. Then issued ./script feeds install -d y -p openmptcprouter_feeds mptcp mptcpd. Here is the error message: (could it be the https link has been changed?)


klu@ip-10-2-0-126:~/svn/redwood.mptcp_ipv6$ ./scripts/feeds install -d y -p openmptcprouter_feeds mptcp mptcpd

Collecting package info: done

WARNING: Makefile 'package/feeds/packages/bcm27xx-eeprom/Makefile' has a dependency on 'bcm27xx-utils', which does not exist

WARNING: Makefile 'package/feeds/waavstandardpackage/qmi-projects/Makefile' has a build dependency on '+kmod-usb-core', which does not exist

WARNING: Makefile 'package/feeds/waavstandardpackage/qmi-projects/Makefile' has a build dependency on '+kmod-usb-net', which does not exist

Ignoring feed 'openmptcprouter_feeds' - index missing

WARNING: No feed for package 'mptcp' found

WARNING: No feed for package 'mptcpd' found

Please run ./script feeds update before running ./script feeds install.

I have updated my reply as well.

"src-git openmptcprouter_feeds https://github.com/Ysurac/openmptcprouter-feeds.git;v0.59.1" does not work for me.
But "src-git openmptcprouter_feeds https://github.com/Ysurac/openmptcprouter-feeds.git" does allow me to build openwrt with mptcpd.
I am wondering if those two above version has significant difference?
My initial test showed no subflows are established. Only the primary connection is established. My openwrt is kernel 6.1.71, and my ubuntu kernel is 6.8.0.
The tcpdump seems to show that the tcp packets does include mptcp options as follows:
14:39:42.140603 IP 198.18.0.6.29766 > 198.18.140.1.9000: Flags [P.], seq 156:226, ack 1, win 21, options [nop,nop,TS val 604134573 ecr 1318604838,mptcp 26 dss ack 15605280831318668218 seq 17433120259196785092 subseq 257047 len 70,nop,nop], length 70
14:39:42.143673 IP 198.18.140.1.9000 > 198.18.0.6.29766: Flags [P.], seq 1:121, ack 156, win 501, options [nop,nop,TS val 1318605193 ecr 604134199,mptcp 26 dss ack 17433120259196785092 seq 15605280831318668218 subseq 204327 len 120,nop,nop], length 120

Any suggestion about how to figure out why no subflows are established?

Is this correct, when I enter the following url in my browser, that page is not found.
https://github.com/Ysurac/openmptcprouter-feeds.git;v0.59.1
But the following url is ok in the browser:
https://github.com/Ysurac/openmptcprouter-feeds.git
on 8/9/2024.

I have openwrt kernel 6.1.71 with mptcp enabled. It is the client side. The server side is ubuntu kernel 6.8.0. The IP of 198.18.0.6 and 198.18.16.6 are on the client side. The IP of 198.18.140.11 is on the server side.
I found the mptcp connection fallback to TCP connection by the server.
I ran "tcpdump -i any |grep -i mptcp" on the server side. After some test, I examined the tcpdump output. I can see the client sent ADD_ADDR to the server, and the server echo'ed it to the client. But the next step is curious. The server initiated the MP_JOIN to the client and not accepted. Here is the extrfacted tcpdump:

root@ip-10-0-0-60:/tmp# grep addr *pcap2
18:26:41.196415 tunUDP1 In  IP 198.18.0.6.29004 > 198.18.140.11.31335: Flags [.], ack 1, win 21, options [nop,nop,TS val 3764388883 ecr 1745411281,mptcp 16 add-addr v1 id 1 198.18.16.6 hmac 0xbfd4183bcbc7e496], length 0
18:26:41.196481 tunUDP1 Out IP 198.18.140.11.31335 > 198.18.0.6.29004: Flags [.], ack 83, win 339, options [nop,nop,TS val 1745411305 ecr 3764388883,mptcp 8 add-addr v1-echo id 1 198.18.16.6], length 0
18:26:42.374307 tunUDP1 In  IP 198.18.0.6.29016 > 198.18.140.11.31335: Flags [.], ack 1, win 21, options [nop,nop,TS val 3764390061 ecr 1745412458,mptcp 16 add-addr v1 id 1 198.18.16.6 hmac 0x8ef1e263ff846bb], length 0
18:26:42.374399 tunUDP1 Out IP 198.18.140.11.31335 > 198.18.0.6.29016: Flags [.], ack 83, win 339, options [nop,nop,TS val 1745412482 ecr 3764390061,mptcp 8 add-addr v1-echo id 1 198.18.16.6], length 0
root@ip-10-0-0-60:/tmp# grep join *pcap2
18:26:41.196593 tunUDP2 Out IP 198.18.16.1.56009 > 198.18.16.6.29004: Flags [S], seq 887647931, win 43392, options [mss 1460,sackOK,TS val 3299115827 ecr 0,nop,wscale 7,mptcp 12 join id 8 token 0xe8c6424d nonce 0xcd136f14], length 0
18:26:42.374815 tunUDP2 Out IP 198.18.16.1.32743 > 198.18.16.6.29016: Flags [S], seq 3331504336, win 43392, options [mss 1460,sackOK,TS val 3299117005 ecr 0,nop,wscale 7,mptcp 12 join id 8 token 0xe6f42e16 nonce 0x9c496fe], length 0
root@ip-10-0-0-60:/tmp#

In my mptcp test setup, I have a router running openwrt kernel 6.1.71, and a server running ubuntu kernel 6.8.0. There are two openvpn tunnels established between openwrt and ubuntu. The tunUDP1 interfaces in the openwrt is connected to the tunUDP1 interface in the ubuntu. Similarly the tunUDP2 on both side are connected with openvpn. I entered the "ip mptcp endpoint 198.18.0.6 dev tunUDP1 id 1 subflow" command, and the "ip mptcp endpoint 198.18.16.6 dev tunUDP2 subflow" in the openwrt. In the ubuntu side, I entered "ip mptcp limits set subflows 4". After that, I run an app with "mptcpize run -d openvpn ..." in the openwrt and the ubuntu side. The connection between the last two openvpn is mptcp connection with two subflows.
I can use "netstat -net" on the ubuntu side to see the two subflows. Also the "ss -nti" command on the ubuntu can show detailed status of the subflows.
The mptcp debugging tools in the mptcp-v1 is not as good as in the mptcp-v0.95. It will take more time, I guess.

To enable the openwrt kernel to provide more mptcp debugging info, using "ss -ien" or "ss -nti" commmand to show tcp/mptcp connection status. Notice that you should enable some kernel build parameter as follows:

make kernel_menuconfig	// to enable INET_DIAG
"Networking support" ⇒ "Networking options" ⇒ "TCP/IP networking" ⇒ "INET: socket monitoring interface"