From owner-freebsd-hackers Thu Jan 23 20:54:17 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id UAA07041 for hackers-outgoing; Thu, 23 Jan 1997 20:54:17 -0800 (PST) Received: from widefw.csl.sony.co.jp (widefw.csl.sony.co.jp [133.138.1.1]) by freefall.freebsd.org (8.8.5/8.8.5) with ESMTP id UAA07036 for ; Thu, 23 Jan 1997 20:54:10 -0800 (PST) Received: from hotaka.csl.sony.co.jp (hotaka.csl.sony.co.jp [43.27.98.57]) by widefw.csl.sony.co.jp (8.8.3/3.5Wbeta) with ESMTP id EAA14894 for ; Fri, 24 Jan 1997 04:54:00 GMT Received: from localhost (localhost [127.0.0.1]) by hotaka.csl.sony.co.jp (8.8.4/3.3W3) with ESMTP id NAA12432 for ; Fri, 24 Jan 1997 13:53:44 +0900 (JST) Message-Id: <199701240453.NAA12432@hotaka.csl.sony.co.jp> To: hackers@FreeBSD.ORG Subject: tcp window size problem, again Date: Fri, 24 Jan 1997 13:53:44 +0900 From: Kenjiro Cho Sender: owner-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk 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 To: Luigi Rizzo Cc: hackers@freebsd.org, wollman@lcs.mit.edu, phk@freebsd.org Sender: owner-hackers@freebsd.org Subject: Changing default TCP window size ? < 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 ----------------------------------------------------------------------------