Date: Fri, 24 Jan 1997 13:53:44 +0900 From: Kenjiro Cho <kjc@csl.sony.co.jp> To: hackers@FreeBSD.ORG Subject: tcp window size problem, again Message-ID: <199701240453.NAA12432@hotaka.csl.sony.co.jp>
next in thread | raw e-mail | index | archive | help
Recently, I did some network performance benchmarking on high speed network (ATM and 100baseT), and found that the FreeBSD's score is far behind other systems. It turns out that the TCP window size gets reset to the default value at a connection establishment on FreeBSD. After digging into the hackers ML archive, I found this problem was already discussed back in September. (see Garrett's comment attached below.) I don't have a good solution to resolve the conflict between a value by SO_ SNDBUF/SO_RCVBUF and a value by the route. But at least we should leave out setting stupid rmx_snedpipe/rmx_recvpipe values. The current in_addroute() in in_rmx.c sets tcp_sendspace/tcp_recvspace to rmx_sendpipe/rmx_recvpipe. This has no effect when the socket buffer size is not changed, but it does override the socket buffer size even when the socket buffer size has been changed. There is no positive effect to set these default values. By leaving out the default values for rmx_sendpipe/rmx_recvpipe, the behavior of TCP falls back to the original BSD implementation. - SO_SNDBUF/SO_RCVBUF work as expected. - administrators can override the socket buffer size by explicitly setting sendpipe/recvpipe to a route. We can leave the problem of the conflict until someone comes up with a better handling of rmx_sendpipe/rmx_recvpipe. Anyway, with a larger socket buffer size, the TCP score jumps up from 70Mbps to 120Mbps! It's pitty if FreeBSD gets a reputation of bad netwrok performance by benchmark tests. --Kenjiro ---------------------------------------------------------------------------- Date: Thu, 12 Sep 1996 15:05:04 -0400 From: Garrett Wollman <wollman@lcs.mit.edu> To: Luigi Rizzo <luigi@labinfo.iet.unipi.it> Cc: hackers@freebsd.org, wollman@lcs.mit.edu, phk@freebsd.org Sender: owner-hackers@freebsd.org Subject: Changing default TCP window size ? <<On Wed, 11 Sep 1996 23:17:07 +0200 (MET DST), Luigi Rizzo <luigi@labinfo.iet.unipi.it> said: > How do I force TCP (or the OS) to use a window size different from the > default 16K ? > The following code > mywin=DESIRED_WINDOW_SIZE; > setsockopt(f, SOL_SOCKET, SO_SNDBUF, (char *)&mywin, sizeof mywin) > appears to set the value correctly (it can be read back with > getsockopt) but then it appears not to have any effect on TCP > (monitoring the connection with netstat -na always shows a Send-Q > around 16KB, and the throughput in window-limited configurations > remains unchanged). This is a conflict that needs to be resolved between the option-processing code and the code that attempts to set the socket buffer size based on what's in the route. I can't give you a fully-fleshed-out solution, but essentially the code needs to check if there is a buffer size specified via setsockopt, and if there is, then it should ignore the values in the route (or perhaps it should use the lock bits in the route to indicate some sort of clamping). I have a long-standing bug report form Matthew Dillon about this, but it has not had a sufficiently high priority to get done. Come up with a good fix and I'll take it. -GAWollman -- Garrett A. Wollman | O Siem / We are all family / O Siem / We're all the same wollman@lcs.mit.edu | O Siem / The fires of freedom Opinions not those of| Dance in the burning flame MIT, LCS, ANA, or NSA| - Susan Aglukark and Chad Irschick ----------------------------------------------------------------------------
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199701240453.NAA12432>