2,714 views
3 votes
3 votes

Leaky Bucket Algorithm only allows just one packet per ticket irrespective of packet size.Why ???

1 Answer

Best answer
3 votes
3 votes

To actual understand this, you would need to understand the principal reason behind the use such algorithms.

Consider a network which has a sender and receiver and two routers.

Whenever packets is sent from A to B, the packets are queued at the router for the purpose of routing to the destination. Router takes finite amount of time to process ( i.e find out where to route) the packet. And then it is sent through appropriate interface (a port in a router). During normal circumstances, packets sent by A are processed by router(s) and sent to destination. 

Also, note that the size of these packets is decided by the network (MTU incase of Data Link, MSS in case of Transport) using different mechanisms (like setting DF=1 while sending IP packet to router, to know about size, or sending MSS while SYN in TCP). For Ethernet, MTU is 1500 bytes.

Now, imagine a situation where A is sending packets at a rate, larger than the rate at which router(s) can process. What would happen ? The packets would be queued at router(s). But, what if the rate increases even more ? The queue size is limited at routers (as they are not-so-powerful machines and usually have less memory). So they would discard the packets, as they don't have capacity to keep them. Such a situation is called congestion.

In order to avoid this, we have to control this. Please note, sending too many packets (like our case above) is one reason for congestion. So, to control the "rate" to sending of packets, we have two algorithms - Leaky Bucket and Token Bucket.

Leaky bucket streamlines the flow of packets, and send them at a constant rate, irrespective of rate at which the sender actually sends (puts them to bucket) them.

However, it has a disadvantage. Suppose I leaky bucket sends 5 packets / second. Sender did not transmit for 10 seconds. Now it wants to send 20 packets in a single second. It cannot do that.

Token bucket, offers advantage that sender can send extra packets in a given time, provided it has unused token(s).

So, now, you must have understood, that since these are used for congestion control and congestion (in our case) is dependent upon number of packets sent in network, so algorithm associates one packet with one token.
selected by

Related questions

0 votes
0 votes
2 answers
1
3 votes
3 votes
3 answers
2
Na462 asked Sep 15, 2018
2,093 views
1 votes
1 votes
0 answers
3
3 votes
3 votes
1 answer
4
LavTheRawkstar asked Apr 7, 2017
1,930 views
What happens in Token Bucket exactly and what happens in Leaky Bucket somebody please explain ?