aboutsummaryrefslogtreecommitdiffstats
path: root/test/packetdrill/tests/linux/receiver_rtt/rcv-rtt-with-timestamps-new.pkt
diff options
context:
space:
mode:
Diffstat (limited to 'test/packetdrill/tests/linux/receiver_rtt/rcv-rtt-with-timestamps-new.pkt')
-rw-r--r--test/packetdrill/tests/linux/receiver_rtt/rcv-rtt-with-timestamps-new.pkt57
1 files changed, 57 insertions, 0 deletions
diff --git a/test/packetdrill/tests/linux/receiver_rtt/rcv-rtt-with-timestamps-new.pkt b/test/packetdrill/tests/linux/receiver_rtt/rcv-rtt-with-timestamps-new.pkt
new file mode 100644
index 0000000..2155f21
--- /dev/null
+++ b/test/packetdrill/tests/linux/receiver_rtt/rcv-rtt-with-timestamps-new.pkt
@@ -0,0 +1,57 @@
+// Test that receiver-side RTT estimation is sane when
+// using TCP timestamps. We assert that the receive-side
+// RTT estimate is between 95 and 105ms.
+
+// Use a small receive buffer so that we advertise small windows, to keep the
+// test short.
+`sysctl -q net.ipv4.tcp_rmem="4096 10000 2097152"`
+
+// Create a socket.
+0.000 socket(..., SOCK_STREAM, IPPROTO_TCP) = 3
+0.000 setsockopt(3, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
+
+// Verify that the receive buffer is the tcp_rmem default.
+0.000 getsockopt(3, SOL_SOCKET, SO_RCVBUF, [10000], [4]) = 0
+
+0.000 bind(3, ..., ...) = 0
+0.000 listen(3, 1) = 0
+
+// Establish a connection.
+0.100 < S 0:0(0) win 20000 <mss 1000,sackOK,TS val 100 ecr 0>
+0.100 > S. 0:0(0) ack 1 <mss 1460,sackOK,TS val 100 ecr 100>
+0.200 < . 1:1(0) ack 1 win 20000 <nop,nop,TS val 200 ecr 100>
+0.200 accept(3, ..., ...) = 4
+0.200 %{ assert tcpi_rcv_rtt == 0 }%
+
+// First flight.
+0.200 < . 1:1001(1000) ack 1 win 20000 <nop,nop,TS val 200 ecr 100>
+0.200 > . 1:1(0) ack 1001 <nop,nop,TS val 200 ecr 200>
+0.200 < . 1001:2001(1000) ack 1 win 20000 <nop,nop,TS val 200 ecr 100>
+0.200 > . 1:1(0) ack 2001 <nop,nop,TS val 200 ecr 200>
+0.200 read(4, ..., 2000) = 2000
+0.200 %{ assert tcpi_rcv_rtt >= 95*1000 and tcpi_rcv_rtt <= 105*1000 }%
+
+// Second flight.
+0.300 < . 2001:3001(1000) ack 1 win 20000 <nop,nop,TS val 300 ecr 200>
+0.300 > . 1:1(0) ack 3001 <nop,nop,TS val 300 ecr 300>
+0.300 < . 3001:4001(1000) ack 1 win 20000 <nop,nop,TS val 300 ecr 200>
+0.300 > . 1:1(0) ack 4001 <nop,nop,TS val 300 ecr 300>
+0.300 < . 4001:5001(1000) ack 1 win 20000 <nop,nop,TS val 300 ecr 200>
+0.300 > . 1:1(0) ack 5001 <nop,nop,TS val 300 ecr 300>
+0.300 < . 5001:6001(1000) ack 1 win 20000 <nop,nop,TS val 300 ecr 200>
+0.300 read(4, ..., 4000) = 4000
+0.300 > . 1:1(0) ack 6001 <nop,nop,TS val 300 ecr 300>
+0.300 %{ assert tcpi_rcv_rtt >= 95*1000 and tcpi_rcv_rtt <= 105*1000 }%
+
+// Third flight.
+// We omit outgoing ACKs because we don't care about this behavior,
+// and don't want to introduce dependencies on the receive window behavior.
+0.400 < . 6001:7001(1000) ack 1 win 20000 <nop,nop,TS val 400 ecr 300>
+0.400 < . 7001:8001(1000) ack 1 win 20000 <nop,nop,TS val 400 ecr 300>
+0.400 < . 8001:9001(1000) ack 1 win 20000 <nop,nop,TS val 400 ecr 300>
+0.400 < . 9001:10001(1000) ack 1 win 20000 <nop,nop,TS val 400 ecr 300>
+0.400 < . 10001:11001(1000) ack 1 win 20000 <nop,nop,TS val 400 ecr 300>
+0.400 read(4, ..., 5000) = 5000
+0.400 %{ assert tcpi_rcv_rtt >= 95*1000 and tcpi_rcv_rtt <= 105*1000 }%
+
+0.500 `sysctl -q net.ipv4.tcp_rmem="4096 87380 3732736"`