From: Werner Almesberger <wa@almesberger.net>
To: netdev@oss.sgi.com
Cc: chengjin@cs.caltech.edu
Subject: snd_cwnd drawn and quartered
Date: Tue, 24 Dec 2002 22:50:40 -0300 [thread overview]
Message-ID: <20021224225040.A22201@almesberger.net> (raw)
Hi all,
how about a little bug for Christmas ? :-)
There seems to be a bug in how fast recovery halves cwnd:
Linux TCP decrements snd_cwnd for every second incoming ACK
until we leave fast recovery.
Using the NewReno procedure, recovery ends between the time of
the inital loss plus RTT (no further losses), or about one RTT
later (if we lose the packet just sent before we detected the
initial loss).
So, in the worst case (i.e. the drawn-out recovery), cwnd gets
decremented for every second incoming ACK during two RTTs. In
the first RTT, we get the equivalent of the old cwnd of ACKs,
while in the second RTT, we've slowed down, and get only half
as many ACKs. So we end up with cwnd being a quarter of its
initial value.
Now, one could argue that this actually kind of makes sense
(i.e. no discontinuity for loss near the end of recovery),
but the code quite clearly tries to avoid this case:
net/ipv4/tcp_input.c:tcp_cwnd_down:
if (decr && tp->snd_cwnd > tp->snd_ssthresh/2)
tp->snd_cwnd -= decr;
Unfortunately, snd_ssthresh has already been halved at this
point, so the test actually does nothing. So I'd suggest to
change this to
if (decr && tp->snd_cwnd > tp->snd_ssthresh)
This was found by Cheng Jin and me in his simulator based
on 2.4.18, but the code still seems to be the same in 2.5.53.
BTW, ironically, at least gcc 3.1 generates slightly worse
code if I change the second line to
tp->snd_cwnd--;
It may still be desirable to change this for clarity,
though.
- Werner
--
_________________________________________________________________________
/ Werner Almesberger, Buenos Aires, Argentina wa@almesberger.net /
/_http://www.almesberger.net/____________________________________________/
next reply other threads:[~2002-12-25 1:50 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-12-25 1:50 Werner Almesberger [this message]
2003-01-02 1:38 ` snd_cwnd drawn and quartered kuznet
2003-01-02 6:08 ` Werner Almesberger
2003-01-02 8:31 ` Werner Almesberger
2003-01-02 21:26 ` Werner Almesberger
2003-01-14 0:12 ` kuznet
2003-01-14 1:20 ` Cheng Jin
2003-01-14 1:46 ` kuznet
2003-01-14 1:58 ` Cheng Jin
2003-01-14 2:12 ` kuznet
2003-01-14 2:19 ` Cheng Jin
2003-01-14 5:07 ` kuznet
2003-01-14 4:01 ` Werner Almesberger
[not found] ` <200301140502.IAA10733@sex.inr.ac.ru>
2003-01-14 5:25 ` Werner Almesberger
2003-01-14 6:14 ` kuznet
2003-01-14 6:36 ` Werner Almesberger
2003-01-15 17:50 ` kuznet
2003-01-15 18:25 ` Werner Almesberger
2003-01-15 18:43 ` kuznet
2003-01-15 19:37 ` Werner Almesberger
2003-01-19 6:55 ` example showing how cwnd gets to one Cheng Jin
2003-01-14 0:54 ` snd_cwnd drawn and quartered kuznet
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=20021224225040.A22201@almesberger.net \
--to=wa@almesberger.net \
--cc=chengjin@cs.caltech.edu \
--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 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).