Fundamentals of Computer Networks ECE 478/578 Lecture #21: TCP Window Mechanism Instructor: Loukas Lazos Dept of Electrical and Computer Engineering University.

Slides:



Advertisements
Similar presentations
TCP Sliding Windows, Flow Control, and Congestion Control Lecture material taken from Computer Networks A Systems Approach, Fourth Ed.,Peterson and Davie,
Advertisements

CSCI-1680 Transport Layer II Based partly on lecture notes by David Mazières, Phil Levis, John Jannotti Rodrigo Fonseca.
Introduction 1 Lecture 13 Transport Layer (Transmission Control Protocol) slides are modified from J. Kurose & K. Ross University of Nevada – Reno Computer.
1 Computer Networks: A Systems Approach, 5e Larry L. Peterson and Bruce S. Davie Chapter 5 End-to-End Protocols Copyright © 2010, Elsevier Inc. All rights.
1 Transport Protocols & TCP CSE 3213 Fall April 2015.
Slide Set 13: TCP. In this set.... TCP Connection Termination TCP State Transition Diagram Flow Control How does TCP control its sliding window ?
CS 6401 Transport Control Protocol Outline TCP objectives revisited TCP basics New algorithms for RTO calculation.
Computer Networks Chapter 5: End-to-End Protocols
Fundamentals of Computer Networks ECE 478/578 Lecture #20: Transmission Control Protocol Instructor: Loukas Lazos Dept of Electrical and Computer Engineering.
1 Chapter 5 End-to-End Protocols Outline 5.1 UDP 5.2 TCP 5.3 Remote Procedure Call.
1 CS492B Project #2 TCP Tutorial # Jin Hyun Ju.
8. Transport Protocol and UDP 8.1 Transport protocol : End-to-end protocol –IP: Host to host packet delivery –Transport: Process to process communication.
1 Reliable Byte-Stream (TCP) Outline Connection Establishment/Termination Sliding Window Revisited Flow Control Adaptive Timeout.
6-May-154/598N: Computer Networks End-to-End Protocols Underlying best-effort network –drop messages –re-orders messages –delivers duplicate copies of.
CSE Computer Networks Prof. Aaron Striegel Department of Computer Science & Engineering University of Notre Dame Lecture 14 – February 23, 2010.
TCP 4/15/2017.
 TCP connection set up  TCP connection tear-down  Sliding window revisited  Triggering transmission.
1 TCP CSE May TCP Services Flow control Connection establishment and termination Congestion control 2.
Introduction to Congestion Control
ECE544: Communication Networks-II Spring 2011 D. Raychaudhuri Includes teaching materials from, L. Peterson, Sumathi Gopal and Sumit Rangwala.
Transport Layer 3-1 Transport Layer r To learn about transport layer protocols in the Internet: m TCP: connection-oriented protocol m Reliability protocol.
Computer Networks: TCP Congestion Control 1 TCP Congestion Control Lecture material taken from “Computer Networks A Systems Approach”, Third Ed.,Peterson.
ACN: TCP Sliding Windows1 TCP Sliding Windows, with Flow Control, and Congestion Control Based on Peterson and Davie Textbook.
CSE 124 Networked Services Fall 2009 B. S. Manoj, Ph.D 10/20/20091CSE 124 Networked Services Fall 2009 Some.
Advanced Computer Networks : TCP Sliding Windows1 TCP Sliding Windows, Flow Control, and Congestion Control Lecture material taken from “Computer Networks.
CSE 461: Sliding Windows & ARQ. Next Topic  We begin on the Transport layer  Focus  How do we send information reliably?  Topics  The Transport layer.
Spring 2003CS 4611 Reliable Byte-Stream (TCP) Outline Connection Establishment/Termination Sliding Window Revisited Flow Control Adaptive Timeout.
Advanced Computer Networks: TCP Congestion Control 1 TCP Congestion Control Lecture material taken from “Computer Networks A Systems Approach”, Fourth.
Spring 2002CS 4611 Reliable Byte-Stream (TCP) Outline Connection Establishment/Termination Sliding Window Revisited Flow Control Adaptive Timeout.
1 #6 in Mid-Term  Most answered:  many users thru the same bottleneck -> increased queueing delay -> increased e2e latency  Possible reasons behind.
CS 356: Introduction to Computer Networks Lecture 16: Transmission Control Protocol (TCP) Xiaowei Yang
© Janice Regan, CMPT 128, CMPT 371 Data Communications and Networking Flow Control 0.
1 Lecture 14 High-speed TCP connections Wraparound Keeping the pipeline full Estimating RTT Fairness of TCP congestion control Internet resource allocation.
1 Introduction to Computer Networks University of ilam Dr. Mozafar Bag-Mohammadi Transport Layer.
1 CS 4396 Computer Networks Lab TCP – Part II. 2 Flow Control Congestion Control Retransmission Timeout TCP:
1 Reliable Byte-Stream (TCP) Outline Connection Establishment/Termination Sliding Window Revisited Flow Control Adaptive Timeout.
ECE 4110 – Internetwork Programming
Transport Layer: Sliding Window Reliability
Retransmission. Automatic Repeat reQuest (ARQ) 2 Time Packet ACK Timeout Automatic Repeat Request –Receiver sends acknowledgment (ACK) when it receives.
1 Reliable Byte-Stream (TCP) Outline Connection Establishment/Termination Sliding Window Revisited Flow Control Adaptive Timeout.
Ilam University Dr. Mozafar Bag-Mohammadi 1 Transport Layer.
CSE/EE 461 Sliding Windows and ARQ. 2 Last Time We finished up the Network layer –Internetworks (IP) –Routing (DV/RIP, LS/OSPF) It was all about routing:
EE 122: Transport Protocols Kevin Lai October 16, 2002.
1 End-to-End Protocols UDP TCP –Connection Establishment/Termination –Sliding Window Revisited –Flow Control –Congestion Control –Adaptive Timeout.
Univ. of TehranIntroduction to Computer Network1 An Introduction Computer Networks An Introduction to Computer Networks University of Tehran Dept. of EE.
Advanced Computer Networks
3. END-TO-END PROTOCOLS (PART 2) Rocky K. C. Chang Department of Computing The Hong Kong Polytechnic University 22 March
TCP - Part II.
Chapter 5 TCP Sequence Numbers & TCP Transmission Control
Transport Control Protocol
Chapter 5 TCP Sliding Window
Chapter 5 TCP Transmission Control
The University of Adelaide, School of Computer Science
The University of Adelaide, School of Computer Science
TCP Overview Connection-oriented Byte-stream Full duplex
Transport Control Protocol
5. End-to-end protocols (part 2)
TCP Sliding Windows, Flow Control, and Congestion Control
Reliable Byte-Stream (TCP)
Ilam University Dr. Mozafar Bag-Mohammadi
Transmission Control Protocol (TCP) Part II Neil Tang 11/21/2008
State Transition Diagram
Advanced Computer Networks
CSS432 End-to-End Protocols Textbook Ch5.1 – 5.2
The University of Adelaide, School of Computer Science
Introduction to Computer Networks
Chapter 5 TCP Sliding Window
Introduction to Computer Networks
TCP Sliding Windows, Flow Control, and Congestion Control
TCP Sliding Windows, Flow Control, and Congestion Control
Presentation transcript:

Fundamentals of Computer Networks ECE 478/578 Lecture #21: TCP Window Mechanism Instructor: Loukas Lazos Dept of Electrical and Computer Engineering University of Arizona

Sliding Window in TCP Goals of sliding window Guarantee end-to-end reliable data delivery, and in order Enforce flow control between sender and receiver LastByteAcked  LastByteSent  LastByteWritten LastByteRead < NextByteExpected  LastByteRcvd + 1 2

Flow Control in TCP Receiver advertises window no larger than its buffer size LastByteRcvd – LastByteRead  MaxRcvBuffer AdvertisedWindow = MaxRcvBuffer – ((NextByteExpected – 1) – LastByteRead) Example: LastByteRcvd = 5, LastByteRead = 1, NextByteExpected = 6, MaxRcvBuffer = 10 5 – 1  10 AdvertisedWindow = 10 - ((6 – 1) – 1) = 10 – 4 = 6 Sender adheres to the AdvertisedWindow by LastByteSent – LastByteAcked  AdvertisedWindow EffectiveWindow = AdvertisedWindow – (LastByteSent – LastByteAcked) Example: sent 7, ACK 5, EffectiveWindow = 6 – (7 - 5) = 4 3

Why Ignore LastByteReceived Example MaxReceiverBuffer = 10 Receiver buffer : 1, 2, 3, 5, 6, 7, 8, AdvertisedWindow = 7 (though buffer space is only 3) Since only packet 3 is ACKed, sender can only have UnAcked. Sender will send 9, 10 and wait for any ACK. Packet 4 timeouts and gets retransmitted. An Ack arrives for packet 8, with an updated Advertised Window 4

Flow Control in TCP 5 Buffer at the Sender LastByteWritten – LastByteAcked  MaxSendSize Fast sender slow receiver scenario Sender’s buffer Receiver’s buffer

6 Learning about Advertised Window Sender sends data Receiver replies with ACK and Advertised Window Issue with fast sender slow receiver Sender is blocked, receiver will not have data to reply to When receiver advertises window of 0, sender periodically sends one byte of data Smart sender/Dumb receiver rule Sender’s buffer Receiver’s buffer

Sequence Number Wraparound 7 AdvertisedWindow: 16 bits long, up to 2 16 Sequence number field: 32 bits long up to 2 32 SN>>2 AdvertisedWindow, so there would be no problem in ordering How fast are sequence numbers exhausted T1 (1.5MBps) : 2 32 x 8 / 1.5 x 10 6 ~ 6.4hrs Ethernet (10 Mbps) : 57 mins T3 (45Mbps) : 13 mins Fast Ethernet (100 MBps): 6 mins TTL = 120 sec OC-3 (155Mbps): 4 mins OC-12 (622 Mbps): 55 sec OC-48 (2.5 Gbps): 14 sec

Failure due to Seq # Wraparound Sequence number wrap-around on the current connection A seq number may be "wrapped" (cycled) within the time that a segment is delayed in queues Earlier incarnation of the connection A delayed segment from the terminated connection could fall within the current window for the new incarnation and be accepted as valid Solution Add a timestamp field on every packet Reject a packet with a higher sequence number if earlier ones have a later timestamp 8

Keeping the Pipe Full Assume the receiver has adequate buffer space End-to-end Delay x Bandwidth product T1 (1.5MBps) : 1.5 x 10 6 x 0.1 / 8 ~ 19 KB Ethernet (10 Mbps) : 122KB T3 (45Mbps) : 549 KB Fast Ethernet (100 MBps): 1.2 MB RTT = 100 msec OC-3 (155Mbps): 1.8 MB OC-12 (622 Mbps): 7.4 MB OC-48 (2.5 Gbps): 29.6 MB AdvertisedWindow field: 16 bits – 2 16 = 64KB Handled by TCP extension specification. A scale factor is indicated in the options header of a SYN packet 9

Triggering TCP Transmissions Mechanism for triggering transmission of a segment Maximum Segment Size (MSS) parameter MSS = MTU of underlying network – Headers = 1500 – = 1460 Push Operation Sending process using TCP request to empty the buffer Timer expiration A timer with specific task expires and all buffered packets are sent So far we ignored flow control AdvertisedWindow may be smaller than MSS, or closed Aggressive stategy: Send whatever you have in an aggressive manner Example 10 MSS MSS/2

Silly Window Syndrome Introduces tiny segments that stay in the system indefinitely To avoid small segments, receiver advertises open window after MSS buffer size is available To coalesce tiny segments, receiver may delay ACKs so buffer space empties up Still, receiver cannot know exactly how much to delay 11

Nagle’s Algorithm Use received ACKs as a timer to send more data when the application has data to send if both data written in buffer and the window  MSS Send full segment else if there are unACKed data in flight buffer new data till ACK received else send all data now 12

TCP Adaptive Retransmission Problem Estimate RTT between two hosts to set up timeout for retransmissions Original Algorithm Use a running average of RTT SampleRTT = RTT of last segment ACKed EstimatedRTT = α x EstimatedRTT + (1 - α) x SampleRTT α usually in the range 0.8 – 0.9 Timeout: 2 x EstimatedRTT 13

Karn/Patridge Algorithm Problem with SampleRTT measurement Solution Ignore all SampleRTT for segments sent more than once Additional improvement Double the timeout every time you do a retransmission Exponential backoff mechanism for TCP 14

Jacobson/Karels Algorithm Previous approaches did not take into account the variance of RTT If variance was well known, no need to be too conservative Difference = SampleRTT – EstimatedRTT EstimatedRTT = EstimatedRTT + (δ x Difference), 0  δ  1 Deviation = Deviation + (δ x (|Difference|- Deviation) TimeOut = μ x EstimatedRTT +φ x Deviation, μ = 1, φ = 4 15

TCP Extensions Use the Options field and the Hdrlen field to define extensions Extension #1: Timestamps Put a 32-bit timestamp in a segment Receiver simply reflects this timestamp in the acknowledgment Compute round-trip time based on the time ACK was received and the timestamp in ACK Eliminates discrepancies in RTT estimates Extension #2: Expand the 32-bit sequence number field Use the 32-bit timestamp to extend the sequence number space Timestamps always increase 16

TCP Extensions Extension #3: Extend the window size Increase the unit from one byte to several bytes (e.g. 16 bytes) Max Window size increases from 2^16 to 2^20 Window size has to be a multiple of unit (e.g. 16) Extension #4: Use of Cumulative and Selective ACKs (SACKs) Acknowledge normally for segments received in sequence in the standard header Indicate the out-of-sequence packets received in optional headers If SACK not used, transmitter can use Go-back-N, which may unnecessarily retransmit some segments 17