lists.openwall.net   lists  /  announce  john-users  owl-users  popa3d-users  /  xvendor  oss-security  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4 
Open Source and information security mailing list archives
 
Order Openwall GNU/*/Linux 2.0 on a CD with delivery worldwide
[<prev] [next>] [month] [year] [list]
Date:	Thu, 1 Feb 2007 01:45:31 -0800
From:	"Xiaoliang (David) Wei" <davidwei79@...il.com>
To:	netdev@...r.kernel.org
Subject: A potential bug in tcp_vegas.c

Hi gurus,

I am testing tcp_vegas.c in Linux with the NS-2 TCP-Linux. It seems
that the ssthresh is not correctly reset in this file and the problem
might lead to very unfair behavior among Vegas flows, when some flows
exit slow start due to loss, not delay.

Please see the details at:

http://www.cs.caltech.edu/%7Eweixl/technical/ns2linux/known_linux/index.html#vegas
(the section of "Setting of Slow-Start-Threshold")

A fix I wrote (for Linux 2.6.19.2) is as follow:

--- tcp_vegas.c.old	2007-02-01 00:33:55.000000000 -0800
+++ tcp_vegas.c	2007-02-01 00:39:49.000000000 -0800
@@ -265,26 +265,25 @@
 			 */
 			diff = (old_wnd << V_PARAM_SHIFT) - target_cwnd;

-			if (tp->snd_cwnd <= tp->snd_ssthresh) {
-				/* Slow start.  */
-				if (diff > gamma) {
-					/* Going too fast. Time to slow down
-					 * and switch to congestion avoidance.
-					 */
-					tp->snd_ssthresh = 2;
+			if (diff > gamma && tp->snd_ssthresh > 2 ) {
+				/* Going too fast. Time to slow down
+				 * and switch to congestion avoidance.
+				 */
+				tp->snd_ssthresh = 2;

-					/* Set cwnd to match the actual rate
-					 * exactly:
-					 *   cwnd = (actual rate) * baseRTT
-					 * Then we add 1 because the integer
-					 * truncation robs us of full link
-					 * utilization.
-					 */
-					tp->snd_cwnd = min(tp->snd_cwnd,
-							   (target_cwnd >>
-							    V_PARAM_SHIFT)+1);
+				/* Set cwnd to match the actual rate
+				 * exactly:
+				 *   cwnd = (actual rate) * baseRTT
+				 * Then we add 1 because the integer
+				 * truncation robs us of full link
+				 * utilization.
+				 */
+				tp->snd_cwnd = min(tp->snd_cwnd,
+						   (target_cwnd >>
+						    V_PARAM_SHIFT)+1);

-				}
+			} else if (tp->snd_cwnd <= tp->snd_ssthresh) {
+				/* Slow start.  */
 				tcp_slow_start(tp);
 			} else {
 				/* Congestion avoidance. */


Thanks.

-David
-- 
Xiaoliang (David) Wei      Graduate Student, CS@...tech
http://davidwei.org
***********************************************
-
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

Hosted by DataForce ISP - Powered by Openwall GNU/*/Linux