// A simple server-side test that sends exactly an initial window (IW10) // worth of packets. --tolerance_usecs=500000 // Flush Hostcache 0.0 `sysctl net.inet.tcp.cc.algorithm=newreno` 0.05 `sysctl net.inet.tcp.ecn.enable=1` 0.1 `sysctl net.inet.tcp.initcwnd_segments=10` 0.15 `sysctl net.inet.tcp.rfc3465=1` 0.2 `sysctl net.inet.tcp.hostcache.purgenow=1` 0.3 `sync` // in case of crash // Create a listening TCP socket. 0.50 socket(..., SOCK_STREAM, IPPROTO_TCP) = 3 +0.005 fcntl(3, F_SETFL, O_RDWR|O_NONBLOCK) = 0 +0.005 setsockopt(3, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0 +0.005 setsockopt(3, SOL_SOCKET, SO_DEBUG, [1], 4) = 0 +0.005 setsockopt(3, SOL_SOCKET, SO_SNDBUF, [1048576], 4) = 0 // Establish a TCP connection with ECN to explicitly track CWR +0.035 connect(3, ..., ...) = -1 // EINPROGRESS +0 > SEW 0:0(0) win 65535 // Respond with invalid TCP ECN header flags, session should be Not-ECN +0 < SEW. 0:0(0) ack 1 win 65535 +0 %{ print "window at syn:\t\t cwnd: {} ssthresh: {}".format(tcpi_snd_cwnd, tcpi_snd_ssthresh) if (tcpi_state != TCPI_ESTABLISHED): print "Error - not in ESTABLISHED state" assert tcpi_state == TCPI_ESTABLISHED }% +0 > . 1:1(0) ack 1 win 1031 +0.01 getsockopt(3, SOL_SOCKET, SO_ERROR, [0], [4]) = 0 +0.01 fcntl(3, F_SETFL, O_RDWR) = 0 // set back to blocking // First, send IW plus 1 segment, drop 2nd packet to pull ssthresh low 0.700 write(3, ..., 15000) = 15000 +0 > . 1:1001(1000) ack 1 +0 > . 1001:2001(1000) ack 1 +0 > . 2001:3001(1000) ack 1 +0 > . 3001:4001(1000) ack 1 +0 > . 4001:5001(1000) ack 1 +0 > . 5001:6001(1000) ack 1 +0 > . 6001:7001(1000) ack 1 +0 > . 7001:8001(1000) ack 1 +0 > . 8001:9001(1000) ack 1 +0 > . 9001:10001(1000) ack 1 +0 %{ print "window at syn:\t\t cwnd: {} ssthresh: {}".format(tcpi_snd_cwnd, tcpi_snd_ssthresh) }% +0.1 < E. 1:1(0) ack 1001 win 64 +0 %{ print "window at syn:\t\t cwnd: {} ssthresh: {}".format(tcpi_snd_cwnd, tcpi_snd_ssthresh) }% +0 > . 10001:11001(1000) ack 1 +0.1 < . 1:1(0) ack 2001 win 64 +0.1 < . 1:1(0) ack 3001 win 64 +0.1 < . 1:1(0) ack 4001 win 64 +0.1 < . 1:1(0) ack 5001 win 64 +0.1 < . 1:1(0) ack 6001 win 64 +0.1 < . 1:1(0) ack 7001 win 64 +0.1 < . 1:1(0) ack 8001 win 64 +0.1 < . 1:1(0) ack 9001 win 64 +0.1 < . 1:1(0) ack 10001 win 64 +0.1 < . 1:1(0) ack 11001 win 64 +0.1 < . 1:1(0) ack 12001 win 64 +0.1 < . 1:1(0) ack 13001 win 64 +0.1 < . 1:1(0) ack 14001 win 64 +0.1 < . 1:1(0) ack 15001 win 64 +0 %{ print "window at syn:\t\t cwnd: {} ssthresh: {}".format(tcpi_snd_cwnd, tcpi_snd_ssthresh) }% +0.1 close(3) = 0 +0.1 < F. 1:1(0) ack 15002 win 65535