Date: Wed, 4 Sep 1996 22:20:46 +0200 (MET DST) From: Luigi Rizzo <luigi@labinfo.iet.unipi.it> To: bugs@freebsd.org, wollman@freebsd.org, davidg@freebsd.org, stefano@unipi.it Subject: A bug in slow start mechanism (2.1, 2.1.5 at least) Message-ID: <199609042020.WAA09870@labinfo.iet.unipi.it>
next in thread | raw e-mail | index | archive | help
I think there is a (potentially dangerous for the network) bug in tcp_mss() due to an optimization introduced to avoid the use of slow start in local networks. This bug is not present in 4.4Lite. Luckily it has a simple fix: replace, in netinet/in.c, the line #define SUBNETSARELOCAL 1 with #define SUBNETSARELOCAL 0 I'll try to explain the problem in some detail. It's a bit tricky. When a TCP connection is opened, snd_cwnd is set to a large value (2^30); it is reset to 1 MSS in tcp_mss(), but _only_ if in_localaddr() returns 0. In other words, slow start is defeated for "local" connections, thus causing a full window of data to be blasted onto the network at the first write (if, of course, enough data is available). The above behaviour (which is not present in 4.4Lite, where snd_cwnd is always set to 1 MSS in tcp_mss() -- just checked on TCP/IP Ill. vol.2) is based on the assumption that "local" connections have a high speed path, perhaps with no routers or bottlenecks in the middle. HOWEVER: with the default system configuration (in 2.1R, 2.1.5 and possibly -current, although I have no sources available for the latter) in_localaddr() defines networks as local basing on CLASSA/CLASSB/CLASSC netmasks instead of using the subnetmask associated with the various i/f addresses (this behaviour is regulated by the value of SUBNETSARELOCAL which is 1 by default). The consequence of all the above is that in many many cases slow_start is disabled when it should not. Typical examples are: - CLASS B networks which are further partitioned (e.g. here in Pisa most networks are 131.114.X.Y, but the various links range from 9.6Kb/s to 10Mb/s); I suspect that this occurs in a lot of places. - PPP links (especially those using the "tun" device, where a dedicated address is not needed on the point-to-point link). Luigi ==================================================================== Luigi Rizzo Dip. di Ingegneria dell'Informazione email: luigi@iet.unipi.it Universita' di Pisa tel: +39-50-568533 via Diotisalvi 2, 56126 PISA (Italy) fax: +39-50-568522 http://www.iet.unipi.it/~luigi/ ====================================================================
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199609042020.WAA09870>