All of lore.kernel.org
 help / color / mirror / Atom feed
From: Prasanna Meda <pmeda@akamai.com>
To: netdev@oss.sgi.com
Cc: davem@redhat.com, linux-kernel@vger.kernel.org
Subject: srtt and rtt_seq out of sync
Date: Wed, 18 Aug 2004 19:08:11 -0700	[thread overview]
Message-ID: <41240B8B.9A7F6CFF@akamai.com> (raw)


   tcp_init_metrics initialises srtt from route cache.
   tcp_rtt_estimator has an assumption that
   whenerver srtt is set, rtt_seq is set.
   Invariant assumed  before(rtt_seq,snd_nxt) is
   not true most of the time while initailising from
   cache, so rttvar will  not be calcualted for this
   socket,  rto will be wrong for long time.
   The condition after(send_una, rtt_seq=0) is
   correct 50% of the time of random send_una.
   mdev check also resets the rttvar, but it will be
   slower.

   One fix is,  initialising the rtt_seq in tcp_init_metrics
   properly. Another fix is, doing the special check
   like the below to test whether the invariant has
   failed, i.e. initialised from the route cache.

 --- net/ipv4/tcp_input.c Tue Jun 15 22:19:43 2004
+++ net/ipv4/tcp_input.c Wed Aug 18 17:36:18 2004
@@ -641,7 +641,7 @@
                        if (tp->mdev_max > tp->rttvar)
                                tp->rttvar = tp->mdev_max;
                }
-               if (after(tp->snd_una, tp->rtt_seq)) {
+               if (after(tp->snd_una, tp->rtt_seq) ||
before(tp->snd_nxt, tp->rtt_seq))
                        if (tp->mdev_max < tp->rttvar)
                                tp->rttvar -=
(tp->rttvar-tp->mdev_max)>>2;
                        tp->rtt_seq = tp->snd_nxt;

Fix from Dave miller:
===== net/ipv4/tcp_input.c 1.69 vs edited =====
--- 1.69/net/ipv4/tcp_input.c   2004-08-02 17:05:30 -07:00
+++ edited/net/ipv4/tcp_input.c 2004-08-18 17:53:54 -07:00
@@ -852,8 +852,10 @@
         * to low value, and then abruptly stops to do it and starts to
delay
         * ACKs, wait for troubles.
         */
-       if (dst_metric(dst, RTAX_RTT) > tp->srtt)
+       if (dst_metric(dst, RTAX_RTT) > tp->srtt) {
                tp->srtt = dst_metric(dst, RTAX_RTT);
+               tp->rtt_seq = tp->snd_nxt;
+       }
        if (dst_metric(dst, RTAX_RTTVAR) > tp->mdev) {
                tp->mdev = dst_metric(dst, RTAX_RTTVAR);
                tp->mdev_max = tp->rttvar = max(tp->mdev, TCP_RTO_MIN);

Thanks,
Prasanna.


                 reply	other threads:[~2004-08-19  2:08 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=41240B8B.9A7F6CFF@akamai.com \
    --to=pmeda@akamai.com \
    --cc=davem@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@oss.sgi.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.