SlideShare a Scribd company logo
1 of 34
TTCCPP 
CCoonnggeessttiioonn CCoonnttrrooll 
Lecture material taken from 
“Computer Networks A Systems Approach”, 
Fourth Edition,Peterson and Davie, 
Morgan Kaufmann, 2007. 
Computer Networks: TTCCPP CCoonnggeessttiioonn CCoonnttrrooll 11
TTCCPP CCoonnggeessttiioonn CCoonnttrrooll 
• Essential strategy :: The TCP host sends 
packets into the network without a reservation 
and then the host reacts to observable events. 
• Originally TCP assumed FIFO queuing. 
• Basic idea :: each source determines how 
much capacity is available to a given flow in the 
network. 
• ACKs are used to ‘pace’ the transmission of 
packets such that TCP is “self-clocking”. 
Computer Networks: TTCCPP CCoonnggeessttiioonn CCoonnttrrooll 22
AAIIMMDD 
((AAddddiittiivvee IInnccrreeaassee // MMuullttiipplliiccaattiivvee 
DDeeccrreeaassee)) 
• CongestionWindow (cwnd) is a variable held by 
the TCP source for each connection. 
MaxWindow :: min (CongestionWindow , AdvertisedWindow) 
EffectiveWindow = MaxWindow – (LastByteSent -LastByteAcked) 
• cwnd is set based on the perceived level of 
congestion. The Host receives implicit (packet 
drop) or explicit (packet mark) indications of 
internal congestion. 
Computer Networks: TTCCPP CCoonnggeessttiioonn CCoonnttrrooll 33
AAddddiittiivvee IInnccrreeaassee ((AAII)) 
• Additive Increase is a reaction to perceived available 
capacity (referred to as congestion avoidance stage). 
• Frequently in the literature, additive increase is defined 
by parameter α (where the default is α = 1). 
• Linear Increase :: For each “cwnd’s worth” of packets 
sent, increase cwnd by 1 packet. 
• In practice, cwnd is incremented fractionally for each 
arriving ACK. 
increment = MSS x (MSS /cwnd) 
cwnd = cwnd + increment 
Computer Networks: TTCCPP CCoonnggeessttiioonn CCoonnttrrooll 44
Source Destination 
Add one packet 
each RTT 
FFiigguurree 66..88 AAddddiittiivvee IInnccrreeaassee 
Computer Networks: TTCCPP CCoonnggeessttiioonn CCoonnttrrooll 55
MMuullttiipplliiccaattiivvee DDeeccrreeaassee ((MMDD)) 
* Key assumption :: a dropped packet and resultant 
timeout are due to congestion at a router. 
• Frequently in the literature, multiplicative decrease 
is defined by parameter β (where the default is β = 
0.5) 
Multiplicate Decrease:: TCP reacts to a timeout by 
halving cwnd. 
• Although defined in bytes, the literature often 
discusses cwnd in terms of packets (or more 
formally in MSS == Maximum Segment Size). 
• cwnd is not allowed below the size of a single 
packet. 
Computer Networks: TTCCPP CCoonnggeessttiioonn CCoonnttrrooll 66
AAIIMMDD 
((AAddddiittiivvee IInnccrreeaassee // MMuullttiipplliiccaattiivvee 
DDeeccrreeaassee)) 
• It has been shown that AIMD is a necessary 
condition for TCP congestion control to be stable. 
• Because the simple CC mechanism involves 
timeouts that cause retransmissions, it is important 
that hosts have an accurate timeout mechanism. 
• Timeouts set as a function of average RTT and 
standard deviation of RTT. 
• However, TCP hosts only sample round-trip time 
once per RTT using coarse-grained clock. 
Computer Networks: TTCCPP CCoonnggeessttiioonn CCoonnttrrooll 77
FFiigguurree 66..99 TTyyppiiccaall TTCCPP 
SSaawwttooootthh PPaatttteerrnn 
Computer Networks: TTCCPP CCoonnggeessttiioonn CCoonnttrrooll 88 
60 
50 
40 
20 
1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 
Time (seconds) 
70 
30 
10 
10.0
SSllooww SSttaarrtt 
• Linear additive increase takes too long to 
ramp up a new TCP connection from cold 
start. 
• Beginning with TCP Tahoe, the slow start 
mechanism was added to provide an initial 
exponential increase in the size of cwnd. 
Remember mechanism by: slow start 
prevents a slow start. Moreover, slow start 
is slower than sending a full advertised 
window’s worth of packets all at once. 
Computer Networks: TTCCPP CCoonnggeessttiioonn CCoonnttrrooll 99
SSllooww SSttaarrtt 
• The source starts with cwnd = 1. 
• Every time an ACK arrives, cwnd is 
incremented. 
cwnd is effectively doubled per RTT “epoch”. 
• Two slow start situations: 
 At the very beginning of a connection {cold start}. 
 When the connection goes dead waiting for a 
timeout to occur (i.e, the advertized window goes 
to zero!) 
Computer Networks: TTCCPP CCoonnggeessttiioonn CCoonnttrrooll 1100
Source Destination 
Slow Start 
Add one packet 
per ACK 
FFiigguurree 66..1100 SSllooww SSttaarrtt 
Computer Networks: TTCCPP CCoonnggeessttiioonn CCoonnttrrooll 1111
SSllooww SSttaarrtt 
• However, in the second case the 
source has more information. The 
current value of cwnd can be saved as 
a congestion threshold. 
• This is also known as the “slow start 
threshold” ssthresh. 
Computer Networks: TTCCPP CCoonnggeessttiioonn CCoonnttrrooll 1122
ssthresh 
Computer Networks: TTCCPP CCoonnggeessttiioonn CCoonnttrrooll 1133
FFiigguurree 66..1111 BBeehhaavviioorr ooff TTCCPP 
CCoonnggeessttiioonn CCoonnttrrooll 
Computer Networks: TTCCPP CCoonnggeessttiioonn CCoonnttrrooll 1144 
60 
50 
40 
20 
1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 
Time (seconds) 
70 
30 
10
FFaasstt RReettrraannssmmiitt 
• Coarse timeouts remained a problem, and Fast 
retransmit was added with TCP Tahoe. 
• Since the receiver responds every time a packet 
arrives, this implies the sender will see duplicate 
ACKs. 
Basic Idea:: use duplicate ACKs to signal lost packet. 
Fast Retransmit 
Upon receipt of three duplicate ACKs, the TCP Sender 
retransmits the lost packet. 
Computer Networks: TTCCPP CCoonnggeessttiioonn CCoonnttrrooll 1155
FFaasstt RReettrraannssmmiitt 
• Generally, fast retransmit eliminates about half 
the coarse-grain timeouts. 
• This yields roughly a 20% improvement in 
throughput. 
• Note – fast retransmit does not eliminate all 
the timeouts due to small window sizes at the 
source. 
Computer Networks: TTCCPP CCoonnggeessttiioonn CCoonnttrrooll 1166
Sender Receiver 
ACK 2 
FFiigguurree 66..1122 FFaasstt RReettrraannssmmiitt 
Computer Networks: TTCCPP CCoonnggeessttiioonn CCoonnttrrooll 1177 
Packet 1 
Packet 2 
Packet 3 
Packet 4 
Packet 5 
Packet 6 
Retransmit 
packet 3 
ACK 1 
ACK 2 
ACK 2 
ACK 2 
ACK 6 
Fast Retransmit 
Based on three 
duplicate ACKs
FFiigguurree 66..1133 TTCCPP FFaasstt RReettrraannssmmiitt 
TTrraaccee 
Computer Networks: TTCCPP CCoonnggeessttiioonn CCoonnttrrooll 1188 
60 
50 
40 
20 
1.0 2.0 3.0 4.0 5.0 6.0 7.0 
Time (seconds) 
70 
30 
10
FFaasstt RReeccoovveerryy 
• Fast recovery was added with TCP Reno. 
• Basic idea:: When fast retransmit detects 
three duplicate ACKs, start the recovery 
process from congestion avoidance region 
and use ACKs in the pipe to pace the 
sending of packets. 
Fast Recovery 
After Fast Retransmit, half cwnd and commence 
recovery from this point using linear additive increase 
‘primed’ by left over ACKs in pipe. 
Computer Networks: TTCCPP CCoonnggeessttiioonn CCoonnttrrooll 1199
MMooddiiffiieedd SSllooww SSttaarrtt 
• With fast recovery, slow start only 
occurs: 
–At cold start 
–After a coarse-grain timeout 
• This is the difference between 
TCP Tahoe and TCP Reno!! 
Computer Networks: TTCCPP CCoonnggeessttiioonn CCoonnttrrooll 2200
MMaannyy TTCCPP ‘‘ffllaavvoorrss’’ 
• TCP New Reno 
• TCP SACK 
– requires sender and receiver both to 
support TCP SACK 
– possible state machine is complex. 
• TCP Vegas 
– adjusts window size based on difference 
between expected and actual RTT. 
• TCP Cubic 
CCoommppuutteerr NNeettwwoorrkkss:: TTCCPP CCoonnggeessttiioonn CCoonnttrrooll 2211
FFiigguurree 55..66 TThhrreeee--wwaayy TTCCPP 
HHaannddsshhaakkee 
CCoommppuutteerr NNeettwwoorrkkss:: TTCCPP CCoonnggeessttiioonn CCoonnttrrooll 2222
AAddaappttiivvee RReettrraannssmmiissssiioonnss 
RTT:: Round Trip Time between a pair of 
hosts on the Internet. 
• How to set the TimeOut value (RTO)? 
– The timeout value is set as a function of 
the expected RTT. 
– Consequences of a bad choice? 
Computer Networks: TTCCPP CCoonnggeessttiioonn CCoonnttrrooll 2233
OOrriiggiinnaall AAllggoorriitthhmm 
• Keep a running average of RTT and 
compute TimeOut as a function of this 
RTT. 
– Send packet and keep timestamp ts . 
– When ACK arrives, record timestamp ta . 
SampleRTT = ta - ts 
Computer Networks: TTCCPP CCoonnggeessttiioonn CCoonnttrrooll 2244
OOrriiggiinnaall AAllggoorriitthhmm 
Compute a weighted average: 
EEssttiimmaatteeddRRTTTT == αα xx EEssttiimmaatteeddRRTTTT ++ 
((11-- αα)) xx SSaammpplleeRRTTTT 
Original TCP spec: αα iinn rraannggee ((00..88,,00..99)) 
TTiimmeeOOuutt == 22 xx EEssttiimmaatteeddRRTTTT 
Computer Networks: TTCCPP CCoonnggeessttiioonn CCoonnttrrooll 2255
KKaarrnn//PPaarrttiiddggee AAllggoorriitthhmm 
An obvious flaw in the original algorithm: 
Whenever there is a retransmission it is 
impossible to know whether to associate 
the ACK with the original packet or the 
retransmitted packet. 
Computer Networks: TTCCPP CCoonnggeessttiioonn CCoonnttrrooll 2266
FFiigguurree 55..1100 AAssssoocciiaattiinngg tthhee 
AACCKK?? 
Sender Receiver 
Original transmission 
Retransmission 
ACK 
Sender Receiver 
Original transmission 
ACK 
Retransmission 
(a) (b) 
Computer Networks: TTCCPP CCoonnggeessttiioonn CCoonnttrrooll 2277
KKaarrnn//PPaarrttiiddggee AAllggoorriitthhmm 
1. Do not measure SSaammpplleeRRTTTT when 
sending packet more than once. 
2. For each retransmission, set TTiimmeeOOuutt 
to double the last TTiimmeeOOuutt. 
{ Note – this is a form of exponential 
backoff based on the believe that the 
lost packet is due to congestion.} 
Computer Networks: TTCCPP CCoonnggeessttiioonn CCoonnttrrooll 2288
JJaaccoobbssoonn//KKaarreellss AAllggoorriitthhmm 
The problem with the original algorithm is that it did not 
take into account the variance of SampleRTT. 
DDiiffffeerreennccee == SSaammpplleeRRTTTT –– EEssttiimmaatteeddRRTTTT 
EEssttiimmaatteeddRRTTTT == EEssttiimmaatteeddRRTTTT ++ 
((δδ xx DDiiffffeerreennccee)) 
DDeevviiaattiioonn == δδ ((||DDiiffffeerreennccee|| - DDeevviiaattiioonn)) 
where δδ is a fraction between 0 and 1. 
Computer Networks: TTCCPP CCoonnggeessttiioonn CCoonnttrrooll 2299
JJaaccoobbssoonn//KKaarreellss AAllggoorriitthhmm 
TCP computes timeout using both the mean 
and variance of RTT 
TTiimmeeOOuutt == μμ xx EEssttiimmaatteeddRRTTTT 
++ ΦΦ xx DDeevviiaattiioonn 
where based on experience μμ == 11 and ΦΦ == 44. 
Computer Networks: TTCCPP CCoonnggeessttiioonn CCoonnttrrooll 3300
TTCCPP CCoonnggeessttiioonn CCoonnttrrooll 
SSuummmmaarryy 
• TCP interacts with routers in the subnet 
and reacts to implicit congestion 
notification (packet drop) by reducing the 
TCP sender’s congestion window. 
• TCP increases congestion window using 
slow start or congestion avoidance. 
• Currently, the two most common versions 
of TCP are New Reno and Cubic 
CCoommppuutteerr NNeettwwoorrkkss:: TTCCPP CCoonnggeessttiioonn CCoonnttrrooll 3311
TTCCPP NNeeww RReennoo 
• Two problem scenarios with TCP Reno 
– bursty losses, Reno cannot recover from 
bursts of 3+ losses 
– Packets arriving out-of-order can yield 
duplicate acks when in fact there is no 
loss. 
• New Reno solution – try to determine 
the end of a burst loss. 
CCoommppuutteerr NNeettwwoorrkkss:: TTCCPP CCoonnggeessttiioonn CCoonnttrrooll 3322
TTCCPP NNeeww RReennoo 
• When duplicate ACKs trigger a 
retransmission for a lost packet, 
remember the highest packet sent from 
window in recover. 
• Upon receiving an ACK, 
– if ACK < recover => partial ACK 
– If ACK ≥ recover => new ACK 
CCoommppuutteerr NNeettwwoorrkkss:: TTCCPP CCoonnggeessttiioonn CCoonnttrrooll 3333
TTCCPP NNeeww RReennoo 
• Partial ACK implies another lost packet: 
retransmit next packet, inflate window 
and stay in fast recovery. 
• New ACK implies fast recovery is over: 
starting from 0.5 x cwnd proceed with 
congestion avoidance (linear increase). 
• New Reno recovers from n losses in n 
round trips. 
CCoommppuutteerr NNeettwwoorrkkss:: TTCCPP CCoonnggeessttiioonn CCoonnttrrooll 3344

More Related Content

What's hot

What's hot (20)

Csma protocols
Csma protocolsCsma protocols
Csma protocols
 
Distance Vector Routing Protocols
Distance Vector Routing ProtocolsDistance Vector Routing Protocols
Distance Vector Routing Protocols
 
Carrier Sense Multiple Access (CSMA)
Carrier Sense Multiple Access (CSMA)Carrier Sense Multiple Access (CSMA)
Carrier Sense Multiple Access (CSMA)
 
Mac layer
Mac  layerMac  layer
Mac layer
 
Quality of Service
Quality of ServiceQuality of Service
Quality of Service
 
Schedule Based MAC Protocol
Schedule Based MAC ProtocolSchedule Based MAC Protocol
Schedule Based MAC Protocol
 
Dsdv
DsdvDsdv
Dsdv
 
Error control
Error controlError control
Error control
 
Chapter 3 : User Datagram Protocol (UDP)
Chapter 3 : User Datagram Protocol (UDP)Chapter 3 : User Datagram Protocol (UDP)
Chapter 3 : User Datagram Protocol (UDP)
 
Routing algorithm
Routing algorithmRouting algorithm
Routing algorithm
 
Demand assigned and packet reservation multiple access
Demand assigned and packet reservation multiple accessDemand assigned and packet reservation multiple access
Demand assigned and packet reservation multiple access
 
Energy consumption of wsn
Energy consumption of wsnEnergy consumption of wsn
Energy consumption of wsn
 
Data link layer
Data link layer Data link layer
Data link layer
 
Mobile network layer (mobile comm.)
Mobile network layer (mobile comm.)Mobile network layer (mobile comm.)
Mobile network layer (mobile comm.)
 
Distance Vector Routing
Distance Vector RoutingDistance Vector Routing
Distance Vector Routing
 
Tcp
TcpTcp
Tcp
 
Routing Algorithm
Routing AlgorithmRouting Algorithm
Routing Algorithm
 
Chap 10 igmp
Chap 10 igmpChap 10 igmp
Chap 10 igmp
 
TCP - Transmission Control Protocol
TCP - Transmission Control ProtocolTCP - Transmission Control Protocol
TCP - Transmission Control Protocol
 
wireless network IEEE 802.11
 wireless network IEEE 802.11 wireless network IEEE 802.11
wireless network IEEE 802.11
 

Viewers also liked

Java Input Output and File Handling
Java Input Output and File HandlingJava Input Output and File Handling
Java Input Output and File HandlingSunil OS
 
basics of file handling
basics of file handlingbasics of file handling
basics of file handlingpinkpreet_kaur
 
Routing Protocols and Concepts - Chapter 1
Routing Protocols and Concepts - Chapter 1Routing Protocols and Concepts - Chapter 1
Routing Protocols and Concepts - Chapter 1CAVC
 
14 file handling
14 file handling14 file handling
14 file handlingAPU
 
Java Course 8: I/O, Files and Streams
Java Course 8: I/O, Files and StreamsJava Course 8: I/O, Files and Streams
Java Course 8: I/O, Files and StreamsAnton Keks
 

Viewers also liked (7)

Socket System Calls
Socket System CallsSocket System Calls
Socket System Calls
 
Java Input Output and File Handling
Java Input Output and File HandlingJava Input Output and File Handling
Java Input Output and File Handling
 
basics of file handling
basics of file handlingbasics of file handling
basics of file handling
 
Routing Protocols and Concepts - Chapter 1
Routing Protocols and Concepts - Chapter 1Routing Protocols and Concepts - Chapter 1
Routing Protocols and Concepts - Chapter 1
 
14 file handling
14 file handling14 file handling
14 file handling
 
Java Course 8: I/O, Files and Streams
Java Course 8: I/O, Files and StreamsJava Course 8: I/O, Files and Streams
Java Course 8: I/O, Files and Streams
 
Socket programming
Socket programmingSocket programming
Socket programming
 

Similar to TCP congestion control

Tcp congestion control
Tcp congestion controlTcp congestion control
Tcp congestion controlAbdo sayed
 
Tcp congestion control (1)
Tcp congestion control (1)Tcp congestion control (1)
Tcp congestion control (1)Abdo sayed
 
Lecture 19 22. transport protocol for ad-hoc
Lecture 19 22. transport protocol for ad-hoc Lecture 19 22. transport protocol for ad-hoc
Lecture 19 22. transport protocol for ad-hoc Chandra Meena
 
Computer network (13)
Computer network (13)Computer network (13)
Computer network (13)NYversity
 
Designing TCP-Friendly Window-based Congestion Control
Designing TCP-Friendly Window-based Congestion ControlDesigning TCP-Friendly Window-based Congestion Control
Designing TCP-Friendly Window-based Congestion Controlsoohyunc
 
Mobile Transpot Layer
Mobile Transpot LayerMobile Transpot Layer
Mobile Transpot LayerMaulik Patel
 
Troubleshooting TCP/IP
Troubleshooting TCP/IPTroubleshooting TCP/IP
Troubleshooting TCP/IPvijai s
 
chapter 3.2 TCP.pptx
chapter 3.2 TCP.pptxchapter 3.2 TCP.pptx
chapter 3.2 TCP.pptxTekle12
 
Tcp Congestion Avoidance
Tcp Congestion AvoidanceTcp Congestion Avoidance
Tcp Congestion AvoidanceRam Dutt Shukla
 
TCP protocol flow control
TCP protocol flow control TCP protocol flow control
TCP protocol flow control anuragjagetiya
 
Tcp performance simulationsusingns2
Tcp performance simulationsusingns2Tcp performance simulationsusingns2
Tcp performance simulationsusingns2Justin Frankel
 
Unit III IPV6 UDP
Unit III IPV6 UDPUnit III IPV6 UDP
Unit III IPV6 UDPsangusajjan
 
XPDS13: On Paravirualizing TCP - Congestion Control on Xen VMs - Luwei Cheng,...
XPDS13: On Paravirualizing TCP - Congestion Control on Xen VMs - Luwei Cheng,...XPDS13: On Paravirualizing TCP - Congestion Control on Xen VMs - Luwei Cheng,...
XPDS13: On Paravirualizing TCP - Congestion Control on Xen VMs - Luwei Cheng,...The Linux Foundation
 

Similar to TCP congestion control (20)

Tcp congestion control
Tcp congestion controlTcp congestion control
Tcp congestion control
 
Tcp congestion control (1)
Tcp congestion control (1)Tcp congestion control (1)
Tcp congestion control (1)
 
TCP_Congestion_Control.ppt
TCP_Congestion_Control.pptTCP_Congestion_Control.ppt
TCP_Congestion_Control.ppt
 
NE #1.pptx
NE #1.pptxNE #1.pptx
NE #1.pptx
 
Tcp congestion avoidance
Tcp congestion avoidanceTcp congestion avoidance
Tcp congestion avoidance
 
Lecture 19 22. transport protocol for ad-hoc
Lecture 19 22. transport protocol for ad-hoc Lecture 19 22. transport protocol for ad-hoc
Lecture 19 22. transport protocol for ad-hoc
 
Computer network (13)
Computer network (13)Computer network (13)
Computer network (13)
 
Designing TCP-Friendly Window-based Congestion Control
Designing TCP-Friendly Window-based Congestion ControlDesigning TCP-Friendly Window-based Congestion Control
Designing TCP-Friendly Window-based Congestion Control
 
Mobile Transpot Layer
Mobile Transpot LayerMobile Transpot Layer
Mobile Transpot Layer
 
Troubleshooting TCP/IP
Troubleshooting TCP/IPTroubleshooting TCP/IP
Troubleshooting TCP/IP
 
6610-l14.pptx
6610-l14.pptx6610-l14.pptx
6610-l14.pptx
 
Mobile comn.pptx
Mobile comn.pptxMobile comn.pptx
Mobile comn.pptx
 
chapter 3.2 TCP.pptx
chapter 3.2 TCP.pptxchapter 3.2 TCP.pptx
chapter 3.2 TCP.pptx
 
Tcp Congestion Avoidance
Tcp Congestion AvoidanceTcp Congestion Avoidance
Tcp Congestion Avoidance
 
Part9-congestion.pptx
Part9-congestion.pptxPart9-congestion.pptx
Part9-congestion.pptx
 
TCP protocol flow control
TCP protocol flow control TCP protocol flow control
TCP protocol flow control
 
Tcp performance simulationsusingns2
Tcp performance simulationsusingns2Tcp performance simulationsusingns2
Tcp performance simulationsusingns2
 
Congestion control avoidance
Congestion control avoidanceCongestion control avoidance
Congestion control avoidance
 
Unit III IPV6 UDP
Unit III IPV6 UDPUnit III IPV6 UDP
Unit III IPV6 UDP
 
XPDS13: On Paravirualizing TCP - Congestion Control on Xen VMs - Luwei Cheng,...
XPDS13: On Paravirualizing TCP - Congestion Control on Xen VMs - Luwei Cheng,...XPDS13: On Paravirualizing TCP - Congestion Control on Xen VMs - Luwei Cheng,...
XPDS13: On Paravirualizing TCP - Congestion Control on Xen VMs - Luwei Cheng,...
 

Recently uploaded

Earthing details of Electrical Substation
Earthing details of Electrical SubstationEarthing details of Electrical Substation
Earthing details of Electrical Substationstephanwindworld
 
System Simulation and Modelling with types and Event Scheduling
System Simulation and Modelling with types and Event SchedulingSystem Simulation and Modelling with types and Event Scheduling
System Simulation and Modelling with types and Event SchedulingBootNeck1
 
Virtual memory management in Operating System
Virtual memory management in Operating SystemVirtual memory management in Operating System
Virtual memory management in Operating SystemRashmi Bhat
 
Main Memory Management in Operating System
Main Memory Management in Operating SystemMain Memory Management in Operating System
Main Memory Management in Operating SystemRashmi Bhat
 
Energy Awareness training ppt for manufacturing process.pptx
Energy Awareness training ppt for manufacturing process.pptxEnergy Awareness training ppt for manufacturing process.pptx
Energy Awareness training ppt for manufacturing process.pptxsiddharthjain2303
 
Industrial Safety Unit-I SAFETY TERMINOLOGIES
Industrial Safety Unit-I SAFETY TERMINOLOGIESIndustrial Safety Unit-I SAFETY TERMINOLOGIES
Industrial Safety Unit-I SAFETY TERMINOLOGIESNarmatha D
 
Introduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECHIntroduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECHC Sai Kiran
 
Internet of things -Arshdeep Bahga .pptx
Internet of things -Arshdeep Bahga .pptxInternet of things -Arshdeep Bahga .pptx
Internet of things -Arshdeep Bahga .pptxVelmuruganTECE
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionDr.Costas Sachpazis
 
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfCCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfAsst.prof M.Gokilavani
 
welding defects observed during the welding
welding defects observed during the weldingwelding defects observed during the welding
welding defects observed during the weldingMuhammadUzairLiaqat
 
Indian Dairy Industry Present Status and.ppt
Indian Dairy Industry Present Status and.pptIndian Dairy Industry Present Status and.ppt
Indian Dairy Industry Present Status and.pptMadan Karki
 
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsyncWhy does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsyncssuser2ae721
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girlsssuser7cb4ff
 
Vishratwadi & Ghorpadi Bridge Tender documents
Vishratwadi & Ghorpadi Bridge Tender documentsVishratwadi & Ghorpadi Bridge Tender documents
Vishratwadi & Ghorpadi Bridge Tender documentsSachinPawar510423
 
Class 1 | NFPA 72 | Overview Fire Alarm System
Class 1 | NFPA 72 | Overview Fire Alarm SystemClass 1 | NFPA 72 | Overview Fire Alarm System
Class 1 | NFPA 72 | Overview Fire Alarm Systemirfanmechengr
 
Mine Environment II Lab_MI10448MI__________.pptx
Mine Environment II Lab_MI10448MI__________.pptxMine Environment II Lab_MI10448MI__________.pptx
Mine Environment II Lab_MI10448MI__________.pptxRomil Mishra
 
NO1 Certified Black Magic Specialist Expert Amil baba in Uae Dubai Abu Dhabi ...
NO1 Certified Black Magic Specialist Expert Amil baba in Uae Dubai Abu Dhabi ...NO1 Certified Black Magic Specialist Expert Amil baba in Uae Dubai Abu Dhabi ...
NO1 Certified Black Magic Specialist Expert Amil baba in Uae Dubai Abu Dhabi ...Amil Baba Dawood bangali
 

Recently uploaded (20)

Earthing details of Electrical Substation
Earthing details of Electrical SubstationEarthing details of Electrical Substation
Earthing details of Electrical Substation
 
System Simulation and Modelling with types and Event Scheduling
System Simulation and Modelling with types and Event SchedulingSystem Simulation and Modelling with types and Event Scheduling
System Simulation and Modelling with types and Event Scheduling
 
young call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Serviceyoung call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Service
 
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
 
Virtual memory management in Operating System
Virtual memory management in Operating SystemVirtual memory management in Operating System
Virtual memory management in Operating System
 
Main Memory Management in Operating System
Main Memory Management in Operating SystemMain Memory Management in Operating System
Main Memory Management in Operating System
 
Energy Awareness training ppt for manufacturing process.pptx
Energy Awareness training ppt for manufacturing process.pptxEnergy Awareness training ppt for manufacturing process.pptx
Energy Awareness training ppt for manufacturing process.pptx
 
Industrial Safety Unit-I SAFETY TERMINOLOGIES
Industrial Safety Unit-I SAFETY TERMINOLOGIESIndustrial Safety Unit-I SAFETY TERMINOLOGIES
Industrial Safety Unit-I SAFETY TERMINOLOGIES
 
Introduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECHIntroduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECH
 
Internet of things -Arshdeep Bahga .pptx
Internet of things -Arshdeep Bahga .pptxInternet of things -Arshdeep Bahga .pptx
Internet of things -Arshdeep Bahga .pptx
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
 
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfCCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
 
welding defects observed during the welding
welding defects observed during the weldingwelding defects observed during the welding
welding defects observed during the welding
 
Indian Dairy Industry Present Status and.ppt
Indian Dairy Industry Present Status and.pptIndian Dairy Industry Present Status and.ppt
Indian Dairy Industry Present Status and.ppt
 
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsyncWhy does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
Why does (not) Kafka need fsync: Eliminating tail latency spikes caused by fsync
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girls
 
Vishratwadi & Ghorpadi Bridge Tender documents
Vishratwadi & Ghorpadi Bridge Tender documentsVishratwadi & Ghorpadi Bridge Tender documents
Vishratwadi & Ghorpadi Bridge Tender documents
 
Class 1 | NFPA 72 | Overview Fire Alarm System
Class 1 | NFPA 72 | Overview Fire Alarm SystemClass 1 | NFPA 72 | Overview Fire Alarm System
Class 1 | NFPA 72 | Overview Fire Alarm System
 
Mine Environment II Lab_MI10448MI__________.pptx
Mine Environment II Lab_MI10448MI__________.pptxMine Environment II Lab_MI10448MI__________.pptx
Mine Environment II Lab_MI10448MI__________.pptx
 
NO1 Certified Black Magic Specialist Expert Amil baba in Uae Dubai Abu Dhabi ...
NO1 Certified Black Magic Specialist Expert Amil baba in Uae Dubai Abu Dhabi ...NO1 Certified Black Magic Specialist Expert Amil baba in Uae Dubai Abu Dhabi ...
NO1 Certified Black Magic Specialist Expert Amil baba in Uae Dubai Abu Dhabi ...
 

TCP congestion control

  • 1. TTCCPP CCoonnggeessttiioonn CCoonnttrrooll Lecture material taken from “Computer Networks A Systems Approach”, Fourth Edition,Peterson and Davie, Morgan Kaufmann, 2007. Computer Networks: TTCCPP CCoonnggeessttiioonn CCoonnttrrooll 11
  • 2. TTCCPP CCoonnggeessttiioonn CCoonnttrrooll • Essential strategy :: The TCP host sends packets into the network without a reservation and then the host reacts to observable events. • Originally TCP assumed FIFO queuing. • Basic idea :: each source determines how much capacity is available to a given flow in the network. • ACKs are used to ‘pace’ the transmission of packets such that TCP is “self-clocking”. Computer Networks: TTCCPP CCoonnggeessttiioonn CCoonnttrrooll 22
  • 3. AAIIMMDD ((AAddddiittiivvee IInnccrreeaassee // MMuullttiipplliiccaattiivvee DDeeccrreeaassee)) • CongestionWindow (cwnd) is a variable held by the TCP source for each connection. MaxWindow :: min (CongestionWindow , AdvertisedWindow) EffectiveWindow = MaxWindow – (LastByteSent -LastByteAcked) • cwnd is set based on the perceived level of congestion. The Host receives implicit (packet drop) or explicit (packet mark) indications of internal congestion. Computer Networks: TTCCPP CCoonnggeessttiioonn CCoonnttrrooll 33
  • 4. AAddddiittiivvee IInnccrreeaassee ((AAII)) • Additive Increase is a reaction to perceived available capacity (referred to as congestion avoidance stage). • Frequently in the literature, additive increase is defined by parameter α (where the default is α = 1). • Linear Increase :: For each “cwnd’s worth” of packets sent, increase cwnd by 1 packet. • In practice, cwnd is incremented fractionally for each arriving ACK. increment = MSS x (MSS /cwnd) cwnd = cwnd + increment Computer Networks: TTCCPP CCoonnggeessttiioonn CCoonnttrrooll 44
  • 5. Source Destination Add one packet each RTT FFiigguurree 66..88 AAddddiittiivvee IInnccrreeaassee Computer Networks: TTCCPP CCoonnggeessttiioonn CCoonnttrrooll 55
  • 6. MMuullttiipplliiccaattiivvee DDeeccrreeaassee ((MMDD)) * Key assumption :: a dropped packet and resultant timeout are due to congestion at a router. • Frequently in the literature, multiplicative decrease is defined by parameter β (where the default is β = 0.5) Multiplicate Decrease:: TCP reacts to a timeout by halving cwnd. • Although defined in bytes, the literature often discusses cwnd in terms of packets (or more formally in MSS == Maximum Segment Size). • cwnd is not allowed below the size of a single packet. Computer Networks: TTCCPP CCoonnggeessttiioonn CCoonnttrrooll 66
  • 7. AAIIMMDD ((AAddddiittiivvee IInnccrreeaassee // MMuullttiipplliiccaattiivvee DDeeccrreeaassee)) • It has been shown that AIMD is a necessary condition for TCP congestion control to be stable. • Because the simple CC mechanism involves timeouts that cause retransmissions, it is important that hosts have an accurate timeout mechanism. • Timeouts set as a function of average RTT and standard deviation of RTT. • However, TCP hosts only sample round-trip time once per RTT using coarse-grained clock. Computer Networks: TTCCPP CCoonnggeessttiioonn CCoonnttrrooll 77
  • 8. FFiigguurree 66..99 TTyyppiiccaall TTCCPP SSaawwttooootthh PPaatttteerrnn Computer Networks: TTCCPP CCoonnggeessttiioonn CCoonnttrrooll 88 60 50 40 20 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 Time (seconds) 70 30 10 10.0
  • 9. SSllooww SSttaarrtt • Linear additive increase takes too long to ramp up a new TCP connection from cold start. • Beginning with TCP Tahoe, the slow start mechanism was added to provide an initial exponential increase in the size of cwnd. Remember mechanism by: slow start prevents a slow start. Moreover, slow start is slower than sending a full advertised window’s worth of packets all at once. Computer Networks: TTCCPP CCoonnggeessttiioonn CCoonnttrrooll 99
  • 10. SSllooww SSttaarrtt • The source starts with cwnd = 1. • Every time an ACK arrives, cwnd is incremented. cwnd is effectively doubled per RTT “epoch”. • Two slow start situations:  At the very beginning of a connection {cold start}.  When the connection goes dead waiting for a timeout to occur (i.e, the advertized window goes to zero!) Computer Networks: TTCCPP CCoonnggeessttiioonn CCoonnttrrooll 1100
  • 11. Source Destination Slow Start Add one packet per ACK FFiigguurree 66..1100 SSllooww SSttaarrtt Computer Networks: TTCCPP CCoonnggeessttiioonn CCoonnttrrooll 1111
  • 12. SSllooww SSttaarrtt • However, in the second case the source has more information. The current value of cwnd can be saved as a congestion threshold. • This is also known as the “slow start threshold” ssthresh. Computer Networks: TTCCPP CCoonnggeessttiioonn CCoonnttrrooll 1122
  • 13. ssthresh Computer Networks: TTCCPP CCoonnggeessttiioonn CCoonnttrrooll 1133
  • 14. FFiigguurree 66..1111 BBeehhaavviioorr ooff TTCCPP CCoonnggeessttiioonn CCoonnttrrooll Computer Networks: TTCCPP CCoonnggeessttiioonn CCoonnttrrooll 1144 60 50 40 20 1.0 2.0 3.0 4.0 5.0 6.0 7.0 8.0 9.0 Time (seconds) 70 30 10
  • 15. FFaasstt RReettrraannssmmiitt • Coarse timeouts remained a problem, and Fast retransmit was added with TCP Tahoe. • Since the receiver responds every time a packet arrives, this implies the sender will see duplicate ACKs. Basic Idea:: use duplicate ACKs to signal lost packet. Fast Retransmit Upon receipt of three duplicate ACKs, the TCP Sender retransmits the lost packet. Computer Networks: TTCCPP CCoonnggeessttiioonn CCoonnttrrooll 1155
  • 16. FFaasstt RReettrraannssmmiitt • Generally, fast retransmit eliminates about half the coarse-grain timeouts. • This yields roughly a 20% improvement in throughput. • Note – fast retransmit does not eliminate all the timeouts due to small window sizes at the source. Computer Networks: TTCCPP CCoonnggeessttiioonn CCoonnttrrooll 1166
  • 17. Sender Receiver ACK 2 FFiigguurree 66..1122 FFaasstt RReettrraannssmmiitt Computer Networks: TTCCPP CCoonnggeessttiioonn CCoonnttrrooll 1177 Packet 1 Packet 2 Packet 3 Packet 4 Packet 5 Packet 6 Retransmit packet 3 ACK 1 ACK 2 ACK 2 ACK 2 ACK 6 Fast Retransmit Based on three duplicate ACKs
  • 18. FFiigguurree 66..1133 TTCCPP FFaasstt RReettrraannssmmiitt TTrraaccee Computer Networks: TTCCPP CCoonnggeessttiioonn CCoonnttrrooll 1188 60 50 40 20 1.0 2.0 3.0 4.0 5.0 6.0 7.0 Time (seconds) 70 30 10
  • 19. FFaasstt RReeccoovveerryy • Fast recovery was added with TCP Reno. • Basic idea:: When fast retransmit detects three duplicate ACKs, start the recovery process from congestion avoidance region and use ACKs in the pipe to pace the sending of packets. Fast Recovery After Fast Retransmit, half cwnd and commence recovery from this point using linear additive increase ‘primed’ by left over ACKs in pipe. Computer Networks: TTCCPP CCoonnggeessttiioonn CCoonnttrrooll 1199
  • 20. MMooddiiffiieedd SSllooww SSttaarrtt • With fast recovery, slow start only occurs: –At cold start –After a coarse-grain timeout • This is the difference between TCP Tahoe and TCP Reno!! Computer Networks: TTCCPP CCoonnggeessttiioonn CCoonnttrrooll 2200
  • 21. MMaannyy TTCCPP ‘‘ffllaavvoorrss’’ • TCP New Reno • TCP SACK – requires sender and receiver both to support TCP SACK – possible state machine is complex. • TCP Vegas – adjusts window size based on difference between expected and actual RTT. • TCP Cubic CCoommppuutteerr NNeettwwoorrkkss:: TTCCPP CCoonnggeessttiioonn CCoonnttrrooll 2211
  • 22. FFiigguurree 55..66 TThhrreeee--wwaayy TTCCPP HHaannddsshhaakkee CCoommppuutteerr NNeettwwoorrkkss:: TTCCPP CCoonnggeessttiioonn CCoonnttrrooll 2222
  • 23. AAddaappttiivvee RReettrraannssmmiissssiioonnss RTT:: Round Trip Time between a pair of hosts on the Internet. • How to set the TimeOut value (RTO)? – The timeout value is set as a function of the expected RTT. – Consequences of a bad choice? Computer Networks: TTCCPP CCoonnggeessttiioonn CCoonnttrrooll 2233
  • 24. OOrriiggiinnaall AAllggoorriitthhmm • Keep a running average of RTT and compute TimeOut as a function of this RTT. – Send packet and keep timestamp ts . – When ACK arrives, record timestamp ta . SampleRTT = ta - ts Computer Networks: TTCCPP CCoonnggeessttiioonn CCoonnttrrooll 2244
  • 25. OOrriiggiinnaall AAllggoorriitthhmm Compute a weighted average: EEssttiimmaatteeddRRTTTT == αα xx EEssttiimmaatteeddRRTTTT ++ ((11-- αα)) xx SSaammpplleeRRTTTT Original TCP spec: αα iinn rraannggee ((00..88,,00..99)) TTiimmeeOOuutt == 22 xx EEssttiimmaatteeddRRTTTT Computer Networks: TTCCPP CCoonnggeessttiioonn CCoonnttrrooll 2255
  • 26. KKaarrnn//PPaarrttiiddggee AAllggoorriitthhmm An obvious flaw in the original algorithm: Whenever there is a retransmission it is impossible to know whether to associate the ACK with the original packet or the retransmitted packet. Computer Networks: TTCCPP CCoonnggeessttiioonn CCoonnttrrooll 2266
  • 27. FFiigguurree 55..1100 AAssssoocciiaattiinngg tthhee AACCKK?? Sender Receiver Original transmission Retransmission ACK Sender Receiver Original transmission ACK Retransmission (a) (b) Computer Networks: TTCCPP CCoonnggeessttiioonn CCoonnttrrooll 2277
  • 28. KKaarrnn//PPaarrttiiddggee AAllggoorriitthhmm 1. Do not measure SSaammpplleeRRTTTT when sending packet more than once. 2. For each retransmission, set TTiimmeeOOuutt to double the last TTiimmeeOOuutt. { Note – this is a form of exponential backoff based on the believe that the lost packet is due to congestion.} Computer Networks: TTCCPP CCoonnggeessttiioonn CCoonnttrrooll 2288
  • 29. JJaaccoobbssoonn//KKaarreellss AAllggoorriitthhmm The problem with the original algorithm is that it did not take into account the variance of SampleRTT. DDiiffffeerreennccee == SSaammpplleeRRTTTT –– EEssttiimmaatteeddRRTTTT EEssttiimmaatteeddRRTTTT == EEssttiimmaatteeddRRTTTT ++ ((δδ xx DDiiffffeerreennccee)) DDeevviiaattiioonn == δδ ((||DDiiffffeerreennccee|| - DDeevviiaattiioonn)) where δδ is a fraction between 0 and 1. Computer Networks: TTCCPP CCoonnggeessttiioonn CCoonnttrrooll 2299
  • 30. JJaaccoobbssoonn//KKaarreellss AAllggoorriitthhmm TCP computes timeout using both the mean and variance of RTT TTiimmeeOOuutt == μμ xx EEssttiimmaatteeddRRTTTT ++ ΦΦ xx DDeevviiaattiioonn where based on experience μμ == 11 and ΦΦ == 44. Computer Networks: TTCCPP CCoonnggeessttiioonn CCoonnttrrooll 3300
  • 31. TTCCPP CCoonnggeessttiioonn CCoonnttrrooll SSuummmmaarryy • TCP interacts with routers in the subnet and reacts to implicit congestion notification (packet drop) by reducing the TCP sender’s congestion window. • TCP increases congestion window using slow start or congestion avoidance. • Currently, the two most common versions of TCP are New Reno and Cubic CCoommppuutteerr NNeettwwoorrkkss:: TTCCPP CCoonnggeessttiioonn CCoonnttrrooll 3311
  • 32. TTCCPP NNeeww RReennoo • Two problem scenarios with TCP Reno – bursty losses, Reno cannot recover from bursts of 3+ losses – Packets arriving out-of-order can yield duplicate acks when in fact there is no loss. • New Reno solution – try to determine the end of a burst loss. CCoommppuutteerr NNeettwwoorrkkss:: TTCCPP CCoonnggeessttiioonn CCoonnttrrooll 3322
  • 33. TTCCPP NNeeww RReennoo • When duplicate ACKs trigger a retransmission for a lost packet, remember the highest packet sent from window in recover. • Upon receiving an ACK, – if ACK < recover => partial ACK – If ACK ≥ recover => new ACK CCoommppuutteerr NNeettwwoorrkkss:: TTCCPP CCoonnggeessttiioonn CCoonnttrrooll 3333
  • 34. TTCCPP NNeeww RReennoo • Partial ACK implies another lost packet: retransmit next packet, inflate window and stay in fast recovery. • New ACK implies fast recovery is over: starting from 0.5 x cwnd proceed with congestion avoidance (linear increase). • New Reno recovers from n losses in n round trips. CCoommppuutteerr NNeettwwoorrkkss:: TTCCPP CCoonnggeessttiioonn CCoonnttrrooll 3344