Computer Networks · TEE · mocks

Q7B · Traffic-shaping algorithm

TEE mock B · full paper

TEE · 100 attempted marks · solutions for every choice · current syllabus 702AI0C023

TEE practice mock · Q7B. Draw and explain the leaky-bucket algorithm. Is it always better than a token bucket? [10 mock marks]

Answer

In the textbook leaky-bucket queue/shaper model, arriving packets enter a finite buffer. The output sends at a configured rate whenever data is queued. When the queue empties, it cannot send nonexistent packets; when the buffer is full, excess arrivals are dropped in this finite-buffer model.

Swipe across the diagram to read its labels ↔
Leaky-bucket data queue
Diagram: Leaky-bucket data queue. Labels: Leaky-bucket data queue | Leaky-bucket data queue | Bursty arrivals enter finite buffer B | Accept packets that fit; the stated queue model drops overflow. | Queue drains at configured rate r | Send while data exists. An empty queue produces no packets. | Smoother departure stream | Buffering adds delay; idle service cannot be saved for a later burst.
Finite data buffer smooths a burst into a bounded departure rate.
  1. Choose buffer capacity B and output service rate r in consistent units.
  2. Admit arrivals that fit. Drop/mark overflow according to the stated implementation; this queue example drops the excess.
  3. Drain at rate r while the queue is nonempty. Idle time does not accumulate permission for a later faster burst.
  4. The result is smoothed output. Larger buffers accommodate larger bursts but can increase waiting delay.
AdvantageLimitation
Simple bound on output rateBursts may overflow or suffer delay
Reduces short-term output variationUnused idle service cannot be saved
Useful for predictable traffic shapingNo end-to-end delay/loss guarantee by itself

The term “leaky bucket” can also describe a conformance meter in standards. This course’s diagrams and numerical questions explicitly use the finite data-queue model, so its state is queued data rather than tokens.

No algorithm is universally better. The leaky data-queue model is useful for a smooth output profile; token bucket is preferable when controlled bursts should be allowed. State the application’s delay, burst and rate needs before recommending one.