Re: [RFC PATCH RESEND] tcp: avoid F-RTO if SACK and timestamps are disabled

From: Ilpo Järvinen
Date: Thu Jun 14 2018 - 05:53:02 EST

On Wed, 13 Jun 2018, Yuchung Cheng wrote:

> On Wed, Jun 13, 2018 at 9:55 AM, Michal Kubecek <mkubecek@xxxxxxx> wrote:
> >
> > When F-RTO algorithm (RFC 5682) is used on connection without both SACK and
> > timestamps (either because of (mis)configuration or because the other
> > endpoint does not advertise them), specific pattern loss can make RTO grow
> > exponentially until the sender is only able to send one packet per two
> > minutes (TCP_RTO_MAX).
> >
> > One way to reproduce is to
> >
> > - make sure the connection uses neither SACK nor timestamps
> > - let tp->reorder grow enough so that lost packets are retransmitted
> > after RTO (rather than when high_seq - snd_una > reorder * MSS)
> > - let the data flow stabilize
> > - drop multiple sender packets in "every second" pattern

Hmm? What is deterministically dropping every second packet for a
particular flow that has RTOs in between?

Years back I was privately contacted by somebody from a middlebox vendor
for a case with very similar exponentially growing RTO due to the FRTO
heuristic. It turned out that they didn't want to send dupacks for
out-of-order packets because they wanted to keep the TCP side of their
deep packet inspection middlebox primitive. He claimed that the middlebox
doesn't need to send dupacks because there could be such a TCP
implementation that too doesn't do them either (not that he had anything
to point to besides their middlebox ;-)), which according to him was
not required because of his intepretation of RFC793 (IIRC). ...Nevermind
anything that has occurred since that era.

...Back then, I also envisioned in that mail exchange with him that a
middlebox could break FRTO by always forcing a drop on the key packet
FRTO depends on. Ironically, that is exactly what is required to trigger
this issue? Sure, every a heuristic can be fooled if a deterministic (or
crafted) pattern is introduced to defeat that particular heuristic. ...But
I'd prefer that networks "dropping every second packet" of a flow to be
fixed rather than FRTO?

In addition, one could even argue that the sender is sending whole the
time with lower and lower rate (given the exponentially increasing RTO)
and still gets losses, so that a further rate reduction would be the
correct action. ...But take this intuitive reasoning with some grain of
salt (that is, I can see reasons myself to disagree with it :-)).

> > - either there is no new data to send or acks received in response to new
> > data are also window updates (i.e. not dupacks by definition)

Can you explain what exactly do you mean with this "no new data to send"
condition here as F-RTO is/should not be used if there's no new data to

...Or, why is the receiver going against SHOULD in RFC5681:
"A TCP receiver SHOULD send an immediate duplicate ACK when an out-
of-order segment arrives."
? ...And yes, I know there's this very issue with window updates masking
duplicate ACKs in Linux TCP receiver but I was met with some skepticism
on whether fixing it is worth it or not.

> > In this scenario, the sender keeps cycling between retransmitting first
> > lost packet (step 1 of RFC 5682), sending new data by (2b) and timing out
> > again. In this loop, the sender only gets
> >
> > (a) acks for retransmitted segments (possibly together with old ones)
> > (b) window updates
> >
> > Without timestamps, neither can be used for RTT estimator and without SACK,
> > we have no newly sacked segments to estimate RTT either. Therefore each
> > timeout doubles RTO and without usable RTT samples so that there is nothing
> > to counter the exponential growth.
> >
> > While disabling both SACK and timestamps doesn't make any sense, the
> > resulting behaviour is so pathological that it deserves an improvement.
> > (Also, both can be disabled on the other side.) Avoid F-RTO algorithm in
> > case both SACK and timestamps are disabled so that the sender falls back to
> > traditional slow start retransmission.
> >
> > Signed-off-by: Michal Kubecek <mkubecek@xxxxxxx>
> Acked-by: Yuchung Cheng <ycheng@xxxxxxxxxx>
> Thanks for the patch (and packedrill test)! I would encourage
> submitting an errata to F-RTO RFC about this case.

Unless there's a convincing explination how such a drop pattern would
occur in real world except due to serious brokeness/misconfiguration on
network side (that should not be there), I'm not that sure it's exactly
what erratas are meant for.