0
24kviews
What is traffic shaping? Explain leaky bucket algorithm and compare it with token bucket algorithm.
1 Answer
4
1.3kviews

• Traffic shaping (also referred to as packet shaping) is the technique of delaying and restricting certain packets traveling through a network to increase the performance of packets that have been given priority.

• Classes are defined to separate the packets into groupings so that they can each be shaped separately allowing some classes to pass through a network more freely than others. Traffic shapers are usually placed at the boundaries of a network to either shape the traffic going entering or leaving a network.

• Traffic shaping is a mechanism to control the amount and rate of the traffic sent to the network. The two traffic shaping techniques are:

i. Leaky Bucket Algorithm

• Leaky bucket is a bucket with a hole at bottom. Flow of the water from bucket is at a constant rate which is independent of water entering the bucket. If bucket is full, any additional water entering in the bucket is thrown out.

enter image description here

• Same technique is applied to control congestion in network traffic.Every host in the network is having a buffer with finite queue length

• Packets which are put in the buffer is full are thrown away.The buffer may drain onto the subnet either by some number of packets per unit time,or by some total number of bytes per unit time.

• A FIFO queue is used for holding the packets.

• If the arriving packets are of fixed size,then the process removes a fixed number of packets from the queue at each tick of the clock.

• If the arriving packets are of different size,then the fixed output rate will not be based on the number of departing packets.

• Instead it will be based on the number of departing bytes or bits.

Comparison Of Token Bucket and Leaky Bucket Algorithm:

Token Bucket Leaky Bucket
Token dependent Token independent
If bucket is full token are discarded,but not the packet. If bucket is full packet or data is discarded
Packets can only transmitted when there are enough token Packets are transmitted continuously
It allows large bursts to be sent faster rate after that constant rate. It sends the packet at constant rate.
It saves token to send large bursts It does not save token.
Token Bucket does not have discard or priority policy Leaky Bucket has priority policy
Burstiness is bounded as follows:- Flow never sends more than $β+T*ρ$ tokens worth of data in interval τ and - Long-term transmission rate will not exceed ρ Flow never sends faster than ρ worth of packets per second
Please log in to add an answer.