Computer Networks · TEE · practice

Token-bucket waiting · example 1

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

Answer

Given

B=10000; r=2000; initial tokens=3000; L=7000 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,7000−3000)=4000.

Step 2. Divide by refill rate

Wait=4000/2000=2 s.

Step 3. Check tokens at eligibility

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

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