random function ?

Eddie Kohler kohler at icir.org
Thu Jun 26 23:18:31 EDT 2003


Shilpi,

> I have a small query. What kind of random function is being used in click, and 
> what is the range of the values being returned by function random();

You can see kernel Click's random() function in the include/click/glue.hh
header. It is not a terribly strong random function; at heart, it's a
simple multiplicative congruential generator, r_i = (c * r_{i-1}) mod 2^32,
where c = 69069L. The constant 69069 is actually common for this kind of
generator. Then we xor the result with the value of 'jiffies'. So the range
of values is 0..(2^32 - 1).

Eddi
e




More information about the click mailing list