Skip to content

Commit f5fda1a

Browse files
edumazetkuba-moo
authored andcommitted
selftests/net: packetdrill: add tcp_rcv_big_endseq.pkt
This test checks TCP behavior when receiving a packet beyond the window. It checks the new TcpExtBeyondWindow SNMP counter. Signed-off-by: Eric Dumazet <[email protected]> Reviewed-by: Kuniyuki Iwashima <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 6c75806 commit f5fda1a

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
// SPDX-License-Identifier: GPL-2.0
2+
3+
--mss=1000
4+
5+
`./defaults.sh`
6+
7+
0 `nstat -n`
8+
9+
// Establish a connection.
10+
+0 socket(..., SOCK_STREAM, IPPROTO_TCP) = 3
11+
+0 setsockopt(3, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
12+
+0 setsockopt(3, SOL_SOCKET, SO_RCVBUF, [10000], 4) = 0
13+
+0 bind(3, ..., ...) = 0
14+
+0 listen(3, 1) = 0
15+
16+
+0 < S 0:0(0) win 32792 <mss 1000,nop,wscale 7>
17+
+0 > S. 0:0(0) ack 1 <mss 1460,nop,wscale 0>
18+
+.1 < . 1:1(0) ack 1 win 257
19+
20+
+0 accept(3, ..., ...) = 4
21+
22+
+0 < P. 1:4001(4000) ack 1 win 257
23+
+0 > . 1:1(0) ack 4001 win 5000
24+
25+
// packet in sequence : SKB_DROP_REASON_TCP_INVALID_END_SEQUENCE / LINUX_MIB_BEYOND_WINDOW
26+
+0 < P. 4001:54001(50000) ack 1 win 257
27+
+0 > . 1:1(0) ack 4001 win 5000
28+
29+
// ooo packet. : SKB_DROP_REASON_TCP_INVALID_END_SEQUENCE / LINUX_MIB_BEYOND_WINDOW
30+
+1 < P. 5001:55001(50000) ack 1 win 257
31+
+0 > . 1:1(0) ack 4001 win 5000
32+
33+
// SKB_DROP_REASON_TCP_INVALID_SEQUENCE / LINUX_MIB_BEYOND_WINDOW
34+
+0 < P. 70001:80001(10000) ack 1 win 257
35+
+0 > . 1:1(0) ack 4001 win 5000
36+
37+
+0 read(4, ..., 100000) = 4000
38+
39+
// If queue is empty, accept a packet even if its end_seq is above wup + rcv_wnd
40+
+0 < P. 4001:54001(50000) ack 1 win 257
41+
+.040 > . 1:1(0) ack 54001 win 0
42+
43+
// Check LINUX_MIB_BEYOND_WINDOW has been incremented 3 times.
44+
+0 `nstat | grep TcpExtBeyondWindow | grep -q " 3 "`

0 commit comments

Comments
 (0)