Hi all!

Can you give me some guideline about how and where
netrand ... influences an action in the tc sources?

(I've also tried LARTC mailing list, but did not get
 any response)

When I last checked, iproute2 sources had a tc gact
module with 2 statistical netrand methods:

 - random
 - determ

and both are followed by an integer, saying what to do
with every n-th packet (if I get it right from docs
and tc filter show)

Problem is, I would need % of packets to do actions
on, not on every n-th. This limits me to
50,33,25,20,... etc % ratios, because I cannot write
for. ex. 

action drop random determ 1.23 ok

So, basically I believe I would need something like
this in pseudo:

for every packet
    if(rand()<(percent/100))
         do_action

,where rand() gives a float of 0..1

Or if doing a rand() for every packet is costy,
then I could decrease granularity by 2 or 5, etc.
Still,I would get the ratio.

I delved into the sources, but was unable to find
where 
this conditional (for every n-th packet) tc action
execution occurs.

(If anyone is interested, I need this for a  protocol
that uses a strange congestion signaling method to let
intra-domain nodes notify edges, based on packet ratio
having different DSCP. The name is RMD-QoS-NSLP)

PS:
I've tried to do something a bit complex with existing
stuff, but it limits me to about 4% accuracy, even
with 4 subqueues, and inverted sorting.
If interested, I can send some scripts.

Thanks in advance,

Ferenc


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to