Computer Networks · TEE · practice
Leaky-bucket timeline · example 3
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 20 fixed-size packets and drains at 5 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 |
|---|---|
| 0 | 10 |
| 1 | 18 |
| 4 | 6 |
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)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
| t | Arrive | Drained | Before | Admit | Drop | After |
|---|---|---|---|---|---|---|
| 0 | 10 | 0 | 0 | 10 | 0 | 10 |
| 1 | 18 | 5 | 5 | 15 | 3 | 20 |
| 4 | 6 | 15 | 5 | 6 | 0 | 11 |
Step 3. Sum the overflow
Total dropped=3 packets.
Step 4. Drain after the last arrival
Last event t=4; queue=11. Time needed=11/5=2.2 s; final empty time=6.2 s.
Final answer: 3 packets dropped; queue finally empty at t=6.2 s.