From owner-freebsd-net@FreeBSD.ORG Wed Dec 29 13:09:53 2004 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B52D416A4CE for ; Wed, 29 Dec 2004 13:09:53 +0000 (GMT) Received: from mp2.macomnet.net (mp2.macomnet.net [195.128.64.6]) by mx1.FreeBSD.org (Postfix) with ESMTP id E78AB43D31 for ; Wed, 29 Dec 2004 13:09:52 +0000 (GMT) (envelope-from maxim@FreeBSD.org) Received-SPF: pass (mp2.macomnet.net: domain of maxim@FreeBSD.org designates 127.0.0.1 as permitted sender) receiver=mp2.macomnet.net; client_ip=127.0.0.1; envelope-from=maxim@FreeBSD.org; Received: from localhost (localhost [127.0.0.1]) by mp2.macomnet.net (8.12.11/8.12.11) with ESMTP id iBTD9oGW075360; Wed, 29 Dec 2004 16:09:50 +0300 (MSK) (envelope-from maxim@FreeBSD.org) Date: Wed, 29 Dec 2004 16:09:50 +0300 (MSK) From: Maxim Konovalov To: Mike Silbersack In-Reply-To: <20041229025718.U26249@odysseus.silby.com> Message-ID: <20041229155419.I74642@mp2.macomnet.net> References: <20041218033226.L28788@odysseus.silby.com> <20041229025718.U26249@odysseus.silby.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-SpamTest-Info: Profile: Formal (188/041227) X-SpamTest-Info: Profile: Detect Hard (4/030526) X-SpamTest-Info: Profile: SysLog X-SpamTest-Info: Profile: Marking - Keywords (2/030321) X-SpamTest-Status: Not detected X-SpamTest-Version: SMTP-Filter Version 2.0.0 [0124], SpamtestISP/Release cc: net@FreeBSD.org Subject: Re: Update: Alternate port randomization approaches X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Dec 2004 13:09:53 -0000 On Wed, 29 Dec 2004, 03:02-0600, Mike Silbersack wrote: > On Sat, 18 Dec 2004, Mike Silbersack wrote: > > > There have been a few reports by users of front end web proxies and other > > systems under FreeBSD that port randomization causes them problems under > > load. This seems to be due to a combination of port randomization and > > rapid connections to the same host causing ports to be recycled before > > the ISN has advanced past the end of the previous connection, thereby > > causing the TIME_WAIT socket on the receiving end to ignore the new SYN. > > Based on testing done by Igor Sysoev, I've found that my original patch is > insufficient; even as little as one randomizaion per second can cause problems > for some users. As a result, I've created the attached patch (versions for > both 6.x and 4.x are included). It implements a relatively simple algorithm: > Port randomization is turned disable once the connection rate goes above 20 > connections per second, and it is not reenabled until the connection rate > falls below 20 cps for 5 seconds straight. > > This appears to work for Igor, and it seems safe enough to commit before > 4.11-RC2. But, if possible, I'd like a few more sets of eyes to doublecheck > the concept and code; please take a look at it if you have a chance. Again, it's not clear for me why we don't follow our usual deveplopment cycle here: commit & test in HEAD and then MFC to STABLE? -- Maxim Konovalov