From owner-freebsd-hackers Thu Sep 12 14:20:48 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id OAA04371 for hackers-outgoing; Thu, 12 Sep 1996 14:20:48 -0700 (PDT) Received: from labinfo.iet.unipi.it (labinfo.iet.unipi.it [131.114.9.5]) by freefall.freebsd.org (8.7.5/8.7.3) with SMTP id OAA04365 for ; Thu, 12 Sep 1996 14:20:44 -0700 (PDT) Received: from localhost (luigi@localhost) by labinfo.iet.unipi.it (8.6.5/8.6.5) id WAA10840; Thu, 12 Sep 1996 22:51:05 +0200 From: Luigi Rizzo Message-Id: <199609122051.WAA10840@labinfo.iet.unipi.it> Subject: Re: Changing default TCP window size ? To: avalon@coombs.anu.edu.au (Darren Reed) Date: Thu, 12 Sep 1996 22:51:05 +0200 (MET DST) Cc: matt@lkg.dec.com, hackers@freebsd.org In-Reply-To: <199609122042.WAA10821@labinfo.iet.unipi.it> from "Darren Reed" at Sep 13, 96 07:09:37 am X-Mailer: ELM [version 2.4 PL23] Content-Type: text Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk > In some mail from Matt Thomas, sie said: > > > > You can't do it in -current (as I found on FDDI). The TCP code forces > > the buffser to what is in the route and does not allow one to override > > them. About a month I sent a set of patches which allows SO_SNDBUF/ > > SO_RCVBUF to work. > > sounds like something else there, I've watched ftp connections with > tcpdump and in that case, the window grows during the data connection from > 4k to 16k. Have played a little bit with Matt's patch (which is quite simple, in tcp_input.c the two blocks of code conditioned to RTV_SPIPE and RTV_RPIPE must be changed as follows: #ifdef RTV_SPIPE if ((bufsize = rt->rt_rmx.rmx_sendpipe) == 0 || /* XXX Matt Thomas fix to enable larger windows */ so->so_snd.sb_hiwat != tcp_sendspace ) #endif ... #ifdef RTV_RPIPE if ((bufsize = rt->rt_rmx.rmx_recvpipe) == 0 || /* XXX Matt Thomas fix to enable larger windows */ so->so_rcv.sb_hiwat != tcp_recvspace) #endif and this works, in principle. The problem is, you have to recompile applications to call setsockopt() with SO_SNDBUF and SO_RCVBUF, or you need to alter tcp_sendspace and tcp_recvspace (don't know if they can be modified with sysctl.) After this, things work up to a window of 65535. For larger windows, using scaling options, I think there is some problem with option negotiation, so that if both values are not above 65535 they end up negotiating the default value (16K) instead of the min() of the two values. Still looking at this... 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/ ====================================================================