SlideShare a Scribd company logo
1 of 28
TCP
CS4482 High Performance Networking
Dilum Bandara
Dilum.Bandara@uom.lk
Some slides extracted from Dr. Dan Massey’s CS557 class at Colorado
State University
TCP Properties
 Point-to-point
 One sender & one receiver
 Connection-oriented
 Handshaking (exchange of control msgs)
 Initialize sender & receiver state before data
exchange
 Flow controlled
 Sender will not overwhelm receiver
 Send & receive buffers
2
TCP Properties (Cont.)
 Full duplex
 Bi-directional data flow within same connection
 Reliable, in-order byte stream
 No “message boundaries”
 Maximum Segment Size (MSS)
 Pipelined
 TCP congestion & flow control set window size
 Fair
3
TCP UDP
Reliable Best effort
Connection oriented Connection less
Segmented retransmission
& flow control through
windowing
No
Segmented sequencing No
Acknowledge segments No
Slow start Full speed
TCP vs. UDP
4
TCP Connection Establishment &
Termination
5
http://pic.dhe.ibm.com/infocenter/tpfhelp/
http://technet.microsoft.com/en-us/magazine/2007.01.cableguy.aspx
TCP Flow Control
 Sender won’t overflow receiver’s buffer by transmitting too
much, too fast
 Receiver advertises spare room by including value of
RcvWindow in segments
 Sender limits unACKed data to RcvWindow
 Guarantees receive buffer doesn’t overflow
6
TCP Flow Control (Cont.)
 Seq. Nos
 Byte stream “number” of 1st
byte in segment’s data
 ACKs
 Seq No of next byte
expected from other side
 Cumulative ACK
7
Challenges
 Connection never reaches equilibrium
 Too many initial packets drives network into
congestion & then hard to recover
 Sender adds packets before one leaves
 Poor timer causes retransmission of packets that are
still in-flight on network
 Equilibrium can’t be reached due to resource
limits on path
 Assume packet loss is due to congestion & back off
by multiplicative factor
8
TCP – Retransmission Scenarios
9
TCP – Retransmission Scenarios
(Cont.)
10
Congestion Avoidance & Control
 “Congestion Avoidance and Control” by
Jacobson and Karels, 1988
 Objective
 Techniques for dealing with network congestion
 Approach
 Slow start
 Adaptive timers
 Additive increase/multiplicitive decrease
 Contributions
 Essential points of TCP congestion control
11
Motivation
 Network collapsing due to congestion
 Throughput dropped from 32 Kbps to 40 bps
 Conclusion  packet switching failed…
 Paper says we can fix the problem
 Conservation of packets
 Can’t have collapse if packets entering network =
packets leaving network
12
Slow Start
 TCP is self-clocking
 Receipt of ACK triggers sending a new packet
 Good if network is in stable state
 How to ramp up at start?
 Start slow
 Initially send 1 packet
 Each ACK triggers 2 packets
 Quickly ramp up window to correct size
13
Slow Start
14
http://user.it.uu.se/~carle/Notes/43_TCP.html
TCP Timeout Values
 How to set TCP timeout value?
 Longer than RTT
 But RTT varies
 Too short  premature timeout , unnecessary
retransmissions
 Too long  slow reaction to segment loss
 How to estimate RTT?
 SampleRTT
 Measured time from segment transmission until ACK receipt
 Ignore retransmissions
 SampleRTT will vary, want estimated RTT to be “smoother”
 Average several recent measurements, not just current
SampleRTT 15
RTT Distribution
16
http://user.it.uu.se/~carle/Notes/43_TCP.html
RTT Estimation
EstimatedRTT = (1 – α) ×EstimatedRTT +
α×SampleRTT
 Exponential weighted moving average
 Influence of past sample decreases exponentially fast
 Typical value: α=0.125
 Setting timeout
 EstimtedRTT plus “safety margin”
 Large variation in EstimatedRTT  Larger safety margin
 1st estimate of how much SampleRTT deviates from
EstimatedRTT
17
Example RTT Estimation
18
TCP Congestion Control Review
 When CongWin is below Threshold
 Sender in slow-start phase, window grows exponentially
 When CongWin is above Threshold
 Sender is in congestion-avoidance phase, window
grows linearly
 When a triple duplicate ACK occurs
 i.e., four ACKs acknowledging the same packet
 Threshold set to CongWin/2 & CongWin set to
Threshold
 When timeout occurs
 Threshold set to CongWin/2 & CongWin is set to 1 MSS
19
TCP Window Size Over Time
20
TCP Tahoe & Reno
 Tahoe
 Triple duplicate ACKS are treated same as a timeout
 Perform fast retransmit
 Set slow start threshold to ½ current congestion
window, reduce congestion window to 1 MSS
 Go to slow-start state
 Reno
 Three duplicate ACKs are received
 Perform fast retransmit
 ½ the congestion window, set slow start threshold to
new congestion window
 Enters a phase called “Fast Recovery” 21
Fast Retransmit
 Time-out period is often relatively long
 Long delay before resending lost packet
 Detect lost segments via duplicate ACKs
 Sender often sends many segments back-to-back
 If segment is lost, there will likely be many duplicate
ACKs
 If sender receives 3 ACKs for same data, it
supposes that segment after ACKed data was
lost
 Fast retransmit – Resend segment before timer
expires
22
Fast Retransmit (Cont.)
23
http://cnp3book.info.ucl.ac.be/transport/tcp/
TCP ACK Generation [RFC 1122, RFC 2581]
24
Event at Receiver TCP Receiver Action
Arrival of in-order segment with
expected seq #. All data up to
expected seq # already ACKed
Delayed ACK. Wait up to 500ms for
next segment. If no next segment,
send ACK
Arrival of in-order segment with
expected seq #. One other
segment has ACK pending
Immediately send single cumulative
ACK, ACKing both in-order
segments
Arrival of out-of-order segment
higher-than-expect seq # . Gap
detected
Immediately send duplicate ACK,
indicating seq. # of next expected
byte
Arrival of segment that partially or
completely fills gap
Immediate send ACK, provided that
segment starts at lower end of gap
Review: Automatic Repeat Request
(ARQ)
 Stop-and-Wait ARQ
 One packet/frame at a time
 Go-Back-N ARQ
 Window of packets/frames on flight
 If a negative ACK is received, restart from lost
packet/frame
 Selective-Repeat ARQ
 Window of packets/frames on flight
 If a negative ACK is received, only lost packet/frame
is send
 Typically used by TCP implementations
 See http://www.ccs-labs.org/teaching/rn/animations/gbn_sr/ 25
ARQ (Cont.)
26
TCP Fairness
 Fairness goal
 If K TCP sessions share same bottleneck link of
bandwidth R, each should have average rate of R/K
 TCP is fair
 Additive increase gives slope of 1, as throughput
increases
 Multiplicative decrease drops throughput proportionally
27
TCP Concerns
 TCP over wireless links
 Packet losses due to errors are no longer insignificant
 Multiplicative decrease is too conservative
 TCP over high bandwidth, low-latency links
 Millions of packets may be on the fly
 Few of those packets will get lost or contain errors
 Multiplicative decrease is too conservative
 Various extensions are proposed to address
these
28

More Related Content

Similar to High Performance Networking with Advanced TCP

NetWork Design Question2.) How does TCP prevent Congestion Dicuss.pdf
NetWork Design Question2.) How does TCP prevent Congestion Dicuss.pdfNetWork Design Question2.) How does TCP prevent Congestion Dicuss.pdf
NetWork Design Question2.) How does TCP prevent Congestion Dicuss.pdfoptokunal1
 
transport layer pptxdkididkdkdkddjjdjffkfif
transport layer pptxdkididkdkdkddjjdjffkfiftransport layer pptxdkididkdkdkddjjdjffkfif
transport layer pptxdkididkdkdkddjjdjffkfifMujtabaFarooq5
 
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
 
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
 
tcp congestion .pptx
tcp congestion .pptxtcp congestion .pptx
tcp congestion .pptxECE01AJAYS
 
Congestion control in tcp
Congestion control in tcpCongestion control in tcp
Congestion control in tcpsamarai_apoc
 
Tcp performance simulationsusingns2
Tcp performance simulationsusingns2Tcp performance simulationsusingns2
Tcp performance simulationsusingns2Justin Frankel
 
Adhoc and Sensor Networks - Chapter 07
Adhoc and Sensor Networks - Chapter 07Adhoc and Sensor Networks - Chapter 07
Adhoc and Sensor Networks - Chapter 07Ali Habeeb
 
chapter 3.2 TCP.pptx
chapter 3.2 TCP.pptxchapter 3.2 TCP.pptx
chapter 3.2 TCP.pptxTekle12
 
Computer network (11)
Computer network (11)Computer network (11)
Computer network (11)NYversity
 
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
 
tcp-wireless-tutorial.ppt
tcp-wireless-tutorial.ppttcp-wireless-tutorial.ppt
tcp-wireless-tutorial.pptRadwan Mahmoud
 

Similar to High Performance Networking with Advanced TCP (20)

NetWork Design Question2.) How does TCP prevent Congestion Dicuss.pdf
NetWork Design Question2.) How does TCP prevent Congestion Dicuss.pdfNetWork Design Question2.) How does TCP prevent Congestion Dicuss.pdf
NetWork Design Question2.) How does TCP prevent Congestion Dicuss.pdf
 
Tcp congestion avoidance
Tcp congestion avoidanceTcp congestion avoidance
Tcp congestion avoidance
 
transport layer pptxdkididkdkdkddjjdjffkfif
transport layer pptxdkididkdkdkddjjdjffkfiftransport layer pptxdkididkdkdkddjjdjffkfif
transport layer pptxdkididkdkdkddjjdjffkfif
 
Mcseminar
McseminarMcseminar
Mcseminar
 
TCP_Congestion_Control.ppt
TCP_Congestion_Control.pptTCP_Congestion_Control.ppt
TCP_Congestion_Control.ppt
 
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
 
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
 
Transport layer
Transport layerTransport layer
Transport layer
 
NE #1.pptx
NE #1.pptxNE #1.pptx
NE #1.pptx
 
tcp congestion .pptx
tcp congestion .pptxtcp congestion .pptx
tcp congestion .pptx
 
Congestion control in tcp
Congestion control in tcpCongestion control in tcp
Congestion control in tcp
 
Tcp performance simulationsusingns2
Tcp performance simulationsusingns2Tcp performance simulationsusingns2
Tcp performance simulationsusingns2
 
Adhoc and Sensor Networks - Chapter 07
Adhoc and Sensor Networks - Chapter 07Adhoc and Sensor Networks - Chapter 07
Adhoc and Sensor Networks - Chapter 07
 
Analysis of TCP variants
Analysis of TCP variantsAnalysis of TCP variants
Analysis of TCP variants
 
chapter 3.2 TCP.pptx
chapter 3.2 TCP.pptxchapter 3.2 TCP.pptx
chapter 3.2 TCP.pptx
 
Tieu luan qo s
Tieu luan qo sTieu luan qo s
Tieu luan qo s
 
Computer network (11)
Computer network (11)Computer network (11)
Computer network (11)
 
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-wireless-tutorial.ppt
tcp-wireless-tutorial.ppttcp-wireless-tutorial.ppt
tcp-wireless-tutorial.ppt
 

More from Dilum Bandara

Introduction to Machine Learning
Introduction to Machine LearningIntroduction to Machine Learning
Introduction to Machine LearningDilum Bandara
 
Time Series Analysis and Forecasting in Practice
Time Series Analysis and Forecasting in PracticeTime Series Analysis and Forecasting in Practice
Time Series Analysis and Forecasting in PracticeDilum Bandara
 
Introduction to Dimension Reduction with PCA
Introduction to Dimension Reduction with PCAIntroduction to Dimension Reduction with PCA
Introduction to Dimension Reduction with PCADilum Bandara
 
Introduction to Descriptive & Predictive Analytics
Introduction to Descriptive & Predictive AnalyticsIntroduction to Descriptive & Predictive Analytics
Introduction to Descriptive & Predictive AnalyticsDilum Bandara
 
Introduction to Concurrent Data Structures
Introduction to Concurrent Data StructuresIntroduction to Concurrent Data Structures
Introduction to Concurrent Data StructuresDilum Bandara
 
Hard to Paralelize Problems: Matrix-Vector and Matrix-Matrix
Hard to Paralelize Problems: Matrix-Vector and Matrix-MatrixHard to Paralelize Problems: Matrix-Vector and Matrix-Matrix
Hard to Paralelize Problems: Matrix-Vector and Matrix-MatrixDilum Bandara
 
Introduction to Map-Reduce Programming with Hadoop
Introduction to Map-Reduce Programming with HadoopIntroduction to Map-Reduce Programming with Hadoop
Introduction to Map-Reduce Programming with HadoopDilum Bandara
 
Embarrassingly/Delightfully Parallel Problems
Embarrassingly/Delightfully Parallel ProblemsEmbarrassingly/Delightfully Parallel Problems
Embarrassingly/Delightfully Parallel ProblemsDilum Bandara
 
Introduction to Warehouse-Scale Computers
Introduction to Warehouse-Scale ComputersIntroduction to Warehouse-Scale Computers
Introduction to Warehouse-Scale ComputersDilum Bandara
 
Introduction to Thread Level Parallelism
Introduction to Thread Level ParallelismIntroduction to Thread Level Parallelism
Introduction to Thread Level ParallelismDilum Bandara
 
CPU Memory Hierarchy and Caching Techniques
CPU Memory Hierarchy and Caching TechniquesCPU Memory Hierarchy and Caching Techniques
CPU Memory Hierarchy and Caching TechniquesDilum Bandara
 
Data-Level Parallelism in Microprocessors
Data-Level Parallelism in MicroprocessorsData-Level Parallelism in Microprocessors
Data-Level Parallelism in MicroprocessorsDilum Bandara
 
Instruction Level Parallelism – Hardware Techniques
Instruction Level Parallelism – Hardware TechniquesInstruction Level Parallelism – Hardware Techniques
Instruction Level Parallelism – Hardware TechniquesDilum Bandara
 
Instruction Level Parallelism – Compiler Techniques
Instruction Level Parallelism – Compiler TechniquesInstruction Level Parallelism – Compiler Techniques
Instruction Level Parallelism – Compiler TechniquesDilum Bandara
 
CPU Pipelining and Hazards - An Introduction
CPU Pipelining and Hazards - An IntroductionCPU Pipelining and Hazards - An Introduction
CPU Pipelining and Hazards - An IntroductionDilum Bandara
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionDilum Bandara
 
Introduction to Content Delivery Networks
Introduction to Content Delivery NetworksIntroduction to Content Delivery Networks
Introduction to Content Delivery NetworksDilum Bandara
 
Peer-to-Peer Networking Systems and Streaming
Peer-to-Peer Networking Systems and StreamingPeer-to-Peer Networking Systems and Streaming
Peer-to-Peer Networking Systems and StreamingDilum Bandara
 
Wired Broadband Communication
Wired Broadband CommunicationWired Broadband Communication
Wired Broadband CommunicationDilum Bandara
 

More from Dilum Bandara (20)

Introduction to Machine Learning
Introduction to Machine LearningIntroduction to Machine Learning
Introduction to Machine Learning
 
Time Series Analysis and Forecasting in Practice
Time Series Analysis and Forecasting in PracticeTime Series Analysis and Forecasting in Practice
Time Series Analysis and Forecasting in Practice
 
Introduction to Dimension Reduction with PCA
Introduction to Dimension Reduction with PCAIntroduction to Dimension Reduction with PCA
Introduction to Dimension Reduction with PCA
 
Introduction to Descriptive & Predictive Analytics
Introduction to Descriptive & Predictive AnalyticsIntroduction to Descriptive & Predictive Analytics
Introduction to Descriptive & Predictive Analytics
 
Introduction to Concurrent Data Structures
Introduction to Concurrent Data StructuresIntroduction to Concurrent Data Structures
Introduction to Concurrent Data Structures
 
Hard to Paralelize Problems: Matrix-Vector and Matrix-Matrix
Hard to Paralelize Problems: Matrix-Vector and Matrix-MatrixHard to Paralelize Problems: Matrix-Vector and Matrix-Matrix
Hard to Paralelize Problems: Matrix-Vector and Matrix-Matrix
 
Introduction to Map-Reduce Programming with Hadoop
Introduction to Map-Reduce Programming with HadoopIntroduction to Map-Reduce Programming with Hadoop
Introduction to Map-Reduce Programming with Hadoop
 
Embarrassingly/Delightfully Parallel Problems
Embarrassingly/Delightfully Parallel ProblemsEmbarrassingly/Delightfully Parallel Problems
Embarrassingly/Delightfully Parallel Problems
 
Introduction to Warehouse-Scale Computers
Introduction to Warehouse-Scale ComputersIntroduction to Warehouse-Scale Computers
Introduction to Warehouse-Scale Computers
 
Introduction to Thread Level Parallelism
Introduction to Thread Level ParallelismIntroduction to Thread Level Parallelism
Introduction to Thread Level Parallelism
 
CPU Memory Hierarchy and Caching Techniques
CPU Memory Hierarchy and Caching TechniquesCPU Memory Hierarchy and Caching Techniques
CPU Memory Hierarchy and Caching Techniques
 
Data-Level Parallelism in Microprocessors
Data-Level Parallelism in MicroprocessorsData-Level Parallelism in Microprocessors
Data-Level Parallelism in Microprocessors
 
Instruction Level Parallelism – Hardware Techniques
Instruction Level Parallelism – Hardware TechniquesInstruction Level Parallelism – Hardware Techniques
Instruction Level Parallelism – Hardware Techniques
 
Instruction Level Parallelism – Compiler Techniques
Instruction Level Parallelism – Compiler TechniquesInstruction Level Parallelism – Compiler Techniques
Instruction Level Parallelism – Compiler Techniques
 
CPU Pipelining and Hazards - An Introduction
CPU Pipelining and Hazards - An IntroductionCPU Pipelining and Hazards - An Introduction
CPU Pipelining and Hazards - An Introduction
 
Advanced Computer Architecture – An Introduction
Advanced Computer Architecture – An IntroductionAdvanced Computer Architecture – An Introduction
Advanced Computer Architecture – An Introduction
 
Introduction to Content Delivery Networks
Introduction to Content Delivery NetworksIntroduction to Content Delivery Networks
Introduction to Content Delivery Networks
 
Peer-to-Peer Networking Systems and Streaming
Peer-to-Peer Networking Systems and StreamingPeer-to-Peer Networking Systems and Streaming
Peer-to-Peer Networking Systems and Streaming
 
Mobile Services
Mobile ServicesMobile Services
Mobile Services
 
Wired Broadband Communication
Wired Broadband CommunicationWired Broadband Communication
Wired Broadband Communication
 

Recently uploaded

From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
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
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
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
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 

Recently uploaded (20)

From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
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...
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
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...
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 

High Performance Networking with Advanced TCP

  • 1. TCP CS4482 High Performance Networking Dilum Bandara Dilum.Bandara@uom.lk Some slides extracted from Dr. Dan Massey’s CS557 class at Colorado State University
  • 2. TCP Properties  Point-to-point  One sender & one receiver  Connection-oriented  Handshaking (exchange of control msgs)  Initialize sender & receiver state before data exchange  Flow controlled  Sender will not overwhelm receiver  Send & receive buffers 2
  • 3. TCP Properties (Cont.)  Full duplex  Bi-directional data flow within same connection  Reliable, in-order byte stream  No “message boundaries”  Maximum Segment Size (MSS)  Pipelined  TCP congestion & flow control set window size  Fair 3
  • 4. TCP UDP Reliable Best effort Connection oriented Connection less Segmented retransmission & flow control through windowing No Segmented sequencing No Acknowledge segments No Slow start Full speed TCP vs. UDP 4
  • 5. TCP Connection Establishment & Termination 5 http://pic.dhe.ibm.com/infocenter/tpfhelp/
  • 6. http://technet.microsoft.com/en-us/magazine/2007.01.cableguy.aspx TCP Flow Control  Sender won’t overflow receiver’s buffer by transmitting too much, too fast  Receiver advertises spare room by including value of RcvWindow in segments  Sender limits unACKed data to RcvWindow  Guarantees receive buffer doesn’t overflow 6
  • 7. TCP Flow Control (Cont.)  Seq. Nos  Byte stream “number” of 1st byte in segment’s data  ACKs  Seq No of next byte expected from other side  Cumulative ACK 7
  • 8. Challenges  Connection never reaches equilibrium  Too many initial packets drives network into congestion & then hard to recover  Sender adds packets before one leaves  Poor timer causes retransmission of packets that are still in-flight on network  Equilibrium can’t be reached due to resource limits on path  Assume packet loss is due to congestion & back off by multiplicative factor 8
  • 10. TCP – Retransmission Scenarios (Cont.) 10
  • 11. Congestion Avoidance & Control  “Congestion Avoidance and Control” by Jacobson and Karels, 1988  Objective  Techniques for dealing with network congestion  Approach  Slow start  Adaptive timers  Additive increase/multiplicitive decrease  Contributions  Essential points of TCP congestion control 11
  • 12. Motivation  Network collapsing due to congestion  Throughput dropped from 32 Kbps to 40 bps  Conclusion  packet switching failed…  Paper says we can fix the problem  Conservation of packets  Can’t have collapse if packets entering network = packets leaving network 12
  • 13. Slow Start  TCP is self-clocking  Receipt of ACK triggers sending a new packet  Good if network is in stable state  How to ramp up at start?  Start slow  Initially send 1 packet  Each ACK triggers 2 packets  Quickly ramp up window to correct size 13
  • 15. TCP Timeout Values  How to set TCP timeout value?  Longer than RTT  But RTT varies  Too short  premature timeout , unnecessary retransmissions  Too long  slow reaction to segment loss  How to estimate RTT?  SampleRTT  Measured time from segment transmission until ACK receipt  Ignore retransmissions  SampleRTT will vary, want estimated RTT to be “smoother”  Average several recent measurements, not just current SampleRTT 15
  • 17. RTT Estimation EstimatedRTT = (1 – α) ×EstimatedRTT + α×SampleRTT  Exponential weighted moving average  Influence of past sample decreases exponentially fast  Typical value: α=0.125  Setting timeout  EstimtedRTT plus “safety margin”  Large variation in EstimatedRTT  Larger safety margin  1st estimate of how much SampleRTT deviates from EstimatedRTT 17
  • 19. TCP Congestion Control Review  When CongWin is below Threshold  Sender in slow-start phase, window grows exponentially  When CongWin is above Threshold  Sender is in congestion-avoidance phase, window grows linearly  When a triple duplicate ACK occurs  i.e., four ACKs acknowledging the same packet  Threshold set to CongWin/2 & CongWin set to Threshold  When timeout occurs  Threshold set to CongWin/2 & CongWin is set to 1 MSS 19
  • 20. TCP Window Size Over Time 20
  • 21. TCP Tahoe & Reno  Tahoe  Triple duplicate ACKS are treated same as a timeout  Perform fast retransmit  Set slow start threshold to ½ current congestion window, reduce congestion window to 1 MSS  Go to slow-start state  Reno  Three duplicate ACKs are received  Perform fast retransmit  ½ the congestion window, set slow start threshold to new congestion window  Enters a phase called “Fast Recovery” 21
  • 22. Fast Retransmit  Time-out period is often relatively long  Long delay before resending lost packet  Detect lost segments via duplicate ACKs  Sender often sends many segments back-to-back  If segment is lost, there will likely be many duplicate ACKs  If sender receives 3 ACKs for same data, it supposes that segment after ACKed data was lost  Fast retransmit – Resend segment before timer expires 22
  • 24. TCP ACK Generation [RFC 1122, RFC 2581] 24 Event at Receiver TCP Receiver Action Arrival of in-order segment with expected seq #. All data up to expected seq # already ACKed Delayed ACK. Wait up to 500ms for next segment. If no next segment, send ACK Arrival of in-order segment with expected seq #. One other segment has ACK pending Immediately send single cumulative ACK, ACKing both in-order segments Arrival of out-of-order segment higher-than-expect seq # . Gap detected Immediately send duplicate ACK, indicating seq. # of next expected byte Arrival of segment that partially or completely fills gap Immediate send ACK, provided that segment starts at lower end of gap
  • 25. Review: Automatic Repeat Request (ARQ)  Stop-and-Wait ARQ  One packet/frame at a time  Go-Back-N ARQ  Window of packets/frames on flight  If a negative ACK is received, restart from lost packet/frame  Selective-Repeat ARQ  Window of packets/frames on flight  If a negative ACK is received, only lost packet/frame is send  Typically used by TCP implementations  See http://www.ccs-labs.org/teaching/rn/animations/gbn_sr/ 25
  • 27. TCP Fairness  Fairness goal  If K TCP sessions share same bottleneck link of bandwidth R, each should have average rate of R/K  TCP is fair  Additive increase gives slope of 1, as throughput increases  Multiplicative decrease drops throughput proportionally 27
  • 28. TCP Concerns  TCP over wireless links  Packet losses due to errors are no longer insignificant  Multiplicative decrease is too conservative  TCP over high bandwidth, low-latency links  Millions of packets may be on the fly  Few of those packets will get lost or contain errors  Multiplicative decrease is too conservative  Various extensions are proposed to address these 28

Editor's Notes

  1. Fast Recovery. (Reno Only) In this state, TCP retransmits the missing packet that was signaled by three duplicate ACKs, and waits for an acknowledgment of the entire transmit window before returning to congestion avoidance. If there is no acknowledgment, TCP Reno experiences a timeout and enters the slow-start state.