Transmission Control Protocol (TCP) TCP Flow Control and Congestion Control CS 60008: Internet Architecture and Protocols Department of CSE, IIT Kharagpur.

Slides:



Advertisements
Similar presentations
TCP Variants.
Advertisements

Introduction 1 Lecture 13 Transport Layer (Transmission Control Protocol) slides are modified from J. Kurose & K. Ross University of Nevada – Reno Computer.
Simulation-based Comparison of Tahoe, Reno, and SACK TCP Kevin Fall & Sally Floyd Presented: Heather Heiman September 10, 2002.
1 Transport Protocols & TCP CSE 3213 Fall April 2015.
Transport Layer – TCP (Part2) Dr. Sanjay P. Ahuja, Ph.D. Fidelity National Financial Distinguished Professor of CIS School of Computing, UNF.
TCP: Transmission Control Protocol Overview Connection set-up and termination Interactive Bulk transfer Timers Improvements.
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.
Transport Layer 3-1 outline r TCP m segment structure m reliable data transfer m flow control m congestion control.
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 Layer 3-1 Outline r TCP m Congestion control m Flow control.
Computer Networks: TCP Congestion Control 1 TCP Congestion Control Lecture material taken from “Computer Networks A Systems Approach”, Third Ed.,Peterson.
CSEE W4140 Networking Laboratory Lecture 7: TCP flow control and congestion control Jong Yul Kim
CSCE 515: Computer Network Programming Chin-Tser Huang University of South Carolina.
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.
TDC375 Winter 03/04 John Kristoff - DePaul University 1 Network Protocols Transmission Control Protocol (TCP)
Networks : TCP Congestion Control1 TCP Congestion Control.
Networks : TCP Congestion Control1 TCP Congestion Control Presented by Bob Kinicki.
TCP in Heterogeneous Network Md. Ehtesamul Haque # P.
Department of Electronic Engineering City University of Hong Kong EE3900 Computer Networks Transport Protocols Slide 1 Transport Protocols.
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.
EE 4272Spring, 2003 Chapter 17 Transport Protocols Connection-Oriented Transport Protocol  Reliable Network Service: Design Issues  Unreliable Network.
TCP: flow and congestion control. Flow Control Flow Control is a technique for speed-matching of transmitter and receiver. Flow control ensures that a.
1 Transport Layer Computer Networks. 2 Where are we?
COMT 4291 Communications Protocols and TCP/IP COMT 429.
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.
1 Transport Protocols (continued) Relates to Lab 5. UDP and TCP.
TCP : Transmission Control Protocol Computer Network System Sirak Kaewjamnong.
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.
TCP1 Transmission Control Protocol (TCP). TCP2 Outline Transmission Control Protocol.
Transport Layer Moving Segments. Transport Layer Protocols Provide a logical communication link between processes running on different hosts as if directly.
2000 년 11 월 20 일 전북대학교 분산처리실험실 TCP Flow Control (nagle’s algorithm) 오 남 호 분산 처리 실험실
1 Mao W07 Midterm Review EECS 489 Computer Networks Z. Morley Mao Monday Feb 19, 2007 Acknowledgement: Some.
Copyright © Lopamudra Roychoudhuri
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.
Chapter 24 Transport Control Protocol (TCP) Layer 4 protocol Responsible for reliable end-to-end transmission Provides illusion of reliable network to.
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.
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.
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 Computer Networks Congestion Avoidance. 2 Recall TCP Sliding Window Operation.
TCP OVER ADHOC NETWORK. TCP Basics TCP (Transmission Control Protocol) was designed to provide reliable end-to-end delivery of data over unreliable networks.
ECE 4110 – Internetwork Programming
TCP Timeout and Retransmission
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.
TCP as a Reliable Transport. How things can go wrong… Lost packets Corrupted packets Reordered packets …Malicious packets…
TCP/IP1 Address Resolution Protocol Internet uses IP address to recognize a computer. But IP address needs to be translated to physical address (NIC).
CSEN 404 Transport Layer II Amr El Mougy Lamia AlBadrawy.
Transport Layer3-1 Chapter 3 Transport Layer Computer Networking: A Top Down Approach Featuring the Internet, 4th edition. Jim Kurose, Keith Ross Chapter.
DMET 602: Networks and Media Lab Amr El Mougy Yasmeen EssamAlaa Tarek.
DMET 602: Networks and Media Lab
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
Introduction to Networks
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.
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
Transport Layer: Congestion Control
TCP flow and congestion control
Presentation transcript:

Transmission Control Protocol (TCP) TCP Flow Control and Congestion Control CS 60008: Internet Architecture and Protocols Department of CSE, IIT Kharagpur Course Instructor: Sandip Chakraborty

TCP Concepts Stream data transfer – From application’s viewpoint, TCP transfers a contiguous stream of bytes – The application does not need to bother about creating data packets/datagrams Reliability – TCP sequence numbers – positive ACK from receiving TCP layer – Data is transmitted in blocks (called a TCP segments), the sequence number of the first data byte is sent as the sequence number of a TCP segment.

TCP Concepts Flow Control – The receiving TCP layer also informs the number of bytes it can receive without causing overflow in its internal buffer Multiplexing – Use of port numbers Logical connections – Reliability and flow control require that the sending and receiving TCP ends synchronize with some initial parameters, like the sequence number and window sizes Full Duplex

The Window Principle The sender can send all packets within the window without receiving an ACK, but must start a timeout timer for each of them. The receiver must acknowledge each packet received, indicating the sequence number of last well-received packets. The sender slides the window with each ACK received.

The Window Principle Let Packet 2 get lost! – The sender will not receive ACK 2, so it will remain at position 1 – Since the receiver did not received packet 2, it will acknowledge packet 3, 4 and 5 with and ACK 1 – Eventually a timeout will occur for packet 2, and it will be retransmitted – As the receiver has received packet 2, 3, 4 and 5 now, it will send and ACK 5, and the sender window will slide.

The Window Principle Let ACK 2 get lost! – The sender will not receive ACK 2, but it will receive ACK 3 – ACK 3 indicates that it has received all packets up to packet 3

The Window Principle The window mechanism ensures – Reliable transmission – Better use of network bandwidth (better than stop and wait) – Flow control The receiver can delay replying to a packet with an acknowledgement, if its buffer is full

Window Mechanism Applied to TCP TCP provides byte-stream connection – sequence numbers are assigned to each byte in the stream TCP divides this contiguous byte streams into TCP segments The window principle is applied at the byte level – The sequence sent and acknowledgement received will carry byte sequence numbers and the window size is expressed as the number of bytes.

Window Mechanism Applied to TCP

TCP Segment Format

TCP Acknowledgement and Retransmission Process Segment Size: 500 bytes Window Size: 1500 bytes

TCP Congestion Control Algorithms Slow Start Congestion Avoidance Fast Retransmit Fast Recovery

Slow Start Prime Observation: The rate at which new packets should be injected into the network is the rate at which the acknowledgements are returned by the other end. Slow start adds another window to the sender’s TCP : the congestion window (cwnd). Whenever a new connection is established with a host at another network, cwnd is initialized to one segment Each time an ACK is received, cwnd is increased by one segment

Slow Start The sender transmits at the lower value of congestion window and the advertised window (advertised by the receiver during the connection establishment) Congestion window: Flow control imposed by the sender – based on sender’s assessment of perceived network congestion Advertised window: Flow control imposed by the receiver – based on amount of available buffer space at the receiver

Slow Start Provides an exponential growth, although it is not exactly exponential. Receiver might delay its ACK for flow control.

Slow Start At some point, the capacity of the IP network is reached ! An intermediate router starts discarding the packets… This tells the sender that its congestion window has gotten too large – need congestion avoidance !!!

Congestion Avoidance Assumption: Packet loss due to channel error is very less (less than 1%) – therefore, loss of a packet signals congestion somewhere between the source and destination. There are two indications of packet loss, – A timeout occurs – Duplicate ACKs are received Congestion avoidance and slow start are independent algorithms with different objectives, – Slow start: Find out the available capacity between the source and destination – Congestion avoidance: Reduce the flow rate if congestion occurs However, in practice, they are implemented together because after reducing the flow rate on detection of congestion, available capacity of the link need to be calculated again.

Slow Start + Congestion Avoidance Congestion avoidance and slow start maintains two variables; – A Congestion window (cwnd) – A slow start threshold size (ssthresh)

Slow Start + Congestion Avoidance The combined algorithm operates as follows: – For a given connection, initialize cwnd to 1 segment and ssthresh to bytes – The TCP output routine sends at a rate of min(cwnd, advwnd) where advwnd is the receiver’s advertised window – When congestion occurs (timeout of duplicate ACK), one-half of the current window size is saved in ssthresh. Additionally, if the congestion is indicated by a timeout, cwnd is set to one window. – When new data is acknowledged by the other end, increase cwnd, as follows: If cwnd is less than or equal to ssthresh, TCP is in slow start (exponential growth) If cwnd is more than ssthresh, TCP is in congestion avoidance (linear growth)

Congestion Avoidance Cwnd is incremented by segsize*segsize/cwnd, each time an ACK is received – segsize is segment size in bytes. The increase in cwnd is at most one segment per round trip time (regardless of how many ACKs are received in a round trip time) – Linear increase

Congestion Avoidance

Fast Retransmit Fast retransmits avoids having TCP wait for a timeout to resend lost segments. TCP can generate an immediate ACK (a duplicate ACK) when an out-of-order segment is received. This duplicate ACK should not be delayed – the purpose is to let the other end know that a segment was received out of order and to tell what sequence number is expected. TCP does not know whether a duplicate ACK is caused by a lost segment or just a reordering of segments – it waits for a small number of duplicate ACKs to be received.

Fast Retransmit Assumption: If there is just a reordering of segments, there will be only one or two duplicate ACKs, before the reordered segment is processed. If three or more duplicate ACKs are received in a row, it is a strong indication that a segment has been lost. TCP then performs a retransmission of what appears to be missing segment, without waiting for a retransmission timer to expire.

Fast Retransmit

Fast Recovery Fast retransmit sends what appears to be the missing segments. What should TCP do next? – Congestion Avoidance – Slow Start

Fast Recovery Receipt of duplicate ACKs tells TCP more than just a packet has been lost. The receiver can only generate duplicate ACKs when another segment is received -> that segment has left the network and is in the receiver buffer -> indicates there is still data flowing between the two ends. TCP does not want to reduce the flow abruptly by going into slow start -> start congestion avoidance instead of slow start

Fast Retransmit + Fast Recovery When the third duplicate ACK in a row is received, set ssthresh to one-half of the current cwnd, but no less than two segments. Retransmit the missing segment. Set cwnd to ssthresh plus three times the segment size – This inflates the cwnd by the number of segments (3) that have left the network and the other end has cached.

Fast Retransmit + Fast Recovery Each time another duplicate ACK arrives, increment cwnd by one segment size. – This inflates the cwnd for the additional segment that has left the network – Transmit a packet, if allowed by the new value of the cwnd. When the new ACK arrives that acknowledges the new data, set cwnd to ssthresh. – This ACK is the acknowledgement of the retransmission. – Additionally, it acknowledges all the intermediate segments sent between the lost packet and the receipt of the first duplicate ACK.

Fast Retransmit + Fast Recovery

TCP Tahoe vs TCP Reno