Congestion Control
Congestion Control
Traffic Shaping
• It is a method of congestion control by providing shape to data flow before entering the
packet into the network.
• At connection set-up time, the sender and carrier negotiate a traffic pattern (shape)
• In this algorithm the input rate can vary but the output rate remains constant.
• This algorithm saves busty traffic into fixed rate traffic by averaging the data rate.
4
(a) A leaky bucket with water. (b) a leaky bucket with packets.
5
Algorithm
Step - 2 : If n is greater than the size of packet in the front of queue send the packet into the network and
decrement the counter by size of packet. Repeat the step until n is less than the size of packet.
• The Token Bucket Algorithm compare to Leaky Bucket Algorithm allow the output rate vary
depending on the size of burst.
• In this algorithm the buckets holds token to transmit a packet, the host must capture and destroy
one token.
• Tokens are generated by a clock at the rate of one token every t sec.
• Idle hosts can capture and save up tokens (up to the max. size of the bucket) in order to send
larger bursts later.
7
5-34
Algorithm
Step - 2 : The bucket can hold at most b-tokens. If a token arrive when bucket is full it is discarded.
Step - 3 : When a packet of m bytes arrived m tokens are removed from the bucket and the packet is sent to
the network.
Step – 4 : If less than n tokens are available no tokens are removed from the buckets and the packet is
considered to be non conformant.
The non conformant packet may be enqueued for subsequent transmission when sufficient token have been
accumulated in the bucket.
9
•C
•P
•M
• S=c/m-p
10