# Token-bucket waiting · example 2

Subject: Computer Networks

Exam: TEE

Reader: https://deep-learning-study-room.vercel.app/cn/#tee/practice/congestion/token-wait-2

Canonical: https://deep-learning-study-room.vercel.app/read/cn/tee/practice/congestion--token-wait-2/

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

#### Answer

## Given

B=8000; r=1000; initial tokens=500; L=2500 bytes; L≤B.

## To find

Token deficit and eligibility wait.

## Formula and why



$$
\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,2500−500)=2000.

#### Step 2. Divide by refill rate

Wait=2000/1000=2 s.

#### Step 3. Check tokens at eligibility

500+1000×2=2500 tokens, at most capacity 8000. Sending consumes 2500, leaving 0.

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

#### What this result means

If L exceeds B and packets must be admitted atomically, merely waiting cannot make the packet eligible under this bucket configuration.
