Leaky Bucket Traffic Shaping

* The algorithm is used to control the rate at which data is injected into a network,
smoothing out "burstiness" in the data rate.
* A leaky bucket provides a mechanism by which bursty traffic can be shaped to
present a steady stream of traffic to the network, as opposed to traffic with erratic
bursts of low-volume and high-volume flows.
* A leaky bucket interface is connected between a packet transmitter and the network
* No matter at which rate the packets enter the traffic shaper, the outflow is
regulated as a constant rate.
* When a packet arrives, the interface decides whether that packet should be queued or discarded, depending on the capacity of the buffer.
* Incoming packets are discarded once the bucket becomes full.
* This method directly restricts the maximum size of burst coming into the system.
* Packets are transmitted as either fixed-size packets or variable-size packets.

* Leaky bucket scheme is modeled by two main buffers, one buffer forms a queue of incoming packets and other one receives authorizations.

Figure:. The leaky-bucket traffic-shaping algorithm
Figure: Queueing model of leaky-bucket traffic-shaping algorithm
Leaky-bucket traffic-shaper algorithm is summarized as follows.
Begin leaky-Bucket Algorithm
1. define for the algorithm
= rate at which packets with irregular rate arrive at the main buffer
g = rate at which authorization grants at the grant buffer
w = size of the grant buffer and can be dynamically adjusted
2. Every 1/g seconds, a grant arrives.
3. Over each period of 1/g seconds, i grants can be assigned to the first i incoming
packets, where i< = w, and packets exit from the queue one at a time every 1/g seconds, totaling i/g seconds.
4. If more than w packets are in the main buffer, only the first w packets are assigned grants at each window time of 1/g, and the rest remain in the main queue to be examined in the next 1/g interval.
5. If no grant is in the grant buffer, packets start to be queued.

0 comments