Dark Mode

14,461 views

31 votes

A computer on a $10\text{Mbps}$ network is regulated by a token bucket. The token bucket is filled at a rate of $2\text{Mbps}$. It is initially filled to capacity with $16\text{Megabits}$. What is the maximum duration for which the computer can transmit at the full $10\text{Mbps}$?

- $1.6$ seconds
- $2$ seconds
- $5$ seconds
- $8$ seconds

12

I had the same confusion but here is the explanation:

Intuitively speaking, at t = 1 sec , you have 8 Mb of tokens in the bucket, so either you can fill 2 Mb into the bucket and then transmit 10 Mb of full capacity or else transmit 8 Mb which is not the full capacity.

But the first choice is made, the reason being that the the bucket is not full currently, you want to transmit at full capacity and currently you have 2 Mb less than the full capacity and hence you will prefer to first fill the bucket completely and then transmit. Hence 2 Mb is first put in which takes 1 second and then at t = 2 sec, you transmit the complete 10 Mb.

Intuitively speaking, at t = 1 sec , you have 8 Mb of tokens in the bucket, so either you can fill 2 Mb into the bucket and then transmit 10 Mb of full capacity or else transmit 8 Mb which is not the full capacity.

But the first choice is made, the reason being that the the bucket is not full currently, you want to transmit at full capacity and currently you have 2 Mb less than the full capacity and hence you will prefer to first fill the bucket completely and then transmit. Hence 2 Mb is first put in which takes 1 second and then at t = 2 sec, you transmit the complete 10 Mb.

0

47 votes

Best answer

New tokens are added at the rate of $r$ bits/sec which is $2\;\text{Mbps}$ in the given question.

Capacity of the token bucket $(b) = 16\;\text{Mbits}$

Maximum possible transmission rate $(M) = 10\;\text{Mbps}$

So, the maximum burst time $= b/(M-r) = 16/(10-2) = 2 \;\text{seconds}$

Here is the animation for token bucket hope this will help us to understand the concept.

Correct Answer: $B$

check this archived version-

https://web.archive.org/web/20161109022643/webmuseum.mi.fh-offenburg.de/index.php?view=exh&src=8

6

working link for animation: https://mi-learning.mi.hs-offenburg.de/Webmuseum/Anim/8-trafficShaping/index.html

6

5 votes

- I/P rate of tokens=2 Mega bps. 2 Megabits tokens come 1 sec
- O/P rate of tokens=10 Mega bps. 10 Megabits tokens comes out in 1 sec
- Capacity of the bucket=16 megabits
- At t=0, bucket=16 Megabits
- At t=1, 10 Megabits tokens comes out(as it is filled so first tokens have to pulled out then it will be filled), 2 Megabits tokens come in, (16-10+2)=8 Megabits tokens. At t=1 bucket has 8 Megabits tokens
- At t=2, bucket has 8 Megabits tokens(it is not full no first tokens will come in then pulled out), 2 Megabits tokens comes in, bucket=8+2=10 Megabits. 10 Megabits tokens will come out. Now bucket has 0 Megabits tokens
- At t=3, bucket has 0 tokens, 2 Megabits tokens comes in and 2 Megabits tokens goes out. So here tokens are send at the rate of 2 Mega bps and this will continue
- In t=1 sec 10 Megabits tokens comes out
- At t=2, 10 Megabits tokens come out
- So till 2 sec we're able to send tokens at 10 Mega bps