CS640: Introduction to Computer Networks Aditya Akella Lecture 15 TCP – III Reliability and Implementation Issues.

Slides:



Advertisements
Similar presentations
CSCI-1680 Transport Layer II Based partly on lecture notes by David Mazières, Phil Levis, John Jannotti Rodrigo Fonseca.
Advertisements

Different TCP Flavors CSCI 780, Fall TCP Congestion Control Slow-start Congestion Avoidance Congestion Recovery Tahoe, Reno, New-Reno SACK.
TCP and Congestion Control
TCP Congestion Control
1 TCP Congestion Control. 2 TCP Segment Structure source port # dest port # 32 bits application data (variable length) sequence number acknowledgement.
Chapter 6 TCP Congestion Control Professor Rick Han University of Colorado at Boulder
Congestion Control Created by M Bateman, A Ruddle & C Allison As part of the TCP View project.
TCP Congestion Control Dina Katabi & Sam Madden nms.csail.mit.edu/~dina 6.033, Spring 2014.
Router Buffer Sizing and Reliability Challenges in Multicast Aditya Akella 02/28.
Computer Networks: TCP Congestion Control 1 TCP Congestion Control Lecture material taken from “Computer Networks A Systems Approach”, Fourth Edition,Peterson.
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.
Introduction to Congestion Control
Congestion Control Tanenbaum 5.3, /12/2015Congestion Control (A Loss Based Technique: TCP)2 What? Why? Congestion occurs when –there is no reservation.
Computer Networks: TCP Congestion Control 1 TCP Congestion Control Lecture material taken from “Computer Networks A Systems Approach”, Third Ed.,Peterson.
15-744: Computer Networking L-10 Congestion Control.
Lecture 18 – TCP Performance
1 Spring Semester 2007, Dept. of Computer Science, Technion Internet Networking recitation #7 TCP New Reno Vs. Reno.
1 Internet Networking Spring 2002 Tutorial 10 TCP NewReno.
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.
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.
1 Internet Networking Spring 2004 Tutorial 10 TCP NewReno.
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)
TCP Congestion Control
TCP: flow and congestion control. Flow Control Flow Control is a technique for speed-matching of transmitter and receiver. Flow control ensures that a.
3: Transport Layer3b-1 Principles of Congestion Control Congestion: r informally: “too many sources sending too much data too fast for network to handle”
Computer Networking Lecture 17 – TCP Performance Dejian Ye, Liu Xin.
T. S. Eugene Ngeugeneng at cs.rice.edu Rice University1 COMP/ELEC 429 Introduction to Computer Networks Lecture 15: Congestion Control I Slides used with.
CSE 461 University of Washington1 Topic How TCP implements AIMD, part 1 – “Slow start” is a component of the AI portion of AIMD Slow-start.
Advance Computer Networking
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
Computer Networking Lecture 18 – More TCP & Congestion Control.
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
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.
TCP Congestion Control Computer Networks TCP Congestion Control 1.
1 Computer Networks Congestion Avoidance. 2 Recall TCP Sliding Window Operation.
TCP Congestion Control
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.
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.
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.
TCP - Part II Relates to Lab 5. This is an extended module that covers TCP flow control, congestion control, and error control in TCP.
Chapter 3 outline 3.1 transport-layer services
COMP 431 Internet Services & Protocols
TCP - Part II Relates to Lab 5. This is an extended module that covers TCP flow control, congestion control, and error control in TCP.
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
CS4470 Computer Networking Protocols
TCP Congestion Control
Transport Layer: Congestion Control
Computer Networking TCP.
Presentation transcript:

CS640: Introduction to Computer Networks Aditya Akella Lecture 15 TCP – III Reliability and Implementation Issues

2 Reliability TCP provides a “reliable byte stream” –“Loss recovery” key to ensuring this abstraction –Sender must retransmit lost packets Challenges: –When is a packet lost? Congestion related losses Reordering of packets –How to tell the difference between a delayed packet and lost one? –Variable packet delays What should the timeout be? –How to recover from losses?

3 Loss Recovery in a Sliding Window setup 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 Sender only retransmits a single packet. –Only one that it knows is lost Sent after timeout Choice of timeout interval  crucial

4 Round-trip Time Estimation Reception success known only after one RTT –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!

5 Jacobson’s Retransmission Timeout (RTO) Original setting: –Round trip times exponentially averaged: New RTT =  (old RTT) + (1 -  ) (new sample) Recommended value for  : –Retransmit timer set to (2 * RTT) –But this can lead to spurious retransmissions Key observation: –At high loads round trip variance is high Solution: –Base RTO on RTT and deviation RTO = RTT + 4 * rttvar –new_rttvar =  * dev + (1-  ) old_rttvar Dev = linear deviation Inappropriately named – actually smoothed linear deviation

6 AIMD Implementation If loss occurs when cwnd = W –Network can handle < W segments –Set cwnd to 0.5W (multiplicative decrease) –Known as “congestion control” Upon receiving ACK –Increase cwnd by (1 packet)/cwnd What is 1 packet?  1 MSS worth of bytes MSS = maximum segment size –After cwnd packets have passed by  approximately increase of 1 MSS –Known as “congestion avoidance” Together these implement AIMD

7 Control/Avoidance Behavior in the presence of timeouts Time Congestion Window Packet loss + Timeout Grabbing back Bandwidth Cut Congestion Window and Rate

8 Improving Loss Recovery: Fast Retransmit Waiting for timeout to retransmit is inefficient Are there quicker recovery schemes? –Use duplicate acknowledgements as an indication –Fast retransmit What are duplicate acks (dupacks)? –Repeated acks for the same sequence When can duplicate acks occur? –Loss –Packet re-ordering 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

9 Fast Retransmit Time Sequence No Duplicate Acks Retransmission X Packets Acks Note: Timeouts can still happen (burst losses in a window)

10 How to Change Window When a loss occurs have W packets outstanding –A bunch of dupacks arrive –Rexmit on 3 rd dupack –But dupacks keep arriving –Must wait for a new ack to send new packets New cwnd = 0.5 * cwnd –Send new cwnd packets in a burst when new ack arrives –Risk losing “self clocking” or “packet pacing”

11 In steady state, a packet is sent when an ack is received –Data transmission remains smooth, once it is smooth (steady state) –“Self-clocking” behavior –When self clocking is lost  send packets in a burst  could momentarily overflow network capacity Packet Pacing

12 Preserving Clocking: Fast Recovery Each duplicate ack notifies sender that single packet has cleared network When < cwnd packets are outstanding –Allow new packets out with each new duplicate acknowledgement Behavior –Sender is idle for some time – waiting for ½ cwnd worth of dupacks –Transmits at original rate after wait Ack clocking rate is same as before loss

13 Fast Recovery (Reno) Time Sequence No Sent for each dupack after W/2 dupacks arrive X Packets Acks

14 Dupacks may not be enough: Timeouts can still happen! Time Sequence No X X X X Now what? - timeout Packets Acks X

15 Reaching Steady State Doing AIMD is fine in steady state… –But how to get to steady state? How does TCP know what is a good initial rate to start with? Quick initial phase to help get up to speed –Called “slow” start (!!) –Losts of packets sent back to back –Paced out by the bottleneck link –Eventually, self clocking is established! PrPr PbPb ArAr AbAb Receiver Sender AsAs

16 Slow Start Slow 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

17 Slow Start Example 1 One RTT One pkt time 0R 2 1R 3 4 2R R

18 Return to Slow Start If too many packets are lost self clocking is lost 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

19 Time Congestion Window Initial Slowstart Fast Retransmit and Recovery Slowstart to pace packets Timeouts may still occur The Whole TCP “Saw Tooth”

20 TCP Performance and Role of Buffering Can TCP saturate a link? Depends on buffering in network Congestion control –Increase utilization until… link becomes congested –React by decreasing window by 50% –Window is proportional to rate * RTT Unbuffered link –The router can’t fully utilize the link If the window is too small, link is not full If the link is full, next window increase causes drop With no buffer TCP achieves 75% utilization t W Minimum window for full utilization

21 TCP Performance In the real world, router queues play important role –Role of Buffers  If window is larger, packets sit in queue on bottleneck link If we have a large router queue  can get 100% utilization –But, router queues can cause large delays How big does the queue need to be? –Windows vary from W  W/2 To make sure that link is always full W/2 > RTT * BW W = RTT * BW + Qsize  Qsize > RTT * BW –Ensures 100% utilization –Delay? Varies between RTT and 2 * RTT Queuing between 0 and RTT

22 Buffered Link t W Minimum window for full utilization With sufficient buffering we achieve full link utilization –The window is always above the “critical” threshold –Buffer absorbs changes in window size Buffer Size = Height of TCP Sawtooth Minimum buffer size needed is 2T*C –This is the origin of the rule-of-thumb Buffer