From 469e1f0cf9914b8becd10a7b66f18cfc88043c47 Mon Sep 17 00:00:00 2001 From: Davide Caratti Date: Mon, 22 Feb 2021 20:44:13 +0100 Subject: [PATCH] update tests to add outbound echoed ADD_ADDR while at it, change parser to use a keyword to specify the echo bit set in ADD_ADDR messages. Link: https://github.com/multipath-tcp/mptcp_net-next/issues/54 Signed-off-by: Davide Caratti --- gtests/net/mptcp/add_addr/add_addr_client.pkt | 2 +- gtests/net/mptcp/add_addr/add_addr_server.pkt | 9 ++++----- .../receive_fastclose_with_ack_multi_v4.pkt | 9 ++++----- .../receive_fastclose_with_rst_multi_v4.pkt | 5 ++--- .../fastclose/receive_fastclose_with_rst_v4.pkt | 3 +-- gtests/net/mptcp/mp_join/mp_join_client_v4.pkt | 2 +- gtests/net/mptcp/mp_join/mp_join_server_v4.pkt | 16 ++++++++-------- gtests/net/mptcp/mp_prio/mp_prio_server_v4.pkt | 7 +++---- gtests/net/mptcp/mp_reset/mp_reset_multi_v4.pkt | 2 +- gtests/net/mptcp/syscalls/accept_v4.pkt | 3 +-- gtests/net/packetdrill/lexer.l | 1 + gtests/net/packetdrill/parser.y | 5 +++-- 12 files changed, 30 insertions(+), 34 deletions(-) diff --git a/gtests/net/mptcp/add_addr/add_addr_client.pkt b/gtests/net/mptcp/add_addr/add_addr_client.pkt index 15b5ecd5..d74532ad 100644 --- a/gtests/net/mptcp/add_addr/add_addr_client.pkt +++ b/gtests/net/mptcp/add_addr/add_addr_client.pkt @@ -27,7 +27,7 @@ +0.0 < . 1:1(0) ack 101 win 256 // ADD_ADDR echo (without hmac) -+0.0 > . 101:101(0) ack 1 ++0.0 > . 101:101(0) ack 1 +0.0 close(3) = 0 +0.0 > . 101:101(0) ack 1 diff --git a/gtests/net/mptcp/add_addr/add_addr_server.pkt b/gtests/net/mptcp/add_addr/add_addr_server.pkt index 2b916632..19cb4f5e 100644 --- a/gtests/net/mptcp/add_addr/add_addr_server.pkt +++ b/gtests/net/mptcp/add_addr/add_addr_server.pkt @@ -2,9 +2,9 @@ --tolerance_usecs=100000 `../common/defaults.sh` -// TODO(malsbat): +// an address not used in packetdrill defaults +0 `ip mptcp endpoint flush` -+0 `ip mptcp endpoint add 192.168.122.83 signal` ++0 `ip mptcp endpoint add 198.51.100.2 signal` +0 socket(..., SOCK_STREAM, IPPROTO_MPTCP) = 3 +0 setsockopt(3, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0 @@ -17,9 +17,8 @@ +0 accept(3, ..., ...) = 4 // ADD_ADDR is sent directly (>= 5.12), not after first data (< 5.12) -+0 > . 1:1(0) ack 1 -// TODO: support injecting ADD_ADDR echo -//+0 < . 1:1(0) ack 1 win 257 ++0 > . 1:1(0) ack 1 ++0 < . 1:1(0) ack 1 win 257 // read and ack 1 data segment +1.0 < P. 1:1001(1000) ack 1 win 450 diff --git a/gtests/net/mptcp/fastclose/receive_fastclose_with_ack_multi_v4.pkt b/gtests/net/mptcp/fastclose/receive_fastclose_with_ack_multi_v4.pkt index e973b5ec..3e86073e 100644 --- a/gtests/net/mptcp/fastclose/receive_fastclose_with_ack_multi_v4.pkt +++ b/gtests/net/mptcp/fastclose/receive_fastclose_with_ack_multi_v4.pkt @@ -15,9 +15,8 @@ +0 accept(3, ..., ...) = 4 // add_addr -+0.0 > . 1:1(0) ack 1 -// TODO: send echo bit -// +0.0 < . 1:1(0) ack 1 win 256 ++0.0 > . 1:1(0) ack 1 ++0.0 < . 1:1(0) ack 1 win 256 +0.2 < P. 1:1001(1000) ack 1 win 450 +0.0 > . 1:1(0) ack 1001 @@ -27,8 +26,8 @@ // add another subflow. -+0.5 < addr[caddr1] > addr[saddr1] S 0:0(0) win 65535 -+0.0 > S. 0:0(0) ack 1 ++0.5 < addr[caddr1] > addr[saddr1] S 0:0(0) win 65535 ++0.0 > S. 0:0(0) ack 1 +0.0 < . 1:1(0) ack 1 win 256 +0.0 > . 1:1(0) ack 1 diff --git a/gtests/net/mptcp/fastclose/receive_fastclose_with_rst_multi_v4.pkt b/gtests/net/mptcp/fastclose/receive_fastclose_with_rst_multi_v4.pkt index 74903d6d..4d6363a9 100644 --- a/gtests/net/mptcp/fastclose/receive_fastclose_with_rst_multi_v4.pkt +++ b/gtests/net/mptcp/fastclose/receive_fastclose_with_rst_multi_v4.pkt @@ -16,10 +16,9 @@ // add_addr +0.0 > . 1:1(0) ack 1 -// TODO: send echo bit -// +0.0 < . 1:1(0) ack 1 win 256 ++0.0 < . 1:1(0) ack 1 win 256 -+0.2 < P. 1:1001(1000) ack 1 win 450 ++0.2 < P. 1:1001(1000) ack 1 win 450 +0.0 > . 1:1(0) ack 1001 +0.2 < P. 1:1(0) ack 1 win 450 diff --git a/gtests/net/mptcp/fastclose/receive_fastclose_with_rst_v4.pkt b/gtests/net/mptcp/fastclose/receive_fastclose_with_rst_v4.pkt index 88445035..e34c236a 100644 --- a/gtests/net/mptcp/fastclose/receive_fastclose_with_rst_v4.pkt +++ b/gtests/net/mptcp/fastclose/receive_fastclose_with_rst_v4.pkt @@ -30,8 +30,7 @@ +0.0 < . 1:1(0) ack 1 win 256 +0.0 > . 1:1(0) ack 1 -// TODO: send echo bit -// +0.0 < . 1:1(0) ack 1 win 256 ++0.0 < . 1:1(0) ack 1 win 256 // more data, resend. should work now. +0.0 < P. 1:1001(1000) ack 1 win 450 diff --git a/gtests/net/mptcp/mp_join/mp_join_client_v4.pkt b/gtests/net/mptcp/mp_join/mp_join_client_v4.pkt index 07616a74..f65cc030 100644 --- a/gtests/net/mptcp/mp_join/mp_join_client_v4.pkt +++ b/gtests/net/mptcp/mp_join/mp_join_client_v4.pkt @@ -22,7 +22,7 @@ +0.0 > > addr[saddr1] S 0:0(0) -+0.0 > > addr[saddr0] . 3:3(0) ack 1 ++0.0 > > addr[saddr0] . 3:3(0) ack 1 +0.0 < S. 0:0(0) ack 1 win 65535 +0.0 > . 1:1(0) ack 1 diff --git a/gtests/net/mptcp/mp_join/mp_join_server_v4.pkt b/gtests/net/mptcp/mp_join/mp_join_server_v4.pkt index a8899a6b..ecf68f4f 100644 --- a/gtests/net/mptcp/mp_join/mp_join_server_v4.pkt +++ b/gtests/net/mptcp/mp_join/mp_join_server_v4.pkt @@ -17,22 +17,22 @@ +0 accept(3, ..., ...) = 4 // add_addr -+0.0 > . 1:1(0) ack 1 -// TODO: send echo bit -// +0.0 < . 1:1(0) ack 1 ++0.0 > . 1:1(0) ack 1 ++0.0 < . 1:1(0) ack 1 win 256 - -+0.2 < P. 1:3(2) ack 1 win 256 ++0.0 < P. 1:3(2) ack 1 win 256 // MP_CAPABLE carrying data are acked with 64-bit, safer not knowing if the // sender will use a DSN on 64-bit or 32-bit. Later we can use the lower 32 bits +0.0 > . 1:1(0) ack 3 + // create subflow -+0.0 < addr[caddr1] > addr[saddr1] S 0:0(0) win 65535 -+0.0 > S. 0:0(0) ack 1 ++0.0 < addr[caddr1] > addr[saddr1] S 0:0(0) win 65535 ++0.0 > S. 0:0(0) ack 1 +0.0 < . 1:1(0) ack 1 win 256 + +0.0 > . 1:1(0) ack 1 // close connection +0.0 < addr[caddr0] > addr[saddr0] F. 3:3(0) ack 1 win 256 -+0.0 < > addr[saddr1] F. 1:1(0) ack 1 win 256 ++0.0 < > addr[saddr1] F. 1:1(0) ack 1 win 256 diff --git a/gtests/net/mptcp/mp_prio/mp_prio_server_v4.pkt b/gtests/net/mptcp/mp_prio/mp_prio_server_v4.pkt index 04fe4c11..6748866f 100644 --- a/gtests/net/mptcp/mp_prio/mp_prio_server_v4.pkt +++ b/gtests/net/mptcp/mp_prio/mp_prio_server_v4.pkt @@ -17,9 +17,8 @@ +0 accept(3, ..., ...) = 4 // add_addr -+0.0 > . 1:1(0) ack 1 -// TODO: send echo bit -// +0.0 < . 1:1(0) ack 1 ++0.0 > . 1:1(0) ack 1 ++0.0 < . 1:1(0) ack 1 win 256 < add_address address_id=1 addr[saddr1] addr_echo, dss dack4=1 dll=0 nocs> +0.2 < P. 1:3(2) ack 1 win 256 // MP_CAPABLE carrying data are acked with 64-bit, safer not knowing if the @@ -33,7 +32,7 @@ +0.0 read(4, ..., 2) = 2 // create subflow -+0.0 < addr[caddr1] > addr[saddr1] S 0:0(0) win 65535 ++0.0 < addr[caddr1] > addr[saddr1] S 0:0(0) win 65535 +0.0 > S. 0:0(0) ack 1 +0.0 < . 1:1(0) ack 1 win 256 +0.0 > . 1:1(0) ack 1 diff --git a/gtests/net/mptcp/mp_reset/mp_reset_multi_v4.pkt b/gtests/net/mptcp/mp_reset/mp_reset_multi_v4.pkt index be551729..d8503d91 100644 --- a/gtests/net/mptcp/mp_reset/mp_reset_multi_v4.pkt +++ b/gtests/net/mptcp/mp_reset/mp_reset_multi_v4.pkt @@ -16,7 +16,7 @@ // add_addr +0.0 > . 1:1(0) ack 1 -// +0.0 < . 1:1(0) ack 1 win 256 ++0.0 < . 1:1(0) ack 1 win 256 +0.2 < P. 1:1001(1000) ack 1 win 450 +0.0 > . 1:1(0) ack 1001 diff --git a/gtests/net/mptcp/syscalls/accept_v4.pkt b/gtests/net/mptcp/syscalls/accept_v4.pkt index eb70394c..da0f4be6 100644 --- a/gtests/net/mptcp/syscalls/accept_v4.pkt +++ b/gtests/net/mptcp/syscalls/accept_v4.pkt @@ -18,8 +18,7 @@ // add_addr +0.0 > . 1:1(0) ack 1 -// TODO: send echo bit -// +0.0 < . 1:1(0) ack 1 ++0.0 < . 1:1(0) ack 1 win 256 +0.2 < P. 1:3(2) ack 1 win 256 // MP_CAPABLE carrying data are acked with 64-bit, safer not knowing if the diff --git a/gtests/net/packetdrill/lexer.l b/gtests/net/packetdrill/lexer.l index 0556e9ea..9c92a1fd 100644 --- a/gtests/net/packetdrill/lexer.l +++ b/gtests/net/packetdrill/lexer.l @@ -254,6 +254,7 @@ backup return BACKUP; mp_join_syn_ack return MP_JOIN_SYN_ACK; mp_join_ack return MP_JOIN_ACK; add_address return ADD_ADDRESS; +addr_echo return ADDR_ECHO; port return PORT; add_addr_ipv4 return ADD_ADDR_IPV4; add_addr_ipv6 return ADD_ADDR_IPV6; diff --git a/gtests/net/packetdrill/parser.y b/gtests/net/packetdrill/parser.y index da7ee908..530492b0 100644 --- a/gtests/net/packetdrill/parser.y +++ b/gtests/net/packetdrill/parser.y @@ -851,7 +851,7 @@ struct tcp_option *dss_do_dsn_dack( int dack_type, int dack_val, %token DSS DACK4 DSN4 DACK8 DSN8 FIN SSN DLL NOCS CKSUM ADDR ADDRESS_ID BACKUP TOKEN AUTO RAND %token TRUNC_R64_HMAC TRUNC_R64_HMAC_SHA1 TRUNC_R64_HMAC_SHA256 %token SENDER_HMAC TRUNC_L64_HMAC FULL_160_HMAC SHA1_32 SHA256_32 ADD_ADDR_HMAC -%token ADD_ADDRESS ADD_ADDR_IPV4 ADD_ADDR_IPV6 PORT MP_FAIL +%token ADD_ADDRESS ADD_ADDR_IPV4 ADD_ADDR_IPV6 PORT MP_FAIL ADDR_ECHO %token REMOVE_ADDRESS ADDRESSES_ID LIST_ID %token MP_PRIO %token MP_TCPRST @@ -1953,7 +1953,8 @@ SENDER_HMAC '=' TRUNC_L64_HMAC '(' INTEGER ')' { ; add_addr_hmac -: { +: +ADDR_ECHO { $$.auto_conf = false; $$.hash = UNDEFINED; }