xref: /linux/tools/testing/selftests/net/packetdrill/tcp_ecn_ecn-uses-ect0.pkt (revision 0ad9617c78acbc71373fb341a6f75d4012b01d69)
1*88395c07SSoham Chakradeo// SPDX-License-Identifier: GPL-2.0
2*88395c07SSoham Chakradeo// Test ECN: verify that Linux TCP ECN sending code uses ECT0 (not ECT1).
3*88395c07SSoham Chakradeo//
4*88395c07SSoham Chakradeo`./defaults.sh
5*88395c07SSoham Chakradeosysctl -q net.ipv4.tcp_ecn=1  # fully enabled
6*88395c07SSoham Chakradeo`
7*88395c07SSoham Chakradeo
8*88395c07SSoham Chakradeo// Initialize connection
9*88395c07SSoham Chakradeo    0 socket(..., SOCK_STREAM, IPPROTO_TCP) = 4
10*88395c07SSoham Chakradeo
11*88395c07SSoham Chakradeo// ECN handshake: send EW flags in SYN packet, E flag in SYN-ACK response
12*88395c07SSoham Chakradeo+.002 ... 0.004 connect(4, ..., ...) = 0
13*88395c07SSoham Chakradeo
14*88395c07SSoham Chakradeo   +0 > SEW 0:0(0) <mss 1460,sackOK,TS val 100 ecr 0,nop,wscale 8>
15*88395c07SSoham Chakradeo+.002 < SE. 0:0(0) ack 1 win 32767 <mss 1000,nop,wscale 6,nop,nop,sackOK>
16*88395c07SSoham Chakradeo   +0 > . 1:1(0) ack 1
17*88395c07SSoham Chakradeo
18*88395c07SSoham Chakradeo// Write 1 MSS.
19*88395c07SSoham Chakradeo+.002 write(4, ..., 1000) = 1000
20*88395c07SSoham Chakradeo// Send 1 MSS with ect0.
21*88395c07SSoham Chakradeo   +0 > [ect0] P. 1:1001(1000) ack 1
22