What is Congestion Control Algorithm?

Congestion control is a critical mechanism in computer networks that prevents network performance degradation when too many packets traverse the communication medium. When the number of packets exceeds the network's capacity, delays increase significantly beyond normal propagation delays, creating a congested state.

There are two primary congestion control algorithms used in network traffic management:

Leaky Bucket Algorithm

The leaky bucket algorithm is a traffic shaping technique that controls the rate at which data is injected into a network. It smooths bursty traffic into a steady stream by enforcing a constant output rate regardless of input variations.

Leaky Bucket Algorithm Bursty Input Bucket (b bytes) Constant rate (r bytes/sec) ? Bucket capacity: b bytes ? Leak rate: r bytes/second ? Overflow packets: dropped ? Output: smooth, constant

How It Works

The algorithm models a bucket with capacity b bytes and a hole at the bottom that leaks at a constant rate of r bytes per second. When packets arrive:

  • If packet size ? available bucket space, the packet is accepted

  • If packet size > available space, it is either dropped or queued

  • Output flows at constant rate r when bucket contains data, zero when empty

Disadvantage: The fixed leak rate leads to inefficient use of network resources during low-traffic periods, as available bandwidth remains unused.

Token Bucket Algorithm

The token bucket algorithm provides more flexibility than the leaky bucket by allowing controlled bursts while maintaining average rate limits. It uses tokens to grant transmission permission for packets.

Token Bucket Algorithm Token Generator (1 token per 1/r sec) Token Bucket (b tokens) T T T T Packet (n bytes) Conformant packet Process: n tokens removed for n-byte packet If tokens < n: packet dropped or marked non-conformant

How It Works

Tokens are added to the bucket at rate 1/r seconds per token, up to bucket capacity b tokens. For packet transmission:

  • Each token represents permission to send a predetermined packet size

  • For an n-byte packet, n tokens are consumed from the bucket

  • If sufficient tokens exist, the packet is transmitted (conformant)

  • If insufficient tokens, the packet is dropped, queued, or marked non-conformant

Advantage: Allows burst transmission up to bucket capacity while maintaining average rate control, providing better network resource utilization.

Comparison

Feature Leaky Bucket Token Bucket
Output Rate Fixed constant rate Variable up to peak rate
Burst Handling Smooths all bursts Allows controlled bursts
Resource Utilization Poor during low traffic Better overall utilization
Flexibility Rigid More flexible

Conclusion

Congestion control algorithms like leaky bucket and token bucket are essential for managing network traffic flow. While leaky bucket provides smooth, constant output, token bucket offers better flexibility and resource utilization by allowing controlled bursts.

Updated on: 2026-03-16T23:36:12+05:30

66K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements