The 'Token bucket' algorithm is commonly used for doing rate limiting of packets in routers.The concept is real simple - A bucket is filled periodically with some tokens equal to the 'Allowed packet rate', each arriving packet consumes available tokens and passes through the bucket. If an arriving packet doesn't find any tokens available when it reaches the router, then obviously the packet rate has exceeded the allowed rate and it has to be dropped. Now, this is real simple. One alteration to this simple scheme is to add 'Burst handling' ability. This is very easily done by setting the 'Bucket size' to some value higher than the packet rate. So, if say 10000 bytes per second is the rate allowed, then if you make the bucket size as 30000, then the tokens can accumulate to 30000 tokens, when the arrival rate is lesser than 10K and these accumulated tokens allow 'Bursts' of up to 30KBps.
Sunday, April 12, 2009
Subscribe to:
Post Comments (Atom)
thanx...!
ReplyDeleteNice. Thanks.
ReplyDelete