Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 2 Jun 2004 11:10:57 -0400
From:      Barney Wolff <barney@databus.com>
To:        Andre Oppermann <andre@freebsd.org>
Cc:        freebsd-net@freebsd.org
Subject:   Re: net.inet.ip.portrange.randomized=1 hurts
Message-ID:  <20040602151057.GA39564@pit.databus.com>
In-Reply-To: <40BDAEEF.2AECC3F0@freebsd.org>
References:  <20040602093940.N99493@atlantis.atlantis.dp.ua> <40BDAEEF.2AECC3F0@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040602151057.GA39564>