netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Gavin McCullagh <Gavin.McCullagh@nuim.ie>
To: netdev@vger.kernel.org
Subject: [PATCH/RFC] TCP: use non-delayed ACK for congestion control RTT
Date: Mon, 17 Dec 2007 13:44:25 +0000	[thread overview]
Message-ID: <20071217134425.GD7409@nuim.ie> (raw)


When a delayed ACK representing two packets arrives, there are two RTT
samples available, one for each packet.  The first (in order of seq number)
will be artificially long due to the delay waiting for the second packet,
the second will trigger the ACK and so will not itself be delayed.

According to rfc1323, the SRTT used for RTO calculation should use the
first rtt, so receivers echo the timestamp from the first packet in the
delayed ack.  For congestion control however, it seems measuring delayed
ack delay is not desirable as it varies independently of congestion.

The patch below causes seq_rtt to be updated with any available later
packet rtts which should have less (and hopefully zero) delack delay.  The
lower seq_rtt then gets passed to ca_ops->pkts_acked().  

For non-delay based congestion control (cubic, h-tcp), rtt is sometimes
used for rtt-scaling.  In shortening the RTT, this may make them a little
less aggressive.  Delay-based schemes (eg vegas, illinois) should get a
considerably cleaner, more accurate congestion signal, particularly for
small cwnds. The congestion control module can potentially also filter out
bad RTTs due to the delayed ack alarm by looking at the associated cnt
which (where delayed acking is in use) should probably be 1 if the alarm
went off or greater if the ACK was triggered by a packet.

I seem to be undoing a design decision here so perhaps there is some reason
this should not be done?  Comments/explanations appreciated...


Signed-off-by: Gavin McCullagh <gavin.mccullagh@nuim.ie>


--- a/net/ipv4/tcp_input.c	2007-12-15 00:22:23.000000000 +0000
+++ b/net/ipv4/tcp_input.c	2007-12-17 13:35:16.000000000 +0000
@@ -2691,11 +2691,9 @@ static int tcp_clean_rtx_queue(struct so
 				    (packets_acked > 1))
 					flag |= FLAG_NONHEAD_RETRANS_ACKED;
 			} else {
-				if (seq_rtt < 0) {
-					seq_rtt = now - scb->when;
-					if (fully_acked)
-						last_ackt = skb->tstamp;
-				}
+				seq_rtt = now - scb->when;
+				if (fully_acked)
+					last_ackt = skb->tstamp;
 				if (!(sacked & TCPCB_SACKED_ACKED))
 					reord = min(cnt, reord);
 			}
@@ -2709,11 +2707,9 @@ static int tcp_clean_rtx_queue(struct so
 			    !before(end_seq, tp->snd_up))
 				tp->urg_mode = 0;
 		} else {
-			if (seq_rtt < 0) {
-				seq_rtt = now - scb->when;
-				if (fully_acked)
-					last_ackt = skb->tstamp;
-			}
+			seq_rtt = now - scb->when;
+			if (fully_acked)
+				last_ackt = skb->tstamp;
 			reord = min(cnt, reord);
 		}
 		tp->packets_out -= packets_acked;


             reply	other threads:[~2007-12-17 13:44 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-17 13:44 Gavin McCullagh [this message]
2007-12-18 20:40 ` [PATCH/RFC] [v2] TCP: use non-delayed ACK for congestion control RTT Gavin McCullagh
2007-12-19 10:28   ` Gavin McCullagh
2007-12-19 11:08   ` Ilpo Järvinen
2007-12-19 11:31     ` Gavin McCullagh
2007-12-19 13:30       ` Ilpo Järvinen
2007-12-21 11:14         ` David Miller
2007-12-21 13:31           ` Gavin McCullagh
2007-12-21 14:05             ` David Miller
2007-12-21 14:07             ` Ilpo Järvinen
2007-12-21 14:10               ` Ilpo Järvinen
2007-12-30  1:15               ` [PATCH/RFC] [v3] " Gavin McCullagh
2007-12-30  1:25                 ` Gavin McCullagh
2007-12-30  3:09                   ` David Miller
2007-12-30 12:20                     ` Gavin McCullagh
2007-12-30  3:06                 ` David Miller
2007-12-30  9:43                 ` Ilpo Järvinen
2007-12-30 12:35                   ` Gavin McCullagh

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=20071217134425.GD7409@nuim.ie \
    --to=gavin.mccullagh@nuim.ie \
    --cc=netdev@vger.kernel.org \
    /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).