lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Fri, 4 Apr 2008 11:27:35 -0800
From:	"Lachlan Andrew" <lachlan.andrew@...il.com>
To:	Netdev <netdev@...r.kernel.org>
Subject: Re: Why is tcp_reno_min_cwnd() ssthresh/2?

Thanks Stephen and all,

I still don't understand why  tcp_cwnd_min()  doesn't default to  Reno
 behaviour.  (The only algorithms this currently affects are BIC and
CUBIC, but since CUBIC is the default, that is important.)

John is right that it would be great to have this documented in the
code.  FWIW, the attached patch points to the mailing list post, and
also makes  tcp_cwnd_min  default to Reno behaviour.  (The inline
patch below is probably mangled by my mail client.)  This patch
changes the behaviour of CUBIC.

Cheers,
Lachlan

diff -ruNp linux-2.6.25-rc7/include/net/tcp.h
linux-2.6.25-rc7-comments/include/net/tcp.h
--- linux-2.6.25-rc7/include/net/tcp.h	2008-03-27 18:25:07.000000000 -0800
+++ linux-2.6.25-rc7-comments/include/net/tcp.h	2008-04-04
11:05:39.000000000 -0800
@@ -645,7 +645,7 @@ struct tcp_congestion_ops {

 	/* return slow start threshold (required) */
 	u32 (*ssthresh)(struct sock *sk);
-	/* lower bound for congestion window (optional) */
+	/* lower bound for congestion window during rate halving (optional) */
 	u32 (*min_cwnd)(const struct sock *sk);
 	/* do new cwnd calculation (required) */
 	void (*cong_avoid)(struct sock *sk, u32 ack, u32 in_flight);
diff -ruNp linux-2.6.25-rc7/net/ipv4/tcp_cong.c
linux-2.6.25-rc7-comments/net/ipv4/tcp_cong.c
--- linux-2.6.25-rc7/net/ipv4/tcp_cong.c	2008-03-27 18:25:07.000000000 -0800
+++ linux-2.6.25-rc7-comments/net/ipv4/tcp_cong.c	2008-04-04
11:05:00.000000000 -0800
@@ -387,6 +387,8 @@ u32 tcp_reno_ssthresh(struct sock *sk)
 EXPORT_SYMBOL_GPL(tcp_reno_ssthresh);

 /* Lower bound on congestion window with halving. */
+/* Allows snd_cwnd to reduce to prev_cwnd/4  */
+/*   -- see http://oss.sgi.com/archives/netdev/2003-01/msg00114.html */
 u32 tcp_reno_min_cwnd(const struct sock *sk)
 {
 	const struct tcp_sock *tp = tcp_sk(sk);
diff -ruNp linux-2.6.25-rc7/net/ipv4/tcp_input.c
linux-2.6.25-rc7-comments/net/ipv4/tcp_input.c
--- linux-2.6.25-rc7/net/ipv4/tcp_input.c	2008-03-27 18:25:07.000000000 -0800
+++ linux-2.6.25-rc7-comments/net/ipv4/tcp_input.c	2008-04-04
11:07:43.000000000 -0800
@@ -2233,14 +2233,15 @@ static inline void tcp_moderate_cwnd(str
 	tp->snd_cwnd_stamp = tcp_time_stamp;
 }

-/* Lower bound on congestion window is slow start threshold
+/* Lower bound on congestion window during rate halving is *half* of
+ * slow start threshold (see net/ipv4/tcp_cong.c:tcp_reno_min_cwnd() )
  * unless congestion avoidance choice decides to overide it.
  */
 static inline u32 tcp_cwnd_min(const struct sock *sk)
 {
 	const struct tcp_congestion_ops *ca_ops = inet_csk(sk)->icsk_ca_ops;

-	return ca_ops->min_cwnd ? ca_ops->min_cwnd(sk) : tcp_sk(sk)->snd_ssthresh;
+	return ca_ops->min_cwnd ? ca_ops->min_cwnd(sk) : tcp_sk(sk)->snd_ssthresh / 2;
 }

 /* Decrease cwnd each second ack. */


On 04/04/2008, Stephen Hemminger <shemminger@...tta.com> wrote:
>
> First sighed 5 years ago, and every times it comes up, the original
>  behaviour is retained.
>
>  http://oss.sgi.com/archives/netdev/2003-01/msg00114.html


-- 
Lachlan Andrew  Dept of Computer Science, Caltech
1200 E California Blvd, Mail Code 256-80, Pasadena CA 91125, USA
Ph: +1 (626) 395-8820    Fax: +1 (626) 568-3603
http://netlab.caltech.edu/lachlan

View attachment "min_cwnd.patch" of type "text/x-patch" (2252 bytes)

Powered by blists - more mailing lists