15-441 Computer Networking Lecture 18 – More TCP & Congestion Control.

Slides:



Advertisements
Similar presentations
TCP and Congestion Control
Advertisements

Congestion Control Created by M Bateman, A Ruddle & C Allison As part of the TCP View project.
1 TCP - Part II. 2 What is Flow/Congestion/Error Control ? Flow Control: Algorithms to prevent that the sender overruns the receiver with information.
Computer Networks: TCP Congestion Control 1 TCP Congestion Control Lecture material taken from “Computer Networks A Systems Approach”, Fourth Edition,Peterson.
School of Information Technologies TCP Congestion Control NETS3303/3603 Week 9.
Computer Networking Lecture 17 – More TCP & Congestion Control Copyright ©, Carnegie Mellon University.
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.
TCP Variations Naveen Manicka CISC 856 – Fall 2005 Computer & Information Sciences University of Delaware Nov 10, 2005 Most slides are borrowed from J.
Computer Networks: TCP Congestion Control 1 TCP Congestion Control Lecture material taken from “Computer Networks A Systems Approach”, Third Ed.,Peterson.
CSCE 515: Computer Network Programming Chin-Tser Huang University of South Carolina.
15-744: Computer Networking L-10 Congestion Control.
Lecture 18 – TCP Performance
CSCE 515: Computer Network Programming Chin-Tser Huang University of South Carolina.
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 Networks : TCP Congestion Control1 TCP Congestion Control.
Computer Networking Lecture 16 – More TCP
Congestion Avoidance and Control CSCI 780, Fall 2005.
Networks : TCP Congestion Control1 TCP Congestion Control.
Networks : TCP Congestion Control1 TCP Congestion Control Presented by Bob Kinicki.
Advanced Computer Networks: TCP Congestion Control 1 TCP Congestion Control Lecture material taken from “Computer Networks A Systems Approach”, Fourth.
CMPE 257 Spring CMPE 257: Wireless and Mobile Networking Spring 2005 E2E Protocols (point-to-point)
1 K. Salah Module 6.1: TCP Flow and Congestion Control Connection establishment & Termination Flow Control Congestion Control QoS.
TCP: flow and congestion control. Flow Control Flow Control is a technique for speed-matching of transmitter and receiver. Flow control ensures that a.
Computer Networking Lecture 17 – TCP Performance Dejian Ye, Liu Xin.
COMT 4291 Communications Protocols and TCP/IP COMT 429.
CS 4396 Computer Networks Lab
Principles of Congestion Control Congestion: informally: “too many sources sending too much data too fast for network to handle” different from flow control!
Advance Computer Networking
1 TCP III - Error Control TCP Error Control. 2 ARQ Error Control Two types of errors: –Lost packets –Damaged packets Most Error Control techniques are.
Malathi Veeraraghavan Originals by Jörg Liebeherr 1 Error Control Congestion Control Timers.
1 TCP - Part II Relates to Lab 5. This is an extended module that covers TCP data transport, and flow control, congestion control, and error control in.
Lecture 9 – More TCP & Congestion Control
Computer Networking Lecture 16 –TCP in detail Eric Anderson Fall
What is TCP? Connection-oriented reliable transfer Stream paradigm
Lecture 18 – More TCP & Congestion Control
CS640: Introduction to Computer Networks Aditya Akella Lecture 15 TCP – III Reliability and Implementation Issues.
Lab The network simulator ns The network simulator ns Allows us to watch evolution of parameters like cwnd and ssthresh Allows us to watch evolution of.
TCP: Transmission Control Protocol Part II : Protocol Mechanisms Computer Network System Sirak Kaewjamnong Semester 1st, 2004.
1 CS 4396 Computer Networks Lab TCP – Part II. 2 Flow Control Congestion Control Retransmission Timeout TCP:
Network Protocols: Design and Analysis Polly Huang EE NTU
1 TCP - Part II Relates to Lab 5. This is an extended module that covers TCP data transport, and flow control, congestion control, and error control in.
TCP End-To-End Congestion Control Wanida Putthividhya Dept. of Computer Science Iowa State University Jan, 27 th 2002 (May, 25 th 2001)
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.
1 TCP - Part II. 2 What is Flow/Congestion/Error Control ? Flow Control: Algorithms to prevent that the sender overruns the receiver with information.
1 Computer Networks Congestion Avoidance. 2 Recall TCP Sliding Window Operation.
TCP - Part II Relates to Lab 5. This is an extended module that covers TCP data transport, and flow control, congestion control, and error control in TCP.
CS 6401 Congestion Control in TCP Outline Overview of RENO TCP Reacting to Congestion SS/AIMD example.
TCP Congestion Control 컴퓨터공학과 인공지능 연구실 서 영우. TCP congestion control2 Contents 1. Introduction 2. Slow-start 3. Congestion avoidance 4. Fast retransmit.
Fall 2004FSU CIS 5930 Internet Protocols1 TCP – Data Exchange Reading: Section 24.4.
Transmission Control Protocol (TCP) connection-oriented stream data transfer data sent as an unstructured stream of bytes reliability acknowledgements.
Transmission Control Protocol (TCP) TCP Flow Control and Congestion Control CS 60008: Internet Architecture and Protocols Department of CSE, IIT Kharagpur.
@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.
Computer Networking Lecture 8 – TCP & Congestion Control.
TCP - Part II.
TCP - Part II Relates to Lab 5. This is an extended module that covers TCP flow control, congestion control, and error control in TCP.
Introduction to Congestion Control
TCP - Part II Relates to Lab 5. This is an extended module that covers TCP flow control, congestion control, and error control in TCP.
Lecture 19 – TCP Performance
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.
Congestion Control in TCP
CS640: Introduction to Computer Networks
Lecture 18 – More TCP & Congestion Control
State Transition Diagram
If both sources send full windows, we may get congestion collapse
EE 122: Lecture 10 (Congestion Control)
TCP III - Error Control TCP Error Control.
Transport Layer: Congestion Control
Computer Networking TCP.
TCP: Transmission Control Protocol Part II : Protocol Mechanisms
Presentation transcript:

Computer Networking Lecture 18 – More TCP & Congestion Control

Lecture 18: Outline TCP reliability TCP congestion control

Lecture 18: Reliability Challenges Congestion related losses Variable packet delays What should the timeout be? Reordering of packets How to tell the difference between a delayed packet and a lost one?

Lecture 18: 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??? Only one that it knows is lost Network is congested  shouldn’t overload it Error control is based on byte sequences, not packets. Retransmitted packet can be different from the original lost packet – Why?

Lecture 18: Round-trip Time Estimation Wait at least one RTT before retransmitting Importance of accurate RTT estimators: Low RTT estimate unneeded retransmissions High RTT estimate 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 18: Original TCP 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 (b * RTT), where b = 2 Every time timer expires, RTO exponentially backed-off Not good at preventing spurious timeouts Why?

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

Lecture 18: RTT Sample Ambiguity Karn’s RTT Estimator 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 AB ACK Sample RTT Original transmission retransmission RTO AB Original transmission retransmission Sample RTT ACK RTO X

Lecture 18: 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 18: 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 18: Fast Retransmit What are duplicate acks (dupacks)? Repeated acks for the same sequence When can duplicate acks occur? Loss Packet re-ordering Window update – advertisement of new flow control window Assume re-ordering is infrequent and not of large magnitude Use receipt of 3 or more duplicate acks as indication of loss Don’t wait for timeout to retransmit packet

Lecture 18: Fast Retransmit Time Sequence No Duplicate Acks Retransmission X Packets Acks

Lecture 18: Outline TCP reliability TCP congestion control

Lecture 18: TCP Congestion Control Changes to TCP motivated by ARPANET congestion collapse Basic principles AIMD Packet conservation Reaching steady state quickly ACK clocking

Lecture 18: AIMD Distributed, fair and efficient Packet loss is seen as sign of congestion and results in a multiplicative rate decrease Factor of 2 TCP periodically probes for available bandwidth by increasing its rate Time Rate

Lecture 18: Implementation Issue Operating system timers are very coarse – how to pace packets out smoothly? Implemented using a congestion window that limits how much data can be in the network. TCP also keeps track of how much data is in transit Data can only be sent when the amount of outstanding data is less than the congestion window. The amount of outstanding data is increased on a “send” and decreased on “ack” (last sent – last acked) < congestion window Window limited by both congestion and buffering Sender’s maximum window = Min (advertised window, cwnd)

Lecture 18: Congestion Avoidance If loss occurs when cwnd = W Network can handle 0.5W ~ W segments Set cwnd to 0.5W (multiplicative decrease) Upon receiving ACK Increase cwnd by (1 packet)/cwnd What is 1 packet?  1 MSS worth of bytes After cwnd packets have passed by  approximately increase of 1 MSS Implements AIMD

Lecture 18: Congestion Avoidance Sequence Plot Time Sequence No Packets Acks

Lecture 18: Congestion Avoidance Behavior Time Congestion Window Packet loss + Timeout Grabbing back Bandwidth Cut Congestion Window and Rate

Lecture 18: Packet Conservation At equilibrium, inject packet into network only when one is removed Sliding window and not rate controlled But still need to avoid sending burst of packets  would overflow links Need to carefully pace out packets Helps provide stability Need to eliminate spurious retransmissions Accurate RTO estimation Better loss recovery techniques (e.g. fast retransmit)

Lecture 18: TCP Packet Pacing Congestion window helps to “pace” the transmission of data packets In steady state, a packet is sent when an ack is received Data transmission remains smooth, once it is smooth Self-clocking behavior PrPr PbPb ArAr AbAb Receiver Sender AsAs

Lecture 18: Reaching Steady State Doing AIMD is fine in steady state but slow… How does TCP know what is a good initial rate to start with? Should work both for a CDPD (10s of Kbps or less) and for supercomputer links (10 Gbps and growing) Quick initial phase to help get up to speed (slow start)

Lecture 18: Slow Start Packet Pacing How do we get this clocking behavior to start? Initialize cwnd = 1 Upon receipt of every ack, cwnd = cwnd + 1 Implications Window actually increases to W in RTT * log 2 (W) Can overshoot window and cause packet loss

Lecture 18: Slow Start Example 1 One RTT One pkt time 0R 2 1R 3 4 2R R

Lecture 18: Slow Start Sequence Plot Time Sequence No Packets Acks

Lecture 18: Return to Slow Start If packet is lost we lose our self clocking as well Need to implement slow-start and congestion avoidance together When timeout occurs set ssthresh to 0.5w If cwnd < ssthresh, use slow start Else use congestion avoidance

Lecture 18: TCP Saw Tooth Behavior Time Congestion Window Initial Slowstart Fast Retransmit and Recovery Slowstart to pace packets Timeouts may still occur

Lecture 18: Important Lessons TCP timeout calculation  how is RTT estimated Modern TCP loss recovery Why are timeouts bad? How to avoid them?  e.g. fast retransmit How does TCP implement AIMD? Sliding window, slow start & ack clocking How to maintain ack clocking during loss recovery  fast recovery