/    /  CDCS – Leaky Bucket vs Token Bucket algorithm

Leaky Bucket vs Token Bucket algorithm

 

What is Leaky Bucket Algorithm?

It is a traffic shaping algorithm that helps reduce traffic congestion by ensuring a smooth flow of traffic. 

 

What is Token Bucket Algorithm?

The token bucket algorithm is used in packet-switched and computer networks to ensure that data transmission in packets does not cross its bandwidth. 

 

Differences between Leaky Bucket Algorithm and Token Bucket Algorithm

 

Leaky Bucket AlgorithmToken Bucket Algorithm
The packets are thrown into the bucket.It holds packets generated at regular intervals of time.
The bucket leaks at a constant rate.It has a maximum capacity.
The output comes at a finite rate.The packet cannot be sent if there are no tokens in the bucket.
It converts bursty traffic into uniform traffic.When there is a ready packet, a token is removed and the packet is sent. 

 

Reference

Leaky Bucket vs Token Bucket algorithm