0% found this document useful (0 votes)
28 views11 pages

Congestion Control

computer networking sem5

Uploaded by

Abhishek T
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views11 pages

Congestion Control

computer networking sem5

Uploaded by

Abhishek T
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

1

Traffic Shaping

• It is about regulating average rate of data flow.

• 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)

• There are two types of Traffic shaping algorithm :-

▫ 1. Leaky Bucket Algorithm.

▫ 2. Token Bucket Algorithm


2
3

Leaky Bucket Algorithm

• The Leaky Bucket Algorithm used to control rate in a network.

• It is implemented as a single-server queue with constant service time.

• If the bucket (buffer) overflows then packets are discarded.

• 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

The Leaky Bucket Algorithm

(a) A leaky bucket with water. (b) a leaky bucket with packets.
5

Leaky Bucket Algorithm

Algorithm

Step - 1 : Initialize the counter to ‘n’ at every tick of clock.

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.

Step - 3 : Reset the counter and go to Step - 1.


6

Token Bucket Algorithm

• 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

Token Bucket Algorithm

5-34

(a) Before (b) After


8

Token Bucket Algorithm

Algorithm

Step - 1 : A token is added at every ∆t time.

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

Token Bucket Performance


•S

•C

•P

•M

• S=c/m-p
10

• A computer on a 6 Mbps network is regulated by token


bucket.Token bucket filled at a rate of 1 mbps.It is initially filled to a
capacity with 8 megabits.How long can computer transmit at the
full 6 mbps?
11

DIFFERENCE BETWEEN LEAKY BUCKET AND TOKEN BUCKET ALGORITHM

TOKEN BUCKET LEAKY BUCKET

Token dependent. Token independent.

If bucket is full token are discarded, but not the


If bucket is full packet or data is discarded.
packet.

Packets can only transmitted when there are


Packets are transmitted continuously.
enough token

It allows large bursts to be sent faster rate after


It sends the packet at constant rate
that constant rate

It saves token to send large bursts. It does not save token.

You might also like