Flow Control, and Congestion Control

Similar documents
Flow Control, and Congestion Control

TCP. Sliding Windows, Flow Control, and Congestion Control. Networks : TCP Sliding Windows 1

CS 455: INTRODUCTION TO DISTRIBUTED SYSTEMS [NETWORKING] Frequently asked questions from the previous class surveys

End-to-End Protocols. End-to-End Protocols

Transport Protocols CS 640 1

Reliable Byte-Stream (TCP)

CSE/EE 461. Sliding Windows and ARQ. Last Time. This Time. We finished up the Network layer Internetworks (IP) Routing (DV/RIP, LS/OSPF)

Islamic University of Gaza Faculty of Engineering Department of Computer Engineering ECOM 4021: Networks Discussion. Chapter 5 - Part 2

End-to-End Protocols. Transport Protocols. User Datagram Protocol (UDP) Application Layer Expectations

Problem. Chapter Outline. Chapter Goal. End-to-end Protocols. End-to-end Protocols. Chapter 5. End-to-End Protocols

The Transport Layer Reliability

11/24/2009. Fundamentals of Computer Networks ECE 478/578. Flow Control in TCP

EE 122: Transport Protocols: UDP and TCP

TCP Congestion Control

Transport Layer Marcos Vieira

End-to-End Protocols: UDP and TCP. Hui Chen, Ph.D. Dept. of Engineering & Computer Science Virginia State University Petersburg, VA 23806

TCP Adaptive Retransmission Algorithm - Original TCP. TCP Adaptive Retransmission Algorithm Jacobson

COMPUTER NETWORKS CS CS 55201

COMPUTER NETWORKS CS CS 55201

Fundamentals of Computer Networks ECE 478/578. Transport Layer. End- to- End Protocols 4/16/13. Spring Application. Application.

Direct Link Networks (II)

EE 122: Transport Protocols. Kevin Lai October 16, 2002

CS 640 Introduction to Computer Networks. Role of data link layer. Today s lecture. Lecture16

L5: Building Direct Link Networks III. Hui Chen, Ph.D. Dept. of Engineering & Computer Science Virginia State University Petersburg, VA 23806

TCP Overview. Connection-oriented Byte-stream

Page 1. Goals for Today" Placing Network Functionality" Basic Observation" CS162 Operating Systems and Systems Programming Lecture 15

Transport Protocols. CSCI 363 Computer Networks Department of Computer Science

CMSC 417. Computer Networks Prof. Ashok K Agrawala Ashok Agrawala. October 11, 2018

TCP/IP-2. Transmission control protocol:

CS 356: Introduction to Computer Networks. Lecture 16: Transmission Control Protocol (TCP) Chap. 5.2, 6.3. Xiaowei Yang

TCP Congestion Control. Lecture 16. Outline. TCP Congestion Control. Additive Increase / Multiplicative Decrease (AIMD)

Topics. TCP sliding window protocol TCP PUSH flag TCP slow start Bulk data throughput

Internet transport protocols

EECS 122, Lecture 19. Reliable Delivery. An Example. Improving over Stop & Wait. Picture of Go-back-n/Sliding Window. Send Window Maintenance

Lecture 5: Flow Control. CSE 123: Computer Networks Alex C. Snoeren

Internet Transport Protocols UDP and TCP

23-3 TCP. Topics discussed in this section: TCP Services TCP Features Segment A TCP Connection Flow Control Error Control 23.22

Flow and Congestion Control Marcos Vieira

2.4 Error Detection Bit errors in a frame will occur. How do we detect (and then. (or both) frames contains an error. This is inefficient (and not

CSCI-1680 Transport Layer II Data over TCP Rodrigo Fonseca

Lecture 7: Flow Control"

Administrivia. FEC vs. ARQ. Reliable Transmission FEC. Last time: Framing Error detection. FEC provides constant throughput and predictable delay

Basic Reliable Transport Protocols

Reliable Transmission

CSCI-1680 Link Layer Reliability John Jannotti

ADVANCED COMPUTER NETWORKS

Application Service Models

Internet Protocols Fall Outline

UNIT IV. UDP TCP Adaptive Flow Control-Adaptive Retransmission Congestion Control Congestion avoidance QoS.

CSCI-1680 Link Layer Reliability Rodrigo Fonseca

UNIT IV -- TRANSPORT LAYER

EE 122: Error detection and reliable transmission. Ion Stoica September 16, 2002

The GBN sender must respond to three types of events:

CSCI Topics: Internet Programming Fall 2008

TCP. 1 Administrivia. Tom Kelliher, CS 325. Apr. 2, Announcements. Assignment. Read From Last Time

Error Detection Codes. Error Detection. Two Dimensional Parity. Internet Checksum Algorithm. Cyclic Redundancy Check.

Problem Statement. Physical and Data Link Layer Overview. Five Tasks Encoding. Make two computers talk to each other

Lecture 5. Homework 2 posted, due September 15. Reminder: Homework 1 due today. Questions? Thursday, September 8 CS 475 Networks - Lecture 5 1

CSCD 330 Network Programming Winter 2015

Principles of Reliable Data Transfer

Networking Link Layer

High Level View. EE 122: Error detection and reliable transmission. Overview. Error Detection

The Transport Layer: TCP & Reliable Data Transfer

Congestion Control in TCP

Computer Network. Direct Link Networks Reliable Transmission. rev /2/2004 1

CSE 123: Computer Networks Alex C. Snoeren. HW 1 due NOW!

Lecture 8. TCP/IP Transport Layer (2)

CSEP 561 Connections. David Wetherall

Announcements Computer Networking. Outline. Transport Protocols. Transport introduction. Error recovery & flow control. Mid-semester grades

Computer Networking Introduction

Point-to-Point Links. Outline Encoding Framing Error Detection Sliding Window Algorithm. Fall 2004 CS 691 1

Outline. CS5984 Mobile Computing

Direct Link Communication I: Basic Techniques. Data Transmission. ignore carrier frequency, coding etc.

CSCI-1680 Link Layer I Rodrigo Fonseca


ECE 650 Systems Programming & Engineering. Spring 2018

ERROR AND FLOW CONTROL. Lecture: 10 Instructor Mazhar Hussain

Chapter 23 Process-to-Process Delivery: UDP, TCP, and SCTP 23.1

CNT 6885 Network Review on Transport Layer

Chapter 3 Transport Layer

TCP: Flow and Error Control

ECE697AA Lecture 3. Today s lecture

CSEP 561 Connections. David Wetherall

Data Link Control Protocols

Flow and Congestion Control (Hosts)

Announcements Computer Networking. What was hard. Midterm. Lecture 16 Transport Protocols. Avg: 62 Med: 67 STD: 13.

Lecture 7: Sliding Windows. CSE 123: Computer Networks Geoff Voelker (guest lecture)

Chapter 3 Transport Layer

Lecture 08: The Transport Layer (Part 2) The Transport Layer Protocol (TCP) Dr. Anis Koubaa

Stream Control Transmission Protocol

Transmission Control Protocol. ITS 413 Internet Technologies and Applications

Mobile Transport Layer Lesson 10 Timeout Freezing, Selective Retransmission, Transaction Oriented TCP and Explicit Notification Methods

CC451 Computer Networks

Correcting mistakes. TCP: Overview RFCs: 793, 1122, 1323, 2018, TCP seq. # s and ACKs. GBN in action. TCP segment structure

TCP/IP. Chapter 5: Transport Layer TCP/IP Protocols

CSE 461: Framing, Error Detection and Correction

32 bits. source port # dest port # sequence number acknowledgement number not used. checksum. Options (variable length)

Some slides courtesy David Wetherall. Communications Software. Lecture 4: Connections and Flow Control. CSE 123b. Spring 2003.

CSE/EE 461 Lecture 12 TCP. A brief Internet history...

Computer Network Fundamentals Spring Week 10 Congestion Control Andreas Terzis

Transcription:

TCP Sliding Windows, Flow Control, and Congestion Control Lecture material taken from Computer Networks A Systems Approach, Fourth Ed.,Peterson and Davie, Morgan Kaufmann, 2007. Advanced Computer Networks : TCP Sliding Windows 1

Sliding Windows Normally a data link layer concept. Our interest is understanding the TCP mechanism at the transport layer. Each frame is assigned a sequence number: SeqNum. The sender maintains three variables: send window size (SWS), last ACK received (LAR), and last Frame sent (LFS). Advanced Computer Networks : TCP Sliding Windows 2

Sender Variables SWS :: the upper bound on the number of outstanding frames (not ACKed) the sender can transmit. LAR :: the sequence number of the last ACK received. LFS :: the sequence number of the last frame sent. Advanced Computer Networks : TCP Sliding Windows 3

Sender Invariant LFS LAR SWS SWS LAR LFS Advanced Computer Networks : TCP Sliding Windows 4

Sender Window An arriving ACK LAR moves right 1 sender can send one more frame. Associate a timer with each frame the sender transmits. Sender retransmits the frame if the timer times out. Sender buffer :: up to SWS frames. Advanced Computer Networks : TCP Sliding Windows 5

Receiver Variables Receiver window size (RWS) :: the upper bound on the number of out-of-order frames the receiver is willing to accept. Largest acceptable frame (LAF) :: the sequence number of the largest acceptable frame. Last frame received (LFR) :: the sequence number of the last frame received. Advanced Computer Networks : TCP Sliding Windows 6

Receiver Invariant LAF LFR RWS RWS LFR LAF Advanced Computer Networks : TCP Sliding Windows 7

Receiver Window When a frame arrives with SeqNum: If (SeqNum LFR or SeqNum > LAF) the frame is discarded because it is outside the window. If (LFR < SeqNum LAF) the frame is accepted. Advanced Computer Networks : TCP Sliding Windows 8

Receiver ACK Decisions SeqNumToAck :: largest sequence number not yet ACKed such that all frames SeqNumToAck have been received. Receiver ACKs receipt of SeqNumToAck and sets LFR = SeqNumToAck LAF = LFR + RWS SeqNumToAck is adjusted appropriately! Advanced Computer Networks : TCP Sliding Windows 9

Generic ACK Choices 1. ACK sequence number indicates the last frame successfully received. - OR - 2. ACK sequence number indicates the next frame the receiver expects to receive. Both of these can be strictly individual ACKs or represent cumulative ACKing. Cumulative ACKing is the most common technique. Advanced Computer Networks : TCP Sliding Windows 10

Generic Responses to a lost packet or frame 1.Use a duplicate ACK. 2. Use a selective ACK [SACK]. 3. Use a negative ACK [NACK]. Advanced Computer Networks : TCP Sliding Windows 11

TCP Sliding Windows * In practice, the TCP implementation switches from packet pointers to byte pointers. Guarantees reliable delivery of data. Ensures data delivered in order. Enforces flow control between sender and receiver. The idea is: the sender does not overrun the receiver s buffer. Advanced Computer Networks : TCP Sliding Windows 12

Figure 5.3 TCP Managing a Byte Stream Application process Application process Write bytes Read bytes TCP Send buffer TCP Receive buffer Segment Segment Segment Transmit segments P&D slide Advanced Computer Networks : TCP Sliding Windows 13

Figure 5.8 Relationship between TCP Send Buffer and TCP Receive Buffer Sending application Receiv ing application LastBy tewritten TCP LastBy teread TCP LastBy teacked LastBy tesent NextBy teexpected LastBy tercv d (a) (b) P&D slide Advanced Computer Networks : TCP Sliding Windows 14

Receiver s Advertised Window The big difference in TCP is that the size of the sliding window size at the TCP receiver is not fixed. The receiver advertises an adjustable window size (AdvertisedWindow field in TCP header). Sender is limited to having no more than AdvertisedWindow bytes of unacked data at any time. Advanced Computer Networks : TCP Sliding Windows 15

Figure 5.4 TCP Header Format P&D slide Advanced Computer Networks : TCP Sliding Windows 16

Figure 5.5 Simplified TCP P&D slide Advanced Computer Networks : TCP Sliding Windows 17

TCP Flow Control The discussion is similar to the previous sliding window mechanism except we add the complexity of sending and receiving application processes that are filling and emptying their local buffers. Also we introduce the complexity that buffers are of finite size without worrying about where the buffers are stored. MaxSendBuffer MaxRcvBuffer Advanced Computer Networks : TCP Sliding Windows 18

TCP Flow Control The receiver throttles the sender by advertising a window size no larger than the amount it can buffer. On TCP receiver side: LastByteRcvd - LastByteRead MaxRcvBuffer to avoid buffer overflow! Advanced Computer Networks : TCP Sliding Windows 19

TCP Flow Control TCP receiver advertises: AdvertisedWindow = MaxRcvBuffer - (LastByteRcvd - LastByteRead) i.e., the amount of free space available in the receiver s buffer. Advanced Computer Networks : TCP Sliding Windows 20

TCP Flow Control The TCP sender must adhere to the AdvertisedWindow from the receiver such that LastByteSent LastByteAcked AdvertisedWindow or use EffectiveWindow: EffectiveWindow = AdvertisedWindow (LastByteSent LastByteAcked) Advanced Computer Networks : TCP Sliding Windows 21

TCP Flow Control Sender Flow Control Rules: 1. EffectiveWindow > 0 for sender to send more data. 2. LastByteWritten LastByteAcked MaxSendBuffer equality here send buffer is full!! TCP sender process must block the sender application. Advanced Computer Networks : TCP Sliding Windows 22

TCP Congestion Control CongestionWindow :: a variable held by the TCP source for each connection. * TCP is modified such that the maximum number of bytes of unacknowledged data allowed is the minimum of CongestionWindow and AdvertisedWindow. MaxWindow :: min (CongestionWindow, AdvertisedWindow) Advanced Computer Networks : TCP Sliding Windows 23

TCP Congestion Control Finally, we have that EffectiveWindow = MaxWindow (LastByteSent LastByteAcked) The idea :: the source s effective window can be no faster than the slowest of the network (i.e., its core routers) or the destination Host. * The TCP source receives implicit and/or explicit indications of congestion by which to reduce the size of CongestionWindow. Advanced Computer Networks : TCP Sliding Windows 24