Skip to content

Commit

Permalink
add fallback to TCP tests (server side)
Browse files Browse the repository at this point in the history
test fallback to TCP in the following conditions:
 - client sends a v0 SYN (might trigger false postitive when testing v0
   kernel)
 - client sends a SYN with mp_capable flag 'B' set
 - client sends a SYN with mp_capable flag 'H' unset
 - client flips version to v0 in the 3rd ACK
 - client flips mp_capable flag 'B' in the 3rd ACK
 - client flips mp_capable flag 'H' in the 3rd ACK

related to: issue #3

Signed-off-by: Davide Caratti <[email protected]>
  • Loading branch information
dcaratti committed Jan 9, 2020
1 parent 59e6ff2 commit 0fb4f06
Show file tree
Hide file tree
Showing 6 changed files with 135 additions and 0 deletions.
22 changes: 22 additions & 0 deletions gtests/net/mptcp/mp_capable/v1_bind_tcpfallback_flagB.pkt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// test the mp_capable 'B' flag according to RFC8684 § 3.1
`../common/defaults.sh`

+0 socket(..., SOCK_STREAM, IPPROTO_MPTCP) = 3
+0 setsockopt(3, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0

+0 bind(3, ..., ...) = 0
+0 listen(3, 1) = 0
+0 < S 0:0(0) win 32792 <mss 1460,sackOK,nop,nop,nop,wscale 8,mpcapable v1 flags 0x41 nokey>
+0 > S. 0:0(0) ack 1 <mss 1460,nop,nop,sackOK,nop,wscale 8>
+0.01 < . 1:1(0) ack 1 win 257
+0 accept(3, ..., ...) = 4

// ensure that traffic plane is functional and does not use DSS

+0 write(4, ..., 1000) = 1000
+0 > P. 1:1001(1000) ack 1
+0 < P. 1:501(500) ack 1001 win 257
+0 > . 1001:1001(0) ack 501
+0 read(4, ..., 1000) = 500


23 changes: 23 additions & 0 deletions gtests/net/mptcp/mp_capable/v1_bind_tcpfallback_flagB_3rd_ack.pkt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Test mp_capable mptcp option, first syn sent by packetdrill
`../common/defaults.sh`

+0 socket(..., SOCK_STREAM, IPPROTO_MPTCP) = 3
+0 setsockopt(3, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0

+0 bind(3, ..., ...) = 0
+0 listen(3, 1) = 0
+0 < S 0:0(0) win 32792 <mss 1000,sackOK,nop,nop,nop,wscale 7,mpcapable v1 flags[flag_h] nokey>
+0 > S. 0:0(0) ack 1 <mss 1460,nop,nop,sackOK,nop,wscale 8,mpcapable v1 flags[flag_h] key[skey] >
+0.01 < . 1:1(0) ack 1 win 257 <mpcapable v1 flags [flag_b,flag_h] key[ckey=2,skey] >
+0 accept(3, ..., ...) = 4

// ensure that traffic plane is functional and does not use DSS

+0 write(4, ..., 1000) = 1000
+0 > P. 1:1001(1000) ack 1
+0 < P. 1:501(500) ack 1001 win 257
+0 > . 1001:1001(0) ack 501
+0 read(4, ..., 1000) = 500



22 changes: 22 additions & 0 deletions gtests/net/mptcp/mp_capable/v1_bind_tcpfallback_flagH.pkt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// test fallback to TCP of the mp_capable 'H' flag according to RFC8684 § 3.1
`../common/defaults.sh`

+0 socket(..., SOCK_STREAM, IPPROTO_MPTCP) = 3
+0 setsockopt(3, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0

+0 bind(3, ..., ...) = 0
+0 listen(3, 1) = 0
+0 < S 0:0(0) win 32792 <mss 1460,sackOK,nop,nop,nop,wscale 8,mpcapable v1 flags 0x0 nokey>
+0 > S. 0:0(0) ack 1 <mss 1460,nop,nop,sackOK,nop,wscale 8>
+0.01 < . 1:1(0) ack 1 win 257
+0 accept(3, ..., ...) = 4

// ensure that traffic plane is functional and does not use DSS

+0 write(4, ..., 1000) = 1000
+0 > P. 1:1001(1000) ack 1
+0 < P. 1:501(500) ack 1001 win 257
+0 > . 1001:1001(0) ack 501
+0 read(4, ..., 1000) = 500


23 changes: 23 additions & 0 deletions gtests/net/mptcp/mp_capable/v1_bind_tcpfallback_flagH_3rd_ack.pkt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Test mp_capable mptcp option, first syn sent by packetdrill
`../common/defaults.sh`

+0 socket(..., SOCK_STREAM, IPPROTO_MPTCP) = 3
+0 setsockopt(3, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0

+0 bind(3, ..., ...) = 0
+0 listen(3, 1) = 0
+0 < S 0:0(0) win 32792 <mss 1000,sackOK,nop,nop,nop,wscale 7,mpcapable v1 flags[flag_h] nokey>
+0 > S. 0:0(0) ack 1 <mss 1460,nop,nop,sackOK,nop,wscale 8,mpcapable v1 flags[flag_h] key[skey] >
+0.01 < . 1:1(0) ack 1 win 257 <mpcapable v1 flags 0x0 key[ckey=2,skey] >
+0 accept(3, ..., ...) = 4

// ensure that traffic plane is functional and does not use DSS

+0 write(4, ..., 1000) = 1000
+0 > P. 1:1001(1000) ack 1
+0 < P. 1:501(500) ack 1001 win 257
+0 > . 1001:1001(0) ack 501
+0 read(4, ..., 1000) = 500



22 changes: 22 additions & 0 deletions gtests/net/mptcp/mp_capable/v1_bind_tcpfallback_wrongver.pkt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// test TCP fallback in case of wrong 'version' according to RFC8684 § 3.1
`../common/defaults.sh`

+0 socket(..., SOCK_STREAM, IPPROTO_MPTCP) = 3
+0 setsockopt(3, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0

+0 bind(3, ..., ...) = 0
+0 listen(3, 1) = 0
+0 < S 0:0(0) win 32792 <mss 1460,sackOK,nop,nop,nop,wscale 8,mpcapable v1 flags 0x41 nokey>
+0 > S. 0:0(0) ack 1 <mss 1460,nop,nop,sackOK,nop,wscale 8>
+0.01 < . 1:1(0) ack 1 win 257
+0 accept(3, ..., ...) = 4

// ensure that traffic plane is functional and does not use DSS

+0 write(4, ..., 1000) = 1000
+0 > P. 1:1001(1000) ack 1
+0 < P. 1:501(500) ack 1001 win 257
+0 > . 1001:1001(0) ack 501
+0 read(4, ..., 1000) = 500


Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Test mp_capable mptcp option, first syn sent by packetdrill
`../common/defaults.sh`

+0 socket(..., SOCK_STREAM, IPPROTO_MPTCP) = 3
+0 setsockopt(3, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0

+0 bind(3, ..., ...) = 0
+0 listen(3, 1) = 0
+0 < S 0:0(0) win 32792 <mss 1000,sackOK,nop,nop,nop,wscale 7,mpcapable v1 flags[flag_h] nokey>
+0 > S. 0:0(0) ack 1 <mss 1460,nop,nop,sackOK,nop,wscale 8,mpcapable v1 flags[flag_h] key[skey] >
+0.01 < . 1:1(0) ack 1 win 257 <mpcapable v0 flags[flag_h] key[ckey=2,skey] >
+0 accept(3, ..., ...) = 4

// ensure that traffic plane is functional and does not use DSS

+0 write(4, ..., 1000) = 1000
+0 > P. 1:1001(1000) ack 1
+0 < P. 1:501(500) ack 1001 win 257
+0 > . 1001:1001(0) ack 501
+0 read(4, ..., 1000) = 500



0 comments on commit 0fb4f06

Please sign in to comment.