From 0fb4f067e40f730b0b8a78fd84b7c97b1d1a3074 Mon Sep 17 00:00:00 2001 From: Davide Caratti Date: Thu, 9 Jan 2020 19:15:43 +0100 Subject: [PATCH] add fallback to TCP tests (server side) 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 --- .../mp_capable/v1_bind_tcpfallback_flagB.pkt | 22 ++++++++++++++++++ .../v1_bind_tcpfallback_flagB_3rd_ack.pkt | 23 +++++++++++++++++++ .../mp_capable/v1_bind_tcpfallback_flagH.pkt | 22 ++++++++++++++++++ .../v1_bind_tcpfallback_flagH_3rd_ack.pkt | 23 +++++++++++++++++++ .../v1_bind_tcpfallback_wrongver.pkt | 22 ++++++++++++++++++ .../v1_bind_tcpfallback_wrongver_3rd_ack.pkt | 23 +++++++++++++++++++ 6 files changed, 135 insertions(+) create mode 100644 gtests/net/mptcp/mp_capable/v1_bind_tcpfallback_flagB.pkt create mode 100644 gtests/net/mptcp/mp_capable/v1_bind_tcpfallback_flagB_3rd_ack.pkt create mode 100644 gtests/net/mptcp/mp_capable/v1_bind_tcpfallback_flagH.pkt create mode 100644 gtests/net/mptcp/mp_capable/v1_bind_tcpfallback_flagH_3rd_ack.pkt create mode 100644 gtests/net/mptcp/mp_capable/v1_bind_tcpfallback_wrongver.pkt create mode 100644 gtests/net/mptcp/mp_capable/v1_bind_tcpfallback_wrongver_3rd_ack.pkt diff --git a/gtests/net/mptcp/mp_capable/v1_bind_tcpfallback_flagB.pkt b/gtests/net/mptcp/mp_capable/v1_bind_tcpfallback_flagB.pkt new file mode 100644 index 00000000..0a5b91f3 --- /dev/null +++ b/gtests/net/mptcp/mp_capable/v1_bind_tcpfallback_flagB.pkt @@ -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 ++0 > S. 0:0(0) ack 1 ++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 + + diff --git a/gtests/net/mptcp/mp_capable/v1_bind_tcpfallback_flagB_3rd_ack.pkt b/gtests/net/mptcp/mp_capable/v1_bind_tcpfallback_flagB_3rd_ack.pkt new file mode 100644 index 00000000..a1551269 --- /dev/null +++ b/gtests/net/mptcp/mp_capable/v1_bind_tcpfallback_flagB_3rd_ack.pkt @@ -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 ++0 > S. 0:0(0) ack 1 ++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 + + + diff --git a/gtests/net/mptcp/mp_capable/v1_bind_tcpfallback_flagH.pkt b/gtests/net/mptcp/mp_capable/v1_bind_tcpfallback_flagH.pkt new file mode 100644 index 00000000..f20fdcac --- /dev/null +++ b/gtests/net/mptcp/mp_capable/v1_bind_tcpfallback_flagH.pkt @@ -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 ++0 > S. 0:0(0) ack 1 ++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 + + diff --git a/gtests/net/mptcp/mp_capable/v1_bind_tcpfallback_flagH_3rd_ack.pkt b/gtests/net/mptcp/mp_capable/v1_bind_tcpfallback_flagH_3rd_ack.pkt new file mode 100644 index 00000000..a81ec55f --- /dev/null +++ b/gtests/net/mptcp/mp_capable/v1_bind_tcpfallback_flagH_3rd_ack.pkt @@ -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 ++0 > S. 0:0(0) ack 1 ++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 + + + diff --git a/gtests/net/mptcp/mp_capable/v1_bind_tcpfallback_wrongver.pkt b/gtests/net/mptcp/mp_capable/v1_bind_tcpfallback_wrongver.pkt new file mode 100644 index 00000000..0d2577fe --- /dev/null +++ b/gtests/net/mptcp/mp_capable/v1_bind_tcpfallback_wrongver.pkt @@ -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 ++0 > S. 0:0(0) ack 1 ++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 + + diff --git a/gtests/net/mptcp/mp_capable/v1_bind_tcpfallback_wrongver_3rd_ack.pkt b/gtests/net/mptcp/mp_capable/v1_bind_tcpfallback_wrongver_3rd_ack.pkt new file mode 100644 index 00000000..08fa6347 --- /dev/null +++ b/gtests/net/mptcp/mp_capable/v1_bind_tcpfallback_wrongver_3rd_ack.pkt @@ -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 ++0 > S. 0:0(0) ack 1 ++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 + + +