Computer Networks · TEE · practice

Token-bucket waiting · 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 byte-token shaper has capacity 12000 bytes and refill rate 3000 bytes/s. It currently holds 4000 tokens. A 10000-byte packet arrives with no other waiting packets. Ignoring serialization time, when can it become eligible to send? [5 practice marks]

Answer

Given

B=12000; r=3000; initial tokens=4000; L=10000 bytes; L≤B.

To find

Token deficit and eligibility wait.

Formula and why

\Delta=\max(0,L-T),\quad t_{wait}=\Delta/rLaTeX: \Delta=\max(0,L-T),\quad t_{wait}=\Delta/r

Each byte needs one token. This is a shaper, so it waits for missing tokens; the packet fits within token capacity.

Step-by-step solution

Step 1. Count missing tokens

Δ=max(0,10000−4000)=6000.

Step 2. Divide by refill rate

Wait=6000/3000=2 s.

Step 3. Check tokens at eligibility

4000+3000×2=10000 tokens, at most capacity 12000. Sending consumes 10000, leaving 0.

Final answer: The packet is eligible after 2 s; physical transmission takes additional time.