Question: Token Bucket Algorithm Figure 2 shows the token bucket algorithm. Assume that the arriving packets have a variable size and the queue has a finite

 Token Bucket Algorithm Figure 2 shows the token bucket algorithm. Assume

Token Bucket Algorithm Figure 2 shows the token bucket algorithm. Assume that the arriving packets have a variable size and the queue has a finite buffer. At each clock tick, the program randomly selects the number of arriving packets and the size of each packet, and using the token bucket algorithm, the program tries to send the packets out of the queue. Tokens added at the rate of r per tick. tokens are discarded if bucket is full. Bucket capaciy is c tokens One token removed and discarded per byte transmitted Quiete is fully No Arrival Processor Departure Yes Discard Figure 2: Token bucket algorithm Queue The following is the token bucket algorithm for variable-length packets: 1. Add tokens to the bucket at the rate of r tokens per tick (token rate). 2. For a packet of n bytes, a. if at least n tokens are available, send the packet and remove n tokens from the bucket. b. if fewer than n tokens are available, hold the packet until sufficient tokens are available. 3. Go to step 1. The program inputs are the number of clock ticks for simulation, the maximum packet arrival rate (maximum number of arriving packets at each tick), the maximum packet size (in bytes), the size of the queue (in bytes), the token rate (number of tokens added at each tick), and the bucket capacity (maximum number of tokens in the bucket). Assume the number of ticks for simulation is fixed to 15

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!