From owner-freebsd-questions@FreeBSD.ORG Fri Nov 17 00:17:59 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0E35816A407 for ; Fri, 17 Nov 2006 00:17:59 +0000 (UTC) (envelope-from wmoran@collaborativefusion.com) Received: from mx00.pub.collaborativefusion.com (mx00.pub.collaborativefusion.com [206.210.89.199]) by mx1.FreeBSD.org (Postfix) with ESMTP id A494643D46 for ; Fri, 17 Nov 2006 00:17:58 +0000 (GMT) (envelope-from wmoran@collaborativefusion.com) Received: from working (c-71-60-174-60.hsd1.pa.comcast.net [71.60.174.60]) (AUTH: LOGIN wmoran, TLS: TLSv1/SSLv3,256bits,AES256-SHA) by wingspan with esmtp; Thu, 16 Nov 2006 19:17:57 -0500 id 0005642C.455CFFB5.0000ADAF Date: Thu, 16 Nov 2006 19:17:53 -0500 From: Bill Moran To: freebsd-questions@freebsd.org Message-Id: <20061116191753.bce30afb.wmoran@collaborativefusion.com> In-Reply-To: <200611162317.XAA27092@sopwith.solgatos.com> References: <200611162317.XAA27092@sopwith.solgatos.com> Organization: Collaborative Fusion Inc. X-Mailer: Sylpheed version 2.2.9 (GTK+ 2.10.6; i386-portbld-freebsd6.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: freebsd@sopwith.solgatos.com Subject: Re: TCP parameters X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Nov 2006 00:17:59 -0000 On Thu, 16 Nov 2006 15:17:26 +0000 Dieter wrote: > In the process of debugging a not-working-so-well TCP > application, I've been asked to provide: > > > cat /proc/sys/net/ipv4/tcp_window_scaling > > cat /proc/sys/net/ipv4/tcp_wmem > > Which of course results in "No such file or directory". > > I suspect these are from Linux. Are there equivalent > parameters in FreeBSD 6.x ? http://www.netadmintools.com/html/7tcp.man.html Window scaling is enabled by default. I'd assumed that there would be a sysctl to disable it, but I can't seem to find one. It looks as if tcp_wmem is the equivalent of recvspace, although the description in that document is somewhat befuddling. > The other end (non-FreeBSD non-open-source) is sending > real-time data, and apparently is not able to keep up, > its memory fills up, and it starts dropping packets. I > suspect the problem is a combination of too much latency > (FreeBSD not sending ACKs fast enough) and not enough window > size. Can you get some tcpdumps of the traffic? If the problem is what you suspect, it should be evident in a packet dump. > net.inet.tcp.recvspace and .sendspace seem relevant, > anything else? I'm not a TCP wizard, so please feel free > to point out things that should be obvious. :-) Those are maximum values, perhaps your application is not actually allocating that much? Calling getsockopt() on SO_SNDBUF and SO_RCVBUF will tell you, and setsockopt() can be used to change them. > I doubt that the BSD network stack has anything to do with this, > but perhaps there is something that could be tweaked to help out. > I'm hoping that updating the Ethernet device drivers (bge, nve) > will result in less latency. Latency isn't the only factor. If your window size is enough, a little extra latency shouldn't hurt. Of course, if the thing is unable to maintain the required throughput, that'll kill you every time. > Then there is userland: > > Anyone want to code review a very simple 80 line TCP-to-stdout utility? Sure, post it ... I'll have a look.