Flow Control, and Congestion Control

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

Flow Control, and Congestion Control

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

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

Reliable Byte-Stream (TCP)

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

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

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

EE 122: Transport Protocols: UDP and TCP

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

The Transport Layer Reliability

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

COMPUTER NETWORKS CS CS 55201

COMPUTER NETWORKS CS CS 55201

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

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

TCP Congestion Control

Transport Layer Marcos Vieira

Direct Link Networks (II)

TCP Overview. Connection-oriented Byte-stream

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

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

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

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

Internet transport protocols

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:

Flow and Congestion Control Marcos Vieira

Internet Protocols Fall Outline

CSCI-1680 Transport Layer II Data over TCP Rodrigo Fonseca

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

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

Application Service Models

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

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

Internet Transport Protocols UDP and TCP

Reliable Transmission

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

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

CSCI-1680 Link Layer Reliability John Jannotti

ADVANCED COMPUTER NETWORKS

CSCI-1680 Link Layer Reliability Rodrigo Fonseca

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

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

UNIT IV -- TRANSPORT LAYER

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

Congestion Control in TCP

CSCI Topics: Internet Programming Fall 2008

The GBN sender must respond to three types of events:

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

ECE 650 Systems Programming & Engineering. Spring 2018

CSCD 330 Network Programming Winter 2015


Lecture 8. TCP/IP Transport Layer (2)

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

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

Computer Networking Introduction

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

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

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

Outline. CS5984 Mobile Computing

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

Chapter 3 Transport Layer

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

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

CSEP 561 Connections. David Wetherall

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

Chapter 3 Transport Layer

CSCI-1680 Link Layer I Rodrigo Fonseca

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

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

Last Class. CSE 123b Communications Software. Today. Naming Processes/Services. Transmission Control Protocol (TCP) Picking Port Numbers.

ERROR AND FLOW CONTROL. Lecture: 10 Instructor Mazhar Hussain

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

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

Computer Network Fundamentals Spring Week 10 Congestion Control Andreas Terzis

ECE697AA Lecture 3. Today s lecture

Introduc)on to Computer Networks

CSEP 561 Connections. David Wetherall

Flow and Congestion Control (Hosts)

Data Link Control Protocols

Congestion Control 3/16/09

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

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

Stream Control Transmission Protocol

CNT 6885 Network Review on Transport Layer

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

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. Computer Networks TCP Sliding Windows

Sliding Windows Outline Generic Sliding Windows Receiver Response Choices Introduction to TCP Sliding Windows Flow control and buffers Advertised window Congestion control Computer Networks TCP Sliding Windows 2

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). Computer Networks TCP Sliding Windows 3

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. Computer Networks TCP Sliding Windows 4

Sender Invariant LFS LAR SWS SWS LAR LFS Computer Networks TCP Sliding Windows 5

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. Computer Networks TCP Sliding Windows 6

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. Computer Networks TCP Sliding Windows 7

Receiver Invariant LAF LFR RWS RWS LFR LAF Computer Networks TCP Sliding Windows 8

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. Computer Networks TCP Sliding Windows 9

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! Computer Networks TCP Sliding Windows 10

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 ACKs is the most common technique. Computer Networks TCP Sliding Windows 11

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]. Computer Networks TCP Sliding Windows 12

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. Computer Networks TCP Sliding Windows 13

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 Computer Networks TCP Sliding Windows 14

Figure 5.8 Relationship between TCP Send Buffer and TCP Receive Buffer Sending application Receiving application LastByteWritten TCP LastByteRead TCP LastByteAcked LastByteSent NextByteExpected LastByteRcvd (a) (b) P&D slide Computer Networks TCP Sliding Windows 15

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. Computer Networks TCP Sliding Windows 16

Figure 5.4 TCP Header Format P&D slide Computer Networks TCP Sliding Windows 17

Figure 5.5 Simplified TCP P&D slide Computer Networks TCP Sliding Windows 18

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 Computer Networks TCP Sliding Windows 19

TCP Flow Control The receiver 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! Computer Networks TCP Sliding Windows 20

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

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) Computer Networks TCP Sliding Windows 22

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. Computer Networks TCP Sliding Windows 23

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) Computer Networks TCP Sliding Windows 24

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. Computer Networks TCP Sliding Windows 25

Sliding Windows Summary Generic Sliding Windows Receiver Response Choices Introduction to TCP Sliding Windows Flow control and buffers Advertised window Congestion control Computer Networks TCP Sliding Windows 26