Malathi Veeraraghavan Originals by Jörg Liebeherr 1 Data Transfer in TCP Acknowledgements Flow Control.

Slides:



Advertisements
Similar presentations
LOGO Transmission Control Protocol 12 (TCP) Data Flow.
Advertisements

Simulation-based Comparison of Tahoe, Reno, and SACK TCP Kevin Fall & Sally Floyd Presented: Heather Heiman September 10, 2002.
Flow control Connection management TCP, UDP
1 Transport Protocols & TCP CSE 3213 Fall April 2015.
TCP - Part I Relates to Lab 5. First module on TCP which covers packet format, data transfer, and connection management.
1 CS 4396 Computer Networks Lab Transmission Control Protocol (TCP) Part I.
1 Transport Protocols Relates to Lab 5. UDP and TCP.
1 Week 10 Transport Protocols, UDP, TCP. 2 Orientation r We move one layer up and look at the transport layer across the Internet.
Transport Layer – TCP (Part1) Dr. Sanjay P. Ahuja, Ph.D. Fidelity National Financial Distinguished Professor of CIS School of Computing, UNF.
Flow and Error Control. Flow Control Flow control coordinates the amount of data that can be sent before receiving acknowledgement It is one of the most.
1 TCP - Part II. 2 What is Flow/Congestion/Error Control ? Flow Control: Algorithms to prevent that the sender overruns the receiver with information.
Fundamentals of Computer Networks ECE 478/578 Lecture #21: TCP Window Mechanism Instructor: Loukas Lazos Dept of Electrical and Computer Engineering University.
School of Information Technologies TCP Congestion Control NETS3303/3603 Week 9.
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.
1 K. Salah Module 6.1: TCP Flow and Congestion Control Connection establishment & Termination Flow Control Congestion Control QoS.
TCP. Learning objectives Reliable Transport in TCP TCP flow and Congestion Control.
The Transport Layer.
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.
1 Transport Layer Computer Networks. 2 Where are we?
COMT 4291 Communications Protocols and TCP/IP COMT 429.
1 TCP : Transmission Control Protocol ( Stevens TCP/ IP Illustrated Volume 1) TCP is connection oriented Unit of information passed by TCP to IP is a segment.
1 Transport Protocols (continued) Relates to Lab 5. UDP and TCP.
TCP : Transmission Control Protocol Computer Network System Sirak Kaewjamnong.
Copyright 2002, S.D. Personick. All Rights Reserved.1 Telecommunications Networking II Topic 20 Transmission Control Protocol (TCP) Ref: Tanenbaum pp:
Chapter 12 Transmission Control Protocol (TCP)
1 TCP: Reliable Transport Service. 2 Transmission Control Protocol (TCP) Major transport protocol used in Internet Heavily used Completely reliable transfer.
2000 년 11 월 20 일 전북대학교 분산처리실험실 TCP Flow Control (nagle’s algorithm) 오 남 호 분산 처리 실험실
Malathi Veeraraghavan Originals by Jörg Liebeherr 1 Error Control Congestion Control Timers.
Copyright 2008 Kenneth M. Chipps Ph.D. Controlling Flow Last Update
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.
Lecture 9 – 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:
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.
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.
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 Timeout and Retransmission
TCP Congestion Control 컴퓨터공학과 인공지능 연구실 서 영우. TCP congestion control2 Contents 1. Introduction 2. Slow-start 3. Congestion avoidance 4. Fast retransmit.
© Jörg Liebeherr (modified by Malathi Veeraraghavan) 1 Overview Formats, Data Transfer, etc. Connection Management.
Fall 2004FSU CIS 5930 Internet Protocols1 TCP – Data Exchange Reading: Section 24.4.
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)
Data Link Layer.
Malathi Veeraraghavan Originals by Jörg Liebeherr 1 Congestion Control TCP implements congestion control at the sender –This control is intended to reduce.
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
Chapter 5: Transport Protocols
TCP.
TCP - Part I Karim El Defrawy
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
TCP - Part I Relates to Lab 5. First module on TCP which covers packet format, data transfer, and connection management.
TCP flow and congestion control
TCP: Transmission Control Protocol Part II : Protocol Mechanisms
Presentation transcript:

Malathi Veeraraghavan Originals by Jörg Liebeherr 1 Data Transfer in TCP Acknowledgements Flow Control

Malathi Veeraraghavan Originals by Jörg Liebeherr 2 Interactive and bulk data TCP applications can be put into the following categories –bulk data transfer- ftp, mail, http –interactive data transfer- telnet, rlogin TCP has algorithms to deal which each type of applications efficiently.

Malathi Veeraraghavan Originals by Jörg Liebeherr 3 Rlogin “Rlogin” is a remote terminal applications Originally built only for Unix systems. Rlogin sends one segment per character (keystroke) Receiver echoes the character back. So, we really expect to have four segments per keystroke Q: What is the total number of bytes transmitted for a single keystroke? A: TCP hdr = 20; IP hdr =20; ethernet hdr/trailer:18 bytes =234 bytes

Malathi Veeraraghavan Originals by Jörg Liebeherr 4 Segment exchange in rlogin We would expect that tcpdump shows this pattern: However, tcpdump shows this pattern: So, TCP has delayed the transmission of an ACK

Malathi Veeraraghavan Originals by Jörg Liebeherr 5 tcpdump of an rlogin session This is the output of typing the first character : aida.poly.edu.1023 > catt.poly.edu.login: P 50:51(1) ack catt.poly.edu.login > aida.poly.edu.1023: P 1:2(1) ack 51 win aida.poly.edu.1023 > catt.poly.edu.login:. ack 2 win This is the output of typing the second character: aida.poly.edu.1023 > catt.poly.edu.login: P 51:52(1) ack 2 win catt.poly.edu.login > aida.poly.edu.1023: P 2:3(1) ack 52 win aida.poly.edu.1023 > catt.poly.edu.login:. ack 3 win 17520

Malathi Veeraraghavan Originals by Jörg Liebeherr 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 the data segment. Delayed ACKs explain why the ACK and the “echo of character” are sent in the same segment. What are the delays of the ACKs in the tcpdump example?

Malathi Veeraraghavan Originals by Jörg Liebeherr 7 Delayed ACK timer This timer ticks every 200ms. First timeout occurs based on when the timer was initialized, which is when the system was rebooted. The figure below explains why the delay for the ACKdelay is UP TO 200 ms (and not equal to 200 ms).

Malathi Veeraraghavan Originals by Jörg Liebeherr 8 tcpdump of a wide-area rlogin session This is the output of typing 7 characters : 54: aida.poly.edu.1023 > tenet.CS.Berkeley.EDU.login: P 1:2(1) ack 2 win : tenet.CS.Berkeley.EDU.login > aida.poly.edu.1023: P 2:3(1) ack 2 win : aida.poly.edu.1023 > tenet.CS.Berkeley.EDU.login: P 2:3(1) ack 3 win : tenet.CS.Berkeley.EDU.login > aida.poly.edu.1023: P 3:4(1) ack 3 win : aida.poly.edu.1023 > tenet.CS.Berkeley.EDU.login: P 3:4(1) ack 4 win : tenet.CS.Berkeley.EDU.login > aida.poly.edu.1023: P 4:5(1) ack 4 win : aida.poly.edu.1023 > tenet.CS.Berkeley.EDU.login: P 4:8(4) ack 5 win : tenet.CS.Berkeley.EDU.login > aida.poly.edu.1023: P 5:9(4) ack 8 win 16384

Malathi Veeraraghavan Originals by Jörg Liebeherr 9 Wide-area Rlogin: Observation 1 Transmission of segments follows a different pattern. The delayed acknowled- gment does not kick in Reason is that since the delays for sending segments across the wide area network are much larger, there is always data at aida when it needs to send an ACK for the echo’ed character.

Malathi Veeraraghavan Originals by Jörg Liebeherr 10 Wide-area Rlogin: Observation 2 Aida never has multiple segments outstanding (meaning unacknowledged segments) This is due to Nagle’s Algorithm: Each TCP connection can have only one small segment (less than MSS) 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 rule reduces the amount of small segments. The algorithm can be disabled.

Malathi Veeraraghavan Originals by Jörg Liebeherr 11 Disabling Nagle’s algorithm Typically function keys generate multiple bytes of data If TCP gets 1 byte of data at a time, it may send the first byte in a segment, and wait for an ACK before sending other bytes (if Nagle’s algorithm is enabled). The receiver does not generate an echo till the remaining bytes are received. This triggers delayed ACK, which means the receiver waits till the 200ms delayed ACK timer goes off before sending an ACK. The interactive user may see noticeable delays. Delay is low if Nagle’s algorithm is disabled, but throughput is also low.

Malathi Veeraraghavan Originals by Jörg Liebeherr 12 Summary of interactive data transfer in TCP Delayed ACK timer Nagle’s algorithm Chapter 19 of EL537 textbook

Malathi Veeraraghavan Originals by Jörg Liebeherr 13 Bulk data transfer (flow control) If TCP connections exchange a lot of data (bulk data transfer), then one deals with a different set of problem: Flow Control: How to prevent that the sender overruns the receiver with information? Flow Control in TCP 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

Malathi Veeraraghavan Originals by Jörg Liebeherr 14 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

Malathi Veeraraghavan Originals by Jörg Liebeherr 15 Sliding Window Flow Control Sliding Window Protocol is performed at the byte level: Here: Sender can transmit sequence numbers 6,7,8.

Malathi Veeraraghavan Originals by Jörg Liebeherr 16 Sliding Window: “Window Closes” Transmission of a single byte (with SeqNo = 6) and acknowledgement is received (AckNo = 5, Win=4):

Malathi Veeraraghavan Originals by Jörg Liebeherr 17 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).

Malathi Veeraraghavan Originals by Jörg Liebeherr 18 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 - Host requirements RFC strongly discourages this

Malathi Veeraraghavan Originals by Jörg Liebeherr 19 Sliding Window: Example

Malathi Veeraraghavan Originals by Jörg Liebeherr 20 Example The following overhead slides (see Fig on pg. 276 and Fig on page 279 of texbook) are taken from the textbook. The slides show a transfer of 8 * 1024 byte by a client (sock -i -s 7777 ; sock -i -n8 bsdi 7777)

Malathi Veeraraghavan Originals by Jörg Liebeherr 21 Example: Transmission 1 Open your textbook to page : TCP connection is established : 3 segments are transmitted 7 :ACK for segments 4+5 (because of delayed ACK) 8:Ack for segment 6 (with win reduced to to 3072) :Transmission and ACK for segment :Transmission of data segments 14:ACK for segments 11 and :Transmission of data segment 16:ACKs for segments 13 and :Close connection ACK every other segment strategy (see page 277)

Malathi Veeraraghavan Originals by Jörg Liebeherr 22 Example: Transmission 2 (slow receiver) Open your textbook to page :TCP connection is established : 4 segments are transmitted 8 :ACKs for all segments (with win reduced to 0 !) 9:Window update segment with win being reset to :Transmission of data segments and active close on segment 13 14:ACK for segments 10,11,12,13 15:Window update 16:Passive close 17:Ack for close

Malathi Veeraraghavan Originals by Jörg Liebeherr 23 Congestion Control TCP implements congestion control at the sender –This control is intended to reduce congestion in the network. The sender has two parameters for congestion control: –Congestion Window (cwnd; Initial value is MSS bytes) –Threshhold Value (ssthresh; Initial value is bytes) The window size at the sender is set as follows: Allowed Window = MIN (advertised window, congestion window) MSS: Maximum Segment Size (set with option field in TCP header)

Malathi Veeraraghavan Originals by Jörg Liebeherr 24 Slow Start Whenever starting traffic on a new connection, or whenever increasing traffic after congestion was experienced: Set cwnd =MSS bytes (cwnd is stored in bytes) Each time an ACK is received, the congestion window is increased by 1 segment (= MSS bytes). If an ACK acknowledges two segments, cwnd is still increased by only 1 segment (Caveat: see slide 26) Even if ACK acknowledges a segment that is smaller than MSS bytes long, cwnd is increased by MSS bytes. If cwnd is 3 but there is still one outstanding ACK, the sender can only send two segments (See page 287). Does Slow Start increment slowly? Not really. In fact, the increase of cwnd is exponential

Malathi Veeraraghavan Originals by Jörg Liebeherr 25 Example of Slow Start 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

Malathi Veeraraghavan Originals by Jörg Liebeherr 26 Unresolved question (*) Popular belief is that in slow start cwnd increases by the number of segments ack’ed. In other words, if an ack acknowledges two segments (cumulative ACK), then cwnd is increased by two segments (not 1 - as stated in previous slides). This leads to true exponential growth. Tanenbaum’s book states this. However the EL537 book says cwnd is increased by 1 segment for each ACK received without saying anything about the number of segments ack’ed by the ACK. We looked at TCP Reno implementation. It behaves in this manner as well. This is not in the TCP spec. as slow start was defined in a Van Jacobson paper later on (Jacobson 88 - see EL537 references. The ftp site mentioned does not have this paper). For purposes of this course, we will assume that cwnd increases by 1 segment for each ACK received, irrespective of the number of segments acknowledged.

Malathi Veeraraghavan Originals by Jörg Liebeherr 27 Congestion Avoidance Slow down “Slow Start” If cwnd > ssthresh then each time an ACK is received, increment cwnd as follows: cwnd = cwnd + segsize * segsize / cwnd + segsize / 8 (We will learn later how to set ssthresh)

Malathi Veeraraghavan Originals by Jörg Liebeherr 28 Slow Start/Congestion Avoidance Example Assume that ssthresh = 8 Roundtrip times Cwnd (in segments) ssthresh

Malathi Veeraraghavan Originals by Jörg Liebeherr 29 Example of slow start and congestion avoidance Assume MSS=512 bytes; advertised window = 5120 bytes Enter congestion avoidance

Malathi Veeraraghavan Originals by Jörg Liebeherr 30 Computation of cwnd on previous slide Upto and including ack 2561, this TCP connection is in slow start, and cwnd is increased by 1 MSS bytes each time an ACK is received. Note that when cwnd = ssthresh, slow start is still applied. Hence when ack 2561 is received, cwnd = = When the last ack shown on the previous slide is received, the TCP connection is in congestion avoidance since cwnd is > ssthresh. Therefore, cwnd = cwnd + MSS × MSS / cwnd + MSS / 8 = × 512/ /8=3222

Malathi Veeraraghavan Originals by Jörg Liebeherr 31 Is TCP selective repeat or Go-back-N? It is primarily Go-back-N because it uses cumulative ACKs –Need selective ACKs if selective repeat retranmissions are used But it appears to be selective repeat in certain cases: see example on page 308. After segment 65 is sent, the next segment sent is a new segment with sequence number Segments with sequence numbers 6913 throught 8705 are not repeated. This is because this example shows fast retransmit, in which case only one segment is sent. Even without fast retransmit, if segment 65 was sent in response to a timeout, cwnd becomes 1 (in case of timeout); so only one segment can be sent; if ack received acknowledges intermediate segments, it appears like selective repeat.