The Gateway to Computer Science Excellence

+26 votes

Best answer

700B Capacity of bucket which is initially filled.

Tokean Arrival Rate = 200 Bytes/Sec

Max Output Rate= 300 Bytes

Time to transmit 3000 Bytes?

Bursty Traffic Time =

**C + P*S = M*S** (C=Bucket Capacity, P=Token Generating Rate, S=Bursty Time, M=Output Rate)

700 + 200*S = 300*S

S = 700/100 = 7 Seconds

For 7 seconds system will generate tokens at full speed of 300 Bytes/Sec, and after that it will switch to 200Bytes/Sec.

In 7 seconds at the speed of 300 Bytes/Sec, 2100 Bytes have been sent and left 900 bytes will be sent at the speed of

200 Bytes/sec which requires further 4.5 seconds.

So, Total time to send 3000 Bytes, it will take 7 + 4.5 = 11.5 Seconds

+1

This is the main difference between** leaky bucket** and **token bucket**. Token bucket algorithm allows idle hosts to accumulate while leaky bucket doesn't.

I mean to say here that, when host was idle and not sending data that time 700 bytes were filled in bucket so token bucket will take care of this data, later it will switch to normal and constant rate.

0

0

"shouldn't the data be output as 300 Bps as it is the output rate" then what is the use of token bucket?

0

@Manu Thankur bro from what i undertsood the maximum output rate is the rate at which u can transfer at maximum and is set as per network the rate initially say for 2seconds is 700+200*2=1100/2 =550 bytes/sec but due to network limitation of max out put rate of 300 bytes/sec we can send only 300 bytes/sec rate and immedeatly the rate doesnt come down to 200 bytes/sec after 7 seconds it takes time infinite amount of time

Lt t---->infinity (C+R*t)/t = R (input rate of tokens )

i think it is better to use this approach initially 700 bytes can be transmitted at time t=0 itself and for remaining 2300 bytes it takes 2300/200 =11.5 seconds so total 11.5 seconds just check this and correct me if i am wrong

Lt t---->infinity (C+R*t)/t = R (input rate of tokens )

i think it is better to use this approach initially 700 bytes can be transmitted at time t=0 itself and for remaining 2300 bytes it takes 2300/200 =11.5 seconds so total 11.5 seconds just check this and correct me if i am wrong

0

@Nandkishor3939 @Venkat Sai @Manu Thakur

Can you please tell why token generation rate is taken as $300 Bps$, In question it has been given that token generation rate is 200 $BPS$ and from buket output data can go with a rate of $300Bps$.

As shown in the figure, $r$ tokens/sec is the token generation rate which is $200 Bps$ and Remove token rate is $300Bps$

+1

For, the first 7 sec the bucket will be full of tokens.So, it will pump the data at the max O/p rate i.e. 300Bps.

After this 7 sec the tokens will get totally consumed so thenafter the o/p rate will equal to the Token Generation Rate i.e. 200Bps.

{ The Token generation rate is not 300Bps it is 200Bps...but for the first 7 sec (to calculate this time i.e. how long the transmission will be at max o/p rate, we apply the formula ) the data is transmitted at the max o/p rate , that's it :) }

Hope This Helped ...

After this 7 sec the tokens will get totally consumed so thenafter the o/p rate will equal to the Token Generation Rate i.e. 200Bps.

{ The Token generation rate is not 300Bps it is 200Bps...but for the first 7 sec (to calculate this time i.e. how long the transmission will be at max o/p rate, we apply the formula ) the data is transmitted at the max o/p rate , that's it :) }

Hope This Helped ...

- All categories
- General Aptitude 1.9k
- Engineering Mathematics 7.5k
- Digital Logic 2.9k
- Programming and DS 4.9k
- Algorithms 4.4k
- Theory of Computation 6.2k
- Compiler Design 2.1k
- Databases 4.1k
- CO and Architecture 3.4k
- Computer Networks 4.2k
- Non GATE 1.4k
- Others 1.4k
- Admissions 595
- Exam Queries 573
- Tier 1 Placement Questions 23
- Job Queries 72
- Projects 18

50,737 questions

57,299 answers

198,277 comments

104,990 users