15-441 Computer Networking Lecture 8 – 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.
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.
6-May-154/598N: Computer Networks End-to-End Protocols Underlying best-effort network –drop messages –re-orders messages –delivers duplicate copies of.
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.
Computer Networking Lecture 17 – More TCP & Congestion Control Copyright ©, Carnegie Mellon University.
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.
1 Congestion Control. Transport Layer3-2 Principles of Congestion Control Congestion: r informally: “too many sources sending too much data too fast for.
15-744: Computer Networking L-10 Congestion Control.
Transport Layer Transport Layer: TCP. Transport Layer 3-2 TCP: Overview RFCs: 793, 1122, 1323, 2018, 2581 r full duplex data: m bi-directional.
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.
Computer Networking Lecture 16 – More TCP
Data Communication and Networks
EEC-484/584 Computer Networks Lecture 14 Wenbing Zhao (Part of the slides are based on Drs. Kurose & Ross ’ s slides for their Computer.
15-744: Computer Networking L-8 UDP & TCP. L –8; © Srinivasan Seshan, TCP Basics TCP connection setup/data transfer TCP reliability TCP options.
EEC-484/584 Computer Networks Lecture 16 Wenbing Zhao (Part of the slides are based on Drs. Kurose & Ross ’ s slides for their Computer.
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!
TCOM 509 – Internet Protocols (TCP/IP) Lecture 04_b Transport Protocols - TCP Instructor: Dr. Li-Chuan Chen Date: 09/22/2003 Based in part upon slides.
17-1 Last time □ UDP socket programming ♦ DatagramSocket, DatagramPacket □ TCP ♦ Sequence numbers, ACKs ♦ RTT, DevRTT, timeout calculations ♦ Reliable.
TCP : Transmission Control Protocol Computer Network System Sirak Kaewjamnong.
Chapter 12 Transmission Control Protocol (TCP)
Lecture 9 – More TCP & Congestion Control
Computer Networking Lecture 16 –TCP in detail Eric Anderson Fall
Lecture 18 – More TCP & Congestion Control
81 Sidevõrgud IRT 0020 loeng okt Avo Ots telekommunikatsiooni õppetool, TTÜ raadio- ja sidetehnika inst.
1 Transport Layer Lecture 10 Imran Ahmed University of Management & Technology.
CS640: Introduction to Computer Networks Aditya Akella Lecture 15 TCP – III Reliability and Implementation Issues.
Computer Networking Lecture 18 – More TCP & Congestion Control.
1 CS 4396 Computer Networks Lab TCP – Part II. 2 Flow Control Congestion Control Retransmission Timeout TCP:
CS640: Introduction to Computer Networks Aditya Akella Lecture 15 TCP – III Reliability and Implementation Issues.
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 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.
Advance Computer Networks Lecture#09 & 10 Instructor: Engr. Muhammad Mateen Yaqoob.
TCP. TCP ACK generation [RFC 1122, RFC 2581] Event at Receiver Arrival of in-order segment with expected seq #. All data up to expected seq # already.
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.
Transmission Control Protocol (TCP) connection-oriented stream data transfer data sent as an unstructured stream of bytes reliability acknowledgements.
@Yuan Xue A special acknowledge goes to J.F Kurose and K.W. Ross Some of the slides used in this lecture are adapted from their.
Transport Layer session 1 TELE3118: Network Technologies Week 11: Transport Layer TCP Some slides have been taken from: r Computer Networking:
@Yuan Xue A special acknowledge goes to J.F Kurose and K.W. Ross Some of the slides used in this lecture are adapted from their.
Lecture 17 – TCP & Congestion Control
Chapter 3 outline 3.1 Transport-layer services
Flow and Congestion Control
Lecture 19 – TCP Performance
TCP Overview Connection-oriented Byte-stream Full duplex
CS640: Introduction to Computer Networks
Lecture 18 – More TCP & Congestion Control
Reliable Byte-Stream (TCP)
State Transition Diagram
TCP Overview.
Transport Protocols: TCP Segments, Flow control and Connection Setup
Chapter 3 outline 3.1 Transport-layer services
Computer Networking TCP.
Transport Protocols: TCP Segments, Flow control and Connection Setup
Presentation transcript:

Computer Networking Lecture 8 – TCP & Congestion Control

Lecture 8: Outline TCP connection setup/data transfer TCP Reliability Congestion sources and collapse Congestion control basics

Lecture 8: Connection Establishment A and B must agree on initial sequence number selection Use 3-way handshake AB SYN + Seq A SYN+ACK-A + Seq B ACK-B

Lecture 8: Sequence Number Selection Why not simply chose 0? Must avoid overlap with earlier incarnation Security issues

Lecture 8: Connection Setup CLOSED SYN SENT SYN RCVD ESTAB LISTEN active OPEN create TCB Snd SYN create TCB passive OPEN delete TCB CLOSE delete TCB CLOSE snd SYN SEND snd SYN ACK rcv SYN Send FIN CLOSE rcv ACK of SYN Snd ACK Rcv SYN, ACK rcv SYN snd ACK

Lecture 8: Connection Tear-down Normal termination Allow unilateral close TCP must continue to receive data even after closing Cannot close connection immediately What if a new connection restarts and uses same sequence number?

Lecture 8: Tear-down Packet Exchange SenderReceiver FIN FIN-ACK FIN FIN-ACK Data write Data ack

Lecture 8: Connection Tear-down CLOSING CLOSE WAIT FIN WAIT-1 ESTAB TIME WAIT snd FIN CLOSE send FIN CLOSE rcv ACK of FIN LAST-ACK CLOSED FIN WAIT-2 snd ACK rcv FIN delete TCB Timeout=2msl send FIN CLOSE send ACK rcv FIN snd ACK rcv FIN rcv ACK of FIN snd ACK rcv FIN+ACK

Lecture 8: Detecting Half-open Connections 1.(CRASH) 2.CLOSED 3.SYN-SENT  4.(!!)  5.SYN-SENT  6.SYN-SENT 7.SYN-SENT  (send 300, receive 100) ESTABLISHED  (??)  ESTABLISHED  (Abort!!) CLOSED  TCP BTCP A

Lecture 8: Outline TCP connection setup/data transfer TCP Reliability Congestion sources and collapse Congestion control basics

Lecture 8: Reliability Challenges Congestion related losses Variable packet delays What should the timeout be? Reordering of packets Ensure sequences numbers are not reused How long do packets live? MSL = 120 seconds based on IP behavior

Lecture 8: TCP = Go-Back-N Variant Sliding window with cumulative acks Receiver can only return a single “ack” sequence number to the sender. Acknowledges all bytes with a lower sequence number Starting point for retransmission Duplicate acks sent when out-of-order packet received But: sender only retransmits a single packet. Reason??? Error control is based on byte sequences, not packets. Retransmitted packet can be different from the original lost packet – Why?

Lecture 8: Round-trip Time Estimation Wait at least one RTT before retransmitting Importance of accurate RTT estimators: Low RTT  unneeded retransmissions High RTT  poor throughput RTT estimator must adapt to change in RTT But not too fast, or too slow! Spurious timeouts “Conservation of packets” principle – never more than a window worth of packets in flight

Lecture 8: Initial Round-trip Estimator Round trip times exponentially averaged: New RTT =  (old RTT) + (1 -  ) (new sample) Recommended value for  : for most TCP’s Retransmit timer set to  RTT, where  = 2 Every time timer expires, RTO exponentially backed-off Like Ethernet Not good at preventing spurious timeouts Why?

Lecture 8: Jacobson’s Retransmission Timeout Key observation: At high loads round trip variance is high Solution: Base RTO on RTT and standard deviation rttvar =  * dev + (1-  )rttvar Dev = linear deviation Inappropriately named – actually smoothed linear deviation

Lecture 8: Retransmission Ambiguity AB ACK Sample RTT Original transmission retransmission RTO AB Original transmission retransmission Sample RTT ACK RTO X

Lecture 8: Karn’s RTT Estimator Accounts for retransmission ambiguity If a segment has been retransmitted: Don’t count RTT sample on ACKs for this segment Keep backed off time-out for next packet Reuse RTT estimate only after one successful transmission

Lecture 8: Timestamp Extension Used to improve timeout mechanism by more accurate measurement of RTT When sending a packet, insert current timestamp into option 4 bytes for timestamp, 4 bytes for echo Receiver echoes timestamp in ACK Actually will echo whatever is in timestamp Removes retransmission ambiguity Can get RTT sample on any packet

Lecture 8: Timer Granularity Many TCP implementations set RTO in multiples of 200,500,1000ms Why? Avoid spurious timeouts – RTTs can vary quickly due to cross traffic Make timers interrupts efficient What happens for the first couple of packets? Pick a very conservative value (seconds)

Lecture 8: Outline TCP connection setup/data transfer TCP Reliability Congestion sources and collapse Congestion control basics

Lecture 8: Congestion 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) In many situations will result in < 1.5 Mbps of throughput for the above topology (congestion collapse) 10 Mbps 100 Mbps 1.5 Mbps

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

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

Lecture 8: 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 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 8: 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 8: Congestion Control and Avoidance A mechanism which: 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 8: 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 Two broad approaches towards congestion control:

Lecture 8: 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 8: Outline TCP connection setup/data transfer TCP Reliability Congestion sources and collapse Congestion control basics

Lecture 8: Objectives Simple router behavior Distributedness Efficiency: X =  x i (t) Fairness: (  x i ) 2 /n(  x i 2 ) Convergence: control system must be stable

Lecture 8: 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 8: Linear Control Many different possibilities for reaction to congestion and probing Examine simple linear controls Window(t + 1) = a + b Window(t) Different a i /b i for increase and a d /b d for decrease Supports various reaction to signals Increase/decrease additively Increased/decrease multiplicatively Which of the four combinations is optimal?

Lecture 8: Phase Plots Simple way to visualize behavior of competing connections over time User 1’s Allocation x 1 User 2’s Allocation x 2

Lecture 8: Phase Plots What are desirable properties? What if flows are not equal? Efficiency Line Fairness Line User 1’s Allocation x 1 User 2’s Allocation x 2 Optimal point Overload Underutilization

Lecture 8: Additive Increase/Decrease T0T0 T1T1 Efficiency Line Fairness Line User 1’s Allocation x 1 User 2’s Allocation x 2 Both X 1 and X 2 increase/ decrease by the same amount over time Additive increase improves fairness and additive decrease reduces fairness

Lecture 8: Muliplicative Increase/Decrease Both X 1 and X 2 increase by the same factor over time Extension from origin – constant fairness T0T0 T1T1 Efficiency Line Fairness Line User 1’s Allocation x 1 User 2’s Allocation x 2

Lecture 8: Convergence to Efficiency xHxH Efficiency Line Fairness Line User 1’s Allocation x 1 User 2’s Allocation x 2

Lecture 8: Distributed Convergence to Efficiency xHxH Efficiency Line Fairness Line User 1’s Allocation x 1 User 2’s Allocation x 2 a=0 b=1

Lecture 8: Convergence to Fairness xHxH Efficiency Line Fairness Line User 1’s Allocation x 1 User 2’s Allocation x 2 x H’

Lecture 8: Convergence to Efficiency & Fairness xHxH Efficiency Line Fairness Line User 1’s Allocation x 1 User 2’s Allocation x 2 x H’

Lecture 8: What is the Right Choice? Constraints limit us to AIMD Can have multiplicative term in increase AIMD moves towards optimal point x0x0 x1x1 x2x2 Efficiency Line Fairness Line User 1’s Allocation x 1 User 2’s Allocation x 2

Lecture 8: Next Lecture TCP Congestion Control TCP Loss Recovery TCP Modeling