Page MenuHomeFreeBSD

rack may end up with a struck connection if the rwnd is collapsed on sent data.
ClosedPublic

Authored by rrs on Mar 15 2022, 9:14 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sep 20 2024, 10:57 PM
Unknown Object (File)
Sep 20 2024, 6:24 PM
Unknown Object (File)
Sep 17 2024, 7:49 PM
Unknown Object (File)
Sep 17 2024, 1:37 PM
Unknown Object (File)
Sep 17 2024, 3:58 AM
Unknown Object (File)
Sep 9 2024, 9:27 AM
Unknown Object (File)
Sep 7 2024, 2:38 PM
Unknown Object (File)
Sep 5 2024, 6:48 PM

Details

Summary

There is a case where rack will get stuck when it has outstanding data and
the peer collapses the rwnd down to 0. This leaves the session hung if
the rwnd update is not received. You can test this with the packet drill script
below. Without this fix it will be stuck and hang. With it we retransmit everything.
This also fixes the mtu retransmit case so we don't go into recovery when
the mtu is changed to a smaller value.

Test Plan

--ip_version=ipv4

0.00 kldload -n tcp_bbr tcp_rack
+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.10 < S. 0:0(0) ack 1 win 32767 <mss 1428,sackOK, nop, nop>
+0.00 > . 1:1(0) ack 1 win 65535
+0.00 send(3, ..., 1428, 0) = 1428
+0.00 > P. 1:1429(1428) ack 1 win 65535
+.10 < . 1:1(0) ack 1429 win 32000
+0.10 send(3, ..., 11424, 0) = 11424

  • > . 1429:2857(1428) ack 1 win 65535
  • > . 2857:4285(1428) ack 1 win 65535
  • > . 4285:5713(1428) ack 1 win 65535
  • > . 5713:7141(1428) ack 1 win 65535
  • > . 7141:8569(1428) ack 1 win 65535
  • > . 8569:9997(1428) ack 1 win 65535
  • > . 9997:11425(1428) ack 1 win 65535
  • > P. 11425:12853(1428) ack 1 win 65535

+0.0 < . 1:1(0) ack 4285 win 0

  • > . 4284:4284(0) ack 1 win 65535 // Window probe

+0.0 < . 1:1(0) ack 4285 win 65535

  • > . 4285:5713(1428) ack 1 win 65535
  • > . 5713:7141(1428) ack 1 win 65535

+0.0 < . 1:1(0) ack 7141 win 65535

  • > . 7141:8569(1428) ack 1 win 65535
  • > . 8569:9997(1428) ack 1 win 65535

+0.0 < . 1:1(0) ack 9997 win 65535

  • > . 9997:11425(1428) ack 1 win 65535
  • > P. 11425:12853(1428) ack 1 win 65535

+0.0 < . 1:1(0) ack 12853 win 65535
// Tear it down.
+0.00 close(3) = 0
+0.00 > F. 12853:12853 (0) ack 1 win 65535
+0.10 < F. 1:1(0) ack 12854 win 32767
+0.00 > . 12854:12854 (0) ack 2 win 65535

Diff Detail

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

Event Timeline

rrs requested review of this revision.Mar 15 2022, 9:14 PM
sys/netinet/tcp_stacks/rack.c
9749

marke?

16965

Is this (debug) output still intended?

sys/netinet/tcp_stacks/rack.c
16965

opps no that was when I was debugging let me make sure its not in there..

Thanks for finding the debugging printf I missed in my cleanup. Lets also
take out the "no cc" printf too while we are at it. Only INVARIANT type
printfs as well as kld load failures should be in rack.

rrs marked an inline comment as done.Mar 16 2022, 7:59 AM
sys/netinet/tcp_stacks/rack.c
9749

Yeah this comment needs a bit more details I think...

update the comment Michael pointed out.

rrs marked an inline comment as done.Mar 22 2022, 12:22 PM
This revision is now accepted and ready to land.Apr 1 2022, 11:23 AM