SlideShare a Scribd company logo
1 of 48
Computer Networks: TCP Congestion Control
Chapter 3
TCP/IP and Congestion Control
TCP/IP Protocol Suite
TCP SERVICES
The relationship of TCP to the other protocols in the TCP/IP
protocol suite. TCP lies between the application layer and the
network layer, and serves as the intermediary between the
application programs and the network operations.
 Process-to-Process Communication
 Stream Delivery Service
 Full-Duplex Communication
 Multiplexing and Demultiplexing
 Connection-Oriented Service
 Reliable Service
TCP/IP Protocol Suite
Figure TCP/IP protocol suite
TCP/IP Protocol Suite
TCP/IP Protocol Suite
TCP FEATURES
To provide the services mentioned in the previous
section, TCP has several features that are briefly
summarized in this section and discussed later in
detail.
 Numbering System
 Flow Control
 Error Control
 Congestion Control
TCP/IP Protocol Suite
The bytes of data being transferred in each
connection are numbered by TCP.
The numbering starts with an arbitrarily
generated number.
TCP/IP Protocol Suite
Suppose a TCP connection is transferring a file of 5,000 bytes.
The first byte is numbered 10,001. What are the sequence
numbers for each segment if data are sent in five segments,
each carrying 1,000 bytes?
Solution
The following shows the sequence number for each segment:
TCP/IP Protocol Suite
The value in the sequence number
field of a segment defines the number
assigned to the first data byte
contained in that segment.
TCP/IP Protocol Suite
The value of the acknowledgment field in a
segment defines the number of the next
byte a party expects to receive.
The acknowledgment number is
cumulative.
TCP/IP Protocol Suite
SEGMENT
Before discussing TCP in more detail, let us discuss
the TCP packets themselves. A packet in TCP is
called a segment.
 Format
 Encapsulation
TCP/IP Protocol Suite
Figure TCP segment format
TCP/IP Protocol Suite
Figure 15.6 Control field
TCP/IP Protocol Suite
The use of the checksum in TCP is
mandatory.
TCP/IP Protocol Suite
Frame
header
IP
header
Figure 15.8 Encapsulation
Application-layer data
TCP
header
Data-link layer payload
IP payload
TCP payload
TCP/IP Protocol Suite
A TCP CONNECTION
TCP is connection-oriented. It establishes a virtual path between the
source and destination. All of the segments belonging to a message are
then sent over this virtual path. You may wonder how TCP, which uses the
services of IP, a connectionless protocol, can be connection-oriented. The
point is that a TCP connection is virtual, not physical. TCP operates at a
higher level. TCP uses the services of IP to deliver individual segments to
the receiver, but it controls the connection itself. If a segment is lost or
corrupted, it is retransmitted.
 Connection Establishment
 Data Transfer
 Connection Termination
 Connection Reset
TCP/IP Protocol Suite
Figure Connection establishment using three-way handshake
SYN
U A P R S F
seq: 8000
SYN + ACK
U A P R S F
seq: 15000
ack: 8001
rwnd: 5000
ACK
U A P R S F
seq: 8000
ack: 15001
rwnd: 10000
TCP/IP Protocol Suite
A SYN segment cannot carry data, but it
consumes one sequence number.
A SYN + ACK segment cannot carry data,
but does consume one
sequence number.
An ACK segment, if carrying no data,
consumes no sequence number.
23.
Figure Connection establishment using three-way handshaking
23.
Figure Data transfer
23.
Figure Connection termination using three-way handshaking
TCP/IP Protocol Suite
The FIN segment consumes one sequence
number if it does
not carry data.
Note
TCP/IP Protocol Suite
The FIN + ACK segment consumes one
sequence number if it does
not carry data.
Note
Computer Networks: TCP Congestion Control
Original Algorithm
•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
Compute a weighted average:
R TT = α x EstimatedRTT + (1- α) x SampleRTT
Original TCP spec: α in range (0.8,0.9)
TimeOut = 2 x RTT
Computer Networks: TCP Congestion Control
Karn/Partidge Algorithm
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.
Sender Receiver
Original transmission
ACK
Retransmission
Sender Receiver
Original transmission
ACK
Retransmission
(a) (b)
Computer Networks: TCP Congestion Control
Karn/Partidge Algorithm
1.Do not measure SampleRTT when sending packet more than once.
2.For each retransmission, set TimeOut to double the last TimeOut.
{ Note – this is a form of exponential backoff based on the believe that
the lost packet is due to congestion.}
Computer Networks: TCP Congestion Control
Jacobnson/Karels Algorithm
The problem with the original algorithm is that it did not take into account
the variance of SampleRTT.
TimeOut = µ x EstimatedRTT+ Φ x Deviation
where based on experience µ = 1 and Φ = 4. so,
Timeout = Estimated RTT + 4 * Deviation
Deviation = (1 -α) * DeviationRTT + α* |SampleRTT -
Estimated RTT|
where α = 0.25
Deviation is an estimate how much SampleRTT typically deviates
from Estimated RTT.
If there is little fluctuation in SampleRTT then Deviation is small and
Timeout is only a little more than Estimated RTT.
If there is lot of fluctuation, the TimeOut will be much larger than
SampleRTT
Evolution of TCP
1975 1980 1985 1990
1982
TCP & IP
RFC 793 & 791
1974
TCP described by
Vint Cerf and Bob Kahn
In IEEE Trans Comm
1983
BSD Unix 4.2
supports TCP/IP
1984
Nagel’s algorithm
to reduce overhead
of small packets;
predicts congestion
collapse
1987
Karn’s algorithm
to better estimate
round-trip time
1986
Congestion collapse
observed
1988
Van Jacobson’s algorithms
congestion avoidance and
congestion control
(most implemented in
4.3BSD Tahoe)
1990
4.3BSD Reno
fast retransmit
delayed ACK’s
1975
Three-way handshake
Raymond Tomlinson
In SIGCOMM 75
TCP Through the 1990s
1993 1994 1996
1994
ECN
(Floyd)
Explicit
Congestion
Notification
1993
TCP Vegas
(Brakmo et al)
real congestion
avoidance
1994
T/TCP
(Braden)
Transaction
TCP
1996
SACK TCP
(Floyd et al)
Selective
Acknowledgement
1996
THoe
Improving TCP
startup
1996
FACK TCP
(Mathis et al)
extension to SACK
New TCP Flavours
• Much better than the old TCP Flavours
30
Why are the new flavours better?
• Efficiency!
• When TCP Tahoe and Reno were created, we did not know as much about the
internet as we do now. New technology has been created that better suit the
model of how the internet actually works.
• Specialization
• Not all machines connect to the internet under the same circumstances. Some of
the new TCP flavours provide enhanced performance when dealing with networks
that are not the usual type.
• Integrability
• TCP New Reno, Vegas and Hybla can all play nice when connecting to networks
currently running TCP Reno.
TCP congestion-avoidance algorithm
 TCP Tahoe and Reno
 TCP New Reno
 TCP Vegas
 TCP Hybla
 TCP BIC, Binary Increase Congestion control, Linux
 TCP CUBIC, Linux and Windows
 TCP Compound TCP,(2003)
 TCP Fast TCP,
 TCP H-TCP,
 TCP Westwood+ (1999),Linux
 Compound TCP(2014),Linux
 TCP Proportional Rate Reduction,Linux
 TCP BBR (2016), Google,Linux
TCP/IP Protocol Suite
Congestion Window
Algorithm
•Congestion control algorithm. A modification to the algorithm for
increasing TCP's congestion window (cwnd) that improves both
performance and security.
•Rather than increasing a TCP's congestion window based on the number of
acknowledgments (ACKs) that arrive at the data sender, the congestion
window is increased based on the number of bytes acknowledged by the
arriving ACKs.
•The algorithm improves performance by mitigating (justifying) the impact
of delayed ACKs on the growth of cwnd.
•At the same time, the algorithm provides cwnd growth in direct relation to
the probed capacity of a network path, therefore providing a more measured
response to ACKs that cover only small amounts of data (less than a full
segment size) than ACK counting.
•This more appropriate cwnd growth can improve both performance and can
prevent inappropriate cwnd growth in response to a misbehaving receiver.
•On the other hand, in some cases the modified cwnd growth algorithm
causes larger bursts of segments to be sent into the network. In some cases
this can lead to a non-negligible increase in the drop rate and reduced
performance
Four Components in TCP Congestion Control
1. Slow Start Technique
2. AIMD Technique
3. Fast Retransmit
4. Fast Recovery
Congestion policy in TCP –
Slow Start Phase: starts slowly increment is exponential to
threshold (exponential increment)
Congestion Avoidance Phase: After reaching the threshold
increment is by 1 (additive increment)
Congestion Detection Phase: Sender goes back to Slow
start phase or Congestion avoidance phase. (multiplicative
decrement)
Slow Start Phase : exponential increment – In this phase after
every RTT the congestion window size increments
exponentially.
Congestion Avoidance Phase : additive increment – This
phase starts after the threshold value also denoted as ssthresh.
The size of cwnd(congestion window) increases additive.
After each RTT cwnd = cwnd + 1.
Congestion Detection Phase : multiplicative decrement
If congestion occurs, the congestion window size is
decreased. The only way a sender can guess that
congestion has occurred is the need to retransmit a
segment.
Retransmission is needed to recover a missing packet
which is assumed to have been dropped by a router due
to congestion. Retransmission can occur in one of two
cases: when the RTO timer times out or when three
duplicate ACKs are received.
Computer Networks: TCP Congestion Control
Slow Start
•TCP uses a mechanism called slow start to increase the
congestion window after a connection is initialized or
after a timeout. It starts with a window of two times
the maximum segment size (MSS)
•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.
In the slow start algorithm, the size of the
congestion window increases exponentially
until it reaches a threshold.
TCP/IP Protocol Suite
Figure 15.34 Slow start, exponential increase
TCP/IP Protocol Suite
In the congestion avoidance algorithm the
size of the congestion window
increases additively until
congestion is detected.
On timeout:
1. Congestion window is reset to 1 MSS.
2. "ssthresh" is set to half the congestion
window size before segment loss started.
3. "slow start" is initiated.
Case 1 : Retransmission due to Timeout – In this case congestion
possibility is high.
(a) ssthresh is reduced to half of the current window size.
(b) set cwnd = 1
(c) start with slow start phase again.
Case 2 : Retransmission due to 3 Acknowledgement Duplicates
– In this case congestion possibility is less.
(a) ssthresh value reduces to half of the current window size.
(b) set cwnd= ssthresh
(c) start with congestion avoidance phase
TCP/IP Protocol Suite
Figure 15.37 Congestion example
Computer Networks: TCP Congestion Control
Fast Retransmit TCP Tahoe
•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: TCP Congestion Control
Fast Retransmit
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
ACK 2
Sender Receiver
Fast Retransmit
Based on three
duplicate ACKs
Computer Networks: TCP Congestion Control
Fast Retransmit Advantages
•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: TCP Congestion Control
Fast Recovery TCP Reno
•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.

More Related Content

Similar to chapter 3.2 TCP.pptx

TransportLayerServices.ppt
TransportLayerServices.pptTransportLayerServices.ppt
TransportLayerServices.pptSwatiRani13
 
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
 
Studying_the_TCP_Flow_and_Congestion_Con.pdf
Studying_the_TCP_Flow_and_Congestion_Con.pdfStudying_the_TCP_Flow_and_Congestion_Con.pdf
Studying_the_TCP_Flow_and_Congestion_Con.pdfIUA
 
Analytical Research of TCP Variants in Terms of Maximum Throughput
Analytical Research of TCP Variants in Terms of Maximum ThroughputAnalytical Research of TCP Variants in Terms of Maximum Throughput
Analytical Research of TCP Variants in Terms of Maximum ThroughputIJLT EMAS
 
IMPACT OF CONTENTION WINDOW ON CONGESTION CONTROL ALGORITHMS FOR WIRELESS ADH...
IMPACT OF CONTENTION WINDOW ON CONGESTION CONTROL ALGORITHMS FOR WIRELESS ADH...IMPACT OF CONTENTION WINDOW ON CONGESTION CONTROL ALGORITHMS FOR WIRELESS ADH...
IMPACT OF CONTENTION WINDOW ON CONGESTION CONTROL ALGORITHMS FOR WIRELESS ADH...cscpconf
 
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
 
Explicit congestion notification
Explicit congestion notificationExplicit congestion notification
Explicit congestion notificationAbhishek Kesharwani
 
Performance Evaluation of High Speed Congestion Control Protocols
Performance Evaluation of High Speed Congestion Control  ProtocolsPerformance Evaluation of High Speed Congestion Control  Protocols
Performance Evaluation of High Speed Congestion Control ProtocolsIOSR Journals
 
Tcp congestion avoidance algorithm identification
Tcp congestion avoidance algorithm identificationTcp congestion avoidance algorithm identification
Tcp congestion avoidance algorithm identificationBala Lavanya
 
tcpcongest
tcpcongesttcpcongest
tcpcongestBill Bao
 
A Packet Drop Guesser Module for Congestion Control Protocols for High speed ...
A Packet Drop Guesser Module for Congestion Control Protocols for High speed ...A Packet Drop Guesser Module for Congestion Control Protocols for High speed ...
A Packet Drop Guesser Module for Congestion Control Protocols for High speed ...ijcseit
 
A packet drop guesser module for congestion Control protocols for high speed ...
A packet drop guesser module for congestion Control protocols for high speed ...A packet drop guesser module for congestion Control protocols for high speed ...
A packet drop guesser module for congestion Control protocols for high speed ...ijcseit
 

Similar to chapter 3.2 TCP.pptx (20)

TransportLayerServices.ppt
TransportLayerServices.pptTransportLayerServices.ppt
TransportLayerServices.ppt
 
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
 
Studying_the_TCP_Flow_and_Congestion_Con.pdf
Studying_the_TCP_Flow_and_Congestion_Con.pdfStudying_the_TCP_Flow_and_Congestion_Con.pdf
Studying_the_TCP_Flow_and_Congestion_Con.pdf
 
Analytical Research of TCP Variants in Terms of Maximum Throughput
Analytical Research of TCP Variants in Terms of Maximum ThroughputAnalytical Research of TCP Variants in Terms of Maximum Throughput
Analytical Research of TCP Variants in Terms of Maximum Throughput
 
TCP Congestion Control
TCP Congestion ControlTCP Congestion Control
TCP Congestion Control
 
IMPACT OF CONTENTION WINDOW ON CONGESTION CONTROL ALGORITHMS FOR WIRELESS ADH...
IMPACT OF CONTENTION WINDOW ON CONGESTION CONTROL ALGORITHMS FOR WIRELESS ADH...IMPACT OF CONTENTION WINDOW ON CONGESTION CONTROL ALGORITHMS FOR WIRELESS ADH...
IMPACT OF CONTENTION WINDOW ON CONGESTION CONTROL ALGORITHMS FOR WIRELESS ADH...
 
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)
 
NE #1.pptx
NE #1.pptxNE #1.pptx
NE #1.pptx
 
Explicit congestion notification
Explicit congestion notificationExplicit congestion notification
Explicit congestion notification
 
Performance Evaluation of High Speed Congestion Control Protocols
Performance Evaluation of High Speed Congestion Control  ProtocolsPerformance Evaluation of High Speed Congestion Control  Protocols
Performance Evaluation of High Speed Congestion Control Protocols
 
TCP_Congestion_Control.ppt
TCP_Congestion_Control.pptTCP_Congestion_Control.ppt
TCP_Congestion_Control.ppt
 
Wmc 023
Wmc  023Wmc  023
Wmc 023
 
Tcp congestion avoidance algorithm identification
Tcp congestion avoidance algorithm identificationTcp congestion avoidance algorithm identification
Tcp congestion avoidance algorithm identification
 
Mcseminar
McseminarMcseminar
Mcseminar
 
tcpcongest
tcpcongesttcpcongest
tcpcongest
 
計概
計概計概
計概
 
A Packet Drop Guesser Module for Congestion Control Protocols for High speed ...
A Packet Drop Guesser Module for Congestion Control Protocols for High speed ...A Packet Drop Guesser Module for Congestion Control Protocols for High speed ...
A Packet Drop Guesser Module for Congestion Control Protocols for High speed ...
 
A packet drop guesser module for congestion Control protocols for high speed ...
A packet drop guesser module for congestion Control protocols for high speed ...A packet drop guesser module for congestion Control protocols for high speed ...
A packet drop guesser module for congestion Control protocols for high speed ...
 

More from Tekle12

Chapter 3 Naming in distributed system.pptx
Chapter 3 Naming in distributed system.pptxChapter 3 Naming in distributed system.pptx
Chapter 3 Naming in distributed system.pptxTekle12
 
Chapter Introductionn to distributed system .pptx
Chapter Introductionn to distributed system .pptxChapter Introductionn to distributed system .pptx
Chapter Introductionn to distributed system .pptxTekle12
 
Chapter 6emerging technology - EMTE.pptx
Chapter 6emerging technology - EMTE.pptxChapter 6emerging technology - EMTE.pptx
Chapter 6emerging technology - EMTE.pptxTekle12
 
Chapter 4about internet of things IoT.pptx
Chapter 4about internet of things IoT.pptxChapter 4about internet of things IoT.pptx
Chapter 4about internet of things IoT.pptxTekle12
 
Design and analysis of algorithm chapter two.pptx
Design and analysis of algorithm chapter two.pptxDesign and analysis of algorithm chapter two.pptx
Design and analysis of algorithm chapter two.pptxTekle12
 
Chapter1.1 Introduction to design and analysis of algorithm.ppt
Chapter1.1 Introduction to design and analysis of algorithm.pptChapter1.1 Introduction to design and analysis of algorithm.ppt
Chapter1.1 Introduction to design and analysis of algorithm.pptTekle12
 
Chapter 6 WSN.ppt
Chapter 6 WSN.pptChapter 6 WSN.ppt
Chapter 6 WSN.pptTekle12
 
Chapter 2.1.pptx
Chapter 2.1.pptxChapter 2.1.pptx
Chapter 2.1.pptxTekle12
 
CHAPTER-3a.ppt
CHAPTER-3a.pptCHAPTER-3a.ppt
CHAPTER-3a.pptTekle12
 
CHAPTER-5.ppt
CHAPTER-5.pptCHAPTER-5.ppt
CHAPTER-5.pptTekle12
 
CHAPTER-2.ppt
CHAPTER-2.pptCHAPTER-2.ppt
CHAPTER-2.pptTekle12
 
CHAPTER-1.ppt
CHAPTER-1.pptCHAPTER-1.ppt
CHAPTER-1.pptTekle12
 
Chapter 1 - Intro to Emerging Technologies.pptx
Chapter 1 - Intro to Emerging Technologies.pptxChapter 1 - Intro to Emerging Technologies.pptx
Chapter 1 - Intro to Emerging Technologies.pptxTekle12
 
Chapter 2.1.pptx
Chapter 2.1.pptxChapter 2.1.pptx
Chapter 2.1.pptxTekle12
 
Chapter 1 - EMTE.pptx
Chapter 1 - EMTE.pptxChapter 1 - EMTE.pptx
Chapter 1 - EMTE.pptxTekle12
 
Chapter 1.pptx
Chapter 1.pptxChapter 1.pptx
Chapter 1.pptxTekle12
 
Chapter 3.pptx
Chapter 3.pptxChapter 3.pptx
Chapter 3.pptxTekle12
 
chapter 6.1.pptx
chapter 6.1.pptxchapter 6.1.pptx
chapter 6.1.pptxTekle12
 
Chapter 4.pptx
Chapter 4.pptxChapter 4.pptx
Chapter 4.pptxTekle12
 
Chapter 5.pptx
Chapter 5.pptxChapter 5.pptx
Chapter 5.pptxTekle12
 

More from Tekle12 (20)

Chapter 3 Naming in distributed system.pptx
Chapter 3 Naming in distributed system.pptxChapter 3 Naming in distributed system.pptx
Chapter 3 Naming in distributed system.pptx
 
Chapter Introductionn to distributed system .pptx
Chapter Introductionn to distributed system .pptxChapter Introductionn to distributed system .pptx
Chapter Introductionn to distributed system .pptx
 
Chapter 6emerging technology - EMTE.pptx
Chapter 6emerging technology - EMTE.pptxChapter 6emerging technology - EMTE.pptx
Chapter 6emerging technology - EMTE.pptx
 
Chapter 4about internet of things IoT.pptx
Chapter 4about internet of things IoT.pptxChapter 4about internet of things IoT.pptx
Chapter 4about internet of things IoT.pptx
 
Design and analysis of algorithm chapter two.pptx
Design and analysis of algorithm chapter two.pptxDesign and analysis of algorithm chapter two.pptx
Design and analysis of algorithm chapter two.pptx
 
Chapter1.1 Introduction to design and analysis of algorithm.ppt
Chapter1.1 Introduction to design and analysis of algorithm.pptChapter1.1 Introduction to design and analysis of algorithm.ppt
Chapter1.1 Introduction to design and analysis of algorithm.ppt
 
Chapter 6 WSN.ppt
Chapter 6 WSN.pptChapter 6 WSN.ppt
Chapter 6 WSN.ppt
 
Chapter 2.1.pptx
Chapter 2.1.pptxChapter 2.1.pptx
Chapter 2.1.pptx
 
CHAPTER-3a.ppt
CHAPTER-3a.pptCHAPTER-3a.ppt
CHAPTER-3a.ppt
 
CHAPTER-5.ppt
CHAPTER-5.pptCHAPTER-5.ppt
CHAPTER-5.ppt
 
CHAPTER-2.ppt
CHAPTER-2.pptCHAPTER-2.ppt
CHAPTER-2.ppt
 
CHAPTER-1.ppt
CHAPTER-1.pptCHAPTER-1.ppt
CHAPTER-1.ppt
 
Chapter 1 - Intro to Emerging Technologies.pptx
Chapter 1 - Intro to Emerging Technologies.pptxChapter 1 - Intro to Emerging Technologies.pptx
Chapter 1 - Intro to Emerging Technologies.pptx
 
Chapter 2.1.pptx
Chapter 2.1.pptxChapter 2.1.pptx
Chapter 2.1.pptx
 
Chapter 1 - EMTE.pptx
Chapter 1 - EMTE.pptxChapter 1 - EMTE.pptx
Chapter 1 - EMTE.pptx
 
Chapter 1.pptx
Chapter 1.pptxChapter 1.pptx
Chapter 1.pptx
 
Chapter 3.pptx
Chapter 3.pptxChapter 3.pptx
Chapter 3.pptx
 
chapter 6.1.pptx
chapter 6.1.pptxchapter 6.1.pptx
chapter 6.1.pptx
 
Chapter 4.pptx
Chapter 4.pptxChapter 4.pptx
Chapter 4.pptx
 
Chapter 5.pptx
Chapter 5.pptxChapter 5.pptx
Chapter 5.pptx
 

Recently uploaded

Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 

Recently uploaded (20)

Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 

chapter 3.2 TCP.pptx

  • 1. Computer Networks: TCP Congestion Control Chapter 3 TCP/IP and Congestion Control
  • 2. TCP/IP Protocol Suite TCP SERVICES The relationship of TCP to the other protocols in the TCP/IP protocol suite. TCP lies between the application layer and the network layer, and serves as the intermediary between the application programs and the network operations.  Process-to-Process Communication  Stream Delivery Service  Full-Duplex Communication  Multiplexing and Demultiplexing  Connection-Oriented Service  Reliable Service
  • 3. TCP/IP Protocol Suite Figure TCP/IP protocol suite
  • 5. TCP/IP Protocol Suite TCP FEATURES To provide the services mentioned in the previous section, TCP has several features that are briefly summarized in this section and discussed later in detail.  Numbering System  Flow Control  Error Control  Congestion Control
  • 6. TCP/IP Protocol Suite The bytes of data being transferred in each connection are numbered by TCP. The numbering starts with an arbitrarily generated number.
  • 7. TCP/IP Protocol Suite Suppose a TCP connection is transferring a file of 5,000 bytes. The first byte is numbered 10,001. What are the sequence numbers for each segment if data are sent in five segments, each carrying 1,000 bytes? Solution The following shows the sequence number for each segment:
  • 8. TCP/IP Protocol Suite The value in the sequence number field of a segment defines the number assigned to the first data byte contained in that segment.
  • 9. TCP/IP Protocol Suite The value of the acknowledgment field in a segment defines the number of the next byte a party expects to receive. The acknowledgment number is cumulative.
  • 10. TCP/IP Protocol Suite SEGMENT Before discussing TCP in more detail, let us discuss the TCP packets themselves. A packet in TCP is called a segment.  Format  Encapsulation
  • 11. TCP/IP Protocol Suite Figure TCP segment format
  • 12. TCP/IP Protocol Suite Figure 15.6 Control field
  • 13. TCP/IP Protocol Suite The use of the checksum in TCP is mandatory.
  • 14. TCP/IP Protocol Suite Frame header IP header Figure 15.8 Encapsulation Application-layer data TCP header Data-link layer payload IP payload TCP payload
  • 15. TCP/IP Protocol Suite A TCP CONNECTION TCP is connection-oriented. It establishes a virtual path between the source and destination. All of the segments belonging to a message are then sent over this virtual path. You may wonder how TCP, which uses the services of IP, a connectionless protocol, can be connection-oriented. The point is that a TCP connection is virtual, not physical. TCP operates at a higher level. TCP uses the services of IP to deliver individual segments to the receiver, but it controls the connection itself. If a segment is lost or corrupted, it is retransmitted.  Connection Establishment  Data Transfer  Connection Termination  Connection Reset
  • 16. TCP/IP Protocol Suite Figure Connection establishment using three-way handshake SYN U A P R S F seq: 8000 SYN + ACK U A P R S F seq: 15000 ack: 8001 rwnd: 5000 ACK U A P R S F seq: 8000 ack: 15001 rwnd: 10000
  • 17. TCP/IP Protocol Suite A SYN segment cannot carry data, but it consumes one sequence number. A SYN + ACK segment cannot carry data, but does consume one sequence number. An ACK segment, if carrying no data, consumes no sequence number.
  • 18. 23. Figure Connection establishment using three-way handshaking
  • 20. 23. Figure Connection termination using three-way handshaking
  • 21. TCP/IP Protocol Suite The FIN segment consumes one sequence number if it does not carry data. Note
  • 22. TCP/IP Protocol Suite The FIN + ACK segment consumes one sequence number if it does not carry data. Note
  • 23. Computer Networks: TCP Congestion Control Original Algorithm •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 Compute a weighted average: R TT = α x EstimatedRTT + (1- α) x SampleRTT Original TCP spec: α in range (0.8,0.9) TimeOut = 2 x RTT
  • 24. Computer Networks: TCP Congestion Control Karn/Partidge Algorithm 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. Sender Receiver Original transmission ACK Retransmission Sender Receiver Original transmission ACK Retransmission (a) (b)
  • 25. Computer Networks: TCP Congestion Control Karn/Partidge Algorithm 1.Do not measure SampleRTT when sending packet more than once. 2.For each retransmission, set TimeOut to double the last TimeOut. { Note – this is a form of exponential backoff based on the believe that the lost packet is due to congestion.}
  • 26. Computer Networks: TCP Congestion Control Jacobnson/Karels Algorithm The problem with the original algorithm is that it did not take into account the variance of SampleRTT. TimeOut = µ x EstimatedRTT+ Φ x Deviation where based on experience µ = 1 and Φ = 4. so, Timeout = Estimated RTT + 4 * Deviation
  • 27. Deviation = (1 -α) * DeviationRTT + α* |SampleRTT - Estimated RTT| where α = 0.25 Deviation is an estimate how much SampleRTT typically deviates from Estimated RTT. If there is little fluctuation in SampleRTT then Deviation is small and Timeout is only a little more than Estimated RTT. If there is lot of fluctuation, the TimeOut will be much larger than SampleRTT
  • 28. Evolution of TCP 1975 1980 1985 1990 1982 TCP & IP RFC 793 & 791 1974 TCP described by Vint Cerf and Bob Kahn In IEEE Trans Comm 1983 BSD Unix 4.2 supports TCP/IP 1984 Nagel’s algorithm to reduce overhead of small packets; predicts congestion collapse 1987 Karn’s algorithm to better estimate round-trip time 1986 Congestion collapse observed 1988 Van Jacobson’s algorithms congestion avoidance and congestion control (most implemented in 4.3BSD Tahoe) 1990 4.3BSD Reno fast retransmit delayed ACK’s 1975 Three-way handshake Raymond Tomlinson In SIGCOMM 75
  • 29. TCP Through the 1990s 1993 1994 1996 1994 ECN (Floyd) Explicit Congestion Notification 1993 TCP Vegas (Brakmo et al) real congestion avoidance 1994 T/TCP (Braden) Transaction TCP 1996 SACK TCP (Floyd et al) Selective Acknowledgement 1996 THoe Improving TCP startup 1996 FACK TCP (Mathis et al) extension to SACK
  • 30. New TCP Flavours • Much better than the old TCP Flavours 30
  • 31. Why are the new flavours better? • Efficiency! • When TCP Tahoe and Reno were created, we did not know as much about the internet as we do now. New technology has been created that better suit the model of how the internet actually works. • Specialization • Not all machines connect to the internet under the same circumstances. Some of the new TCP flavours provide enhanced performance when dealing with networks that are not the usual type. • Integrability • TCP New Reno, Vegas and Hybla can all play nice when connecting to networks currently running TCP Reno.
  • 32. TCP congestion-avoidance algorithm  TCP Tahoe and Reno  TCP New Reno  TCP Vegas  TCP Hybla  TCP BIC, Binary Increase Congestion control, Linux  TCP CUBIC, Linux and Windows  TCP Compound TCP,(2003)  TCP Fast TCP,  TCP H-TCP,  TCP Westwood+ (1999),Linux  Compound TCP(2014),Linux  TCP Proportional Rate Reduction,Linux  TCP BBR (2016), Google,Linux
  • 34. •Congestion control algorithm. A modification to the algorithm for increasing TCP's congestion window (cwnd) that improves both performance and security. •Rather than increasing a TCP's congestion window based on the number of acknowledgments (ACKs) that arrive at the data sender, the congestion window is increased based on the number of bytes acknowledged by the arriving ACKs. •The algorithm improves performance by mitigating (justifying) the impact of delayed ACKs on the growth of cwnd.
  • 35. •At the same time, the algorithm provides cwnd growth in direct relation to the probed capacity of a network path, therefore providing a more measured response to ACKs that cover only small amounts of data (less than a full segment size) than ACK counting. •This more appropriate cwnd growth can improve both performance and can prevent inappropriate cwnd growth in response to a misbehaving receiver. •On the other hand, in some cases the modified cwnd growth algorithm causes larger bursts of segments to be sent into the network. In some cases this can lead to a non-negligible increase in the drop rate and reduced performance
  • 36. Four Components in TCP Congestion Control 1. Slow Start Technique 2. AIMD Technique 3. Fast Retransmit 4. Fast Recovery
  • 37. Congestion policy in TCP – Slow Start Phase: starts slowly increment is exponential to threshold (exponential increment) Congestion Avoidance Phase: After reaching the threshold increment is by 1 (additive increment) Congestion Detection Phase: Sender goes back to Slow start phase or Congestion avoidance phase. (multiplicative decrement)
  • 38. Slow Start Phase : exponential increment – In this phase after every RTT the congestion window size increments exponentially. Congestion Avoidance Phase : additive increment – This phase starts after the threshold value also denoted as ssthresh. The size of cwnd(congestion window) increases additive. After each RTT cwnd = cwnd + 1.
  • 39. Congestion Detection Phase : multiplicative decrement If congestion occurs, the congestion window size is decreased. The only way a sender can guess that congestion has occurred is the need to retransmit a segment. Retransmission is needed to recover a missing packet which is assumed to have been dropped by a router due to congestion. Retransmission can occur in one of two cases: when the RTO timer times out or when three duplicate ACKs are received.
  • 40. Computer Networks: TCP Congestion Control Slow Start •TCP uses a mechanism called slow start to increase the congestion window after a connection is initialized or after a timeout. It starts with a window of two times the maximum segment size (MSS) •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. In the slow start algorithm, the size of the congestion window increases exponentially until it reaches a threshold.
  • 41. TCP/IP Protocol Suite Figure 15.34 Slow start, exponential increase
  • 42. TCP/IP Protocol Suite In the congestion avoidance algorithm the size of the congestion window increases additively until congestion is detected. On timeout: 1. Congestion window is reset to 1 MSS. 2. "ssthresh" is set to half the congestion window size before segment loss started. 3. "slow start" is initiated.
  • 43. Case 1 : Retransmission due to Timeout – In this case congestion possibility is high. (a) ssthresh is reduced to half of the current window size. (b) set cwnd = 1 (c) start with slow start phase again. Case 2 : Retransmission due to 3 Acknowledgement Duplicates – In this case congestion possibility is less. (a) ssthresh value reduces to half of the current window size. (b) set cwnd= ssthresh (c) start with congestion avoidance phase
  • 44. TCP/IP Protocol Suite Figure 15.37 Congestion example
  • 45. Computer Networks: TCP Congestion Control Fast Retransmit TCP Tahoe •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.
  • 46. Computer Networks: TCP Congestion Control Fast Retransmit 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 ACK 2 Sender Receiver Fast Retransmit Based on three duplicate ACKs
  • 47. Computer Networks: TCP Congestion Control Fast Retransmit Advantages •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.
  • 48. Computer Networks: TCP Congestion Control Fast Recovery TCP Reno •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.