Congestion Control in Computer Networks
Attention reader! Don’t stop learning now. Get hold of all the important CS Theory concepts for SDE interviews with the CS Theory Course at a student-friendly price and become industry ready.
Ways in which token bucket is superior to leaky bucket:
The leaky bucket algorithm controls the rate at which the packets are introduced in the network, but it is very conservative in nature. Some flexibility is introduced in the token bucket algorithm. In the token bucket, algorithm tokens are generated at each tick (up to a certain limit). For an incoming packet to be transmitted, it must capture a token and the transmission takes place at the same rate. Hence some of the busty packets are transmitted at the same rate if tokens are available and thus introduce some amount of flexibility in the system.
Formula: M * s = C + ρ * s
where S – is the time taken
M – Maximum output rate
ρ – Token arrival rate
C – Capacity of the token bucket in byte
Link to question on leaky bucket algorithm: https://www.geeksforgeeks.org/computer-networks-set-8/
This article is contributed by Vikash Kumar. Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above


