File Index
Files and directories
Sign in
FILE

tcp_nagle_sockopt_cork_nodelay.pkt

File preview with syntax highlighting.

linux-6.19.14/tools/testing/selftests/net/packetdrill/tcp_nagle_sockopt_cork_nodelay.pkt PLAIN TEXT
 1// SPDX-License-Identifier: GPL-2.0
 2// Test TCP_CORK and TCP_NODELAY sockopt behavior
 3`./defaults.sh`
 4
 5    0 socket(..., SOCK_STREAM, IPPROTO_TCP) = 3
 6   +0 setsockopt(3, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
 7   +0 bind(3, ..., ...) = 0
 8   +0 listen(3, 1) = 0
 9
10   +0 < S 0:0(0) win 32792 <mss 1000,nop,wscale 7>
11   +0 > S. 0:0(0) ack 1 <mss 1460,nop,wscale 8>
12 +.01 < . 1:1(0) ack 1 win 257
13   +0 accept(3, ..., ...) = 4
14// Set TCP_CORK sockopt to hold small packets
15   +0 setsockopt(4, SOL_TCP, TCP_CORK, [1], 4) = 0
16
17   +0 write(4, ..., 40) = 40
18 +.05 write(4, ..., 40) = 40
19
20// Unset TCP_CORK should push pending bytes out
21 +.01 setsockopt(4, SOL_TCP, TCP_CORK, [0], 4) = 0
22   +0 > P. 1:81(80) ack 1
23 +.01 < . 1:1(0) ack 81 win 257
24
25// Set TCP_CORK sockopt to hold small packets
26   +0 setsockopt(4, SOL_TCP, TCP_CORK, [1], 4) = 0
27
28   +0 write(4, ..., 40) = 40
29 +.05 write(4, ..., 40) = 40
30
31// Set TCP_NODELAY sockopt should push pending bytes out
32   +0 setsockopt(4, SOL_TCP, TCP_NODELAY, [1], 4) = 0
33   +0 > P. 81:161(80) ack 1
34 +.01 < . 1:1(0) ack 161 win 257
35
36// Set MSG_MORE to hold small packets
37   +0 send(4, ..., 40, MSG_MORE) = 40
38 +.05 send(4, ..., 40, MSG_MORE) = 40
39
40// Set TCP_NODELAY sockopt should push pending bytes out
41 +.01 setsockopt(4, SOL_TCP, TCP_NODELAY, [1], 4) = 0
42   +0 > . 161:241(80) ack 1
43 +.01 < . 1:1(0) ack 241 win 257
~/ Read-only file preview.