Index: A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Home > Token bucket
Token Bucket (TB) Algorithm
- Though the token bucket algorithm has several uses, the algorithm is best understood in
the context of network traffic shaping or rate limiting
- It has a bucket with a valve at the bottom. The valve is opened
whenever any packet arrives.
- A token is added to the bucket every sec.
- The bucket can hold at the most b tokens.
- If a token arrives when the bucket is full, the token is
discarded.
- One token permits one byte of data to be transmitted
- When a packet (network layer PDU) of n bytes arrive, n tokens
are removed from the bucket, and the packet is sent to the
network.
- If less than n tokens available, the packet is dropped.
- A token bucket allows bursts of up to b bytes, but over the
long run output is limited to the constant rate, .
Sometimes the leaky bucket and token bucket algorithms are
lumped together under the same name.
1 See also
2 External links
Read more »