SlideShare a Scribd company logo
1 of 46
Download to read offline
Lecture 5: Congestion Control
Overview 
 Internet is a network of networks 
 Narrow waist of IP: unreliable, best-effort 
datagram delivery 
 Packet forwarding: input port to output port 
 Routing protocols: computing port mappings 
 Transport: end-to-end, reliability, flow control, and 
congestion control
Transport 
 Provides end-to-end communication between 
applications 
 UDP: unreliable datagram delivery (thin layer on 
top of IP) 
 TCP: reliable stream delivery
TCP 
 Connection establishment 
 Connection teardown 
 Retransmission timeout (RTT and variance) 
 Flow control (receiver window) 
 Congestion control (transmit window)
TCP 
 Connection establishment 
 Connection teardown 
 Retransmission timeout (RTT and variance) 
 Flow control (receiver window) 
 Congestion control (transmit window)
A Bit of History 
 1974: 3-way handshake 
 1978: TCP and IP split into TCP/IP 
 1983: January 1, ARPAnet switches to TCP/IP 
 1986: Internet begins to suffer congestion collapses 
 1987-8: Van Jacobson fixes TCP, publishes seminal 
paper (Tahoe) 
 1990: Fast recovery and fast retransmit added 
(Reno)
Three questions 
 Goal: maintain TCP goodput at equilibrium 
 When does TCP retransmit packets? 
 When does TCP transmit packets? 
 When does TCP ack packets?
Flow Control 
 Part of TCP specification (pre-1988) 
 Want to make sure we don’t send more than what 
the receiver can handle 
 Sliding window protocol as described in lecture 3 
 Use window header field to tell other side how 
much space you have 
 Rule: Sent and unacknowledged bytes  window
TCP segment 
0 1 2 3 
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 
source port destination port 
sequence number 
acknowledgment number 
data offset 
reserved 
Window 
UR 
data 
G 
A P R S F 
CK 
SH 
ST 
YN 
IN 
checksum urgent pointer 
options padding
Send Timing 
 Before Tahoe 
- On connection, nodes send full window of packets 
- Retransmit packet immediately after its timer expires 
 Result: window-sized bursts of packets in network
Bursts of packets
Retransmission 
 TCP dynamically estimates round trip time 
 If segment goes unacknowledged, must retransmit 
 Use exponential backoff (in case loss from 
congestion) 
 After 10 minutes, give up and reset connection
Round Trip Time (RTT) 
 We want to estimate RTT so we can know a packet 
was likely lost, not just delayed 
 The challenge is that RTTs for individual packets 
can be highly variable, both on long-term and 
short-term time scales 
 Can increase significantly with load! 
 Solution 
- Use exponentially weighted moving average (EWMA) 
- Estimate deviation as well as expected value 
- Assume packet is lost when time is well beyond reasonable 
deviation
RTT with EWMA 
 EstRTT = (1  )  EstRTT +   SampleRTT 
- Recommended  is 0.125 
 DevRTT = (1
) DevRTT +
jSampleRTT EstRTT j 
- Recommended
is 0.25 
 Timeout is EstRTT + 4  DevRTT
Old RTT estimation
Tahoe RTT estimation
Self-Clocking 
 Goal is conservation of packets in steady state 
- A new packet isn’t put into the network until an old one 
leaves 
- Very effective in avoiding and controlling congestion 
 Solution: send a data packet for each ack
Self-Clocking, Continued 
 Assuming good RTT estimation, self-clocking 
prevents congestion by making window limit the 
number of packets in the network 
 Very simple to implement 
 But how big should the window be?
Slow start 
 But how do you start? 
 Introduce a congestion window to connection state, 
cwnd 
 Rule: Sent and unacknowledged bytes  cwnd 
 On start or loss, set cwnd to one packet (or... more 
on this later) 
 On each data ack, increase cwnd by one packet 
 Prevents bursts of packets
With Slow Start 
 Slow start allows connection to quickly reach 
equilibrium 
 How do we maintain it?
Two States 
 TCP has two states: Slow Start (SS) and 
Congestion Avoidance (CA) 
 A window size threshold governs the state 
transition 
- Window  threshold: slow start 
- Window  threshold: collision avoidance 
 States differ in how they respond to new acks 
- Slow start: cwnd += MSS 
- Congestion avoidance: cwnd += MSS2 
cwnd (MSS every RTT)
Congestion Control 
 Two conflicting goals 
- Provider: high utilization 
- User: fairness among users 
 Want to converge to a state where everyone gets 1 
N 
 Avoid congestion collapse
Taming Congestion 
 The optimal congestion window is the 
bandwidth/delay product 
 Sender learns this by adapting window size 
 Senders must slow down when there is congestion 
 Absence of ACKs (timeout) implies serious 
congestion 
 Duplicate ACKs imply some congestion
Responding to Loss (TCP Tahoe) 
 On triple duplicate ACK or timeout 
- Implies lost packet 
- Set threshold to cwnd 
2 
- Set cwnd to 1 
- Enter slow start state
TCP Reno [RFC 2581] 
 Same as Tahoe on timeout 
 On triple duplicate ACK 
- Set threshold to cwnd 
2 
- Set cwnd to cwnd 
2 (fast recovery) 
- Retransmit missing segment (fast retransmit) 
- Stays in congestion avoidance state
TCP NewReno [RFC 3782] 
 Same as Tahoe/Reno on timeout 
 During fast recovery 
- Keep track of last unacknowledged packet on entering fast 
recovery 
- On every duplicate ACK, inflate congestion window by 
MSS 
- When last packet is acknowledged, return to congestion 
avoidance, set cwnd back to original value
Walk Through Three Examples 
 TCP Tahoe (RTT estimation, congestion window) 
 TCP Reno (Fast retransmit, fast recovery) 
 TCP New Reno (cwnd inflation in fast recovery 
state)
2-minute stretch
AIMD 
 Additive increase, multiplicative decrease 
 Behavior in congestion avoidance mode 
 Why AIMD? Remember goals: 
- Link utilization 
- Fairness
AIMD in action 
30 
AIMD in Action 
• Sender searches for correct window size 
 Figure thanks to Brad Karp
Chiu Jain Phase Plots 
Flow A rate (bps) Flow B rate (bps)
Chiu Jain Phase Plots 
Flow A rate (bps) Flow B rate (bps) 
Fair 
A=B
Chiu Jain Phase Plots 
Flow A rate (bps) Flow B rate (bps) 
Fair 
A=B 
Efficient 
A+B=C
Chiu Jain Phase Plots 
Flow A rate (bps) Flow B rate (bps) 
Fair 
A=B 
Efficient 
A+B=C 
overload 
underload
Chiu Jain Phase Plots 
Flow A rate (bps) Flow B rate (bps) 
Fair 
A=B 
Efficient 
A+B=C 
overload 
underload
Chiu Jain Phase Plots 
Flow A rate (bps) Flow B rate (bps) 
Fair 
A=B 
Efficient 
A+B=C 
overload 
underload 
t1 
t2 
t3 
t4 
t5 
t6
Chiu Jain Phase Plots 
Flow A rate (bps) Flow B rate (bps) 
Fair 
A=B 
Efficient 
A+B=C 
overload 
underload 
α 
β
Three questions, revisited 
 Goal: maintain TCP goodput at equilibrium 
 When does TCP retransmit packets? 
 When does TCP transmit packets? 
 When does TCP ack packets?
Sending acknowledgements 
 An ACK must be sent for every other segment 
(RFC 2581) 
 An ACK must be sent within 500ms (RFC 2581) 
 Send duplicate acks aggressively
Acknowledgement Issues 
 Savage et al., CCR 1999 
 ACKs are in terms of bytes 
 Congestion control is in terms of segments 
 What if you send multiple ACKs per segment?
Multiplicative increase 
 Receiver can force multiplicative increase, for M  
segment length 
 Can lead to 4GB cwnd in 4 RTTs!
TCP Daytona!

More Related Content

What's hot

Congestion control in tcp
Congestion control in tcpCongestion control in tcp
Congestion control in tcpsamarai_apoc
 
TCP-FIT: An Improved TCP Congestion Control Algorithm and its Performance
TCP-FIT: An Improved TCP Congestion Control Algorithm and its PerformanceTCP-FIT: An Improved TCP Congestion Control Algorithm and its Performance
TCP-FIT: An Improved TCP Congestion Control Algorithm and its PerformanceKevin Tong
 
Tcp congestion avoidance algorithm identification
Tcp congestion avoidance algorithm identificationTcp congestion avoidance algorithm identification
Tcp congestion avoidance algorithm identificationBala Lavanya
 
TCP Congestion Control By Owais Jara
TCP Congestion Control By Owais JaraTCP Congestion Control By Owais Jara
TCP Congestion Control By Owais JaraOwaîs Járå
 
Tcp Congestion Avoidance
Tcp Congestion AvoidanceTcp Congestion Avoidance
Tcp Congestion AvoidanceRam Dutt Shukla
 
Tcp congestion control (1)
Tcp congestion control (1)Tcp congestion control (1)
Tcp congestion control (1)Abdo sayed
 
TCP congestion control
TCP congestion controlTCP congestion control
TCP congestion controlShubham Jain
 
Congestion Control in Computer Networks - ATM and TCP
Congestion Control in Computer Networks - ATM and TCPCongestion Control in Computer Networks - ATM and TCP
Congestion Control in Computer Networks - ATM and TCPAttila Balazs
 
Congestion control
Congestion controlCongestion control
Congestion controlAbhay Pai
 
Mobile computing-tcp data flow control
Mobile computing-tcp data flow controlMobile computing-tcp data flow control
Mobile computing-tcp data flow controlSushant Kushwaha
 
Investigating the Use of Synchronized Clocks in TCP Congestion Control
Investigating the Use of Synchronized Clocks in TCP Congestion ControlInvestigating the Use of Synchronized Clocks in TCP Congestion Control
Investigating the Use of Synchronized Clocks in TCP Congestion ControlMichele Weigle
 

What's hot (20)

Congestion control in tcp
Congestion control in tcpCongestion control in tcp
Congestion control in tcp
 
TCP-FIT: An Improved TCP Congestion Control Algorithm and its Performance
TCP-FIT: An Improved TCP Congestion Control Algorithm and its PerformanceTCP-FIT: An Improved TCP Congestion Control Algorithm and its Performance
TCP-FIT: An Improved TCP Congestion Control Algorithm and its Performance
 
TCP Congestion Control
TCP Congestion ControlTCP Congestion Control
TCP Congestion Control
 
Tcp congestion avoidance algorithm identification
Tcp congestion avoidance algorithm identificationTcp congestion avoidance algorithm identification
Tcp congestion avoidance algorithm identification
 
Tcp congestion avoidance
Tcp congestion avoidanceTcp congestion avoidance
Tcp congestion avoidance
 
Congestion control avoidance
Congestion control avoidanceCongestion control avoidance
Congestion control avoidance
 
TCP Congestion Control By Owais Jara
TCP Congestion Control By Owais JaraTCP Congestion Control By Owais Jara
TCP Congestion Control By Owais Jara
 
Tcp Congestion Avoidance
Tcp Congestion AvoidanceTcp Congestion Avoidance
Tcp Congestion Avoidance
 
Tcp congestion control (1)
Tcp congestion control (1)Tcp congestion control (1)
Tcp congestion control (1)
 
TCP congestion control
TCP congestion controlTCP congestion control
TCP congestion control
 
Retransmission Tcp
Retransmission TcpRetransmission Tcp
Retransmission Tcp
 
Congestion Control in Computer Networks - ATM and TCP
Congestion Control in Computer Networks - ATM and TCPCongestion Control in Computer Networks - ATM and TCP
Congestion Control in Computer Networks - ATM and TCP
 
Congestion control
Congestion controlCongestion control
Congestion control
 
Go Back N Arq1
Go  Back N Arq1Go  Back N Arq1
Go Back N Arq1
 
Real-Time Streaming Protocol
Real-Time Streaming Protocol Real-Time Streaming Protocol
Real-Time Streaming Protocol
 
RTP.ppt
RTP.pptRTP.ppt
RTP.ppt
 
Rtsp
RtspRtsp
Rtsp
 
Mobile computing-tcp data flow control
Mobile computing-tcp data flow controlMobile computing-tcp data flow control
Mobile computing-tcp data flow control
 
Investigating the Use of Synchronized Clocks in TCP Congestion Control
Investigating the Use of Synchronized Clocks in TCP Congestion ControlInvestigating the Use of Synchronized Clocks in TCP Congestion Control
Investigating the Use of Synchronized Clocks in TCP Congestion Control
 
Tcp(no ip) review part2
Tcp(no ip) review part2Tcp(no ip) review part2
Tcp(no ip) review part2
 

Similar to Computer network (13)

High Performance Networking with Advanced TCP
High Performance Networking with Advanced TCPHigh Performance Networking with Advanced TCP
High Performance Networking with Advanced TCPDilum Bandara
 
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
 
Mobile Transpot Layer
Mobile Transpot LayerMobile Transpot Layer
Mobile Transpot LayerMaulik Patel
 
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
 
chapter 3.2 TCP.pptx
chapter 3.2 TCP.pptxchapter 3.2 TCP.pptx
chapter 3.2 TCP.pptxTekle12
 
Troubleshooting TCP/IP
Troubleshooting TCP/IPTroubleshooting TCP/IP
Troubleshooting TCP/IPvijai s
 
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
 
Computer network (11)
Computer network (11)Computer network (11)
Computer network (11)NYversity
 
TCP Theory
TCP TheoryTCP Theory
TCP Theorysoohyunc
 
Improving Performance of TCP in Wireless Environment using TCP-P
Improving Performance of TCP in Wireless Environment using TCP-PImproving Performance of TCP in Wireless Environment using TCP-P
Improving Performance of TCP in Wireless Environment using TCP-PIDES Editor
 
KandR_TCP (1).ppt notes for congestion control
KandR_TCP (1).ppt    notes for congestion controlKandR_TCP (1).ppt    notes for congestion control
KandR_TCP (1).ppt notes for congestion controlGOKULKANNANMMECLECTC
 
tcp-wireless-tutorial.ppt
tcp-wireless-tutorial.ppttcp-wireless-tutorial.ppt
tcp-wireless-tutorial.pptRadwan Mahmoud
 
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
 
Computer network (18)
Computer network (18)Computer network (18)
Computer network (18)NYversity
 
features of tcp important for the web
features of tcp  important for the webfeatures of tcp  important for the web
features of tcp important for the webrinnocente
 

Similar to Computer network (13) (20)

High Performance Networking with Advanced TCP
High Performance Networking with Advanced TCPHigh Performance Networking with Advanced TCP
High Performance Networking with Advanced TCP
 
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
 
Mobile Transpot Layer
Mobile Transpot LayerMobile Transpot Layer
Mobile Transpot Layer
 
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
 
chapter 3.2 TCP.pptx
chapter 3.2 TCP.pptxchapter 3.2 TCP.pptx
chapter 3.2 TCP.pptx
 
Troubleshooting TCP/IP
Troubleshooting TCP/IPTroubleshooting TCP/IP
Troubleshooting TCP/IP
 
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
 
Computer network (11)
Computer network (11)Computer network (11)
Computer network (11)
 
Transport layer
Transport layerTransport layer
Transport layer
 
TCP Theory
TCP TheoryTCP Theory
TCP Theory
 
Improving Performance of TCP in Wireless Environment using TCP-P
Improving Performance of TCP in Wireless Environment using TCP-PImproving Performance of TCP in Wireless Environment using TCP-P
Improving Performance of TCP in Wireless Environment using TCP-P
 
KandR_TCP (1).ppt notes for congestion control
KandR_TCP (1).ppt    notes for congestion controlKandR_TCP (1).ppt    notes for congestion control
KandR_TCP (1).ppt notes for congestion control
 
NE #1.pptx
NE #1.pptxNE #1.pptx
NE #1.pptx
 
tcp-wireless-tutorial.ppt
tcp-wireless-tutorial.ppttcp-wireless-tutorial.ppt
tcp-wireless-tutorial.ppt
 
Transport layer
Transport layerTransport layer
Transport layer
 
TCP_Congestion_Control.ppt
TCP_Congestion_Control.pptTCP_Congestion_Control.ppt
TCP_Congestion_Control.ppt
 
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
 
Mcseminar
McseminarMcseminar
Mcseminar
 
Computer network (18)
Computer network (18)Computer network (18)
Computer network (18)
 
features of tcp important for the web
features of tcp  important for the webfeatures of tcp  important for the web
features of tcp important for the web
 

More from NYversity

Programming methodology-1.1
Programming methodology-1.1Programming methodology-1.1
Programming methodology-1.1NYversity
 
3016 all-2007-dist
3016 all-2007-dist3016 all-2007-dist
3016 all-2007-distNYversity
 
Programming methodology lecture28
Programming methodology lecture28Programming methodology lecture28
Programming methodology lecture28NYversity
 
Programming methodology lecture27
Programming methodology lecture27Programming methodology lecture27
Programming methodology lecture27NYversity
 
Programming methodology lecture26
Programming methodology lecture26Programming methodology lecture26
Programming methodology lecture26NYversity
 
Programming methodology lecture25
Programming methodology lecture25Programming methodology lecture25
Programming methodology lecture25NYversity
 
Programming methodology lecture24
Programming methodology lecture24Programming methodology lecture24
Programming methodology lecture24NYversity
 
Programming methodology lecture23
Programming methodology lecture23Programming methodology lecture23
Programming methodology lecture23NYversity
 
Programming methodology lecture22
Programming methodology lecture22Programming methodology lecture22
Programming methodology lecture22NYversity
 
Programming methodology lecture20
Programming methodology lecture20Programming methodology lecture20
Programming methodology lecture20NYversity
 
Programming methodology lecture19
Programming methodology lecture19Programming methodology lecture19
Programming methodology lecture19NYversity
 
Programming methodology lecture18
Programming methodology lecture18Programming methodology lecture18
Programming methodology lecture18NYversity
 
Programming methodology lecture17
Programming methodology lecture17Programming methodology lecture17
Programming methodology lecture17NYversity
 
Programming methodology lecture16
Programming methodology lecture16Programming methodology lecture16
Programming methodology lecture16NYversity
 
Programming methodology lecture15
Programming methodology lecture15Programming methodology lecture15
Programming methodology lecture15NYversity
 
Programming methodology lecture14
Programming methodology lecture14Programming methodology lecture14
Programming methodology lecture14NYversity
 
Programming methodology lecture13
Programming methodology lecture13Programming methodology lecture13
Programming methodology lecture13NYversity
 
Programming methodology lecture12
Programming methodology lecture12Programming methodology lecture12
Programming methodology lecture12NYversity
 
Programming methodology lecture11
Programming methodology lecture11Programming methodology lecture11
Programming methodology lecture11NYversity
 
Programming methodology lecture10
Programming methodology lecture10Programming methodology lecture10
Programming methodology lecture10NYversity
 

More from NYversity (20)

Programming methodology-1.1
Programming methodology-1.1Programming methodology-1.1
Programming methodology-1.1
 
3016 all-2007-dist
3016 all-2007-dist3016 all-2007-dist
3016 all-2007-dist
 
Programming methodology lecture28
Programming methodology lecture28Programming methodology lecture28
Programming methodology lecture28
 
Programming methodology lecture27
Programming methodology lecture27Programming methodology lecture27
Programming methodology lecture27
 
Programming methodology lecture26
Programming methodology lecture26Programming methodology lecture26
Programming methodology lecture26
 
Programming methodology lecture25
Programming methodology lecture25Programming methodology lecture25
Programming methodology lecture25
 
Programming methodology lecture24
Programming methodology lecture24Programming methodology lecture24
Programming methodology lecture24
 
Programming methodology lecture23
Programming methodology lecture23Programming methodology lecture23
Programming methodology lecture23
 
Programming methodology lecture22
Programming methodology lecture22Programming methodology lecture22
Programming methodology lecture22
 
Programming methodology lecture20
Programming methodology lecture20Programming methodology lecture20
Programming methodology lecture20
 
Programming methodology lecture19
Programming methodology lecture19Programming methodology lecture19
Programming methodology lecture19
 
Programming methodology lecture18
Programming methodology lecture18Programming methodology lecture18
Programming methodology lecture18
 
Programming methodology lecture17
Programming methodology lecture17Programming methodology lecture17
Programming methodology lecture17
 
Programming methodology lecture16
Programming methodology lecture16Programming methodology lecture16
Programming methodology lecture16
 
Programming methodology lecture15
Programming methodology lecture15Programming methodology lecture15
Programming methodology lecture15
 
Programming methodology lecture14
Programming methodology lecture14Programming methodology lecture14
Programming methodology lecture14
 
Programming methodology lecture13
Programming methodology lecture13Programming methodology lecture13
Programming methodology lecture13
 
Programming methodology lecture12
Programming methodology lecture12Programming methodology lecture12
Programming methodology lecture12
 
Programming methodology lecture11
Programming methodology lecture11Programming methodology lecture11
Programming methodology lecture11
 
Programming methodology lecture10
Programming methodology lecture10Programming methodology lecture10
Programming methodology lecture10
 

Recently uploaded

THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONHumphrey A Beña
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxDr.Ibrahim Hassaan
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Mark Reed
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPCeline George
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)lakshayb543
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfSpandanaRallapalli
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptxSherlyMaeNeri
 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomnelietumpap1
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxAnupkumar Sharma
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designMIPLM
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17Celine George
 
Q4 English4 Week3 PPT Melcnmg-based.pptx
Q4 English4 Week3 PPT Melcnmg-based.pptxQ4 English4 Week3 PPT Melcnmg-based.pptx
Q4 English4 Week3 PPT Melcnmg-based.pptxnelietumpap1
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYKayeClaireEstoconing
 

Recently uploaded (20)

FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptxFINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptx
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERP
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdf
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
Judging the Relevance and worth of ideas part 2.pptx
Judging the Relevance  and worth of ideas part 2.pptxJudging the Relevance  and worth of ideas part 2.pptx
Judging the Relevance and worth of ideas part 2.pptx
 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choom
 
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptxYOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
 
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptxMULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
MULTIDISCIPLINRY NATURE OF THE ENVIRONMENTAL STUDIES.pptx
 
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptxLEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17
 
Q4 English4 Week3 PPT Melcnmg-based.pptx
Q4 English4 Week3 PPT Melcnmg-based.pptxQ4 English4 Week3 PPT Melcnmg-based.pptx
Q4 English4 Week3 PPT Melcnmg-based.pptx
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITYISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
ISYU TUNGKOL SA SEKSWLADIDA (ISSUE ABOUT SEXUALITY
 

Computer network (13)

  • 2. Overview Internet is a network of networks Narrow waist of IP: unreliable, best-effort datagram delivery Packet forwarding: input port to output port Routing protocols: computing port mappings Transport: end-to-end, reliability, flow control, and congestion control
  • 3. Transport Provides end-to-end communication between applications UDP: unreliable datagram delivery (thin layer on top of IP) TCP: reliable stream delivery
  • 4. TCP Connection establishment Connection teardown Retransmission timeout (RTT and variance) Flow control (receiver window) Congestion control (transmit window)
  • 5. TCP Connection establishment Connection teardown Retransmission timeout (RTT and variance) Flow control (receiver window) Congestion control (transmit window)
  • 6. A Bit of History 1974: 3-way handshake 1978: TCP and IP split into TCP/IP 1983: January 1, ARPAnet switches to TCP/IP 1986: Internet begins to suffer congestion collapses 1987-8: Van Jacobson fixes TCP, publishes seminal paper (Tahoe) 1990: Fast recovery and fast retransmit added (Reno)
  • 7. Three questions Goal: maintain TCP goodput at equilibrium When does TCP retransmit packets? When does TCP transmit packets? When does TCP ack packets?
  • 8. Flow Control Part of TCP specification (pre-1988) Want to make sure we don’t send more than what the receiver can handle Sliding window protocol as described in lecture 3 Use window header field to tell other side how much space you have Rule: Sent and unacknowledged bytes window
  • 9. TCP segment 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 source port destination port sequence number acknowledgment number data offset reserved Window UR data G A P R S F CK SH ST YN IN checksum urgent pointer options padding
  • 10. Send Timing Before Tahoe - On connection, nodes send full window of packets - Retransmit packet immediately after its timer expires Result: window-sized bursts of packets in network
  • 12. Retransmission TCP dynamically estimates round trip time If segment goes unacknowledged, must retransmit Use exponential backoff (in case loss from congestion) After 10 minutes, give up and reset connection
  • 13. Round Trip Time (RTT) We want to estimate RTT so we can know a packet was likely lost, not just delayed The challenge is that RTTs for individual packets can be highly variable, both on long-term and short-term time scales Can increase significantly with load! Solution - Use exponentially weighted moving average (EWMA) - Estimate deviation as well as expected value - Assume packet is lost when time is well beyond reasonable deviation
  • 14. RTT with EWMA EstRTT = (1 ) EstRTT + SampleRTT - Recommended is 0.125 DevRTT = (1
  • 16. jSampleRTT EstRTT j - Recommended
  • 17. is 0.25 Timeout is EstRTT + 4 DevRTT
  • 20. Self-Clocking Goal is conservation of packets in steady state - A new packet isn’t put into the network until an old one leaves - Very effective in avoiding and controlling congestion Solution: send a data packet for each ack
  • 21. Self-Clocking, Continued Assuming good RTT estimation, self-clocking prevents congestion by making window limit the number of packets in the network Very simple to implement But how big should the window be?
  • 22. Slow start But how do you start? Introduce a congestion window to connection state, cwnd Rule: Sent and unacknowledged bytes cwnd On start or loss, set cwnd to one packet (or... more on this later) On each data ack, increase cwnd by one packet Prevents bursts of packets
  • 23. With Slow Start Slow start allows connection to quickly reach equilibrium How do we maintain it?
  • 24. Two States TCP has two states: Slow Start (SS) and Congestion Avoidance (CA) A window size threshold governs the state transition - Window threshold: slow start - Window threshold: collision avoidance States differ in how they respond to new acks - Slow start: cwnd += MSS - Congestion avoidance: cwnd += MSS2 cwnd (MSS every RTT)
  • 25. Congestion Control Two conflicting goals - Provider: high utilization - User: fairness among users Want to converge to a state where everyone gets 1 N Avoid congestion collapse
  • 26. Taming Congestion The optimal congestion window is the bandwidth/delay product Sender learns this by adapting window size Senders must slow down when there is congestion Absence of ACKs (timeout) implies serious congestion Duplicate ACKs imply some congestion
  • 27. Responding to Loss (TCP Tahoe) On triple duplicate ACK or timeout - Implies lost packet - Set threshold to cwnd 2 - Set cwnd to 1 - Enter slow start state
  • 28. TCP Reno [RFC 2581] Same as Tahoe on timeout On triple duplicate ACK - Set threshold to cwnd 2 - Set cwnd to cwnd 2 (fast recovery) - Retransmit missing segment (fast retransmit) - Stays in congestion avoidance state
  • 29. TCP NewReno [RFC 3782] Same as Tahoe/Reno on timeout During fast recovery - Keep track of last unacknowledged packet on entering fast recovery - On every duplicate ACK, inflate congestion window by MSS - When last packet is acknowledged, return to congestion avoidance, set cwnd back to original value
  • 30. Walk Through Three Examples TCP Tahoe (RTT estimation, congestion window) TCP Reno (Fast retransmit, fast recovery) TCP New Reno (cwnd inflation in fast recovery state)
  • 32. AIMD Additive increase, multiplicative decrease Behavior in congestion avoidance mode Why AIMD? Remember goals: - Link utilization - Fairness
  • 33. AIMD in action 30 AIMD in Action • Sender searches for correct window size Figure thanks to Brad Karp
  • 34. Chiu Jain Phase Plots Flow A rate (bps) Flow B rate (bps)
  • 35. Chiu Jain Phase Plots Flow A rate (bps) Flow B rate (bps) Fair A=B
  • 36. Chiu Jain Phase Plots Flow A rate (bps) Flow B rate (bps) Fair A=B Efficient A+B=C
  • 37. Chiu Jain Phase Plots Flow A rate (bps) Flow B rate (bps) Fair A=B Efficient A+B=C overload underload
  • 38. Chiu Jain Phase Plots Flow A rate (bps) Flow B rate (bps) Fair A=B Efficient A+B=C overload underload
  • 39. Chiu Jain Phase Plots Flow A rate (bps) Flow B rate (bps) Fair A=B Efficient A+B=C overload underload t1 t2 t3 t4 t5 t6
  • 40. Chiu Jain Phase Plots Flow A rate (bps) Flow B rate (bps) Fair A=B Efficient A+B=C overload underload α β
  • 41. Three questions, revisited Goal: maintain TCP goodput at equilibrium When does TCP retransmit packets? When does TCP transmit packets? When does TCP ack packets?
  • 42. Sending acknowledgements An ACK must be sent for every other segment (RFC 2581) An ACK must be sent within 500ms (RFC 2581) Send duplicate acks aggressively
  • 43. Acknowledgement Issues Savage et al., CCR 1999 ACKs are in terms of bytes Congestion control is in terms of segments What if you send multiple ACKs per segment?
  • 44. Multiplicative increase Receiver can force multiplicative increase, for M segment length Can lead to 4GB cwnd in 4 RTTs!
  • 46.
  • 47. TCP Daytona Lessons TCP implementations now symmetrically use bytes Protocol specification is difficult! Very subtle and simple design decisions can lead to undesired behavior IETF requires at least two interoperating implementations before moving to standards track Protocols evolve
  • 48. Future of TCP BitTorrent can lead to other apps performing poorly - BitTorrent (and other P2P applications) can open 10-100 connections - TCP provides per-flow, not per-application, fairness Low Extra Delay Background Transport (ledbat) - ”LEDBAT is a transport-area WG that will focus on broadly applicable techniques that allow large amounts of data to be consistently transmitted without substantially affecting the delays experienced by other users and applications.”
  • 49. Future of TCP, Continued High speed links/high bandwidth-delay product - Single packet loss cuts cwnd in half - Can take a long time to grow - Fast TCP, High-Speed TCP Wireless - Wireless exhibits many losses due to poor links, limits throughput - High-throughput TCP in wireless meshes does not yet exist - More in lecture 13