Page MenuHomeFreeBSD

Basic Lost Retransmission Detection (LRD)
ClosedPublic

Authored by rscheff on Feb 25 2021, 10:41 PM.

Details

Summary

The loss of a retransmission during loss-recovery is currently an
event, that can only be recovered from in the base stack, by waiting
for a lengthy RTO, and then picking up from there with slow-start
again.

The theory of operation of this variant - which only works in
conjunction with SACK - is to remeber the snd_recover point
at the time, the last segment of a scoreboard hole is sent out.

Once snd_fack (the topmost right edge of a returned SACK block)
acknowledges the recovery point (snd_recover) - that is, a SACK
for a segment beyond snd_nxt at the time of entering loss-recovery,
the first window of loss recovery is over. Without additional loss,
all holes in the SACK scoreboard should have closed by that time
with successful retransmissions. Thus any remaining holes are
likely to be due to lost retransmissions.

Caveats:

  • Extremely severe reordering of original and retransmitted packets

may cause similar observable SACK patterns.

  • When the sender has no data to send beyond recovery point, which

is a not uncommon in request-response IO type exchanges, where TCP
often is application limited, the above heuristic will never trigger.
A more agressive variant of LRD could simply check when an octet
dupthresh*SMSS beyond the current hole is acknowledges (or the highest
outstanding, not-yet-acked octet, if no additional data is available
for sending), and restart the retransmission from the leftmost hole
at that point.

  • This is work in progress
  • The patch has been revived from code written against 8.0
Test Plan

Extensive Unit testing will be necessary, to validate no unexpected
or damaging behavior under severe reordering, extensive loss, ack thinning,
application limiting etc.

Diff Detail

Repository
R10 FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

  • revive basic LRD
  • add tcp_input() logging for prr
  • add cc_cong_signal to LRD trigger condition.
  • make the compiler happy
  • add tunable for LRD
  • track prr sent bytes from prior window for LRD
  • move LRD into dedicated function to reduce clutter
  • nicify comments
  • rebase to main
  • simplify processing for 2nd round of PRR/SACK reduction

transport call: fence this new functionality behind a sysctl until stability has been demonstrated

  • add man page for net.inet.tcp.do_lrd
gbe added a subscriber: gbe.

OK for the man page part.

  • add statisticts to see when lrd triggered
  • add sockopt TCP_LRD for a/B testing

The socket option (and TF_LRD) would be expected to get removed,
once A/B testing is completed.

This revision is now accepted and ready to land.Mon, May 10, 3:46 PM
sys/netinet/tcp_sack.c
778–780

You might want to put += at the end of the line before.

Except for the nit, I'm happy.