Page MenuHomeFreeBSD

Consolidate Initial Window calculations
ClosedPublic

Authored by rscheff on Jan 24 2019, 10:14 AM.

Details

Summary

The initial window is used when starting the transmission over a session,
both initially, and also when the session was idle.

The actual value used was adjusted over time with various RFCs (RFC5681,
RFC3390 (IW4) and RFC6928 (IW10).

However, the actual calculation was split for the first (initial) round,
where all these adjustments were added, and the re-calculation when
a session had become idle. The restart window calculation also omitted
considering the TCP options used, during re-calculations.

This change consolidates both calculations in a single function, and
also addresses the common case, where TCP options like timestamps
would leave some of the congestion window left unused, potentially
leading to smaller than MSS sized segments.

Diff Detail

Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 22141
Build 21361: arc lint + arc unit

Event Timeline

tuexen added a reviewer: tuexen.
This revision is now accepted and ready to land.Jan 24 2019, 10:58 AM

Here is a sample siftr log, prior to the patch. A simple utility is transmitting 1MB once per second, with the pause in between transfers well above the idle time.

Will check if I can get a packetdrill script to validate IW10 in after-idle together.

Start of session (IW10):

o,0x00000000,1548360273.371317,192.168.233.112,52715,192.168.233.251,5001,1073725440,1073725440,0,0,0,0,0,2,536,0,1,672,300,32768,0,65536,0,0,0,0,0
i,0x00000000,1548360273.373004,192.168.233.112,52715,192.168.233.251,5001,1073725440,1073725440,0,0,0,0,0,2,536,0,1,672,300,32768,0,65536,0,1,0,0,0
o,0x00000000,1548360273.373049,192.168.233.112,52715,192.168.233.251,5001,1073725440,14480,0,28960,65700,7,6,4,1460,27,1,993,23,33580,0,65700,0,0,0,0,0
o,0x00000000,1548360273.383441,192.168.233.112,52715,192.168.233.251,5001,1073725440,14480,0,28960,65700,7,6,4,1460,27,1,992,23,33580,33580,65700,0,0,0,0,0
o,0x00000000,1548360273.383629,192.168.233.112,52715,192.168.233.251,5001,1073725440,14480,0,28960,65700,7,6,4,1460,27,1,992,23,33580,33580,65700,0,1448,0,0,0
o,0x00000000,1548360273.383761,192.168.233.112,52715,192.168.233.251,5001,1073725440,14480,0,28960,65700,7,6,4,1460,27,1,992,23,33580,33580,65700,0,2896,0,0,0
o,0x00000000,1548360273.383884,192.168.233.112,52715,192.168.233.251,5001,1073725440,14480,0,28960,65700,7,6,4,1460,27,1,992,23,33580,33580,65700,0,4344,0,0,0
o,0x00000000,1548360273.384014,192.168.233.112,52715,192.168.233.251,5001,1073725440,14480,0,28960,65700,7,6,4,1460,27,1,992,23,33580,33580,65700,0,5792,0,0,0
o,0x00000000,1548360273.384144,192.168.233.112,52715,192.168.233.251,5001,1073725440,14480,0,28960,65700,7,6,4,1460,27,1,992,23,33580,33580,65700,0,7240,0,0,0
o,0x00000000,1548360273.384264,192.168.233.112,52715,192.168.233.251,5001,1073725440,14480,0,28960,65700,7,6,4,1460,27,1,992,23,33580,33580,65700,0,8688,0,0,0
o,0x00000000,1548360273.384386,192.168.233.112,52715,192.168.233.251,5001,1073725440,14480,0,28960,65700,7,6,4,1460,27,1,992,23,33580,33580,65700,0,10136,0,0,0
o,0x00000000,1548360273.384507,192.168.233.112,52715,192.168.233.251,5001,1073725440,14480,0,28960,65700,7,6,4,1460,27,1,992,23,33580,33580,65700,0,11584,0,0,0
i,0x00000000,1548360273.386376,192.168.233.112,52715,192.168.233.251,5001,1073725440,14480,0,28960,65700,7,6,4,1460,27,1,992,23,33580,33580,65700,0,13032,0,0,0
o,0x00000000,1548360273.386412,192.168.233.112,52715,192.168.233.251,5001,1073725440,15928,0,31872,65700,7,6,4,1460,24,1,992,23,33580,32132,65700,0,11584,0,0,0
o,0x00000000,1548360273.386583,192.168.233.112,52715,192.168.233.251,5001,1073725440,15928,0,31872,65700,7,6,4,1460,24,1,992,23,33580,32132,65700,0,13032,0,0,0
i,0x00000000,1548360273.389017,192.168.233.112,52715,192.168.233.251,5001,1073725440,15928,0,31872,65700,7,6,4,1460,24,1,992,23,33580,32132,65700,0,14480,0,0,0
...
After-Idle (IW4):
i,0x00000000,1548360275.663005,192.168.233.112,52715,192.168.233.251,5001,1073725440,1046940,0,1644928,65700,7,6,4,1460,23,1,992,23,803628,6016,65700,0,5792,0,0,0
i,0x00000000,1548360275.663022,192.168.233.112,52715,192.168.233.251,5001,1073725440,1049836,0,1644928,65700,7,6,4,1460,25,1,992,23,803628,3120,65700,0,2896,0,0,0
o,0x00000000,1548360275.663031,192.168.233.112,52715,192.168.233.251,5001,1073725440,1052732,0,1644928,65700,7,6,4,1460,26,1,992,23,803628,224,65700,0,0,0,0,0
i,0x00000000,1548360275.664720,192.168.233.112,52715,192.168.233.251,5001,1073725440,1052732,0,1644928,65700,7,6,4,1460,26,1,992,23,803628,224,65700,0,224,0,0,0
o,0x00000000,1548360276.680693,192.168.233.112,52715,192.168.233.251,5001,1073725440,4380,0,1644928,65700,7,6,4,1460,23,1,992,23,803628,803628,65700,0,0,0,0,0
o,0x00000000,1548360276.681195,192.168.233.112,52715,192.168.233.251,5001,1073725440,4380,0,1644928,65700,7,6,4,1460,23,1,992,23,803628,803628,65700,0,1448,0,0,0
o,0x00000000,1548360276.681829,192.168.233.112,52715,192.168.233.251,5001,1073725440,4380,0,1644928,65700,7,6,4,1460,23,1,992,23,803628,803628,65700,0,2896,0,0,0
i,0x00000000,1548360276.682786,192.168.233.112,52715,192.168.233.251,5001,1073725440,4380,0,1644928,65700,7,6,4,1460,23,1,992,23,803628,803628,65700,0,4344,0,0,0
o,0x00000000,1548360276.682845,192.168.233.112,52715,192.168.233.251,5001,1073725440,5828,0,1644928,65700,7,6,4,1460,21,1,992,23,803628,802180,65700,0,2896,0,0,0
o,0x00000000,1548360276.683309,192.168.233.112,52715,192.168.233.251,5001,1073725440,5828,0,1644928,65700,7,6,4,1460,21,1,992,23,803628,802180,65700,0,4344,0,0,0
i,0x00000000,1548360276.683905,192.168.233.112,52715,192.168.233.251,5001,1073725440,5828,0,1644928,65700,7,6,4,1460,21,1,992,23,803628,802180,65700,0,5792,0,0,0
o,0x00000000,1548360276.684005,192.168.233.112,52715,192.168.233.251,5001,1073725440,7276,0,1644928,65700,7,6,4,1460,19,1,992,23,803628,800732,65700,0,4344,0,0,0
o,0x00000000,1548360276.684449,192.168.233.112,52715,192.168.233.251,5001,1073725440,7276,0,1644928,65700,7,6,4,1460,19,1,992,23,803628,800732,65700,0,5792,0,0,0

tuexen requested changes to this revision.Jan 25 2019, 10:35 AM

Can you please make use of tcp_compute_initwnd() also in sys/netinet/tcp_stacks/rack.c to minimise code duplication?

This revision now requires changes to proceed.Jan 25 2019, 10:35 AM

Include RACK in consolidation effort, tcp_compute_initcwnd and tcp_maxseg in rack_after_idle

This revision is now accepted and ready to land.Jan 25 2019, 1:44 PM
This revision was automatically updated to reflect the committed changes.

packet drill test script for validating that RW == IW after idle

I was just starting to validate something around RTO, and found, that the effective IW is now actually 11 SMSS, not 10 MSS, when NOT doing ABC (net.inet.tcp.rfc3465=0).

I suspect, the final ACK of the 3WHS is already processed in the normal ACK path, increasing cwnd at that point by one MSS.

Here is the corresponding Packetdrill script (named for what I wanted to validate, before hitting this).