Professional Documents
Culture Documents
Leaky Bucket Algorithm
Leaky Bucket Algorithm
Congestion: It is a state occurs in the network layer when the message traffic is so heavy that
it slows down network response time.
Congestion control is a mechanism that controls the entry of data packets into the network.
Image I bucket with a hole and water is flowing from a tap at a variable rate, the water is
flowing drop by drop from the hole. In this scenario, no matter at what rate the water enters the
bucket, the outflow is constant. Once after the bucket is full, that water is spilled out and gets
wasted.
In the same way, no matter how the host is sending the packets, the bucket will outflow only
one packet at a time in a constant rate. When the congestion is there, what this leaky bucket
will do? It will holds the packets and sends no matter how many packets the sender is sending
but sends out the packet from the router one after the other in a regulated flow. So, a busty
traffic is converted into uniform traffic with the help of leaky bucket.
package leacky;
import java.util.Scanner;