Lecture 17 – TCP & Congestion Control

Slides:



Advertisements
Similar presentations
Congestion Control and Fairness Models Nick Feamster CS 4251 Computer Networking II Spring 2008.
Advertisements

Congestion Control and Fairness Models Nick Feamster CS 4251 Computer Networking II Spring 2008.
TCP and Congestion Control
Principles of Congestion Control Chapter 3.6 Computer Networking: A top-down approach.
3-1 TCP Protocol r point-to-point: m one sender, one receiver r reliable, in-order byte steam: m no “message boundaries” r pipelined: m TCP congestion.
1 TCP Congestion Control. 2 TCP Segment Structure source port # dest port # 32 bits application data (variable length) sequence number acknowledgement.
Computer Networks 2 Lecture 2 TCP – I - Transport Protocols: TCP Segments, Flow control and Connection Setup.
Congestion Control Created by M Bateman, A Ruddle & C Allison As part of the TCP View project.
CS640: Introduction to Computer Networks Mozafar Bag-Mohammadi Lecture 3 TCP Congestion Control.
Computer Networking Lecture 17 – TCP & Congestion Control Dejian Ye, Liu Xin.
Introduction 1 Lecture 14 Transport Layer (Transmission Control Protocol) slides are modified from J. Kurose & K. Ross University of Nevada – Reno Computer.
School of Information Technologies TCP Congestion Control NETS3303/3603 Week 9.
Chapter 3 Transport Layer slides are modified from J. Kurose & K. Ross CPE 400 / 600 Computer Communication Networks Lecture 12.
Transport Layer 3-1 Fast Retransmit r time-out period often relatively long: m long delay before resending lost packet r detect lost segments via duplicate.
Transport Layer3-1 Congestion Control. Transport Layer3-2 Principles of Congestion Control Congestion: r informally: “too many sources sending too much.
15-744: Computer Networking L-10 Congestion Control.
Week 9 TCP9-1 Week 9 TCP 3 outline r 3.5 Connection-oriented transport: TCP m segment structure m reliable data transfer m flow control m connection management.
Computer Networking Lecture 16 – TCP & Congestion Control Copyright ©, Carnegie Mellon University.
1 Chapter 3 Transport Layer. 2 Chapter 3 outline 3.1 Transport-layer services 3.2 Multiplexing and demultiplexing 3.3 Connectionless transport: UDP 3.4.
Data Communication and Networks
TCP. Learning objectives Reliable Transport in TCP TCP flow and Congestion Control.
3: Transport Layer3b-1 Principles of Congestion Control Congestion: r informally: “too many sources sending too much data too fast for network to handle”
Transport Layer 4 2: Transport Layer 4.
Transport Layer3-1 Chapter 3 outline r 3.1 Transport-layer services r 3.2 Multiplexing and demultiplexing r 3.3 Connectionless transport: UDP r 3.4 Principles.
Transport Layer1 Flow and Congestion Control Ram Dantu (compiled from various text books)
Principles of Congestion Control Congestion: informally: “too many sources sending too much data too fast for network to handle” different from flow control!
Lecture 15 – Transport Protocols Eric Anderson Fall Computer Networking.
Computer Networking Lecture 18 – More TCP & Congestion Control.
By N.Gopinath AP/CSE Unit: III Introduction to Transport layer.
Advance Computer Networks Lecture#09 & 10 Instructor: Engr. Muhammad Mateen Yaqoob.
Transport Layer3-1 Chapter 3 outline r 3.1 Transport-layer services r 3.2 Multiplexing and demultiplexing r 3.3 Connectionless transport: UDP r 3.4 Principles.
CS640: Introduction to Computer Networks Aditya Akella Lecture 15 TCP – II - Connection Set-up and Congestion Control.
CS640: Introduction to Computer Networks Aditya Akella Lecture 15 TCP Congestion Control.
Computer Networking Lecture 16 – Reliable Transport.
Computer Networking Lecture 8 – TCP & Congestion Control.
CS450 – Introduction to Networking Lecture 19 – Congestion Control (2)
Approaches towards congestion control
Chapter 3 outline 3.1 transport-layer services
CS-1652 Jack Lange University of Pittsburgh
Introduction to Congestion Control
Chapter 3 outline 3.1 Transport-layer services
Introduction of Transport Protocols
Internet and Intranet Protocols and Applications
Chapter 3-3 TCP Congestion CTL *
TCP and Congestion Control (1)
Advanced Computer Networking
Flow and Congestion Control
Lecture 19 – TCP Performance
15-744: Computer Networking
So far, On the networking side, we looked at mechanisms to links hosts using direct linked networks and then forming a network of these networks. We introduced.
Advanced Computer Networking
15-744: Computer Networking
Review 2 – Transport Protocols
Review 2 – Transport Protocols
Lecture 18 – More TCP & Congestion Control
October 1st, 2013 CS-1652 Jack Lange University of Pittsburgh
TCP Congestion Control
TCP Overview.
Transport Protocols: TCP Segments, Flow control and Connection Setup
CS-1652 Congestion Control Jack Lange University of Pittsburgh
Transport Layer: Congestion Control
Chapter 3 outline 3.1 Transport-layer services
Computer Networking TCP.
Transport Protocols: TCP Segments, Flow control and Connection Setup
TCP flow and congestion control
Chapter 3 Transport Layer
October 4th, 2011 CS-1652 Jack Lange University of Pittsburgh
Review of Internet Protocols Transport Layer
Lecture 5, Computer Networks (198:552)
Lecture 6, Computer Networks (198:552)
Presentation transcript:

Lecture 17 – TCP & Congestion Control 15-441 Computer Networking Lecture 17 – TCP & Congestion Control

Lecture 17: TCP & Congestion Control Good Ideas So Far… Flow control Stop & wait Parallel stop & wait Sliding window Loss recovery Timeouts Acknowledgement-driven recovery (selective repeat or cumulative acknowledgement) Lecture 17: TCP & Congestion Control

Lecture 17: TCP & Congestion Control Outline TCP flow control Congestion sources and collapse Congestion control basics Lecture 17: TCP & Congestion Control

Sequence Numbers (reminder) How large do sequence numbers need to be? Must be able to detect wrap-around Depends on sender/receiver window size E.g. Max seq = 7, send win=recv win=7 If pkts 0..6 are sent succesfully and all acks lost Receiver expects 7,0..5, sender retransmits old 0..6!!! Max sequence must be ≥ send window + recv window Xxx picture Lecture 17: TCP & Congestion Control

Lecture 17: TCP & Congestion Control Sequence Numbers 32 Bits, Unsigned  for bytes not packets! Circular Comparison Why So Big? For sliding window, must have |Sequence Space| > |Sending Window| + |Receiving Window| No problem Also, want to guard against stray packets With IP, packets have maximum lifetime of 120s Sequence number would wrap around in this time at 286MB/s =~ 2.3Gbit/s (hmm!) Max a b a < b Max b a b < a Lecture 17: TCP & Congestion Control

Lecture 17: TCP & Congestion Control TCP Flow Control TCP is a sliding window protocol For window size n, can send up to n bytes without receiving an acknowledgement When the data is acknowledged then the window slides forward Each packet advertises a window size Indicates number of bytes the receiver has space for Original TCP always sent entire window But receiver buffer space != available net. capacity! Congestion control now limits this window = min(receiver window, congestion window) Lecture 17: TCP & Congestion Control

Window Flow Control: Send Side Sent but not acked Not yet sent Sent and acked Next to be sent Lecture 17: TCP & Congestion Control

Window Flow Control: Send Side Packet Sent Packet Received Source Port Dest. Port Source Port Dest. Port Sequence Number Sequence Number Acknowledgment Acknowledgment HL/Flags Window HL/Flags Window D. Checksum Urgent Pointer D. Checksum Urgent Pointer Options… Options... App write acknowledged sent to be sent outside window Lecture 17: TCP & Congestion Control

Window Flow Control: Receive Side What should receiver do? New Receive buffer Acked but not delivered to user Not yet acked window Lecture 17: TCP & Congestion Control

Lecture 17: TCP & Congestion Control TCP Persist What happens if window is 0? Receiver updates window when application reads data What if this update is lost? TCP Persist state Sender periodically sends 1 byte packets Receiver responds with ACK even if it can’t store the packet Lecture 17: TCP & Congestion Control

Performance Considerations The window size can be controlled by receiving application Can change the socket buffer size from a default (e.g. 8-64Kbytes) to some maximum value Modern TCPs (linux, bsd, os x) may auto-tune Historical source of performance problems on fast nets The window size field in the TCP header limits the window that the receiver can advertise 16 bits  64 KBytes 10 msec RTT  51 Mbit/second 100 msec RTT  5 Mbit/second TCP options to get around 64KB limit  increases above limit Lecture 17: TCP & Congestion Control

Lecture 17: TCP & Congestion Control Outline TCP flow control Congestion sources and collapse Congestion control basics Lecture 17: TCP & Congestion Control

Lecture 17: TCP & Congestion Control Internet Pipes? How should you control the faucet? Lecture 17: TCP & Congestion Control

Lecture 17: TCP & Congestion Control Internet Pipes? How should you control the faucet? Too fast – sink overflows! Lecture 17: TCP & Congestion Control

Lecture 17: TCP & Congestion Control Internet Pipes? How should you control the faucet? Too fast – sink overflows! Too slow – what happens? Lecture 17: TCP & Congestion Control

Lecture 17: TCP & Congestion Control Internet Pipes? How should you control the faucet? Too fast – sink overflows Too slow – what happens? Goals Fill the bucket as quickly as possible Avoid overflowing the sink Solution – watch the sink Lecture 17: TCP & Congestion Control

Lecture 17: TCP & Congestion Control Plumbers Gone Wild! How do we prevent water loss? Know the size of the pipes? Lecture 17: TCP & Congestion Control

Lecture 17: TCP & Congestion Control Plumbers Gone Wild 2! Now what? Feedback from the bucket or the funnels? Lecture 17: TCP & Congestion Control

Lecture 17: TCP & Congestion Control 10 Mbps 100 Mbps 1.5 Mbps Different sources compete for resources inside network Why is it a problem? Sources are unaware of current state of resource Sources are unaware of each other Manifestations: Lost packets (buffer overflow at routers) Long delays (queuing in router buffers) Can result in throughput less than bottleneck link (1.5Mbps for the above topology)  a.k.a. congestion collapse Lecture 17: TCP & Congestion Control

Causes & Costs of Congestion Four senders – multihop paths Timeout/retransmit Q: What happens as rate increases? Lecture 17: TCP & Congestion Control

Causes & Costs of Congestion When packet dropped, any “upstream transmission capacity used for that packet was wasted! Lecture 17: TCP & Congestion Control

Lecture 17: TCP & Congestion Control Congestion Collapse Definition: Increase in network load results in decrease of useful work done Many possible causes Spurious retransmissions of packets still in flight Classical congestion collapse How can this happen with packet conservation? RTT increases! Solution: better timers and TCP congestion control Undelivered packets Packets consume resources and are dropped elsewhere in network Solution: congestion control for ALL traffic Lecture 17: TCP & Congestion Control

Congestion Control and Avoidance A mechanism that: Uses network resources efficiently Preserves fair network resource allocation Prevents or avoids collapse Congestion collapse is not just a theory Has been frequently observed in many networks Lecture 17: TCP & Congestion Control

Approaches Towards Congestion Control Two broad approaches towards congestion control: End-end congestion control: No explicit feedback from network Congestion inferred from end-system observed loss, delay Approach taken by TCP Network-assisted congestion control: Routers provide feedback to end systems Single bit indicating congestion (SNA, DECbit, TCP/IP ECN, ATM) Explicit rate sender should send at Problem: makes routers complicated Lecture 17: TCP & Congestion Control

Example: TCP Congestion Control Very simple mechanisms in network FIFO scheduling with shared buffer pool Feedback through packet drops TCP interprets packet drops as signs of congestion and slows down This is an assumption: packet drops are not a sign of congestion in all networks E.g. wireless networks Periodically probes the network to check whether more bandwidth has become available. Lecture 17: TCP & Congestion Control

Lecture 17: TCP & Congestion Control Outline TCP flow control Congestion sources and collapse Congestion control basics Lecture 17: TCP & Congestion Control

Lecture 17: TCP & Congestion Control Objectives Simple router behavior Distributedness Efficiency: X = Σxi(t) Fairness: (Σxi)2/n(Σxi2) What are the important properties of this function? Convergence: control system must be stable Lecture 17: TCP & Congestion Control

Lecture 17: TCP & Congestion Control Phase Plots What are desirable properties? What if flows are not equal? Fairness Line Overload User 2’s Allocation x2 Optimal point Underutilization Efficiency Line User 1’s Allocation x1 Lecture 17: TCP & Congestion Control

Lecture 17: TCP & Congestion Control Basic Control Model Reduce speed when congestion is perceived How is congestion signaled? Either mark or drop packets How much to reduce? Increase speed otherwise Probe for available bandwidth – how? Lecture 17: TCP & Congestion Control

Lecture 17: TCP & Congestion Control Linear Control Many different possibilities for reaction to congestion and probing Examine simple linear controls Window(t + 1) = a + b Window(t) Different ai/bi for increase and ad/bd for decrease Supports various reaction to signals Increase/decrease additively Increased/decrease multiplicatively Which of the four combinations is optimal? Lecture 17: TCP & Congestion Control

Lecture 17: TCP & Congestion Control Phase Plots Simple way to visualize behavior of competing connections over time User 2’s Allocation x2 User 1’s Allocation x1 Lecture 17: TCP & Congestion Control

Additive Increase/Decrease Both X1 and X2 increase/ decrease by the same amount over time Additive increase improves fairness and additive decrease reduces fairness Fairness Line T1 User 2’s Allocation x2 T0 Efficiency Line User 1’s Allocation x1 Lecture 17: TCP & Congestion Control

Muliplicative Increase/Decrease Both X1 and X2 increase by the same factor over time Extension from origin – constant fairness Fairness Line T1 User 2’s Allocation x2 T0 Efficiency Line User 1’s Allocation x1 Lecture 17: TCP & Congestion Control

Convergence to Efficiency Fairness Line xH User 2’s Allocation x2 Efficiency Line User 1’s Allocation x1 Lecture 17: TCP & Congestion Control

Distributed Convergence to Efficiency a>0 & b>1 a=0 b=1 Fairness Line a<0 & b>1 xH a>0 & b<1 User 2’s Allocation x2 a<0 & b<1 Efficiency Line User 1’s Allocation x1 Lecture 17: TCP & Congestion Control

Convergence to Fairness Fairness Line xH User 2’s Allocation x2 xH’ Efficiency Line User 1’s Allocation x1 Lecture 17: TCP & Congestion Control

Convergence to Efficiency & Fairness Intersection of valid regions For decrease: a=0 & b < 1 Fairness Line xH User 2’s Allocation x2 xH’ Efficiency Line User 1’s Allocation x1 Lecture 17: TCP & Congestion Control

What is the Right Choice? Constraints limit us to AIMD Can have multiplicative term in increase (MAIMD) AIMD moves towards optimal point x0 x1 x2 Efficiency Line Fairness Line User 1’s Allocation x1 User 2’s Allocation x2 Lecture 17: TCP & Congestion Control

Lecture 17: TCP & Congestion Control Important Lessons Transport service UDP  mostly just IP service TCP  congestion controlled, reliable, byte stream Types of ARQ protocols Stop-and-wait  slow, simple Go-back-n  can keep link utilized (except w/ losses) Selective repeat  efficient loss recovery Sliding window flow control TCP flow control Sliding window  mapping to packet headers 32bit sequence numbers (bytes) Lecture 17: TCP & Congestion Control

Lecture 17: TCP & Congestion Control Important Lessons Why is congestion control needed? How to evaluate congestion control algorithms? Why is AIMD the right choice for congestion control? TCP flow control Sliding window  mapping to packet headers 32bit sequence numbers (bytes) Lecture 17: TCP & Congestion Control

Lecture 17: TCP & Congestion Control Good Ideas So Far… Flow control Stop & wait Parallel stop & wait Sliding window (e.g., advertised windows) Loss recovery Timeouts Acknowledgement-driven recovery (selective repeat or cumulative acknowledgement) Congestion control AIMD  fairness and efficiency Next Lecture: How does TCP actually implement these? Lecture 17: TCP & Congestion Control

The rest of the slides are FYI EXTRA SLIDES The rest of the slides are FYI

Other Congestion Collapse Causes Fragments Mismatch of transmission and retransmission units Solutions Make network drop all fragments of a packet (early packet discard in ATM) Do path MTU discovery Control traffic Large percentage of traffic is for control Headers, routing messages, DNS, etc. Stale or unwanted packets Packets that are delayed on long queues “Push” data that is never used Lecture 17: TCP & Congestion Control

Pipes…Tubes…Let’s call the whole thing off An alternate way to look at congestion? Lecture 17: TCP & Congestion Control