Page MenuHomeFreeBSD

Incorrect rwnd needs update decision
ClosedPublic

Authored by rrs on Jun 12 2020, 7:31 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Jan 12, 10:53 PM
Unknown Object (File)
Fri, Jan 10, 11:55 PM
Unknown Object (File)
Thu, Jan 9, 11:03 PM
Unknown Object (File)
Thu, Jan 9, 11:03 PM
Unknown Object (File)
Dec 16 2024, 1:25 AM
Unknown Object (File)
Dec 12 2024, 5:00 PM
Unknown Object (File)
Dec 11 2024, 4:30 PM
Unknown Object (File)
Nov 25 2024, 8:36 PM
Subscribers

Details

Summary

So it turns out with the right window scaling you can get the code in all stacks to
always want to do a window update, even when no data can be sent. Now in
cases where you are not pacing thats probably ok, you just send an extra
window update or two. However with bbr (and rack if its paced) every time
the pacer goes off its going to send a "window update".

Test Plan

You can use the following pkt drill script to test this with BBR and see it fixes the issue too

--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 listening TCP socket
+0.00 socket(..., SOCK_STREAM, IPPROTO_TCP) = 3
+0.00 setsockopt(3, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
+0.00 bind(3, ..., ...) = 0
+0.00 listen(3, 1) = 0
// Establish the connection
+0.00 < S 0:0(0) win 65535 <mss 1390, sackOK, nop, nop, nop, wscale 8 >
* > S. 0:0(0) ack 1 <mss 1460,nop, wscale 6,sackOK,eol,eol>
+0.00 <  . 1:1(0) ack 1 win 65535
+0.00 accept(3, ..., ...) = 4
+0.00 setsockopt(4, IPPROTO_TCP, TCP_NODELAY, [1], 4) = 0
+0.00 close(3) = 0
+0.00 <  . 1:400(399) ack 1 win 32767
// Verify that there are no errors pending at the socket layer.
+0.00 setsockopt(4, IPPROTO_TCP, TCP_FUNCTION_BLK, {function_set_name="bbr_latest", pcbcnt=0}, 36) = 0
+0.00 setsockopt(4, IPPROTO_TCP, TCP_LOG, [4], 4) = 0
+0.00 getsockopt(4, SOL_SOCKET, SO_ERROR, [0], [4]) = 0
// Now it is in the ESTABLISHED state.
+0.00 setsockopt(4, IPPROTO_TCP, TCP_LOG, [4], 4) = 0
+0.00 write(4, ..., 3154) = 3154
+0.00 >  . 1:1391(1390) ack 400 win 1037
*  >  . 1391:2781(1390) ack 400 win 1037
*  >  P. 2781:3155(374) ack 400 win 1037
+0.50 <  . 400:400(0) ack 2781  win 32767
+0.10 <  . 400:400(0) ack 3155 win 32767
// Tear it down.
+0.00 close(4) = 0

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

rrs requested review of this revision.Jun 12 2020, 7:31 PM
rrs created this revision.
tuexen added inline comments.
tcp_stacks/bbr.c
8081

I guess this change is fixing another issue?

This revision is now accepted and ready to land.Jun 12 2020, 7:40 PM

Using the upstream variant of bbr (not "bbr_latest"), I could not recreate the reported issue (that is, the packetdrill script failing) with either bbr or the base stack...

I will have to think some how to get rcv_adv - rcv_nxt larger than recwin, to make a working check for the base stack...

Also, for some reason, rS362113 is not tied into this Diff properly (and the Diff closed automatically).

rrs added inline comments.
tcp_stacks/bbr.c
8081

Yeah this was another bug I found in debugging. We get dropped out of STARTUP when we should not at times.