Re: Know tcp bug ?!

Alan Cox (alan@lxorguk.ukuu.org.uk)
Sat, 18 Jan 1997 18:58:25 +0000 (GMT)


> I have problem with squid and setsockopt with SO_RCVBUF options.
> This is a dump that show that tcp is not OK. Note the window size
> of 700, that is the option that I use in squid.Is this a known bug ?

If you set your SO_RCVBUF below twice the MSS of a TCP socket then
its behaviour is not going to be good.

> This is strange. Is send an ack with win 0. (There have not been any
> data, so it should be the value I have put in to the
> setsockopt value.)

The setsockopt value is the maximum memory committed to the socket NOT
the window size. Consider the case of a daemon that wants 500 connections
all to use small amounts of memory. If I create 500 clients and send all
1 byte data blocks that 700 bytes will actually take in the region of
64Kbytes.

Setting the window using SO_RCVBUF is the wrong way to do it. Instead
set the window on routes you need to force a low window with something
like

route -net add 44.0.0.0 netmask 255.0.0.0 gw 44.1.2.3 window 700

Alan