[Subject Prev][Subject Next][Thread Prev][Thread Next][Subject Index][Thread Index]

Quick Randomizing Algorithm.



Hi list,

Here's where the question fits :
- we are testing DoS attacks on DiffServ flows.
- we have built a kernel module that drops, remarks DSCP etc on a
compromised router in a DiffServ domain

What I need : (I know this is not linux specific - sorry!)
- a _very_ quick way of randomizing. We need to _randomly_ attack only a
specified percentage of packets in a flow. I have tried the 'Quick and
Dirty RN Generator' from 'Numerical 	Recipes in C' (pp. 283,
http://www.ulib.org/webRoot/Books/Numerical_Recipes/bookcpdf.html). like
-

/* rand is the random float between 0 and 1 generated from that
technique, specified is the integer % of packets to be attacked */
if (rand <= (float)specified/100.0) {/* attack */} 

That turned out to be quick but not random enough. 

Since this number will be generated inside the kernel for every packet,
I would want it to be as fast as possible. At the same time, I also want
the probability distribution to be very very uniform over 0.0-1.0 ->
that being the first priority/requirement. There are many algorithms
around, which would you recommend? Code/URL would make my life easier!

Thanks and bye,
Vinay.

-- 
-----------------------------------------------------------------------
Mr. Mahadik, Vinay A.
Graduate Student - Electrical & Computer Engineering Department, NCSU.
Major - Computer Network Engineering.

Home	: 1701/1 Crest Rd., Raleigh, NC 27606 (919)8388325
Office	: Suite 2300, Research IV, Centennial Campus, NCSU (919)5159677
Email	: vamahadi@xxxxxxxxxxxx
URL	: http://hickory.csc.ncsu.edu/
-----------------------------------------------------------------------