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.

Slides:



Advertisements
Similar presentations
Simulation-based Comparison of Tahoe, Reno, and SACK TCP Kevin Fall & Sally Floyd Presented: Heather Heiman September 10, 2002.
Advertisements

Different TCP Flavors CSCI 780, Fall TCP Congestion Control Slow-start Congestion Avoidance Congestion Recovery Tahoe, Reno, New-Reno SACK.
Flow control Connection management TCP, UDP
TCP: Transmission Control Protocol Overview Connection set-up and termination Interactive Bulk transfer Timers Improvements.
1 Transport Protocols Relates to Lab 5. UDP and TCP.
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.
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.
TDC365 Spring 2001John Kristoff - DePaul University1 Internetworking Technologies Transmission Control Protocol (TCP)
Transport Layer3-1 Congestion Control. Transport Layer3-2 Principles of Congestion Control Congestion: r informally: “too many sources sending too much.
CSCE 515: Computer Network Programming Chin-Tser Huang University of South Carolina.
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.
Computer Networks : TCP Congestion Control1 TCP Congestion Control.
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.
TCP. Learning objectives Reliable Transport in TCP TCP flow and 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.
Lect3..ppt - 09/12/04 CIS 4100 Systems Performance and Evaluation Lecture 3 by Zornitza Genova Prodanoff.
COMT 4291 Communications Protocols and TCP/IP COMT 429.
1 Transport Protocols (continued) Relates to Lab 5. UDP and TCP.
Copyright © Lopamudra Roychoudhuri
Lecture 9 – More TCP & Congestion Control
What is TCP? Connection-oriented reliable transfer Stream paradigm
Transport Layer 3-1 Chapter 3 Transport Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March
CS640: Introduction to Computer Networks Aditya Akella Lecture 15 TCP – III Reliability and Implementation Issues.
Computer Networking Lecture 18 – More TCP & Congestion Control.
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:
1 TCP Timeout And Retransmission Chapter 21 TCP sets a timeout when it sends data and if data is not acknowledged before timeout expires it retransmits.
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.
CS640: Introduction to Computer Networks Aditya Akella Lecture 15 TCP – III Reliability and Implementation Issues.
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.
Malathi Veeraraghavan Originals by Jörg Liebeherr 1 Data Transfer in TCP Acknowledgements Flow Control.
TCP OVER ADHOC NETWORK. TCP Basics TCP (Transmission Control Protocol) was designed to provide reliable end-to-end delivery of data over unreliable networks.
Internet Networking recitation #11
ECE 4110 – Internetwork Programming
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.
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.
Recap Slow start introduced cwnd Slow start introduced cwnd Can transmit up to Can transmit up to min( cwnd, offered window ) Flow control by the sender.
TCP as a Reliable Transport. How things can go wrong… Lost packets Corrupted packets Reordered packets …Malicious packets…
Transmission Control Protocol (TCP) TCP Flow Control and Congestion Control CS 60008: Internet Architecture and Protocols Department of CSE, IIT Kharagpur.
1 TCP ProtocolsLayer name DNSApplication TCP, UDPTransport IPInternet (Network ) WiFi, Ethernet Link (Physical)
Malathi Veeraraghavan Originals by Jörg Liebeherr 1 Congestion Control TCP implements congestion control at the sender –This control is intended to reduce.
TCP over Wireless PROF. MICHAEL TSAI 2016/6/3. TCP Congestion Control (TCP Tahoe) Only ACK correctly received packets Congestion Window Size: Maximum.
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 Networks
Introduction to Congestion Control
Chapter 17 and 18: TCP is connection oriented
TCP.
Chapter 5: Transport Protocols
TCP.
Precept 2: TCP Congestion Control Review
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 - Part II Suman Banerjee CS 640, UW-Madison
PUSH Flag A notification from the sender to the receiver to pass all the data the receiver has to the receiving application. Some implementations of TCP.
CS4470 Computer Networking Protocols
EE 122: Lecture 10 (Congestion Control)
Transport Layer: Congestion Control
TCP flow and congestion control
TCP: Transmission Control Protocol Part II : Protocol Mechanisms
Presentation transcript:

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.

2 Interactive and bulk data transfer TCP applications can be put into the following categories bulk data transfer- ftp, mail, http interactive data transfer- telnet, rlogin TCP has heuristics to deal these application types. For interactive data transfer: Try to reduce the number of packets For bulk data transfer:

3 Telnet session on a local network This is the output of typing 3 (three) characters : Time :Argon  Neon: Push, SeqNo 0:1(1), AckNo 1 Time :Neon  Argon: Push, SeqNo 1:2(1), AckNo 1 Time :Argon  Neon: No Data, AckNo 2 Time : Argon  Neon: Push, SeqNo 1:2(1), AckNo 2 Time :Neon  Argon: Push, SeqNo 2:3(1), AckNo 2 Time : Argon  Neon: No Data, AckNo 3 Time : Argon  Neon: Push, SeqNo 2:3(1) AckNo 3 Time :Neon  Argon: Push, SeqNo 3:4(1) AckNo 3 Time : Argon  Neon: No Data, AckNo 4

4 Interactive applications: Telnet Remote terminal applications (e.g., Telnet) send characters to a server. The server interprets the character and sends the output at the server to the client. For each character typed, you see three packets: 1.Client  Server: Send typed character 2.Server  Client: Echo of character (or user output) and acknowledgement for first packet 3.Client  Server: Acknowledgement for second packet

5 Why 3 packets per character? We would expect four packets per character: However, tcpdump shows this pattern: What has happened? TCP has delayed the transmission of an ACK

6 Delayed Acknowledgement TCP delays transmission of ACKs for up to 200ms The hope is to have data ready in that time frame. Then, the ACK can be piggybacked with a data segment. Delayed ACKs explain why the ACK and the “echo of character” are sent in the same segment.

7 Telnet session to a distant host This is the output of typing nine characters : Time :Argon  Tenet: Push, SeqNo 1:2(1), AckNo 2 Time :Tenet  Argon: Push, SeqNo 2:3(1), AckNo 2 Time :Argon  Tenet: Push, SeqNo 2:3(1), AckNo 3 Time : Tenet  Argon: Push, SeqNo 3:4(1), AckNo 3 Time : Argon  Tenet: Push, SeqNo 3:4(1), AckNo 4 Time : Tenet  Argon: Push, SeqNo 4:5(1) AckNo 4 Time : Argon  Tenet: Push, SeqNo 4:8(4) AckNo 5 Time : Tenet  Argon: Push, SeqNo 5:9(4) AckNo 8

8 Observation 1 Observation: Transmission of segments follows a different pattern, i.e., there are only two packets per character typed The delayed acknowled- gment does not kick in The reason is that there is always data at Argon ready to sent when the ACK arrives.

9 Observation 2 Observation: –Argon never has multiple unacknowledged segments outstanding –There are fewer transmissions than there are characters. This is due to Nagle’s Algorithm: Each TCP connection can have only one small (1-byte) segment outstanding that has not been acknowledged. Implementation: Send one byte and buffer all subsequent bytes until acknowledgement is received.Then send all buffered bytes in a single segment. (Only enforced if byte is arriving from application one byte at a time) Nagle’s algorithm reduces the amount of small segments. The algorithm can be disabled.

10 Flow Control Congestion Control Error Control TCP:

11 What is Flow/Congestion/Error Control ? Flow Control: Algorithms to prevent that the sender overruns the receiver with information? Congestion Control: Algorithms to prevent that the sender overloads the network Error Control: Algorithms to recover or conceal the effects from packet losses  The goal of each of the control mechanisms are different.  But the implementation is combined

12 TCP Flow Control

13 TCP Flow Control TCP implements sliding window flow control Sending acknowledgements is separated from setting the window size at sender. Acknowledgements do not automatically increase the window size Acknowledgements are cumulative

14 Sliding Window Flow Control Sliding Window Protocol is performed at the byte level: Here: Sender can transmit sequence numbers 6,7,8.

15 Sliding Window: “Window Closes” Transmission of a single byte (with SeqNo = 6) and acknowledgement is received (AckNo = 5, Win=4):

16 Sliding Window: “Window Opens” Acknowledgement is received that enlarges the window to the right (AckNo = 5, Win=6): A receiver opens a window when TCP buffer empties (meaning that data is delivered to the application).

17 Sliding Window: “Window Shrinks” Acknowledgement is received that reduces the window from the right (AckNo = 5, Win=3): Shrinking a window should not be used

18 Window Management in TCP The receiver is returning two parameters to the sender The interpretation is: I am ready to receive new data with SeqNo= AckNo, AckNo+1, …., AckNo+Win-1 Receiver can acknowledge data without opening the window Receiver can change the window size without acknowledging data

19 Sliding Window: Example

20 TCP Congestion Control

21 TCP Congestion Control TCP has a mechanism for congestion control. The mechanism is implemented at the sender The sender has two parameters: –Congestion Window (cwnd) –Slow-start threshhold Value (ssthresh) Initial value is the advertised window size Congestion control works in two modes: –slow start (cwnd < ssthresh) –congestion avoidance (cwnd >= ssthresh

22 Slow Start Initial value: Set cwnd = 1 »Note: Unit is a segment size. TCP actually is based on bytes and increments by 1 MSS (maximum segment size) The receiver sends an acknowledgement (ACK) for each packet »Note: Generally, a TCP receiver sends an ACK for every other segment. Each time an ACK is received by the sender, the congestion window is increased by 1 segment: cwnd = cwnd + 1 »If an ACK acknowledges two segments, cwnd is still increased by only 1 segment. »Even if ACK acknowledges a segment that is smaller than MSS bytes long, cwnd is increased by 1. Does Slow Start increment slowly? Not really. In fact, the increase of cwnd is exponential

23 Slow Start Example The congestion window size grows very rapidly –For every ACK, we increase cwnd by 1 irrespective of the number of segments ACK’ed TCP slows down the increase of cwnd when cwnd > ssthresh

24 Congestion Avoidance Congestion avoidance phase is started if cwnd has reached the slow-start threshold value If cwnd >= ssthresh then each time an ACK is received, increment cwnd as follows: cwnd = cwnd + 1/ [cwnd] Where [cwnd] is the largest integer smaller than cwnd So cwnd is increased by one only if all cwnd segments have been acknowledged.

25 Example of Slow Start/Congestion Avoidance Assume that ssthresh = 8 Roundtrip times Cwnd (in segments) ssthresh

26 Responses to Congestion So, TCP assumes there is congestion if it detects a packet loss A TCP sender can detect lost packets via: Timeout of a retransmission timer Receipt of a duplicate ACK TCP interprets a Timeout as a binary congestion signal. When a timeout occurs, the sender performs: –cwnd is reset to one: cwnd = 1 –ssthresh is set to half the current size of the congestion window: ssthressh = cwnd / 2 –and slow-start is entered

27 Summary of TCP congestion control Initially: cwnd = 1; ssthresh = advertised window size; New Ack received: if (cwnd < ssthresh) /* Slow Start*/ cwnd = cwnd + 1; else /* Congestion Avoidance */ cwnd = cwnd + 1/cwnd; Timeout: /* Multiplicative decrease */ ssthresh = cwnd/2; cwnd = 1;

28 Slow Start / Congestion Avoidance A typical plot of cwnd for a TCP connection (MSS = 1500 bytes) with TCP Tahoe:

29 Flavors of TCP Congestion Control TCP Tahoe (1988, FreeBSD 4.3 Tahoe) –Slow Start –Congestion Avoidance –Fast Retransmit TCP Reno (1990, FreeBSD 4.3 Reno) –Fast Recovery New Reno (1996) SACK (1996) RED (Floyd and Jacobson 1993)

30 Acknowledgments in TCP Receiver sends ACK to sender –ACK is used for flow control, error control, and congestion control ACK number sent is the next sequence number expected Delayed ACK: TCP receiver normally delays transmission of an ACK (for about 200ms) – Why? ACKs are not delayed when packets are received out of sequence –Why? Lost segment

31 Acknowledgments in TCP Receiver sends ACK to sender –ACK is used for flow control, error control, and congestion control ACK number sent is the next sequence number expected Delayed ACK: TCP receiver normally delays transmission of an ACK (for about 200ms) – Why? ACKs are not delayed when packets are received out of sequence –Why? Out-of-order arrivals

32 Fast Retransmit If three or more duplicate ACKs are received in a row, the TCP sender believes that a segment has been lost. Then TCP performs a retransmission of what seems to be the missing segment, without waiting for a timeout to happen. Enter slow start: ssthresh = cwnd/2 cwnd = 1

33 Fast Recovery Fast recovery avoids slow start after a fast retransmit Intuition: Duplicate ACKs indicate that data is getting through After three duplicate ACKs set: –Retransmit “lost packet” –ssthresh = cwnd/2 –cwnd = cwnd+3 –Enter congestion avoidance –Increment cwnd by one for each additional duplicate ACK When ACK arrives that acknowledges “new data” (here: AckNo=2028), set: cwnd=ssthresh enter congestion avoidance

34 TCP Reno Duplicate ACKs: Fast retransmit Fast recovery  Fast Recovery avoids slow start Timeout: Retransmit Slow Start TCP Reno improves upon TCP Tahoe when a single packet is dropped in a round-trip time.

35 TCP Tahoe and TCP Reno (for single segment losses) Reno time cwnd time cwnd Taho

36 TCP Tahoe This picture is copied from somewhere

37 TCP Reno (Jacobson 1990) CA SS Fast retransmission/fast recovery This picture is copied from somewhere

38 TCP New Reno When multiple packets are dropped, Reno has problems Partial ACK: –Occurs when multiple packets are lost –A partial ACK acknowledges some, but not all packets that are outstanding at the start of a fast recovery, takes sender out of fast recovery  Sender has to wait until timeout occurs New Reno: –Partial ACK does not take sender out of fast recovery –Partial ACK causes retransmission of the segment following the acknowledged segment New Reno can deal with multiple lost segments without going to slow start

39 SACK SACK = Selective acknowledgment Issue: Reno and New Reno retransmit at most 1 lost packet per round trip time Selective acknowledgments: The receiver can acknowledge non- continuous blocks of data (SACK , ) Multiple blocks can be sent in a single segment. TCP SACK: –Enters fast recovery upon 3 duplicate ACKs –Sender keeps track of SACKs and infers if segments are lost. Sender retransmits the next segment from the list of segments that are deemed lost.