34 votes 34 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 Computer Networks gatecse-2008 computer-networks token-bucket + – Kathleen asked Sep 12, 2014 • edited Jun 20, 2021 by Lakshman Bhaiya Kathleen 25.1k views answer comment Share Follow See all 10 Comments See all 10 10 Comments reply Show 7 previous comments Praddyumn commented Nov 16, 2021 reply Follow Share 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. 0 votes 0 votes Ray Tomlinson commented Aug 16, 2023 reply Follow Share THE ACTUAL CONCEPT used https://gateoverflow.in/481/gate-cse-2008-question-58?show=409187#a409187 0 votes 0 votes Akash 15 commented Jan 30 reply Follow Share $\frac{c+rt}{t}=10\;Mbps$ $\frac{16\;Mb+2\;Mbps\times t}{t}=10\;Mbps$ $16\;Mb+2\;Mbps\times t=10\;Mbps\times t$ $8\;Mbps\times t=16\;Mb$ $t=2\;sec$ 0 votes 0 votes Please log in or register to add a comment.
Best answer 48 votes 48 votes 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$ Vikrant Singh answered Nov 18, 2014 • edited Jun 20, 2021 by Lakshman Bhaiya Vikrant Singh comment Share Follow See all 8 Comments See all 8 8 Comments reply Show 5 previous comments PARTNER commented Oct 18, 2018 reply Follow Share Yes, it is not working now, unfortunately! 0 votes 0 votes dan31 commented Dec 5, 2018 reply Follow Share check this archived version- https://web.archive.org/web/20161109022643/webmuseum.mi.fh-offenburg.de/index.php?view=exh&src=8 6 votes 6 votes Aakash_ commented Dec 13, 2018 reply Follow Share working link for animation: https://mi-learning.mi.hs-offenburg.de/Webmuseum/Anim/8-trafficShaping/index.html 6 votes 6 votes Please log in or register to add a comment.
38 votes 38 votes TIME TOKEN IN BUCKET TOKEN SEND LEFT IN BUCKET First sec 16Mb+ 2Mb =18Mb 10Mb 8Mb next sec 8Mb+2Mb 10Mb 0Mb Hence for 2 seconds we can send the tokens at 10 Mbps. gari answered Aug 1, 2017 gari comment Share Follow See 1 comment See all 1 1 comment reply Itachi_Uchiha commented Feb 4, 2021 reply Follow Share Capacity of the bucket is mention is 16Mb, so how it can hold 18Mb token in 1st second? 0 votes 0 votes Please log in or register to add a comment.
20 votes 20 votes It's 'kind of' aptitude question: packets leaving bucket at 10Mbps && packets entering bucket at 2Mbps. So "actual rate" of bucket being empty is 10-2=8Mbps. so (capacity/transmission rate) = 16/8 =2seconds. amitatgateoverflow answered Jul 13, 2016 amitatgateoverflow comment Share Follow See 1 comment See all 1 1 comment reply Vgone commented Sep 3, 2020 reply Follow Share Why did you subtract 8 from 10 and please do interpret the question? 0 votes 0 votes Please log in or register to add a comment.
5 votes 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 aditi19 answered Nov 5, 2018 • edited Sep 29, 2019 by aditi19 aditi19 comment Share Follow See all 2 Comments See all 2 2 Comments reply `JEET commented Sep 29, 2019 reply Follow Share @aditi19 Good answer. Just correct the last second line. You missed to write 10 there . 0 votes 0 votes ayushsomani commented Oct 17, 2019 reply Follow Share @aditi19 @`JEET I think rate of adding tokens to bucket and rate of consuming tokens from bucket happens according to the capacity of Bucket (for example, it takes 1 sec to consume a token and 2 sec to add a token, then for every 2 sec - 2 tokens are used and 1 token is added). Correct me, if i am wrong. 0 votes 0 votes Please log in or register to add a comment.