SlideShare a Scribd company logo
1 of 20
Download to read offline
1
Bit stuffing is the process of adding one extra 0Bit stuffing is the process of adding one extra 0
whenever there are five consecutive 1s in the datawhenever there are five consecutive 1s in the data
so that the receiver does not mistake theso that the receiver does not mistake the
data for a flag.data for a flag.
Note:Note:
Dr Sudhir Shelke,
2
. Bit stuffing and removal
Dr Sudhir Shelke,
3
Unit-V
CONGESTION CONTROL
Dr Sudhir Shelke,
4
Congestion Control
• When one part of the subnet (e.g. one or more
routers in an area) becomes overloaded,
congestion results.
• Because routers are receiving packets faster than
they can forward them, one of two things must
happen:
– The subnet must prevent additional packets from
entering the congested region until those already
present can be processed.
– The congested routers can discard queued packets to
make room for those that are arriving.
Dr Sudhir Shelke,
5
Factors that Cause Congestion
• Packet arrival rate exceeds the outgoing
link capacity.
• Insufficient memory to store arriving
packets
• Bursty traffic
• Slow processor
Dr Sudhir Shelke,
6
Congestion Control vs Flow
Control
• Congestion control is a global issue –
involves every router and host within the
subnet
• Flow control – scope is point-to-point;
involves just sender and receiver.
Dr Sudhir Shelke,
7
Congestion Control, cont.
• Congestion Control is concerned with efficiently
using a network at high load.
• Several techniques can be employed. These include:
– Warning bit
– Choke packets
– Load shedding
– Random early discard
– Traffic shaping
• The first 3 deal with congestion detection and
recovery. The last 2 deal with congestion avoidance.
Dr Sudhir Shelke,
8
Warning Bit
• A special bit in the packet header is set by the
router to warn the source when congestion is
detected.
• The bit is copied and piggy-backed on the
ACK and sent to the sender.
• The sender monitors the number of ACK
packets it receives with the warning bit set
and adjusts its transmission rate accordingly.
Dr Sudhir Shelke,
9
Choke Packets
• A more direct way of telling the source to
slow down.
• A choke packet is a control packet generated
at a congested node and transmitted to
restrict traffic flow.
• The source, on receiving the choke packet
must reduce its transmission rate by a certain
percentage.
• An example of a choke packet is the ICMP
Source Quench Packet.
Dr Sudhir Shelke,
10
Hop-by-Hop Choke Packets
• Over long distances or at high speeds choke
packets are not very effective.
• A more efficient method is to send to choke
packets hop-by-hop.
• This requires each hop to reduce its
transmission even before the choke packet
arrive at the source.
Dr Sudhir Shelke,
11
Load Shedding
• When buffers become full, routers simply discard
packets.
• Which packet is chosen to be the victim depends on
the application and on the error strategy used in the
data link layer.
• For a file transfer, for, e.g. cannot discard older
packets since this will cause a gap in the received
data.
• For real-time voice or video it is probably better to
throw away old data and keep new packets.
• Get the application to mark packets with discard
priority.
Dr Sudhir Shelke,
12
Random Early Discard (RED)
• This is a proactive approach in which the
router discards one or more packets before
the buffer becomes completely full.
• Each time a packet arrives, the RED
algorithm computes the average queue
length, avg.
• If avg is lower than some lower threshold,
congestion is assumed to be minimal or
non-existent and the packet is queued.
Dr Sudhir Shelke,
13
RED, cont.
• If avg is greater than some upper threshold,
congestion is assumed to be serious and the
packet is discarded.
• If avg is between the two thresholds, this
might indicate the onset of congestion. The
probability of congestion is then calculated.
Dr Sudhir Shelke,
14
Traffic Shaping
• Another method of congestion control is to
“shape” the traffic before it enters the
network.
• Traffic shaping controls the rate at which
packets are sent (not just how many). Used in
ATM and Integrated Services networks.
• At connection set-up time, the sender and
carrier negotiate a traffic pattern (shape).
• Two traffic shaping algorithms are:
– Leaky Bucket
– Token Bucket
Dr Sudhir Shelke,
15
The 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.
Dr Sudhir Shelke,
16
The Leaky Bucket Algorithm
(a) A leaky bucket with water. (b) a leaky bucket with packets.
Dr Sudhir Shelke,
17
Leaky Bucket Algorithm, cont.
• The leaky bucket enforces a constant output rate
(average rate) regardless of the burstiness of the
input. Does nothing when input is idle.
• The host injects one packet per clock tick onto the
network. This results in a uniform flow of packets,
smoothing out bursts and reducing congestion.
• When packets are the same size (as in ATM cells),
the one packet per tick is okay. For variable length
packets though, it is better to allow a fixed number
of bytes per tick. E.g. 1024 bytes per tick will allow
one 1024-byte packet or two 512-byte packets or
four 256-byte packets on 1 tick.
Dr Sudhir Shelke,
18
Token Bucket Algorithm
• In contrast to the LB, the Token Bucket Algorithm,
allows the output rate to vary, depending on the
size of the burst.
• In the TB algorithm, the bucket holds tokens. 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.
Dr Sudhir Shelke,
19
The Token Bucket Algorithm
(a) Before. (b) After.
5-34
Dr Sudhir Shelke,
20
Leaky Bucket vs Token Bucket
• LB discards packets; TB does not. TB
discards tokens.
• With TB, a packet can only be transmitted if
there are enough tokens to cover its length in
bytes.
• LB sends packets at an average rate. TB
allows for large bursts to be sent faster by
speeding up the output.
• TB allows saving up tokens (permissions) to
send large bursts. LB does not allow saving.
Dr Sudhir Shelke,

More Related Content

What's hot

What's hot (20)

Concurrency Control in Distributed Database.
Concurrency Control in Distributed Database.Concurrency Control in Distributed Database.
Concurrency Control in Distributed Database.
 
Clustering: Large Databases in data mining
Clustering: Large Databases in data miningClustering: Large Databases in data mining
Clustering: Large Databases in data mining
 
Introduction to Distributed System
Introduction to Distributed SystemIntroduction to Distributed System
Introduction to Distributed System
 
Distributed Mutual Exclusion and Distributed Deadlock Detection
Distributed Mutual Exclusion and Distributed Deadlock DetectionDistributed Mutual Exclusion and Distributed Deadlock Detection
Distributed Mutual Exclusion and Distributed Deadlock Detection
 
Congestion control in TCP
Congestion control in TCPCongestion control in TCP
Congestion control in TCP
 
Multiple Access Protocal
Multiple Access ProtocalMultiple Access Protocal
Multiple Access Protocal
 
Artificial Neural Networks for Data Mining
Artificial Neural Networks for Data MiningArtificial Neural Networks for Data Mining
Artificial Neural Networks for Data Mining
 
AI Lecture 7 (uncertainty)
AI Lecture 7 (uncertainty)AI Lecture 7 (uncertainty)
AI Lecture 7 (uncertainty)
 
Dynamic Itemset Counting
Dynamic Itemset CountingDynamic Itemset Counting
Dynamic Itemset Counting
 
Distance vector routing
Distance vector routingDistance vector routing
Distance vector routing
 
Congestion avoidance in TCP
Congestion avoidance in TCPCongestion avoidance in TCP
Congestion avoidance in TCP
 
DATA RATE LIMITS
DATA RATE LIMITSDATA RATE LIMITS
DATA RATE LIMITS
 
Sliding window protocol
Sliding window protocolSliding window protocol
Sliding window protocol
 
Transport layer protocols : Simple Protocol , Stop and Wait Protocol , Go-Bac...
Transport layer protocols : Simple Protocol , Stop and Wait Protocol , Go-Bac...Transport layer protocols : Simple Protocol , Stop and Wait Protocol , Go-Bac...
Transport layer protocols : Simple Protocol , Stop and Wait Protocol , Go-Bac...
 
Leaky Bucket & Tocken Bucket - Traffic shaping
Leaky Bucket & Tocken Bucket - Traffic shapingLeaky Bucket & Tocken Bucket - Traffic shaping
Leaky Bucket & Tocken Bucket - Traffic shaping
 
Types of Load distributing algorithm in Distributed System
Types of Load distributing algorithm in Distributed SystemTypes of Load distributing algorithm in Distributed System
Types of Load distributing algorithm in Distributed System
 
Routing algorithm
Routing algorithmRouting algorithm
Routing algorithm
 
Load balancing in Distributed Systems
Load balancing in Distributed SystemsLoad balancing in Distributed Systems
Load balancing in Distributed Systems
 
Processor allocation in Distributed Systems
Processor allocation in Distributed SystemsProcessor allocation in Distributed Systems
Processor allocation in Distributed Systems
 
Addressing in networking (IP,MAC,Port addressing)
Addressing in networking (IP,MAC,Port addressing)Addressing in networking (IP,MAC,Port addressing)
Addressing in networking (IP,MAC,Port addressing)
 

Similar to Congestion control

Module 2.pptx.............sdvsdcdssdfsdf
Module 2.pptx.............sdvsdcdssdfsdfModule 2.pptx.............sdvsdcdssdfsdf
Module 2.pptx.............sdvsdcdssdfsdf
Shivakrishnan18
 

Similar to Congestion control (20)

Congestion control
Congestion controlCongestion control
Congestion control
 
Conjestion control
Conjestion controlConjestion control
Conjestion control
 
Congestion control 1
Congestion control 1Congestion control 1
Congestion control 1
 
Congestion Control
Congestion ControlCongestion Control
Congestion Control
 
Tieu luan qo s
Tieu luan qo sTieu luan qo s
Tieu luan qo s
 
Leaky bucket A
Leaky bucket ALeaky bucket A
Leaky bucket A
 
Tcp Congestion Avoidance
Tcp Congestion AvoidanceTcp Congestion Avoidance
Tcp Congestion Avoidance
 
Congestion control
Congestion controlCongestion control
Congestion control
 
9_Network.ppt
9_Network.ppt9_Network.ppt
9_Network.ppt
 
qos-f05.ppt
qos-f05.pptqos-f05.ppt
qos-f05.ppt
 
qos-f05 (2).ppt
qos-f05 (2).pptqos-f05 (2).ppt
qos-f05 (2).ppt
 
qos-f05 (3).ppt
qos-f05 (3).pptqos-f05 (3).ppt
qos-f05 (3).ppt
 
qos-f05.pdf
qos-f05.pdfqos-f05.pdf
qos-f05.pdf
 
Computer Networks Module 2.pdf
Computer Networks Module 2.pdfComputer Networks Module 2.pdf
Computer Networks Module 2.pdf
 
DLC_23 (3).pptx
DLC_23 (3).pptxDLC_23 (3).pptx
DLC_23 (3).pptx
 
Module 2.pptx.............sdvsdcdssdfsdf
Module 2.pptx.............sdvsdcdssdfsdfModule 2.pptx.............sdvsdcdssdfsdf
Module 2.pptx.............sdvsdcdssdfsdf
 
QoSintro.PPT
QoSintro.PPTQoSintro.PPT
QoSintro.PPT
 
Congestion Control
Congestion ControlCongestion Control
Congestion Control
 
Tcp(no ip) review part1
Tcp(no ip) review part1Tcp(no ip) review part1
Tcp(no ip) review part1
 
Transport layer
Transport layerTransport layer
Transport layer
 

More from Principal,Guru Nanak Institute of Technology, Nagpur

More from Principal,Guru Nanak Institute of Technology, Nagpur (12)

Tcp ip
Tcp ipTcp ip
Tcp ip
 
Icmp
IcmpIcmp
Icmp
 
Unit VI CPLD-FPGA Architecture
Unit VI CPLD-FPGA ArchitectureUnit VI CPLD-FPGA Architecture
Unit VI CPLD-FPGA Architecture
 
Unit v. HDL Synthesis Process
Unit v. HDL Synthesis ProcessUnit v. HDL Synthesis Process
Unit v. HDL Synthesis Process
 
Unit 3 instruction of tms320 c5x (3 files merged)
Unit 3  instruction of tms320 c5x (3 files merged)Unit 3  instruction of tms320 c5x (3 files merged)
Unit 3 instruction of tms320 c5x (3 files merged)
 
Unit 3 Instruction of tms320C5x
Unit 3  Instruction of tms320C5xUnit 3  Instruction of tms320C5x
Unit 3 Instruction of tms320C5x
 
Unit I.fundamental of Programmable DSP
Unit I.fundamental of Programmable DSPUnit I.fundamental of Programmable DSP
Unit I.fundamental of Programmable DSP
 
Unit ii.arc of tms320 c5 xx
Unit ii.arc of tms320 c5 xxUnit ii.arc of tms320 c5 xx
Unit ii.arc of tms320 c5 xx
 
Unit V:Motorola 563xx
Unit V:Motorola 563xxUnit V:Motorola 563xx
Unit V:Motorola 563xx
 
Unit v.tms320 cs6x
Unit v.tms320 cs6xUnit v.tms320 cs6x
Unit v.tms320 cs6x
 
Unit4.addressing modes 54 xx
Unit4.addressing modes 54 xxUnit4.addressing modes 54 xx
Unit4.addressing modes 54 xx
 
Unit4.tms320c54x
Unit4.tms320c54xUnit4.tms320c54x
Unit4.tms320c54x
 

Recently uploaded

Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Dr.Costas Sachpazis
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
ankushspencer015
 

Recently uploaded (20)

Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
(SHREYA) Chakan Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Esc...
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduits
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
 
Glass Ceramics: Processing and Properties
Glass Ceramics: Processing and PropertiesGlass Ceramics: Processing and Properties
Glass Ceramics: Processing and Properties
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Online banking management system project.pdf
Online banking management system project.pdfOnline banking management system project.pdf
Online banking management system project.pdf
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
 
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxBSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptx
 

Congestion control

  • 1. 1 Bit stuffing is the process of adding one extra 0Bit stuffing is the process of adding one extra 0 whenever there are five consecutive 1s in the datawhenever there are five consecutive 1s in the data so that the receiver does not mistake theso that the receiver does not mistake the data for a flag.data for a flag. Note:Note: Dr Sudhir Shelke,
  • 2. 2 . Bit stuffing and removal Dr Sudhir Shelke,
  • 4. 4 Congestion Control • When one part of the subnet (e.g. one or more routers in an area) becomes overloaded, congestion results. • Because routers are receiving packets faster than they can forward them, one of two things must happen: – The subnet must prevent additional packets from entering the congested region until those already present can be processed. – The congested routers can discard queued packets to make room for those that are arriving. Dr Sudhir Shelke,
  • 5. 5 Factors that Cause Congestion • Packet arrival rate exceeds the outgoing link capacity. • Insufficient memory to store arriving packets • Bursty traffic • Slow processor Dr Sudhir Shelke,
  • 6. 6 Congestion Control vs Flow Control • Congestion control is a global issue – involves every router and host within the subnet • Flow control – scope is point-to-point; involves just sender and receiver. Dr Sudhir Shelke,
  • 7. 7 Congestion Control, cont. • Congestion Control is concerned with efficiently using a network at high load. • Several techniques can be employed. These include: – Warning bit – Choke packets – Load shedding – Random early discard – Traffic shaping • The first 3 deal with congestion detection and recovery. The last 2 deal with congestion avoidance. Dr Sudhir Shelke,
  • 8. 8 Warning Bit • A special bit in the packet header is set by the router to warn the source when congestion is detected. • The bit is copied and piggy-backed on the ACK and sent to the sender. • The sender monitors the number of ACK packets it receives with the warning bit set and adjusts its transmission rate accordingly. Dr Sudhir Shelke,
  • 9. 9 Choke Packets • A more direct way of telling the source to slow down. • A choke packet is a control packet generated at a congested node and transmitted to restrict traffic flow. • The source, on receiving the choke packet must reduce its transmission rate by a certain percentage. • An example of a choke packet is the ICMP Source Quench Packet. Dr Sudhir Shelke,
  • 10. 10 Hop-by-Hop Choke Packets • Over long distances or at high speeds choke packets are not very effective. • A more efficient method is to send to choke packets hop-by-hop. • This requires each hop to reduce its transmission even before the choke packet arrive at the source. Dr Sudhir Shelke,
  • 11. 11 Load Shedding • When buffers become full, routers simply discard packets. • Which packet is chosen to be the victim depends on the application and on the error strategy used in the data link layer. • For a file transfer, for, e.g. cannot discard older packets since this will cause a gap in the received data. • For real-time voice or video it is probably better to throw away old data and keep new packets. • Get the application to mark packets with discard priority. Dr Sudhir Shelke,
  • 12. 12 Random Early Discard (RED) • This is a proactive approach in which the router discards one or more packets before the buffer becomes completely full. • Each time a packet arrives, the RED algorithm computes the average queue length, avg. • If avg is lower than some lower threshold, congestion is assumed to be minimal or non-existent and the packet is queued. Dr Sudhir Shelke,
  • 13. 13 RED, cont. • If avg is greater than some upper threshold, congestion is assumed to be serious and the packet is discarded. • If avg is between the two thresholds, this might indicate the onset of congestion. The probability of congestion is then calculated. Dr Sudhir Shelke,
  • 14. 14 Traffic Shaping • Another method of congestion control is to “shape” the traffic before it enters the network. • Traffic shaping controls the rate at which packets are sent (not just how many). Used in ATM and Integrated Services networks. • At connection set-up time, the sender and carrier negotiate a traffic pattern (shape). • Two traffic shaping algorithms are: – Leaky Bucket – Token Bucket Dr Sudhir Shelke,
  • 15. 15 The 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. Dr Sudhir Shelke,
  • 16. 16 The Leaky Bucket Algorithm (a) A leaky bucket with water. (b) a leaky bucket with packets. Dr Sudhir Shelke,
  • 17. 17 Leaky Bucket Algorithm, cont. • The leaky bucket enforces a constant output rate (average rate) regardless of the burstiness of the input. Does nothing when input is idle. • The host injects one packet per clock tick onto the network. This results in a uniform flow of packets, smoothing out bursts and reducing congestion. • When packets are the same size (as in ATM cells), the one packet per tick is okay. For variable length packets though, it is better to allow a fixed number of bytes per tick. E.g. 1024 bytes per tick will allow one 1024-byte packet or two 512-byte packets or four 256-byte packets on 1 tick. Dr Sudhir Shelke,
  • 18. 18 Token Bucket Algorithm • In contrast to the LB, the Token Bucket Algorithm, allows the output rate to vary, depending on the size of the burst. • In the TB algorithm, the bucket holds tokens. 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. Dr Sudhir Shelke,
  • 19. 19 The Token Bucket Algorithm (a) Before. (b) After. 5-34 Dr Sudhir Shelke,
  • 20. 20 Leaky Bucket vs Token Bucket • LB discards packets; TB does not. TB discards tokens. • With TB, a packet can only be transmitted if there are enough tokens to cover its length in bytes. • LB sends packets at an average rate. TB allows for large bursts to be sent faster by speeding up the output. • TB allows saving up tokens (permissions) to send large bursts. LB does not allow saving. Dr Sudhir Shelke,