From owner-freebsd-net@FreeBSD.ORG Fri Aug 6 08:56:38 2010 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E56CE1065673 for ; Fri, 6 Aug 2010 08:56:38 +0000 (UTC) (envelope-from andre@freebsd.org) Received: from c00l3r.networx.ch (c00l3r.networx.ch [62.48.2.2]) by mx1.freebsd.org (Postfix) with ESMTP id 36DE68FC1E for ; Fri, 6 Aug 2010 08:56:37 +0000 (UTC) Received: (qmail 27212 invoked from network); 6 Aug 2010 07:27:26 -0000 Received: from localhost (HELO [127.0.0.1]) ([127.0.0.1]) (envelope-sender ) by c00l3r.networx.ch (qmail-ldap-1.03) with SMTP for ; 6 Aug 2010 07:27:26 -0000 Message-ID: <4C5BCE48.5070504@freebsd.org> Date: Fri, 06 Aug 2010 10:56:40 +0200 From: Andre Oppermann User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.11) Gecko/20100711 Thunderbird/3.0.6 MIME-Version: 1.0 To: Maxim Dounin References: <20100512124702.GJ2679@rambler-co.ru> <20100713140051.GV99657@mdounin.ru> In-Reply-To: <20100713140051.GV99657@mdounin.ru> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-net@freebsd.org, Igor Sysoev Subject: Re: net.inet.tcp.slowstart_flightsize in 8-STABLE X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Aug 2010 08:56:39 -0000 On 13.07.2010 16:01, Maxim Dounin wrote: > Hello! > > On Wed, May 12, 2010 at 04:47:02PM +0400, Igor Sysoev wrote: > >> It seems that net.inet.tcp.slowstart_flightsize does not work in 8-STABLE. >> For a long time I used slowstart_flightsize=2 on FreeBSD 4, 6, and 7 hosts. >> However, FreeBSD-8 always starts with the single packet. >> I saw this on different versions of 8-STABLE since 8 Oct 2009 till >> 04 Apr 2010. > > Finally I had some time to look into it (sorry for long delay). > > 1. Slow start isn't used on recent FreeBSD versions for initial snd_cwnd > calculations as long as you have rfc3390 support switched on (default since > Jan 06 23:29:46 2004, at least in 7.*). It effectively sets initial > snd_cwnd to 3*MSS on common networks and shouldn't cause any problems. > Slowstart_flightsize only affects connection restarts. > > 2. Due to bug in syncache code (patch below) all accepted connections has > their snd_cwnd reset to 1*MSS (since r171639, 7.0+ AFAIR). > > 3. Support for rfc3465 introduced in r187289 uncovered (2) as > ACK to SYN/ACK no longer causes snd_cwnd increase by MSS (actually, this > increase shouldn't happen as it's explicitly forbidden by rfc 3390, but > it's another issue). Snd_cwnd remains really small (1*MSS + 1) and this > causes really bad interaction with delayed acks on other side. > > As a workaround to delayed acks interaction problems you may disable > rfc3465 by setting net.inet.tcp.rfc3465 to 0. Correct fix would be to apply > the patch below. > > To Andre Oppermann: could you please take a look at the patch and > commit it if found appropriate? I've committed your fix with svn r210666. In a few days I will MFC it back to the stable branches. Thanks for reporting the bug and a patch for it. -- Andre > # HG changeset patch > # User Maxim Dounin > # Date 1279028684 -14400 > # Node ID 93699203f408fa8e22c971769bde9c26bd14d410 > # Parent e2cf8c51a6294a0d09d5628d96c6ab3ab626957e > Fix cwnd resetting problem introduced in r171639. > > Sc_rxmits counts timer engagements, not actual retransmits, and value 1 > corresponds to no retransmits. Revert check to correct one as present > before r171639. > > diff --git a/netinet/tcp_syncache.c b/netinet/tcp_syncache.c > --- a/netinet/tcp_syncache.c > +++ b/netinet/tcp_syncache.c > @@ -804,8 +804,10 @@ syncache_socket(struct syncache *sc, str > > /* > * If the SYN,ACK was retransmitted, reset cwnd to 1 segment. > + * Note that sc_rxmits counts timer engagements, not actual > + * retransmits. > */ > - if (sc->sc_rxmits) > + if (sc->sc_rxmits> 1) > tp->snd_cwnd = tp->t_maxseg; > tcp_timer_activate(tp, TT_KEEP, tcp_keepinit); > > > Maxim Dounin > _______________________________________________ > freebsd-net@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-net > To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org" > >