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] [thread-next>] [day] [month] [year] [list]
Date:	Sun, 12 Sep 2010 18:23:08 -0700 (PDT)
From:	David Miller <davem@...emloft.net>
To:	kuznet@....inr.ac.ru
Cc:	ilpo.jarvinen@...sinki.fi, eric.dumazet@...il.com,
	leandroal@...il.com, netdev@...r.kernel.org
Subject: Re: TCP packet size and delivery packet decisions

From: Alexey Kuznetsov <kuznet@....inr.ac.ru>
Date: Wed, 8 Sep 2010 16:14:50 +0400

> I do not know actual context, of course. I can guess the situation
> can be like this: "I set window=mss exactly to see only one packet in flight
> all the times. Why the hell linux tries to send two mss/2 sized?" :-)

The context is that a very stupid embedded device takes commands that
are all some specific size (I think it was 75 bytes), and it's
TCP stack sets MSS and window to exactly 75 bytes.

Device will only process the commands sent to it over TCP properly
if they are sent full sized, 75 bytes, by the sending TCP stack.
Linux is the only stack with which the device will not work.

To be honest, at such tiny MSS and window sizes, such packetization
for the sake of SWS done by us is stupid.

Let's be a little bit postmodern and just turn off this stuff using
perhaps a modified version of your idea #1, elide the SWS "window / 2"
logic when "max_window >= 512" or something like that.

It seems to handle every angle:

1) Huge MTU (>= 65535) devices are still covered.

2) For sane ethernet derived MSS and normal large window
   behavior stays the same.

3) When speaking to devices using super tiny windows, it is
   apparent that loss recovery performance is not their primary
   concern. :-)

Therefore, how about the following?

diff --git a/include/net/tcp.h b/include/net/tcp.h
index eaa9582..f8744e0 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -475,7 +475,15 @@ extern unsigned int tcp_current_mss(struct sock *sk);
 /* Bound MSS / TSO packet size with the half of the window */
 static inline int tcp_bound_to_half_wnd(struct tcp_sock *tp, int pktsize)
 {
-	if (tp->max_window && pktsize > (tp->max_window >> 1))
+	/* When peer uses tiny windows, there is no use in packetizing
+	 * to sub-MSS pieces for the sake of SWS or making sure there
+	 * are enough packets in the pipe for fast recovery.
+	 *
+	 * On the other hand, for extremely large MSS devices, handling
+	 * smaller than MSS windows in this way does make sense.
+	 */
+	if (tp->max_window >= 512 &&
+	    pktsize > (tp->max_window >> 1))
 		return max(tp->max_window >> 1, 68U - tp->tcp_header_len);
 	else
 		return pktsize;
--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ