Re: [Zcip] embeddable zeroconf/ip code

David Brownell <[email protected]> Mon, 18 Oct 2004 13:17:12 -0700
Newsgroups gmane.network.zeroconf.workers
Message-ID <[email protected]>
On Monday 18 October 2004 12:57 pm, H. Peter Anvin wrote:

> > I don't think "same" PRNG matters anywhere near as much as having
> > any single machine have a repeatable/reproducible first guess.  Why
> > should it matter if different PRNGs are used to guess?  Though it would
> > be nice to be able to use all 48 bits of etheraddr in the seed ... ;)
> > 
> 
> Yes, seed48() is the right function, not srand48() as I mistakenly said.
> 
> It does matter 

I still don't see it...

> for the PRNGs because of the "P" part -- we're not using them  
> as RNGs but as a hash sequence generator indexed based on the MAC.

Right, but that doesn't matter.  (And do all the Windows an MacOS
machines all use the same PRNG sequences?  I suspect not... so
it "must not" matter whether Linux ones use that.)

Consider:  Machine A uses srandom(), B uses seed48().  Each uses
a different seed.  What we care about is that the random host number
they get next -- random() or lrand48(), modulo (2^16 - 512) - not
collide "too much" with each other or machines C, D, E, etc.  We
know that some collisions are guaranteed in larger networks given
that small address space; OK, we'll recover from collisions.

You're talking about a different property:  that when both use the
same seed and seed API, a collision is guaranteed.  That can
be guaranteed with seed48() because it's fully specified, but not
with srandom() since that PRNG's math isn't fully specified.

Or am I missing something?  The only real issue I can see here
with PRNG is ensuring the sequences repeat no sooner than every
2^16 - 512 samples.

- Dave


-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl