Page MenuHomeFreeBSD

Support RTT measurement even if switching from the rack stack to the base stack

Authored by tuexen on Nov 18 2018, 11:36 AM.



If a client is using the rack stack to initiate a TCP connection to a server not supporting the TCP SACK extension, the client side switches on reception of the SYN-ACK the stack to the base stack. The base stack should be able to use the SYN/SYN-ACK for an initial RTT measurement, as if the base stack was used right from the beginning.

This patch allows the base stack to perform this measurement after switchback.

Test Plan

Get the tests from rcv-syn-closing passing after setting sysctl net.inet.tcp.functions_default=rack.
They use FIN retransmissions and they occur at the wrong time if not RTT measurement is performed.

Diff Detail

rS FreeBSD src repository
Lint Skipped
Unit Tests Skipped
Build Status
Buildable 20875

Event Timeline

tuexen created this revision.Nov 18 2018, 11:36 AM
rrs added inline comments.Nov 20 2018, 12:59 PM

Why are you adding this code here? Rack times its RTT's based
on the send_map i.e. each segment sent. Is there some reason you
would want to use t_rtttime too?

tuexen marked an inline comment as done.Nov 20 2018, 9:14 PM
tuexen added inline comments.

The reason (as indicated in the last sentence of the comment) is that in case you switch back to the base stack, the base stack will use these variables.

Assume a client initiating a TCP connection to a server not supporting the SACK extension.
If the client uses the base stack, the SYN/SYN-ACK exchange is used for an initial RTT measurement and a later retransmission will be based on that RTT measurement.
If the client uses the RACK stack without this change, the bases stack, which processes the SYN-ACK will not do an RTT measurement since these variables are not set and a later retransmission will be based on RTO.Initial.
Using this patch avoids this difference.

rrs accepted this revision.Nov 20 2018, 9:36 PM
rrs added inline comments.

Ahh thanks for the explanation.. I knew it had to be something I had not realized :)

This revision is now accepted and ready to land.Nov 20 2018, 9:36 PM
This revision was automatically updated to reflect the committed changes.