Page MenuHomeFreeBSD

tcp: consistently set CWND to MSS in case of SYN/SYN ACK retransmissions
ClosedPublic

Authored by tuexen on Mon, Nov 4, 6:46 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Nov 12, 9:26 AM
Unknown Object (File)
Tue, Nov 5, 2:01 PM
Unknown Object (File)
Tue, Nov 5, 1:57 PM
Unknown Object (File)
Tue, Nov 5, 10:06 AM

Details

Summary

RFC 3390 states:

If the SYN or SYN/ACK is lost, the initial window used by a sender after a correctly
transmitted SYN MUST be one segment consisting of MSS bytes.

and it seems that this is the intention of the code by setting snd_cwnd to 1.
This special value gets overwritten when cc_cong_signal() calls CC_ALGO(tp)->cong_signal().
So don't do that anymore.
It should be noted that RFC 6928 allows larger initial windows when the SYN or SYN/ACK was lost. This might be implemented later in a separate commit.

Test Plan

Ensure this packetdrill script passes:

--ip_version=ipv4

 0.000 `kldload -n cc_newreno`
+0.000 `sysctl kern.timecounter.alloweddeviation=0`
+0.000 socket(..., SOCK_STREAM, IPPROTO_TCP) = 3
+0.000 setsockopt(3, IPPROTO_TCP, TCP_LOG, [4], 4) = 0
+0.000 setsockopt(3, IPPROTO_TCP, TCP_CONGESTION, "newreno", 8) = 0
+0.000 setsockopt(3, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
+0.000 fcntl(3, F_SETFL, O_RDWR | O_NONBLOCK) = 0
+0.000 connect(3, ..., ...) = -1 EINPROGRESS (Operation now in progress)
+0.000 > S      0:0(0)                win 65535 <...>
+1.000 > S      0:0(0)                win 65535 <...>
+0.050 < S.     0:0(0)       ack    1 win 65535 <mss 1000>
+0.000 >  .     1:1(0)       ack    1 win 65535
+0.000 send(3, ..., 2000, 0) = 2000
+0.000 >  .     1:1001(1000) ack    1 win 65535
+0.050 <  .     1:1(0)       ack 1001 win 65535
+0.000 > P.  1001:2001(1000) ack    1 win 65535
+0.050 <  .     1:1(0)       ack 2001 win 65535
+0.000 close(3) = 0
+0.000 > F.  2001:2001(0)    ack    1 win 65535
+0.050 < F.     1:1(0)       ack 2002 win 65535
+0.000 >  .  2002:2002(0)    ack    2 win 65535

Diff Detail

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

Event Timeline

tuexen requested review of this revision.Mon, Nov 4, 6:46 PM
tuexen retitled this revision from tcp: consistently handle CWND in case of SYN/SYN ACK retransmissions to tcp: consistently set CWND to MSS in case of SYN/SYN ACK retransmissions.

I think you meant the title be:
tcp: consistently set CWND to MSS => tcp: consistently set CWND to 1
in case of SYN/SYN ACK retransmissions => in case of SYN retransmissions

This revision is now accepted and ready to land.Mon, Nov 4, 8:59 PM
In D47439#1081965, @cc wrote:

I think you meant the title be:
tcp: consistently set CWND to MSS => tcp: consistently set CWND to 1
in case of SYN/SYN ACK retransmissions => in case of SYN retransmissions

Setting CWND to 1 is only an internal temporal hack to end up with CWND=MSS after conn_init() is called.. That is what I was referring to.
You are right I'm fixing the SYN retransmission case, but I want consistency between the SYN retransmission case and the SYN/ACK retransmission case.