Page MenuHomeFreeBSD

TCP: Rack ends up sending all that is outstanding every timeout.
ClosedPublic

Authored by rrs on Sep 8 2022, 12:30 PM.
Tags
None
Referenced Files
F102841148: D36494.diff
Sun, Nov 17, 8:58 PM
Unknown Object (File)
Fri, Nov 8, 12:19 AM
Unknown Object (File)
Thu, Nov 7, 8:23 AM
Unknown Object (File)
Thu, Nov 7, 2:00 AM
Unknown Object (File)
Wed, Nov 6, 11:34 PM
Unknown Object (File)
Wed, Nov 6, 7:00 PM
Unknown Object (File)
Oct 18 2024, 8:51 AM
Unknown Object (File)
Oct 17 2024, 12:45 PM

Details

Summary

In doing some testing for a different problem, I have found rack retransmitting
all outstanding data every time a timeout occurs. The outstanding is sent 1ms
apart between each packet, and then the timeout runs off again. This causes
extra retransmissions when we should be waiting for an ack after sending the
very first segment.

Test Plan

The following pkt drill script fails with the wrong behavior but with this patch
works as expected:

--ip_version=ipv4

+0.00 `sysctl -w net.inet.tcp.hostcache.purgenow=1`
+0.00 `sysctl -w net.inet.tcp.syncookies_only=0`
+0.00 `sysctl -w net.inet.tcp.syncookies=1`
+0.00 `sysctl -w net.inet.tcp.rfc1323=1`
+0.00 `sysctl -w net.inet.tcp.sack.enable=1`
+0.00 `sysctl -w net.inet.tcp.ecn.enable=2`
// Create a TCP endpoint in the ESTABLISHED state.
+0.00 socket(..., SOCK_STREAM, IPPROTO_TCP) = 3
+0.00 fcntl(3, F_GETFL) = 0x02 (flags O_RDWR)
+0.00 fcntl(3, F_SETFL, O_RDWR | O_NONBLOCK) = 0
+0.00 setsockopt(3, IPPROTO_TCP, TCP_LOG, [4], 4) = 0
+0.00 connect(3, ..., ...) = -1 EINPROGRESS (Operation now in progress)
+0.00 > S  0:0(0) win 65535 <mss 1460,nop,wscale 8,sackOK,TS val 100 ecr 0>
+0.020 < S. 0:0(0) ack 1 win 32767 <mss 1448>
* >  . 1:1(0) ack 1 win 65535 
// Verify that there are no errors pending at the socket layer.
+0.10 getsockopt(3, SOL_SOCKET, SO_ERROR, [0], [4]) = 0
+0.00 setsockopt(3, IPPROTO_TCP, TCP_FUNCTION_BLK, {function_set_name="rack", pcbcnt=0}, 36) = 0
+0.00 send(3, ..., 1448, 0) = 1448
* > P. 1:1449(1448) ack 1 win 65535
+0.0  send(3, ..., 4344, 0) = 4344
* > . 1449:2897(1448) ack 1 win 65535
* > . 2897:4345(1448) ack 1 win 65535 
* > P. 4345:5793(1448) ack 1 win 65535
+.001 <  . 1:1(0) ack 1449 win 32000 
* > . 1449:2897(1448) ack 1 win 65535
* > . 1449:2897(1448) ack 1 win 65535
* > . 1449:2897(1448) ack 1 win 65535
* > . 1449:2897(1448) ack 1 win 65535 
* > . 1449:2897(1448) ack 1 win 65535
* > . 1449:2897(1448) ack 1 win 65535
* > . 1449:2897(1448) ack 1 win 65535
* > . 1449:2897(1448) ack 1 win 65535
* > . 1449:2897(1448) ack 1 win 65535
* > . 1449:2897(1448) ack 1 win 65535
* > . 1449:2897(1448) ack 1 win 65535
* > . 1449:2897(1448) ack 1 win 65535
* > R. 5793:5793(0) ack 1 win 0
+0.00 close(3) = 0

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped