* [PATCH net-next] selftests/net: packetdrill: add tcp_syncookies_ip6_9k
@ 2026-04-29 8:00 Eric Dumazet
2026-04-29 14:15 ` Neal Cardwell
2026-04-29 16:48 ` Jakub Kicinski
0 siblings, 2 replies; 9+ messages in thread
From: Eric Dumazet @ 2026-04-29 8:00 UTC (permalink / raw)
To: David S . Miller, Jakub Kicinski, Paolo Abeni
Cc: Simon Horman, Neal Cardwell, Kuniyuki Iwashima, netdev,
eric.dumazet, Eric Dumazet
This test checks syncookie mode is able to reconstruct some
client options when TCP TS are used:
- wscale option.
- sackOK.
- MSS (in a limited way).
- ECN (not tested, because of limited value).
Signed-off-by: Eric Dumazet <edumazet@google.com>
---
.../net/packetdrill/tcp_syncookies_ip6_9k.pkt | 30 +++++++++++++++++++
1 file changed, 30 insertions(+)
create mode 100644 tools/testing/selftests/net/packetdrill/tcp_syncookies_ip6_9k.pkt
diff --git a/tools/testing/selftests/net/packetdrill/tcp_syncookies_ip6_9k.pkt b/tools/testing/selftests/net/packetdrill/tcp_syncookies_ip6_9k.pkt
new file mode 100644
index 0000000000000000000000000000000000000000..15d03992a99140ecc4241edae58693dc5098fece
--- /dev/null
+++ b/tools/testing/selftests/net/packetdrill/tcp_syncookies_ip6_9k.pkt
@@ -0,0 +1,30 @@
+// SPDX-License-Identifier: GPL-2.0
+//
+// Check syncookies.
+//
+// Check we are able to rebuild client sack, wscale and mss options.
+// IPv6 msstab[4] = { 1280 - 60, 1480 - 60, 1500 - 60, 9000 - 60 }
+
+--ip_version=ipv6
+
+`./defaults.sh
+sysctl -q net.ipv4.tcp_syncookies=2
+ip link set dev tun0 mtu 9000
+`
+
+ 0 socket(..., SOCK_STREAM, IPPROTO_TCP) = 3
+ +0 setsockopt(3, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
+ +0 bind(3, ..., ...) = 0
+ +0 listen(3, 10) = 0
+
+ +0 < S 0:0(0) win 32792 <mss 8940,sackOK,TS val 100 ecr 0,nop,wscale 10>
+ +0 > S. 0:0(0) ack 1 <mss 8940,sackOK,TS val 4000 ecr 100,nop,wscale 8>
+ +.01 < . 1:1(0) ack 1 win 1024 <nop,nop,TS val 110 ecr 4000>
+
+ +0 accept(3, ..., ...) = 4
+
+// Check we properly infer from the final packet the other peer wanted 8940 mss, wscale 10 and sackOK
+ +0 %{ assert tcpi_snd_mss == 8928, tcpi_snd_mss }%
+ +0 %{ assert tcpi_snd_wscale = 10, tcpi_snd_wscale }%
+ +0 %{ assert (tcpi_options & TCPI_OPT_WSCALE) != 0, tcpi_options }%
+
--
2.54.0.545.g6539524ca2-goog
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH net-next] selftests/net: packetdrill: add tcp_syncookies_ip6_9k
2026-04-29 8:00 [PATCH net-next] selftests/net: packetdrill: add tcp_syncookies_ip6_9k Eric Dumazet
@ 2026-04-29 14:15 ` Neal Cardwell
2026-04-29 15:39 ` Eric Dumazet
2026-04-29 16:48 ` Jakub Kicinski
1 sibling, 1 reply; 9+ messages in thread
From: Neal Cardwell @ 2026-04-29 14:15 UTC (permalink / raw)
To: Eric Dumazet
Cc: David S . Miller, Jakub Kicinski, Paolo Abeni, Simon Horman,
Kuniyuki Iwashima, netdev, eric.dumazet
On Wed, Apr 29, 2026 at 4:00 AM Eric Dumazet <edumazet@google.com> wrote:
>
> This test checks syncookie mode is able to reconstruct some
> client options when TCP TS are used:
>
> - wscale option.
> - sackOK.
> - MSS (in a limited way).
> - ECN (not tested, because of limited value).
>
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> ---
> .../net/packetdrill/tcp_syncookies_ip6_9k.pkt | 30 +++++++++++++++++++
> 1 file changed, 30 insertions(+)
> create mode 100644 tools/testing/selftests/net/packetdrill/tcp_syncookies_ip6_9k.pkt
>
> diff --git a/tools/testing/selftests/net/packetdrill/tcp_syncookies_ip6_9k.pkt b/tools/testing/selftests/net/packetdrill/tcp_syncookies_ip6_9k.pkt
> new file mode 100644
> index 0000000000000000000000000000000000000000..15d03992a99140ecc4241edae58693dc5098fece
> --- /dev/null
> +++ b/tools/testing/selftests/net/packetdrill/tcp_syncookies_ip6_9k.pkt
> @@ -0,0 +1,30 @@
> +// SPDX-License-Identifier: GPL-2.0
> +//
> +// Check syncookies.
> +//
> +// Check we are able to rebuild client sack, wscale and mss options.
> +// IPv6 msstab[4] = { 1280 - 60, 1480 - 60, 1500 - 60, 9000 - 60 }
> +
> +--ip_version=ipv6
> +
> +`./defaults.sh
> +sysctl -q net.ipv4.tcp_syncookies=2
> +ip link set dev tun0 mtu 9000
> +`
> +
> + 0 socket(..., SOCK_STREAM, IPPROTO_TCP) = 3
> + +0 setsockopt(3, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
> + +0 bind(3, ..., ...) = 0
> + +0 listen(3, 10) = 0
> +
> + +0 < S 0:0(0) win 32792 <mss 8940,sackOK,TS val 100 ecr 0,nop,wscale 10>
> + +0 > S. 0:0(0) ack 1 <mss 8940,sackOK,TS val 4000 ecr 100,nop,wscale 8>
> + +.01 < . 1:1(0) ack 1 win 1024 <nop,nop,TS val 110 ecr 4000>
> +
> + +0 accept(3, ..., ...) = 4
> +
> +// Check we properly infer from the final packet the other peer wanted 8940 mss, wscale 10 and sackOK
> + +0 %{ assert tcpi_snd_mss == 8928, tcpi_snd_mss }%
> + +0 %{ assert tcpi_snd_wscale = 10, tcpi_snd_wscale }%
> + +0 %{ assert (tcpi_options & TCPI_OPT_WSCALE) != 0, tcpi_options }%
The comment mentions checking sackOK but the script does not seem to
do that? Probably want to check the TCPI_OPT_SACK bit as well? Maybe
TCPI_OPT_TIMESTAMPS as well, for completeness?
Thanks for the test!
neal
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH net-next] selftests/net: packetdrill: add tcp_syncookies_ip6_9k
2026-04-29 14:15 ` Neal Cardwell
@ 2026-04-29 15:39 ` Eric Dumazet
0 siblings, 0 replies; 9+ messages in thread
From: Eric Dumazet @ 2026-04-29 15:39 UTC (permalink / raw)
To: Neal Cardwell
Cc: David S . Miller, Jakub Kicinski, Paolo Abeni, Simon Horman,
Kuniyuki Iwashima, netdev, eric.dumazet
On Wed, Apr 29, 2026 at 7:15 AM Neal Cardwell <ncardwell@google.com> wrote:
>
> On Wed, Apr 29, 2026 at 4:00 AM Eric Dumazet <edumazet@google.com> wrote:
> >
> > This test checks syncookie mode is able to reconstruct some
> > client options when TCP TS are used:
> >
> > - wscale option.
> > - sackOK.
> > - MSS (in a limited way).
> > - ECN (not tested, because of limited value).
> >
> > Signed-off-by: Eric Dumazet <edumazet@google.com>
> > ---
> > .../net/packetdrill/tcp_syncookies_ip6_9k.pkt | 30 +++++++++++++++++++
> > 1 file changed, 30 insertions(+)
> > create mode 100644 tools/testing/selftests/net/packetdrill/tcp_syncookies_ip6_9k.pkt
> >
> > diff --git a/tools/testing/selftests/net/packetdrill/tcp_syncookies_ip6_9k.pkt b/tools/testing/selftests/net/packetdrill/tcp_syncookies_ip6_9k.pkt
> > new file mode 100644
> > index 0000000000000000000000000000000000000000..15d03992a99140ecc4241edae58693dc5098fece
> > --- /dev/null
> > +++ b/tools/testing/selftests/net/packetdrill/tcp_syncookies_ip6_9k.pkt
> > @@ -0,0 +1,30 @@
> > +// SPDX-License-Identifier: GPL-2.0
> > +//
> > +// Check syncookies.
> > +//
> > +// Check we are able to rebuild client sack, wscale and mss options.
> > +// IPv6 msstab[4] = { 1280 - 60, 1480 - 60, 1500 - 60, 9000 - 60 }
> > +
> > +--ip_version=ipv6
> > +
> > +`./defaults.sh
> > +sysctl -q net.ipv4.tcp_syncookies=2
> > +ip link set dev tun0 mtu 9000
> > +`
> > +
> > + 0 socket(..., SOCK_STREAM, IPPROTO_TCP) = 3
> > + +0 setsockopt(3, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
> > + +0 bind(3, ..., ...) = 0
> > + +0 listen(3, 10) = 0
> > +
> > + +0 < S 0:0(0) win 32792 <mss 8940,sackOK,TS val 100 ecr 0,nop,wscale 10>
> > + +0 > S. 0:0(0) ack 1 <mss 8940,sackOK,TS val 4000 ecr 100,nop,wscale 8>
> > + +.01 < . 1:1(0) ack 1 win 1024 <nop,nop,TS val 110 ecr 4000>
> > +
> > + +0 accept(3, ..., ...) = 4
> > +
> > +// Check we properly infer from the final packet the other peer wanted 8940 mss, wscale 10 and sackOK
> > + +0 %{ assert tcpi_snd_mss == 8928, tcpi_snd_mss }%
> > + +0 %{ assert tcpi_snd_wscale = 10, tcpi_snd_wscale }%
> > + +0 %{ assert (tcpi_options & TCPI_OPT_WSCALE) != 0, tcpi_options }%
>
> The comment mentions checking sackOK but the script does not seem to
> do that? Probably want to check the TCPI_OPT_SACK bit as well? Maybe
> TCPI_OPT_TIMESTAMPS as well, for completeness?
Oh right, last minute typo, I was testing (tcpi_options & 2) != 0,
then wanted to replace with the symbolic version, which should have
been TCPI_OPT_SACK.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH net-next] selftests/net: packetdrill: add tcp_syncookies_ip6_9k
2026-04-29 8:00 [PATCH net-next] selftests/net: packetdrill: add tcp_syncookies_ip6_9k Eric Dumazet
2026-04-29 14:15 ` Neal Cardwell
@ 2026-04-29 16:48 ` Jakub Kicinski
2026-04-29 17:09 ` Eric Dumazet
1 sibling, 1 reply; 9+ messages in thread
From: Jakub Kicinski @ 2026-04-29 16:48 UTC (permalink / raw)
To: Eric Dumazet
Cc: David S . Miller, Paolo Abeni, Simon Horman, Neal Cardwell,
Kuniyuki Iwashima, netdev, eric.dumazet
On Wed, 29 Apr 2026 08:00:36 +0000 Eric Dumazet wrote:
> This test checks syncookie mode is able to reconstruct some
> client options when TCP TS are used:
>
> - wscale option.
> - sackOK.
> - MSS (in a limited way).
> - ECN (not tested, because of limited value).
We're getting:
# TAP version 13
# 1..1
# File "/tmp/code_oyWax9", line 223
# assert tcpi_snd_wscale = 10, tcpi_snd_wscale
# ^
# SyntaxError: invalid syntax
# tcp_syncookies_ip6_9k.pkt: error executing code: 'python3' returned non-zero status 1
do we need to update packetdrill ?
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH net-next] selftests/net: packetdrill: add tcp_syncookies_ip6_9k
2026-04-29 16:48 ` Jakub Kicinski
@ 2026-04-29 17:09 ` Eric Dumazet
2026-04-29 17:15 ` Eric Dumazet
0 siblings, 1 reply; 9+ messages in thread
From: Eric Dumazet @ 2026-04-29 17:09 UTC (permalink / raw)
To: Jakub Kicinski
Cc: David S . Miller, Paolo Abeni, Simon Horman, Neal Cardwell,
Kuniyuki Iwashima, netdev, eric.dumazet
On Wed, Apr 29, 2026 at 9:48 AM Jakub Kicinski <kuba@kernel.org> wrote:
>
> On Wed, 29 Apr 2026 08:00:36 +0000 Eric Dumazet wrote:
> > This test checks syncookie mode is able to reconstruct some
> > client options when TCP TS are used:
> >
> > - wscale option.
> > - sackOK.
> > - MSS (in a limited way).
> > - ECN (not tested, because of limited value).
>
> We're getting:
>
> # TAP version 13
> # 1..1
> # File "/tmp/code_oyWax9", line 223
> # assert tcpi_snd_wscale = 10, tcpi_snd_wscale
> # ^
> # SyntaxError: invalid syntax
> # tcp_syncookies_ip6_9k.pkt: error executing code: 'python3' returned non-zero status 1
>
> do we need to update packetdrill ?
No, this should have been
assert tcpi_snd_wscale == 10, tcpi_snd_wscale
I initially had a value of 8, and decided going to 10 just to make it
different than the output wscale value.
Sorry for the confusion.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH net-next] selftests/net: packetdrill: add tcp_syncookies_ip6_9k
2026-04-29 17:09 ` Eric Dumazet
@ 2026-04-29 17:15 ` Eric Dumazet
2026-04-29 20:47 ` Neal Cardwell
0 siblings, 1 reply; 9+ messages in thread
From: Eric Dumazet @ 2026-04-29 17:15 UTC (permalink / raw)
To: Jakub Kicinski
Cc: David S . Miller, Paolo Abeni, Simon Horman, Neal Cardwell,
Kuniyuki Iwashima, netdev, eric.dumazet
On Wed, Apr 29, 2026 at 10:09 AM Eric Dumazet <edumazet@google.com> wrote:
>
> On Wed, Apr 29, 2026 at 9:48 AM Jakub Kicinski <kuba@kernel.org> wrote:
> >
> > On Wed, 29 Apr 2026 08:00:36 +0000 Eric Dumazet wrote:
> > > This test checks syncookie mode is able to reconstruct some
> > > client options when TCP TS are used:
> > >
> > > - wscale option.
> > > - sackOK.
> > > - MSS (in a limited way).
> > > - ECN (not tested, because of limited value).
> >
> > We're getting:
> >
> > # TAP version 13
> > # 1..1
> > # File "/tmp/code_oyWax9", line 223
> > # assert tcpi_snd_wscale = 10, tcpi_snd_wscale
> > # ^
> > # SyntaxError: invalid syntax
> > # tcp_syncookies_ip6_9k.pkt: error executing code: 'python3' returned non-zero status 1
> >
> > do we need to update packetdrill ?
>
> No, this should have been
>
> assert tcpi_snd_wscale == 10, tcpi_snd_wscale
>
> I initially had a value of 8, and decided going to 10 just to make it
> different than the output wscale value.
>
> Sorry for the confusion.
Neal, can you take care of adding TCPI_OPT_SACK to packetdrill ?
Thanks!
diff --git a/gtests/net/packetdrill/code.c b/gtests/net/packetdrill/code.c
index d90bffabcfe6..6d8d20e64d8c 100644
--- a/gtests/net/packetdrill/code.c
+++ b/gtests/net/packetdrill/code.c
@@ -129,6 +129,7 @@ static void write_symbols(struct code_state *code)
emit_var(code, "TCPI_OPT_WSCALE", TCPI_OPT_WSCALE);
emit_var(code, "TCPI_OPT_ECN", TCPI_OPT_ECN);
emit_var(code, "TCPI_OPT_SYN_DATA", TCPI_OPT_SYN_DATA);
+ emit_var(code, "TCPI_OPT_SACK", TCPI_OPT_SACK);
#endif /* linux */
}
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH net-next] selftests/net: packetdrill: add tcp_syncookies_ip6_9k
2026-04-29 17:15 ` Eric Dumazet
@ 2026-04-29 20:47 ` Neal Cardwell
2026-04-29 23:33 ` Jakub Kicinski
0 siblings, 1 reply; 9+ messages in thread
From: Neal Cardwell @ 2026-04-29 20:47 UTC (permalink / raw)
To: Eric Dumazet
Cc: Jakub Kicinski, David S . Miller, Paolo Abeni, Simon Horman,
Kuniyuki Iwashima, netdev, eric.dumazet
On Wed, Apr 29, 2026 at 1:15 PM Eric Dumazet <edumazet@google.com> wrote:
>
> On Wed, Apr 29, 2026 at 10:09 AM Eric Dumazet <edumazet@google.com> wrote:
> >
> > On Wed, Apr 29, 2026 at 9:48 AM Jakub Kicinski <kuba@kernel.org> wrote:
> > >
> > > On Wed, 29 Apr 2026 08:00:36 +0000 Eric Dumazet wrote:
> > > > This test checks syncookie mode is able to reconstruct some
> > > > client options when TCP TS are used:
> > > >
> > > > - wscale option.
> > > > - sackOK.
> > > > - MSS (in a limited way).
> > > > - ECN (not tested, because of limited value).
> > >
> > > We're getting:
> > >
> > > # TAP version 13
> > > # 1..1
> > > # File "/tmp/code_oyWax9", line 223
> > > # assert tcpi_snd_wscale = 10, tcpi_snd_wscale
> > > # ^
> > > # SyntaxError: invalid syntax
> > > # tcp_syncookies_ip6_9k.pkt: error executing code: 'python3' returned non-zero status 1
> > >
> > > do we need to update packetdrill ?
> >
> > No, this should have been
> >
> > assert tcpi_snd_wscale == 10, tcpi_snd_wscale
> >
> > I initially had a value of 8, and decided going to 10 just to make it
> > different than the output wscale value.
> >
> > Sorry for the confusion.
>
> Neal, can you take care of adding TCPI_OPT_SACK to packetdrill ?
>
> Thanks!
>
> diff --git a/gtests/net/packetdrill/code.c b/gtests/net/packetdrill/code.c
> index d90bffabcfe6..6d8d20e64d8c 100644
> --- a/gtests/net/packetdrill/code.c
> +++ b/gtests/net/packetdrill/code.c
> @@ -129,6 +129,7 @@ static void write_symbols(struct code_state *code)
> emit_var(code, "TCPI_OPT_WSCALE", TCPI_OPT_WSCALE);
> emit_var(code, "TCPI_OPT_ECN", TCPI_OPT_ECN);
> emit_var(code, "TCPI_OPT_SYN_DATA", TCPI_OPT_SYN_DATA);
> + emit_var(code, "TCPI_OPT_SACK", TCPI_OPT_SACK);
> #endif /* linux */
> }
Sure! Done. I added all the missing bit values in the following commit:
https://github.com/google/packetdrill/commit/faa0dfb54065118625e169d3111ce09c65b20229
This can be picked up with the following, or similar:
git clone https://github.com/google/packetdrill.git
neal
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH net-next] selftests/net: packetdrill: add tcp_syncookies_ip6_9k
2026-04-29 20:47 ` Neal Cardwell
@ 2026-04-29 23:33 ` Jakub Kicinski
2026-04-30 2:09 ` Eric Dumazet
0 siblings, 1 reply; 9+ messages in thread
From: Jakub Kicinski @ 2026-04-29 23:33 UTC (permalink / raw)
To: Neal Cardwell, Eric Dumazet
Cc: David S . Miller, Paolo Abeni, Simon Horman, Kuniyuki Iwashima,
netdev, eric.dumazet
On Wed, 29 Apr 2026 16:47:14 -0400 Neal Cardwell wrote:
> > diff --git a/gtests/net/packetdrill/code.c b/gtests/net/packetdrill/code.c
> > index d90bffabcfe6..6d8d20e64d8c 100644
> > --- a/gtests/net/packetdrill/code.c
> > +++ b/gtests/net/packetdrill/code.c
> > @@ -129,6 +129,7 @@ static void write_symbols(struct code_state *code)
> > emit_var(code, "TCPI_OPT_WSCALE", TCPI_OPT_WSCALE);
> > emit_var(code, "TCPI_OPT_ECN", TCPI_OPT_ECN);
> > emit_var(code, "TCPI_OPT_SYN_DATA", TCPI_OPT_SYN_DATA);
> > + emit_var(code, "TCPI_OPT_SACK", TCPI_OPT_SACK);
> > #endif /* linux */
> > }
>
> Sure! Done. I added all the missing bit values in the following commit:
>
> https://github.com/google/packetdrill/commit/faa0dfb54065118625e169d3111ce09c65b20229
>
> This can be picked up with the following, or similar:
>
> git clone https://github.com/google/packetdrill.git
Updated in netdev CI.
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH net-next] selftests/net: packetdrill: add tcp_syncookies_ip6_9k
2026-04-29 23:33 ` Jakub Kicinski
@ 2026-04-30 2:09 ` Eric Dumazet
0 siblings, 0 replies; 9+ messages in thread
From: Eric Dumazet @ 2026-04-30 2:09 UTC (permalink / raw)
To: Jakub Kicinski
Cc: Neal Cardwell, David S . Miller, Paolo Abeni, Simon Horman,
Kuniyuki Iwashima, netdev, eric.dumazet
On Wed, Apr 29, 2026 at 4:33 PM Jakub Kicinski <kuba@kernel.org> wrote:
>
> On Wed, 29 Apr 2026 16:47:14 -0400 Neal Cardwell wrote:
> > > diff --git a/gtests/net/packetdrill/code.c b/gtests/net/packetdrill/code.c
> > > index d90bffabcfe6..6d8d20e64d8c 100644
> > > --- a/gtests/net/packetdrill/code.c
> > > +++ b/gtests/net/packetdrill/code.c
> > > @@ -129,6 +129,7 @@ static void write_symbols(struct code_state *code)
> > > emit_var(code, "TCPI_OPT_WSCALE", TCPI_OPT_WSCALE);
> > > emit_var(code, "TCPI_OPT_ECN", TCPI_OPT_ECN);
> > > emit_var(code, "TCPI_OPT_SYN_DATA", TCPI_OPT_SYN_DATA);
> > > + emit_var(code, "TCPI_OPT_SACK", TCPI_OPT_SACK);
> > > #endif /* linux */
> > > }
> >
> > Sure! Done. I added all the missing bit values in the following commit:
> >
> > https://github.com/google/packetdrill/commit/faa0dfb54065118625e169d3111ce09c65b20229
> >
> > This can be picked up with the following, or similar:
> >
> > git clone https://github.com/google/packetdrill.git
>
> Updated in netdev CI.
Excellent, thanks Neal and Jakub.
I am sending a V2 right now, because I am OOO for the rest of the week.
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2026-04-30 2:09 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-29 8:00 [PATCH net-next] selftests/net: packetdrill: add tcp_syncookies_ip6_9k Eric Dumazet
2026-04-29 14:15 ` Neal Cardwell
2026-04-29 15:39 ` Eric Dumazet
2026-04-29 16:48 ` Jakub Kicinski
2026-04-29 17:09 ` Eric Dumazet
2026-04-29 17:15 ` Eric Dumazet
2026-04-29 20:47 ` Neal Cardwell
2026-04-29 23:33 ` Jakub Kicinski
2026-04-30 2:09 ` Eric Dumazet
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox