Chapter 5 TCP Transmission Control

Slides:



Advertisements
Similar presentations
Introduction 1 Lecture 13 Transport Layer (Transmission Control Protocol) slides are modified from J. Kurose & K. Ross University of Nevada – Reno Computer.
Advertisements

2: Transport Layer 31 Transport Layer 3. 2: Transport Layer 32 TCP Flow Control receiver: explicitly informs sender of (dynamically changing) amount of.
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.
Slide Set 13: TCP. In this set.... TCP Connection Termination TCP State Transition Diagram Flow Control How does TCP control its sliding window ?
Transport Layer3-1 TCP. Transport Layer3-2 TCP: Overview RFCs: 793, 1122, 1323, 2018, 2581 r full duplex data: m bi-directional data flow in same connection.
Data Communications and Computer Networks Chapter 3 CS 3830 Lecture 16 Omar Meqdadi Department of Computer Science and Software Engineering University.
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 Transport Layer Lecture 9 Imran Ahmed University of Management & Technology.
1 CS492B Project #2 TCP Tutorial # Jin Hyun Ju.
Transport Layer3-1 Summary of Reliable Data Transfer Checksums help us detect errors ACKs and NAKs help us deal with errors If ACK/NAK has errors sender.
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.
Transport Layer1 TCP: Overview RFCs: 793, 1122, 1323, 2018, 2581 r reliable, in-order byte steam: m no “message boundaries” r pipelined: m TCP congestion.
Fundamentals of Computer Networks ECE 478/578 Lecture #21: TCP Window Mechanism Instructor: Loukas Lazos Dept of Electrical and Computer Engineering University.
Chapter 3 outline 3.1 transport-layer services
TCP Details: Roadmap Data Flow Timeout/Retransmission
Transport Layer 3-1 Transport Layer r To learn about transport layer protocols in the Internet: m TCP: connection-oriented protocol m Reliability protocol.
Transport Layer Transport Layer: TCP. Transport Layer 3-2 TCP: Overview RFCs: 793, 1122, 1323, 2018, 2581 r full duplex data: m bi-directional.
Transport Layer 3-1 Transport Layer r To learn about transport layer protocols in the Internet: m TCP: connection-oriented protocol m Reliability protocol.
1 Announcement r Project 2 out m Much harder than project 1, start early! r Homework 2 due next Tuesday.
Announcement Project 2 out –Much harder than project 1, start early! Homework 2 due next Tu.
1 TCP latency modeling. 2 Q: How long does it take to receive an object from a Web server after sending a request? r TCP connection establishment r data.
The Future r Let’s look at the homework r The next test is coming the 19 th (just before turkey day!) r Monday will finish TCP canned slides r Wednesday.
Transport Layer3-1 Data Communication and Networks Lecture 7 Transport Protocols: TCP October 21, 2004.
Announcement Homework 1 graded Homework 2 out –Due in a week, 1/30 Project 2 problems –Minet can only compile w/ old version of gcc (2.96). –Only tlab-login.
Transport Layer3-1 TCP sender (simplified) NextSeqNum = InitialSeqNum SendBase = InitialSeqNum loop (forever) { switch(event) event: data received from.
Network LayerII-1 RSC Part III: Transport Layer 3. TCP Redes y Servicios de Comunicaciones Universidad Carlos III de Madrid These slides are, mainly, part.
Transport Layer1 Reliable Transfer Ram Dantu (compiled from various text books)
3: Transport Layer3b-1 TCP: Overview RFCs: 793, 1122, 1323, 2018, 2581 r full duplex data: m bi-directional data flow in same connection m MSS: maximum.
2: Transport Layer 21 Transport Layer 2. 2: Transport Layer 22 TCP: Overview RFCs: 793, 1122, 1323, 2018, 2581 r full duplex data: m bi-directional data.
1 End-to-End Protocols (UDP, TCP, Connection Management)
Copyright © Lopamudra Roychoudhuri
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:
CS640: Introduction to Computer Networks Aditya Akella Lecture 15 TCP – III Reliability and Implementation Issues.
September 26 th, 2013 CS1652 The slides are adapted from the publisher’s material All material copyright J.F Kurose and K.W. Ross, All Rights.
ECE 4110 – Internetwork Programming
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.
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.
Transport Layer3-1 Chapter 3 Transport Layer Computer Networking: A Top Down Approach 5 th edition. Jim Kurose, Keith Ross Addison-Wesley, April 2009.
Transport Layer3-1 Transport Layer If you are going through Hell Keep going.
Chapter 3 Transport Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012 A note on the use of these.
Chapter 3 Transport Layer
COMP 431 Internet Services & Protocols
Chapter 3 outline 3.1 Transport-layer services
DMET 602: Networks and Media Lab
Chapter 3 outline 3.1 transport-layer services
Reliable Transmission
Chapter 5 TCP Sequence Numbers & TCP Transmission Control
CS 1652 Jack Lange University of Pittsburgh
TCP: Overview RFCs: 793, 1122, 1323, 2018, 2581 full duplex data:
Introduction to Networks
CS1652 TCP Jack Lange University of Pittsburgh
Review: UDP demultiplexing TCP demultiplexing Multiplexing?
Transport Layer Goals: Overview:
TCP - Part II Relates to Lab 5. This is an extended module that covers TCP flow control, congestion control, and error control in TCP.
The University of Adelaide, School of Computer Science
The University of Adelaide, School of Computer Science
CS4470 Computer Networking Protocols
Chapter 3 outline 3.1 Transport-layer services
Transmission Control Protocol (TCP) Part II Neil Tang 11/21/2008
State Transition Diagram
Transmission Control Protocol (TCP)
CSS432 End-to-End Protocols Textbook Ch5.1 – 5.2
Transportation Layer.
The University of Adelaide, School of Computer Science
The Transport Layer Reliability
Transport Layer: Congestion Control
Chapter 3 Transport Layer
TCP: Transmission Control Protocol Part II : Protocol Mechanisms
Lecture 5 – Chapter 3 CIS 5617, Spring2019 Anduo Wang
Presentation transcript:

Chapter 5 TCP Transmission Control Networking CS 3470, Section 1

Triggering Transmission How does TCP decide to transmit a segment? TCP supports a byte stream abstraction Application programs write bytes into streams It is up to TCP to decide that it has enough bytes to send a segment

Triggering Transmission How TCP manages a byte stream.

Triggering Transmission TCP has three mechanisms to trigger the transmission of a segment 1) TCP maintains a variable MSS (maximum segment size) and sends a segment as soon as it has collected MSS bytes from the sending process MSS is usually set to the size of the largest segment TCP can send without causing local IP to fragment. MSS: MTU of directly connected network – (TCP header + and IP header)

Triggering Transmission Send buffer got MSS worth of data, sends segment with that data.

Triggering Transmission 2) Sending process has explicitly asked TCP to send it TCP supports push operation

Triggering Transmission Application says “push” (send now), even though we don’t have MSS of data . A smaller segment is sent.

Triggering Transmission 3) When a timer fires Resulting segment contains as many bytes as are currently buffered for transmission

Triggering Transmission A timer went off (we waited for more data as long as we could. We send what we have.

Silly Window Syndrome Of course, we can’t ignore flow control. Suppose the TCP sender is stopped for awhile (AdvertisedWindow = 0) Now suppose TCP sender receives an ACK that opens the window up slightly “I can take 2 whole bytes!!!” Should the sender transmit?

Silly Window Syndrome The strategy of aggressively taking advantage of any available window leads to silly window syndrome Once smaller segment size is introduced into TCP segment system, it will stay around indefinitely

Nagle’s Algorithm If there is data to send but the window is open less than MSS, then we may want to wait some amount of time before sending the available data If we wait too long, then we hurt interactive applications If we don’t wait long enough, then we risk sending a bunch of tiny packets and falling into the silly window syndrome The solution is to introduce a timer and to transmit when the timer expires

Nagle’s Algorithm We could use a clock-based timer, for example one that fires every 100 ms Nagle introduced an elegant self-clocking solution Key Idea As long as TCP has any data in flight, the sender will eventually receive an ACK This ACK can be treated like a timer firing, triggering the transmission of more data

Nagle’s Algorithm Segment

Nagle’s Algorithm Ack

Nagle’s Algorithm Send another segment! ACK received! Segment Even if the segment isn’t a full MSS. Send another segment! Segment

Nagle’s Algorithm When the application produces data to send if both the available data and the window ≥ MSS send a full segment else /* window < MSS */ if there is unACKed data in flight buffer the new data until an ACK arrives else send all the new data now

TCP Retransmission (Timeouts) What about missed packets…? How should TCP set its timeout value waiting for an ACK before resending? Too short will unnecessarily retransmit segments Too long will introduce unnecessary delay

TCP retransmission scenarios Host A Seq=92, 8 bytes data ACK=100 loss timeout lost ACK scenario Host B X time Timeout value just right…

TCP retransmission scenarios Host A Host B Seq=92 timeout Seq=92, 8 bytes data Timeout value too short! Seq=100, 20 bytes data ACK=100 ACK=120 Seq=92, 8 bytes data Seq=92 timeout ACK=120 time premature timeout

TCP retransmission scenarios Host A Seq=92, 8 bytes data ACK=100 loss timeout Cumulative ACK scenario Host B X Seq=100, 20 bytes data ACK=120 time Timeout value too long…

Adaptive Retransmission Q: how to set TCP timeout value? longer than RTT but RTT varies too short: premature timeout unnecessary retransmissions too long: slow reaction to segment loss Q: how to estimate RTT? SampleRTT: measured time from segment transmission until ACK receipt ignore retransmissions SampleRTT will vary, want estimated RTT “smoother” average several recent measurements, not just current SampleRTT

TCP round trip time, timeout EstimatedRTT = (1- )*EstimatedRTT + *SampleRTT exponential weighted moving average influence of past sample decreases exponentially fast typical value:  = 0.125 RTT: Going halfway around the world RTT (milliseconds) sampleRTT EstimatedRTT time (seconds)

What about the receiver..? Can it do anything to help make TCP more efficient? Well, it does send ACKs

TCP ACK generation How quickly should the receiver send an ACK? If ACKs are cumulative, it makes sense that the receiver would not send an ACK for every single packet received

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 ACKed expected seq #. One other segment has ACK pending Arrival of out-of-order segment higher-than-expect seq. # . Gap detected Arrival of segment that partially or completely fills gap TCP Receiver action Delayed ACK. Wait up to 500ms for next segment. If no next segment, send ACK Immediately send single cumulative ACK, ACKing both in-order segments Immediately send duplicate ACK, indicating seq. # of next expected byte Immediately send ACK, provided that segment starts at lower end of gap

Fast Retransmit Time-out period often relatively long: long delay before resending lost packet Detect lost segments via duplicate ACKs. Sender often sends many segments back-to- back If segment is lost, there will likely be many duplicate ACKs. If sender receives 3 ACKs for the same data, it supposes that segment after ACKed data was lost: fast retransmit: resend segment before timer expires