netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Pengcheng Yang" <yangpc@wangsu.com>
To: "'Yuchung Cheng'" <ycheng@google.com>,
	"'Neal Cardwell'" <ncardwell@google.com>
Cc: "'Netdev'" <netdev@vger.kernel.org>,
	"'Eric Dumazet'" <edumazet@google.com>
Subject: Re: tcp: rearm RTO timer does not comply with RFC6298
Date: Thu, 21 Jan 2021 21:48:06 +0800	[thread overview]
Message-ID: <022d01d6effc$0ccd0c50$266724f0$@wangsu.com> (raw)
In-Reply-To: <CAK6E8=e1sdqntpLzeaGKhFB_DhhcNrJmPBQ3u9M44fSqdNTg_Q@mail.gmail.com>

On Thu, Jan 21, 2021 at 2:59 AM Yuchung Cheng <ycheng@google.com> wrote:
> 
> On Wed, Jan 20, 2021 at 6:59 AM Neal Cardwell <ncardwell@google.com> wrote:
> >
> > On Wed, Jan 20, 2021 at 5:50 AM Pengcheng Yang <yangpc@wangsu.com> wrote:
> > >
> > > hi,
> > >
> > > I have a doubt about tcp_rearm_rto().
> > >
> > > Early TCP always rearm the RTO timer to NOW+RTO when it receives
> > > an ACK that acknowledges new data.
> > >
> > > Referring to RFC6298 SECTION 5.3: "When an ACK is received that
> > > acknowledges new data, restart the retransmission timer so that
> > > it will expire after RTO seconds (for the current value of RTO)."
> > >
> > > After ER and TLP, we rearm the RTO timer to *tstamp_of_head+RTO*
> > > when switching from ER/TLP/RACK to original RTO in tcp_rearm_rto(),
> > > in this case the RTO timer is triggered earlier than described in
> > > RFC6298, otherwise the same.
> > >
> > > Is this planned? Or can we always rearm the RTO timer to
> > > tstamp_of_head+RTO?
> > >
> > > Thanks.
> > >
> >
> > This is a good question. As far as I can tell, this difference in
> > behavior would only come into play in a few corner cases, like:
> >
> > (1) The TLP timer fires and the connection is unable to transmit a TLP
> > probe packet. This could happen due to memory allocation failure  or
> > the local qdisc being full.
> >
> > (2) The RACK reorder timer fires but the connection does not take the
> > normal course of action and mark some packets lost and retransmit at
> > least one of them. I'm not sure how this would happen. Maybe someone
> > can think of a case.

Yes, and it also happens when an ACK (a cumulative ACK covered out-of-order data)
is received that makes ca_state change from DISORDER to OPEN, by calling tcp_set_xmit_timer().
Because TLP is not triggered under DISORDER and tcp_rearm_rto() is called before the
ca_state changes.

> >
> > My sense would be that given how relatively rare (1)/(2) are, it is
> > probably not worth changing the current behavior, given that it seems
> > it would require extra state (an extra u32 snd_una_advanced_tstamp? )
> > to save the time at which snd_una advanced (a cumulative ACK covered
> > some data) in order to rearm the RTO timer for snd_una_advanced_tstamp
> > + rto.
> 
> also there's an experimental proposal
> https://tools.ietf.org/html/rfc7765
> 
> so Linux actually implements that in a limited way that only applies
> in specific scenarios.
> 
> >
> > neal

Thank you for answering my questions.


  reply	other threads:[~2021-01-21 13:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-20 10:49 tcp: rearm RTO timer does not comply with RFC6298 Pengcheng Yang
2021-01-20 14:59 ` Neal Cardwell
2021-01-20 18:58   ` Yuchung Cheng
2021-01-21 13:48     ` Pengcheng Yang [this message]
2021-01-21 15:50       ` Neal Cardwell
2021-01-22 10:01         ` Pengcheng Yang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='022d01d6effc$0ccd0c50$266724f0$@wangsu.com' \
    --to=yangpc@wangsu.com \
    --cc=edumazet@google.com \
    --cc=ncardwell@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=ycheng@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).