aboutsummaryrefslogtreecommitdiffstats
path: root/test/packetdrill/tests/linux/mss/mss-setsockopt-tcp_maxseg-client.pkt
blob: 906ad6e6fe0361503c05fc7c70a2f92f3d4cf441 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// Test TCP_MAXSEG works on active/client TCP connections.

// Create a socket.
0.000 socket(..., SOCK_STREAM, IPPROTO_TCP) = 3

// Set MSS to 1100.
0.010 setsockopt(3, SOL_TCP, TCP_MAXSEG, [1100], 4) = 0
// TODO(ncardwell): the following is silly; should we fix it?
0.020 getsockopt(3, SOL_TCP, TCP_MAXSEG, [536], [4]) = 0

0.100...0.200 connect(3, ..., ...) = 0

// Establish a connection with an outgoing advertised MSS of 1100.
0.100 > S 0:0(0) <mss 1100,sackOK,TS val 100 ecr 0,nop,wscale 6>
0.200 < S. 0:0(0) ack 1 win 32792 <mss 1460,nop,wscale 7>
0.200 > . 1:1(0) ack 1

0.300 getsockopt(3, SOL_TCP, TCP_MAXSEG, [1100], [4]) = 0

0.400 %{ assert tcpi_advmss == 1100; assert tcpi_snd_mss == 1100 }%

// IW10 MSS should yield outgoing TSO packet with 10*1100 == 11000 bytes:
0.500 write(3, ..., 12000) = 12000
0.500 > . 1:11001(11000) ack 1