The GATE Grind

GATE 2016 CS (CS1) – Question 64

Computer Networks · TCP: Flow Control, Congestion Control, Socket API · 2 marks · Numerical answer

For a host machine that uses the token bucket algorithm for congestion control, the token bucket has a capacity of 1 megabyte and the maximum output rate is 20 megabytes per second. Tokens arrive at a rate to sustain output at a rate of 10 megabytes per second. The token bucket is currently full and the machine needs to send 12 megabytes of data. The minimum time required to transmit the data is ________ seconds.

Practise this question in The GATE Grind →

Show answer and explanation

Correct answer: 1.09 to 1.11

Explanation

Capacity (bucket) $=1$ MB, maximum output rate $=20$ MB/s, token arrival rate $=10$ MB/s. The bucket is full and 12 MB must be sent.

**Phase 1: burst.** While sending at 20 MB/s, tokens are used at 20 MB/s and replenished at 10 MB/s, so the bucket drains at $20-10=10$ MB/s. A full bucket of 1 MB lasts $\dfrac{1}{10}=0.1$ s. In that time the machine sends $20\times0.1=2$ MB.

**Phase 2: sustained rate.** After the bucket is empty, the machine can only send as fast as tokens arrive, 10 MB/s. The remaining $12-2=10$ MB takes $\dfrac{10}{10}=1$ s.

$$\text{Total time}=0.1+1=\mathbf{1.1}\text{ s}.$$

More TCP: Flow Control, Congestion Control, Socket API questions

All TCP: Flow Control, Congestion Control, Socket API questions →