netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tcp: cubic scaling error
@ 2006-10-25 17:52 Stephen Hemminger
  2006-10-26  6:04 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Stephen Hemminger @ 2006-10-25 17:52 UTC (permalink / raw)
  To: David S. Miller; +Cc: Douglas Leith, netdev

Doug Leith observed a discrepancy between the version of CUBIC described
in the papers and the version in 2.6.18. A math error related to scaling
causes Cubic to grow too slowly.

Patch is from "Sangtae Ha" <sha2@ncsu.edu>. I validated that
it does fix the problems.

See the following to show behavior over 500ms 100 Mbit link.

Sender (2.6.19-rc3) ---  Bridge (2.6.18-rt7) ------- Receiver (2.6.19-rc3)
                    1G      [netem]           100M

	http://developer.osdl.org/shemminger/tcp/2.6.19-rc3/cubic-orig.png
	http://developer.osdl.org/shemminger/tcp/2.6.19-rc3/cubic-fix.png

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>

--- a/net/ipv4/tcp_cubic.c	2006-09-25 16:25:43.000000000 -0700
+++ b/net/ipv4/tcp_cubic.c	2006-10-25 09:17:28.000000000 -0700
@@ -190,7 +190,7 @@
          */
 
 	/* change the unit from HZ to bictcp_HZ */
-        t = ((tcp_time_stamp + ca->delay_min - ca->epoch_start)
+        t = ((tcp_time_stamp + (ca->delay_min>>3) - ca->epoch_start)
 	     << BICTCP_HZ) / HZ;
 
         if (t < ca->bic_K)		/* t - K */
@@ -259,7 +259,7 @@
 	    (s32)(tcp_time_stamp - ca->epoch_start) < HZ)
 		return;
 
-	delay = tcp_time_stamp - tp->rx_opt.rcv_tsecr;
+	delay = (tcp_time_stamp - tp->rx_opt.rcv_tsecr)<<3;
 	if (delay == 0)
 		delay = 1;
 
@@ -366,7 +366,7 @@
 
 	beta_scale = 8*(BICTCP_BETA_SCALE+beta)/ 3 / (BICTCP_BETA_SCALE - beta);
 
-	cube_rtt_scale = (bic_scale << 3) / 10;	/* 1024*c/rtt */
+	cube_rtt_scale = (bic_scale * 10);	/* 1024*c/rtt */
 
 	/* calculate the "K" for (wmax-cwnd) = c/rtt * K^3
 	 *  so K = cubic_root( (wmax-cwnd)*rtt/c )

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] tcp: cubic scaling error
  2006-10-25 17:52 [PATCH] tcp: cubic scaling error Stephen Hemminger
@ 2006-10-26  6:04 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2006-10-26  6:04 UTC (permalink / raw)
  To: shemminger; +Cc: doug.leith, netdev

From: Stephen Hemminger <shemminger@osdl.org>
Date: Wed, 25 Oct 2006 10:52:29 -0700

> Doug Leith observed a discrepancy between the version of CUBIC described
> in the papers and the version in 2.6.18. A math error related to scaling
> causes Cubic to grow too slowly.
> 
> Patch is from "Sangtae Ha" <sha2@ncsu.edu>. I validated that
> it does fix the problems.
> 
> See the following to show behavior over 500ms 100 Mbit link.
> 
> Sender (2.6.19-rc3) ---  Bridge (2.6.18-rt7) ------- Receiver (2.6.19-rc3)
>                     1G      [netem]           100M
> 
> 	http://developer.osdl.org/shemminger/tcp/2.6.19-rc3/cubic-orig.png
> 	http://developer.osdl.org/shemminger/tcp/2.6.19-rc3/cubic-fix.png
> 
> Signed-off-by: Stephen Hemminger <shemminger@osdl.org>

Applied, thanks a lot Stephen.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-10-26  6:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-25 17:52 [PATCH] tcp: cubic scaling error Stephen Hemminger
2006-10-26  6:04 ` David Miller

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).