1// SPDX-License-Identifier: GPL-2.0 2// Test RFC 3042 "Limited Transmit": "sending a new data segment in 3// response to each of the first two duplicate acknowledgments that 4// arrive at the sender". 5// This variation tests a receiver that doesn't support SACK. 6 7`./defaults.sh` 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 bind(3, ..., ...) = 0 13 +0 listen(3, 1) = 0 14 15 +.1 < S 0:0(0) win 32792 <mss 1000,nop,wscale 7> 16 +0 > S. 0:0(0) ack 1 <mss 1460,nop,wscale 8> 17 +.1 < . 1:1(0) ack 1 win 320 18 +0 accept(3, ..., ...) = 4 19 20// Write some data, and send the initial congestion window. 21 +0 write(4, ..., 15000) = 15000 22 +0 > P. 1:10001(10000) ack 1 23 24// Limited transmit: on first dupack, send a new data segment. 25 +.11 < . 1:1(0) ack 1 win 320 26 +0 > . 10001:11001(1000) ack 1 27 28// Limited transmit: on second dupack, send a new data segment. 29 +.01 < . 1:1(0) ack 1 win 320 30 +0 > . 11001:12001(1000) ack 1 31 32// It turned out to be reordering, not loss. 33// We have one packet newly acked (1001:3001 were DUP-ACK'd) 34// So we revert state back to Open. Slow start cwnd from 10 to 11 35// and send 11 - 9 = 2 packets 36 +.01 < . 1:1(0) ack 3001 win 320 37 +0 > P. 12001:14001(2000) ack 1 38 39 +.02 < . 1:1(0) ack 5001 win 320 40 +0 > P. 14001:15001(1000) ack 1 41 42// Client gradually ACKs all data. 43 +.02 < . 1:1(0) ack 7001 win 320 44 +.02 < . 1:1(0) ack 9001 win 320 45 +.02 < . 1:1(0) ack 11001 win 320 46 +.02 < . 1:1(0) ack 13001 win 320 47 +.02 < . 1:1(0) ack 15001 win 320 48 49// Clean up. 50 +.17 close(4) = 0 51 +0 > F. 15001:15001(0) ack 1 52 +.1 < F. 1:1(0) ack 15002 win 257 53 +0 > . 15002:15002(0) ack 2 54