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
Unknown Object (File)
Dec 20 2023, 7:36 AM
Unknown Object (File)
Dec 10 2023, 12:42 PM
Unknown Object (File)
Nov 17 2023, 8:14 AM
Unknown Object (File)
Nov 15 2023, 8:11 AM
Unknown Object (File)
Nov 8 2023, 2:24 AM
Unknown Object (File)
Nov 2 2023, 5:45 AM
Unknown Object (File)
Oct 10 2023, 5:53 PM
Unknown Object (File)
Oct 7 2023, 1:21 AM

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

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable