From owner-freebsd-questions@FreeBSD.ORG Thu Dec 7 16:36:40 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 28A1D16A492 for ; Thu, 7 Dec 2006 16:36:40 +0000 (UTC) (envelope-from freebsd@sopwith.solgatos.com) Received: from schitzo.solgatos.com (pool-71-245-104-192.ptldor.fios.verizon.net [71.245.104.192]) by mx1.FreeBSD.org (Postfix) with ESMTP id 95D0444015 for ; Thu, 7 Dec 2006 16:31:26 +0000 (GMT) (envelope-from freebsd@sopwith.solgatos.com) Received: from schitzo.solgatos.com (localhost.home.localnet [127.0.0.1]) by schitzo.solgatos.com (8.13.8/8.13.6) with ESMTP id kB7GWHLd009297 for ; Thu, 7 Dec 2006 08:32:18 -0800 Received: from sopwith.solgatos.com (uucp@localhost) by schitzo.solgatos.com (8.13.8/8.13.4/Submit) with UUCP id kB7GWHgh009294 for freebsd-questions@freebsd.org; Thu, 7 Dec 2006 08:32:17 -0800 Received: from localhost by sopwith.solgatos.com (8.8.8/6.24) id QAA25171; Thu, 7 Dec 2006 16:29:24 GMT Message-Id: <200612071629.QAA25171@sopwith.solgatos.com> To: freebsd-questions@freebsd.org In-reply-to: Your message of "Wed, 06 Dec 2006 15:37:43 PST." Date: Thu, 07 Dec 2006 08:29:24 +0000 From: Dieter Subject: Re: TCP parameters and interpreting tcpdump output 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: Thu, 07 Dec 2006 16:36:40 -0000 Dieter> > 000016 IP bsd.63743 > src.65001: . ack 52 win 65535 Dieter> > 000011 IP bsd.63743 > src.65001: . ack 53 win 112 <------ why does Dieter> > the window suddenly shrink? Chuck> I'd guess because both sides have requested that the connection Chuck> close That's probably the case. It just looked odd for the window size to suddenly shrink. Dieter> > The ack time is normally 12 or 13 microseconds, which seems to be Dieter> > okay. Dieter> > But 99.5 milliseconds is *way* too slow, data will be lost. Dieter> > Dieter> > Is TCP sitting around waiting for a second packet, so that Dieter> > it can be "efficient" and ack two packets at once? Chuck> Yup. Coalescing data before sending it results in less overhead. Dieter> > What can I do to fix this? Is there a knob I can turn to say Dieter> > "ack every packet", or "only wait xxx microseconds for a 2nd packet" ? Chuck> You can turn on TCP_NODELAY via setsockopt() to disable the Nagle Chuck> algorithm. There are probably sysctl's you can tweak, also... Bill> sysctl -d net.inet.tcp.delayed_ack Bill> net.inet.tcp.delayed_ack: Delay ACK to try and piggyback it onto a data packet Bill> Bill> That sysctl will turn it off for all network connections on the system. You Bill> can also set it on a per-socket basis using setsockopt and the TCP_NODELAY Bill> option. Some google searches on TCP_NODELAY will provide interesting Bill> technical details. That fixed one source of evil latency. Thanks!