From: Cong Wang <amwang@redhat.com>
To: netdev@vger.kernel.org
Cc: Ben Greear <greearb@candelatech.com>,
David Miller <davem@davemloft.net>,
Eric Dumazet <eric.dumazet@gmail.com>,
Stephen Hemminger <shemminger@vyatta.com>,
Rick Jones <rick.jones2@hp.com>, Thomas Graf <tgraf@redhat.com>
Subject: TCP delayed ACK heuristic
Date: Tue, 18 Dec 2012 10:11:24 -0500 (EST) [thread overview]
Message-ID: <2088500005.27728019.1355843484620.JavaMail.root@redhat.com> (raw)
In-Reply-To: <270756364.27707018.1355842632348.JavaMail.root@redhat.com>
Hello, TCP experts!
Some time ago, Ben sent a patch [1] to add some knobs for
tuning TCP delayed ACK, but rejected by David.
David's point is that we can do some heuristics for TCP
delayed ACK, so the question is that what kind of heuristics
can we use?
RFC1122 explicitly mentions:
A TCP SHOULD implement a delayed ACK, but an ACK should not
be excessively delayed; in particular, the delay MUST be
less than 0.5 seconds, and in a stream of full-sized
segments there SHOULD be an ACK for at least every second
segment.
so this prevents us from using any heuristic for the number
of coalesced delayed ACK.
For the timeout of a delayed ACK, my idea is guessing how many
packet we suppose to receive is the TCP stream is fully utilized,
something like below:
+static inline u32 tcp_expect_packets(struct sock *sk)
+{
+ struct tcp_sock *tp = tcp_sk(sk);
+ int rtt = tp->srtt >> 3;
+ u32 idle = tcp_time_stamp - inet_csk(sk)->icsk_ack.lrcvtime;
+
+ return idle * 2 / rtt;
+}
...
+ ato -= tcp_expect_packets(sk) * delta;
The more we expect, the less we should delay. However this is
not accurate due to congestion control.
Meanwhile, we can also check how many packets are pending in TCP
sending queue, the more we pend, the more we can piggyback with
a single ACK, but not beyond how much we are able to send at
that time.
Comments? Ideas?
Thanks.
1. http://thread.gmane.org/gmane.linux.network/233859
next parent reply other threads:[~2012-12-18 15:11 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <270756364.27707018.1355842632348.JavaMail.root@redhat.com>
2012-12-18 15:11 ` Cong Wang [this message]
2012-12-18 16:30 ` TCP delayed ACK heuristic Eric Dumazet
2012-12-19 6:54 ` Cong Wang
2012-12-18 16:39 ` David Laight
2012-12-18 17:54 ` Rick Jones
2012-12-19 9:52 ` David Laight
2012-12-19 7:00 ` Cong Wang
2012-12-19 18:39 ` Rick Jones
2012-12-19 20:59 ` David Miller
2012-12-20 3:23 ` Cong Wang
2012-12-20 9:57 ` David Laight
2012-12-20 12:41 ` Cong Wang
2012-12-19 23:08 ` Eric Dumazet
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=2088500005.27728019.1355843484620.JavaMail.root@redhat.com \
--to=amwang@redhat.com \
--cc=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--cc=greearb@candelatech.com \
--cc=netdev@vger.kernel.org \
--cc=rick.jones2@hp.com \
--cc=shemminger@vyatta.com \
--cc=tgraf@redhat.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).