Now I wish to install MPTCP to get robust (redundant) network connection.
So, getting kernel sources and MPTCP patch for 4.10 into linux_mptcp:
Code: Select all
cd /usr/src/
git clone --depth 1 https://github.com/raspberrypi/linux.git -b rpi-4.10.y
cp linux linux_mptcp
cd linux_mptcp
make distclean
make bcmrpi3_defconfig
wget http://multipath-tcp.org/patches/mptcp-v4.10-d9c9f9273eb1.patchCode: Select all
patch -p1 < mptcp-v4.10-d9c9f9273eb1.patch
1 out of 46 hunks FAILED -- saving rejects to file net/ipv4/tcp_output.c.rej
pi64 /usr/src/linux_mptcp # cat net/ipv4/tcp_output.c.rej
--- net/ipv4/tcp_output.c
+++ net/ipv4/tcp_output.c
@@ -1282,7 +1307,7 @@ int tcp_fragment(struct sock *sk, struct sk_buff *skb, u32 len,
* eventually). The difference is that pulled data not copied, but
* immediately discarded.
*/
-static void __pskb_trim_head(struct sk_buff *skb, int len)
+void __pskb_trim_head(struct sk_buff *skb, int len)
{
struct skb_shared_info *shinfo;
int i, k, eat;So now we have to manually change static int __pskb_trim_head(struct sk_buff *skb, int len) to int __pskb_trim_head(struct sk_buff *skb, int len) (changing void to int, because of commit https://github.com/torvalds/linux/commi ... 3c3e9fc805 ))
Now kernel make will fails, as ./include/net/tcp_output.c was changed by the patch to vanilla string. Ok, lets edit it manually for the gentoo:
Code: Select all
cd ./include/net/
edit by MC tcp_output.c
void __pskb_trim_head(struct sk_buff *skb, int len);
to
int __pskb_trim_head(struct sk_buff *skb, int len);However, this how-to seems not full.. I was truing it, but later I was adding more in .config to specify MPTCP "defaults":
Code: Select all
make menuconfig
¦ -> Networking support (NET [=y]) ¦
¦ -> Networking options ¦
¦ -> TCP/IP networking (INET [=y]) ¦
¦ (1) -> The IPv6 protocol (IPV6 [=m]) to KERNEL (or DISABLE, but my is in kernel..)
then
Networking support (NET [=y])
Networking options
TCP/IP networking (INET [=y])
[*] IP: advanced router
[*] IP: policy routing
[*] MPTCP protocol
[*] MPTCP: advanced path-manager control --->
<*> MPTCP Full-Mesh Path-Manager
<*> MPTCP Linked Increase
Default MPTCP Path-Manager (Full mesh) ---> Full mesh
MPTCP: advanced scheduler control x x
<*> MPTCP Round-Robin x x
x x <*> MPTCP Redundant x x
x x Default MPTCP Scheduler (Redundant) --->
and
Networking support (NET [=y])
Networking options
TCP/IP networking (INET [=y])
[*] TCP: advanced congestion control --->
<*> MPTCP COUPLED CONGESTION CONTROL (!!Can't be found in my menuconfig!!)
<*> MPTCP Opportunistic Linked Increase
Default TCP congestion control (Lia) ---> LiaCode: Select all
make
make modules_install
make firmware_install
cp -v arch/arm64/boot/Image /boot/kernel8.img
cp -v arch/arm64/boot/dts/broadcom/bcm{2710,2837}-rpi-3-b.dtb /boot/
sync
rebootWe have two network cards (the first one is build-in ethernet, the second one is virtual ethernet 3G/4G dongle (cdc-ethernet, sometimes called "stick")).
Code: Select all
pi64 ~ # ifconfig eth0
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.118 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::5102:cac7:da40:234d prefixlen 64 scopeid 0x20<link>
ether b8:27:eb:28:f1:db txqueuelen 1000 (Ethernet)
RX packets 961 bytes 68443 (66.8 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 470 bytes 63405 (61.9 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
pi64 ~ # ifconfig eth3
eth3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.8.10 netmask 255.255.255.0 broadcast 192.168.8.255
inet6 fe80::5d49:fee0:c509:bb11 prefixlen 64 scopeid 0x20<link>
ether 0c:5b:8f:27:9a:64 txqueuelen 1000 (Ethernet)
RX packets 60 bytes 25286 (24.6 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 18 bytes 1710 (1.6 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0Lets check them:
Code: Select all
pi64 ~ # ping -I eth0 8.8.8.8
PING 8.8.8.8 (8.8.8.8) from 192.168.1.118 eth0: 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=55 time=21.4 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=55 time=23.0 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=55 time=18.5 ms
^C
--- 8.8.8.8 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2002ms
rtt min/avg/max/mdev = 18.533/21.011/23.060/1.880 ms
pi64 ~ # ping -I eth3 8.8.8.8
PING 8.8.8.8 (8.8.8.8) from 192.168.8.10 eth3: 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=53 time=655 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=53 time=635 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=53 time=75.4 ms
^C
--- 8.8.8.8 ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 1999ms
rtt min/avg/max/mdev = 75.436/455.283/655.183/268.715 ms
pi64 ~ #
Now lets check resulting settings, as specified here http://multipath-tcp.org/pmwiki.php/Use ... ureRoutingpi64 ~ # # This creates two different routing tables, that we use based on the source-address.
pi64 ~ # ip rule add from 192.168.1.118 table 1
pi64 ~ # ip rule add from 192.168.8.10 table 2
pi64 ~ # # Configure the two different routing tables
pi64 ~ # ip route add 192.168.1.0/24 dev eth0 scope link table 1
pi64 ~ # ip route add default via 192.168.1.1 dev eth0 table 1
pi64 ~ # ip route add 192.168.8.0/24 dev eth3 scope link table 2
pi64 ~ # ip route add default via 192.168.8.1 dev eth3 table 2
pi64 ~ # # default route for the selection process of normal internet-traffic
pi64 ~ # ip route add default scope global nexthop via 192.168.1.1 dev eth0
Code: Select all
pi64 ~ # ip rule show
0: from all lookup local
32764: from 192.168.8.10 lookup 2
32765: from 192.168.1.118 lookup 1
32766: from all lookup main
32767: from all lookup default
pi64 ~ # ip route
default via 192.168.1.1 dev eth0
default via 192.168.1.1 dev eth0 src 192.168.1.118 metric 202
default via 192.168.8.1 dev eth3 src 192.168.8.10 metric 204
192.168.1.0/24 dev eth0 proto kernel scope link src 192.168.1.118 metric 202
192.168.8.0/24 dev eth3 proto kernel scope link src 192.168.8.10 metric 204
pi64 ~ # ip route show table 1
default via 192.168.1.1 dev eth0
192.168.1.0/24 dev eth0 scope link
pi64 ~ # ip route show table 2
default via 192.168.8.1 dev eth3
192.168.8.0/24 dev eth3 scope link
Now lets check network connectivity. Due of setting Default MPTCP Scheduler (Redundant) in the kernel, I suppose that pings' ICMP packet will be sent thru both networks, so I will widrawn eth0 network cable during the experiment and will expectate that connectivity will be still available:
Code: Select all
ping -O 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=55 time=20.0 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=55 time=19.3 ms
64 bytes from 8.8.8.8: icmp_seq=3 ttl=55 time=19.9 ms
no answer yet for icmp_seq=4
no answer yet for icmp_seq=5
no answer yet for icmp_seq=6
NOTE that network cards are still accessible directly:
Code: Select all
pi64 ~ # ping -I eth0 8.8.8.8
PING 8.8.8.8 (8.8.8.8) from 192.168.1.118 eth0: 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=55 time=20.7 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=55 time=17.9 ms
^C
--- 8.8.8.8 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1001ms
rtt min/avg/max/mdev = 17.964/19.376/20.789/1.419 ms
pi64 ~ # ping -I eth3 8.8.8.8
PING 8.8.8.8 (8.8.8.8) from 192.168.8.10 eth3: 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=53 time=660 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=53 time=349 ms
^C
--- 8.8.8.8 ping statistics ---
3 packets transmitted, 2 received, 33.3333% packet loss, time 2002ms
rtt min/avg/max/mdev = 349.341/504.981/660.622/155.642 ms
If someone have any experience working with MPTCP, please suggest something..
(I'm not experience user in linux, so some typical mistakes are also possible)



