Computer Networks · TEE · practice

Leaky-bucket timeline · example 2

Unit 5 · Congestion control and QoS · optional practice

Optional extension · no matching calculation in the two supplied papers

Optional worked extension. This calculation format was not found in the supplied December 2025 final or February 2026 re-exam. The numbers and practice marks are authored. Study the core concept and actual-paper questions first; this is extra explanation, not a TEE prediction.

Practice question. A leaky-bucket data queue holds 12 fixed-size packets and drains at 3 packets/s whenever nonempty. It starts empty. Arrivals are instantaneous at the given times; drain between events, then admit arrivals. Find overflow and final empty time. [7 practice marks]

Answer

Given

Time (s)Arrival packets
012
17
34

To find

Queue after each burst, dropped packets and time the queue finally empties.

Formula and why

q_{before}=\max(0,q_{previous}-r\Delta t)LaTeX: q_{before}=\max(0,q_{previous}-r\Delta t)
a_{accepted}=\min(a,B-q_{before})LaTeX: a_{accepted}=\min(a,B-q_{before})

This explicit event order separates elapsed-time service from instantaneous admission.

Step-by-step solution

Step 1. Start with an empty queue

q=0 at t=0 before the first arrival; no negative-time service.

Step 2. Apply service then admission at each event

tArriveDrainedBeforeAdmitDropAfter
0120012012
17393412
34664010

Step 3. Sum the overflow

Total dropped=4 packets.

Step 4. Drain after the last arrival

Last event t=3; queue=10. Time needed=10/3=3.33333 s; final empty time=6.33333 s.

Final answer: 4 packets dropped; queue finally empty at t=6.33333 s.