Monday, January 4, 2016

MultiPath TCP (MPTCP) for OpenWRT

The goal of this post is to describe how to test MultiPath TCP (https://multipath-tcp.org) with OpenWRT (https://openwrt.org/).
The starting point for this page is https://wiki.openwrt.org/doc/uci/mptcp.

You can see how to test MPCTP with OpenWRT here:
http://mytechpg.blogspot.com/2016/01/multipath-tcp-how-to-test-mptcp-with.html

Here you can see how to build MPTCP for Raspberry PI with Yocto
MPTCP, Raspberrry PI and Yocto

How to build OpenWRT with MPTCP 0.90 support

I have created a patch for kernel 3.18.20 adding MPTCP 0.90 functionalities.
It is possible to download the patch from GitHub, with the command

git clone -b linux_3.18.20-mptcp_0.90      https://github.com/mytechpg/mptcp-kernel-patch.git

Then you can change the name to the mptcp_linux_kernel.patch file and copy inside the OpenWRT tree (in the target/linux directory).

To simplify this procedure, I have prepared a script to prepare OpenWRT 15.05 environment.
You can download with this command:

git clone -b patches_0.90  https://github.com/mytechpg/mptcp_openwrt.git

Then you can enter in the mptcp_openwrt directory and execute:

./prepare_openwrt.sh

The script will download OpenWRT and the kernel patch. Then it will apply the kernel patch and also other patches to iproute2 and add MPTCP util (the moment iproute2 patch is not aligned with MPTCP 0.90).

How to build OpenWRT with MPTCP support

First you have to configure your environment with

make menuconfig

Then, you can enable MPTCP in the kernel with:

make kernel_menuconfig

You can find MPTCP options under

Networking Support -> Networking options 


My suggestion is to enable also other path-managers and schedulers, to select your optimal configuration via software.

Next step: testing MPTCP

http://mytechpg.blogspot.com/2016/01/multipath-tcp-how-to-test-mptcp-with.html

19 comments:

  1. First off, thanks for this. Second, I have a patching issue:

    Patch generic/622-mptcp_linux_kernel.patch does not apply (enforce with -f)


    any thoughts?

    ReplyDelete
    Replies
    1. This comment has been removed by the author.

      Delete
    2. This comment has been removed by the author.

      Delete
    3. His script does a git clone on git://git.openwrt.org/15.05/openwrt.git

      As of today (march 13, 2016) this will fetch kernel 3.18.29.

      His patch will only work on 3.18.20

      To fix his script you will need to pull down a version of openwrt that uses 3.18.20, I got this one to work: https://github.com/openwrt/openwrt/archive/4f27e9cc7185ca4894a211178ffc4cfc5026
      e54a.zip

      Delete
    4. Thank you! I will check openwrt kernel changes and update the patch

      Delete
    5. I have updated the patch for MPTCP 0.90; now it works with kernel 3.18.29

      Delete
  2. I just followed the steps above and compledted menuconfig and kernel_menuconfig. But consistently the build fails. Any pointers pls.


    Latitude-3540:~/mptcp_openwrt/openwrt$ make V=s -j 4 2>&1 | tee build.log | grep -i error
    drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c:39:27: fatal error: mach/hardware.h: No such file or directory
    make[9]: *** [drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.o] Error 1
    drivers/video/fbdev/bcm2708_fb.c:33:22: fatal error: mach/dma.h: No such file or directory
    make[8]: *** [drivers/video/fbdev/bcm2708_fb.o] Error 1
    make[7]: *** [drivers/video/fbdev] Error 2
    make[6]: *** [drivers/video] Error 2
    drivers/usb/host/dwc_otg/dwc_otg_hcd_linux.c:448:13: error: 'INTERRUPT_VC_USB' undeclared (first use in this function)

    ReplyDelete
    Replies
    1. Which kernel version are you using?

      Maybe this post can help you?
      https://github.com/raspberrypi/linux/issues/596

      I never tried to build openwrt with this patch for ARM
      Please let me know if you can solve the problem

      Delete
  3. Can you please help me with a basics MPTCP network setting.

    Regards

    ReplyDelete
    Replies
    1. Did you read this page?

      http://mytechpg.blogspot.com/2016/01/multipath-tcp-how-to-test-mptcp-with.html

      Delete
  4. This comment has been removed by the author.

    ReplyDelete
  5. I followed your setps above.Then install on my mips router.But it does not work.There is nothing to do with the command (dmesg|grep MPTCP).I did enable all options about mptcp.So does the patch support mips router?

    ReplyDelete
  6. could you share you kernel config file?
    you have to enable also IPv6

    MPTCP depends on:
    Depends on: NET [=y] && INET [=y] && IPV6 [=y]!=m

    ReplyDelete
  7. So at this point I made a mistake.thank you very much.Now it works.

    ReplyDelete
  8. do you think you could add short post how you created kernel patch for openwrt? have you just literaly patched mptcp to kernel or do some more modifications? would be awesome - so I could build support for mptpc 0.91 on OpenWRT Bleeding Edge with kernel 4.x

    ReplyDelete
  9. Ok. I will do it in the next days. It is only a hobby for me at the moment:P

    If you look here http://mytechpg.blogspot.com/2016/07/mptcp-raspberrry-pi-and-yocto.html, in the github repo you can find the patch for kernel 4.1.

    ReplyDelete
  10. This comment has been removed by the author.

    ReplyDelete
  11. hi, can you explain how to apply a patch to a 4.4.x linux version using openwrt please ?

    ReplyDelete
  12. I followed all the instructions to patch the mptcp kernel, but when I type "multipath" in openWrt, it says "your device don't support multipath-TCP. You have to install the patched kernel to use MPTCP". How do I make sure the patch is installed. I had selected mptcp in both menuconfig and kernel_menuconfig, but it seems like the patch does not get installed. Can somebody help as to how to make sure the patch gets installed???

    ReplyDelete