Skip to content

Commit

Permalink
mptcp: ADD_ADDR are now sent sooner
Browse files Browse the repository at this point in the history
A recent modification of the kernel changes the way ADD_ADDR are sent.
See: multipath-tcp/mptcp_net-next#139

In consequences, we have to adapt our tests to have these ADD_ADDR sent
earlier, ASAP in fact. We now make sure ADD_ADDR and ADD_ADDR echo are
properly sent before injecting MP_JOIN SYN and SYN+ACK or sending data.

Closes: multipath-tcp/mptcp_net-next#144
Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>
  • Loading branch information
matttbe committed Jan 23, 2021
1 parent 3b67ae3 commit 8658730
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 11 deletions.
5 changes: 4 additions & 1 deletion gtests/net/mptcp/add_addr/add_addr_client.pkt
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,8 @@
+0.0 < . 1:1(0) ack 101 win 256 <nop,nop,TS val 705 ecr 305,dss dack8=101 dll=0 nocs>
+0.0 < . 1:1(0) ack 101 win 256 <nop,nop,TS val 705 ecr 305,add_address addr[saddr] hmac=auto,dss dack8=101 dll=0 nocs>

+0.4 close(3) = 0
// ADD_ADDR echo (without hmac)
+0.0 > . 101:101(0) ack 1 <nop, nop,TS val 494 ecr 700,add_address addr[saddr],dss dack4=1 dll=1 nocs>

+0.0 close(3) = 0
+0.0 > . 101:101(0) ack 1 <nop, nop,TS val 494 ecr 700,dss dack4=1 dsn8=101 ssn=0 dll=1 nocs fin, nop, nop>
7 changes: 6 additions & 1 deletion gtests/net/mptcp/add_addr/add_addr_server.pkt
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,14 @@
+0.01 < . 1:1(0) ack 1 win 257 <mpcapable v1 flags[flag_h] key[ckey=2,skey]>
+0 accept(3, ..., ...) = 4

// ADD_ADDR is sent directly (>= 5.12), not after first data (< 5.12)
+0 > . 1:1(0) ack 1 <add_address addr[saddr] hmac=auto,dss dack4=1 ssn=1 dll=0 nocs>
// TODO: support injecting ADD_ADDR echo
//+0 < . 1:1(0) ack 1 win 257 <add_address addr[saddr],dss dack8=1 ssn=1 dll=0 nocs>

// read and ack 1 data segment
+1.0 < P. 1:1001(1000) ack 1 win 450 <nop, nop, dss dack8=1 dsn8=1 ssn=1 dll=1000 nocs>
+0 > . 1:1(0) ack 1001 <add_address addr[saddr] hmac=auto,dss dack8=1001 ssn=1 dll=0 nocs>
+0 > . 1:1(0) ack 1001 <dss dack8=1001 ssn=1 dll=0 nocs>
+0.3 read(4, ..., 1000) = 1000

+0 close(4) = 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,16 @@
+0.0 < . 1:1(0) ack 1 win 256 <mpcapable v1 flags[flag_h] key[ckey=2,skey]>
+0 accept(3, ..., ...) = 4

+0.0 < P. 1:1001(1000) ack 1 win 450 <nop, nop, dss dack8=1 dsn8=1 ssn=1 dll=1000 nocs>
// add_addr
+0.0 > . 1:1(0) ack 1 <add_address addr[saddr1] hmac=auto,dss dack4=1 dll=0 nocs>
// TODO: send echo bit
// +0.0 < . 1:1(0) ack 1 win 256 <add_address addr[saddr1],dss dack8=1 dll=0 nocs>

+0.2 < P. 1:1001(1000) ack 1 win 450 <nop, nop, dss dack8=1 dsn8=1 ssn=1 dll=1000 nocs>
+0.0 > . 1:1(0) ack 1001 win 264 <dss dack8=1001 nocs>

+0.2 < P. 1:1(0) ack 1 win 450 <mpcapable v1 flags[flag_h] key[skey,ckey]>
+0.0 > . 1:1(0) ack 1001 <add_address addr[saddr1] hmac=auto,dss dack8=1001 dll=0 nocs>
+0.2 < P. 1:1(0) ack 1 win 450 <mpcapable v1 flags[flag_h] key[skey,ckey]>
+0.0 > . 1:1(0) ack 1001 win 264 <dss dack8=1001 nocs>

// add another subflow.
+0.5 < addr[caddr1] > addr[saddr1] S 0:0(0) win 65535 <mss 1460,nop,wscale 7,mp_join_syn address_id=2 token=sha256_32(skey)>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,16 @@
+0.0 < . 1:1(0) ack 1 win 256 <mpcapable v1 flags[flag_h] key[ckey=2,skey]>
+0 accept(3, ..., ...) = 4

+0.0 < P. 1:1001(1000) ack 1 win 450 <nop, nop, dss dack8=1 dsn8=1 ssn=1 dll=1000 nocs>
// add_addr
+0.0 > . 1:1(0) ack 1 <add_address addr[saddr1] hmac=auto,dss dack4=1 dll=0 nocs>
// TODO: send echo bit
// +0.0 < . 1:1(0) ack 1 win 256 <add_address addr[saddr1],dss dack8=1 dll=0 nocs>

+0.2 < P. 1:1001(1000) ack 1 win 450 <nop, nop, dss dack8=1 dsn8=1 ssn=1 dll=1000 nocs>
+0.0 > . 1:1(0) ack 1001 win 264 <dss dack8=1001 nocs>

+0.2 < P. 1:1(0) ack 1 win 450 <mpcapable v1 flags[flag_h] key[skey,ckey]>
+0.0 > . 1:1(0) ack 1001 <add_address addr[saddr1] hmac=auto,dss dack8=1001 dll=0 nocs>
+0.2 < P. 1:1(0) ack 1 win 450 <mpcapable v1 flags[flag_h] key[skey,ckey]>
+0.0 > . 1:1(0) ack 1001 win 264 <dss dack8=1001 nocs>

// add another subflow.
+0.5 < addr[caddr1] > addr[saddr1] S 0:0(0) win 65535 <mss 1460,nop,wscale 7,mp_join_syn address_id=2 token=sha256_32(skey)>
Expand Down
4 changes: 3 additions & 1 deletion gtests/net/mptcp/mp_join/mp_join_client_v4.pkt
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,13 @@
+0.0 < . 1:1(0) ack 3 win 256 <nop,nop,TS val 4074418293 ecr 4074418292,add_address addr[saddr1] hmac=auto,dss dack8=3 dll=0 nocs>

+0.0 > > addr[saddr1] S 0:0(0) <mss 1460,sackOK,TS val 448955294 ecr 0,nop,wscale 8,mp_join_syn address_id=0 token=sha256_32(skey)>
+0.0 > > addr[saddr0] . 3:3(0) ack 1 win 256 <nop, nop, TS val 448955294 ecr 448955294, add_address addr[saddr1], dss dack4=1 nocs>

+0.0 < S. 0:0(0) ack 1 win 65535 <mss 1460,sackOK,TS val 448955294 ecr 448955294,nop,wscale 8,mp_join_syn_ack address_id=1 sender_hmac=auto>
+0.0 > . 1:1(0) ack 1 <nop,nop,TS val 448955294 ecr 448955294,mp_join_ack sender_hmac=auto>
+0.0 < . 1:1(0) ack 1 win 256 <nop,nop,TS val 448955294 ecr 448955294, dss dack8=3 nocs>
+1.0 < . 1:101(100) ack 1 win 256 <TS val 448955294 ecr 448955294, dss dack8=3 dsn8=1 ssn=1 dll=100 nocs>
+0.0 > . 1:1(0) ack 101 win 256 <nop, nop, TS val 448955294 ecr 448955294, add_address addr[saddr1], dss dack8=101 nocs>
+0.0 > . 1:1(0) ack 101 win 256 <nop, nop, TS val 448955294 ecr 448955294, dss dack8=101 nocs>
+0.0 read (3, ..., 100) = 100
+0.1 close(3) = 0
+0.0 > addr[caddr0] > addr[saddr0] . 3:3(0) ack 1 <nop,nop,TS val 4074418292 ecr 4074418293,dss dack8=101 dsn8=3 ssn=0 dll=1 nocs fin,nop,nop>
Expand Down
10 changes: 8 additions & 2 deletions gtests/net/mptcp/mp_join/mp_join_server_v4.pkt
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,14 @@
+0.0 < . 1:1(0) ack 1 win 256 <nop,nop,TS val 4074410674 ecr 4074410674,mpcapable v1 flags[flag_h] key[ckey=2,skey]>
+0 accept(3, ..., ...) = 4

+1.0 < P. 1:3(2) ack 1 win 256 <nop,nop,TS val 4074418292 ecr 4074410674,mpcapable v1 flags[flag_h] key[skey,ckey] mpcdatalen 2,nop,nop>
+0.0 > . 1:1(0) ack 3 <nop,nop,TS val 4074418293 ecr 4074418292,add_address addr[saddr1] hmac=auto,dss dack8=3 dll=0 nocs>
// add_addr
+0.0 > . 1:1(0) ack 1 <nop,nop,TS val 4074418293 ecr 4074418292,add_address addr[saddr1] hmac=auto,dss dack4=1 dll=0 nocs>
// TODO: send echo bit
// +0.0 > . 1:1(0) ack 1 win 256 <nop,nop,TS val 4074418293 ecr 4074418292,add_address addr[saddr1],dss dack8=1 dll=0 nocs>

+0.2 < P. 1:3(2) ack 1 win 256 <nop,nop,TS val 4074418292 ecr 4074410674,mpcapable v1 flags[flag_h] key[skey,ckey] mpcdatalen 2,nop,nop>
// TODO: Why dack8 here?
+0.0 > . 1:1(0) ack 3 <nop,nop,TS val 4074418293 ecr 4074418292,dss dack8=3 dll=0 nocs>

// create subflow
+0.0 < addr[caddr1] > addr[saddr1] S 0:0(0) win 65535 <mss 1460,sackOK,TS val 448955294 ecr 0,nop,wscale 8,mp_join_syn backup=1 address_id=2 token=sha256_32(skey)>
Expand Down

0 comments on commit 8658730

Please sign in to comment.