[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1355848224.9380.30.camel@edumazet-glaptop>
Date: Tue, 18 Dec 2012 08:30:24 -0800
From: Eric Dumazet <erdnetdev@...il.com>
To: Cong Wang <amwang@...hat.com>
Cc: netdev@...r.kernel.org, Ben Greear <greearb@...delatech.com>,
David Miller <davem@...emloft.net>,
Stephen Hemminger <shemminger@...tta.com>,
Rick Jones <rick.jones2@...com>, Thomas Graf <tgraf@...hat.com>
Subject: Re: TCP delayed ACK heuristic
On Tue, 2012-12-18 at 10:11 -0500, Cong Wang wrote:
> 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?
>
ACKS might also be delayed because of bidirectional traffic, and is more
controlled by the application response time. TCP stack can not easily
estimate it.
If you focus on bulk receive, LRO/GRO should already lower number of
ACKS to an acceptable level and without major disruption.
Stretch acks are not only the receiver concern, there are issues for the
sender that you cannot always control/change.
I recommend reading RFC2525 2.13
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists