From owner-freebsd-net@FreeBSD.ORG Wed Jun 2 08:11:04 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 F162316A4CE; Wed, 2 Jun 2004 08:11:04 -0700 (PDT) Received: from pit.databus.com (p70-227.acedsl.com [66.114.70.227]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6F6AB43D4C; Wed, 2 Jun 2004 08:11:04 -0700 (PDT) (envelope-from barney@pit.databus.com) Received: from pit.databus.com (localhost [127.0.0.1]) by pit.databus.com (8.12.11/8.12.11) with ESMTP id i52FAvYA040516; Wed, 2 Jun 2004 11:10:57 -0400 (EDT) (envelope-from barney@pit.databus.com) Received: (from barney@localhost) by pit.databus.com (8.12.11/8.12.11/Submit) id i52FAvW3040515; Wed, 2 Jun 2004 11:10:57 -0400 (EDT) (envelope-from barney) Date: Wed, 2 Jun 2004 11:10:57 -0400 From: Barney Wolff To: Andre Oppermann Message-ID: <20040602151057.GA39564@pit.databus.com> References: <20040602093940.N99493@atlantis.atlantis.dp.ua> <40BDAEEF.2AECC3F0@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <40BDAEEF.2AECC3F0@freebsd.org> User-Agent: Mutt/1.5.6i X-Scanned-By: MIMEDefang 2.43 cc: Dmitry Pryanishnikov cc: freebsd-net@freebsd.org Subject: Re: net.inet.ip.portrange.randomized=1 hurts 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, 02 Jun 2004 15:11:05 -0000 On Wed, Jun 02, 2004 at 12:41:51PM +0200, Andre Oppermann wrote: > > have 16383 non-repeated port numbers before the first repeat). > > The random generator indeed works badly. If it was truely random it > should generate a collision only every (1/range) on average. Maybe > the arc4random function reuses the same or small number of initial vectors > all over again leading to the same small set of 'randomized' ports. I believe you're seeing the birthday paradox at work, and the expected number before collision is sqrt(N), not N. Is the problem that the two systems have different ideas of MSL? -- Barney Wolff http://www.databus.com/bwresume.pdf I'm available by contract or FT, in the NYC metro area or via the 'Net.