CSE 461: Sliding Windows & ARQ. Next Topic  We begin on the Transport layer  Focus  How do we send information reliably?  Topics  The Transport layer.

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

Advanced Computer Networks : TCP Sliding Windows1 TCP Sliding Windows, Flow Control, and Congestion Control Lecture material taken from “Computer Networks.
Introduction 1 Lecture 13 Transport Layer (Transmission Control Protocol) slides are modified from J. Kurose & K. Ross University of Nevada – Reno Computer.
1 Chapter 5 End-to-End Protocols Outline 5.1 UDP 5.2 TCP 5.3 Remote Procedure Call.
8. Transport Protocol and UDP 8.1 Transport protocol : End-to-end protocol –IP: Host to host packet delivery –Transport: Process to process communication.
Transport Layer – TCP (Part1) Dr. Sanjay P. Ahuja, Ph.D. Fidelity National Financial Distinguished Professor of CIS School of Computing, UNF.
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.
ECE 4450:427/527 - Computer Networks Spring 2015 Dr. Nghi Tran Department of Electrical & Computer Engineering Lecture 7.1: End-to-end Protocols Dr. Nghi.
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.
Fundamentals of Computer Networks ECE 478/578 Lecture #21: TCP Window Mechanism Instructor: Loukas Lazos Dept of Electrical and Computer Engineering University.
EEC-484/584 Computer Networks Lecture 12 Wenbing Zhao (Part of the slides are based on Drs. Kurose & Ross ’ s slides for their Computer.
Chapter 3 outline 3.1 transport-layer services
EEC-484/584 Computer Networks Lecture 12 Wenbing Zhao (Part of the slides are based on Drs. Kurose & Ross ’ s slides for their Computer.
Transport Layer 3-1 Transport Layer r To learn about transport layer protocols in the Internet: m TCP: connection-oriented protocol m Reliability protocol.
CMPE 150- Introduction to Computer Networks 1 CMPE 150 Fall 2005 Lecture 13 Introduction to Computer Networks.
Transport Layer 3-1 Transport Layer r To learn about transport layer protocols in the Internet: m TCP: connection-oriented protocol m Reliability protocol.
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.
Spring 2003CS 4611 Reliable Byte-Stream (TCP) Outline Connection Establishment/Termination Sliding Window Revisited Flow Control Adaptive Timeout.
2: Application Layer 1 1DT066 Distributed Information System Chapter 3 Transport Layer.
3-1 Transport services and protocols r provide logical communication between app processes running on different hosts r transport protocols run in end.
Spring 2002CS 4611 Reliable Byte-Stream (TCP) Outline Connection Establishment/Termination Sliding Window Revisited Flow Control Adaptive Timeout.
1 Reliable Data Transfer. 2 r Problem: Reliability  Want an abstraction of a reliable link even though packets can be corrupted or get lost r Solution:
Principles of Reliable Data Transfer. Reliable Delivery Making sure that the packets sent by the sender are correctly and reliably received by the receiver.
CSE 461 University of Washington1 Topic The sliding window algorithm – Pipelining and reliability – Building on Stop-and-Wait Yeah! Network.
McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Chapter 11 Data Link Control Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction.
TCP1 Transmission Control Protocol (TCP). TCP2 Outline Transmission Control Protocol.
Chi-Cheng Lin, Winona State University CS 313 Introduction to Computer Networking & Telecommunication Data Link Layer Part I – Designing Issues and Elementary.
1 Introduction to Computer Networks University of ilam Dr. Mozafar Bag-Mohammadi Transport Layer.
Primitives for Achieving Reliability 3035/GZ01 Networked Systems Kyle Jamieson Lecture 7 Department of Computer Science University College London.
Chapter 5 Peer-to-Peer Protocols and Data Link Layer PART I: Peer-to-Peer Protocols ARQ Protocols and Reliable Data Transfer Flow Control.
1 Transport Layer Lecture 10 Imran Ahmed University of Management & Technology.
Copyright © Lopamudra Roychoudhuri
1 Reliable Byte-Stream (TCP) Outline Connection Establishment/Termination Sliding Window Revisited Flow Control Adaptive Timeout.
Transport Layer 3-1 Internet Transport Layer Lecture 8 Dr. Najla Al-Nabhan.
Transport Layer: Sliding Window Reliability
Data Link Layer Flow and Error Control. Flow Control Flow Control Flow Control Specifies the amount of data can be transmitted by sender before receiving.
© Janice Regan, CMPT 128, CMPT 371 Data Communications and Networking Principles of reliable data transfer 0.
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.
9: Pipelined Protocols and RTT Transport Layer 3-1 Slides adapted from: J.F Kurose and K.W. Ross,
TCP Flow Control – an illustration of distributed system thinking David E. Culler CS162 – Operating Systems and Systems Programming
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:
1 Direct Link Networks: Reliable Transmission Sections 2.5.
IT 424 Networks2 IT 424 Networks2 Ack.: Slides are adapted from the slides of the book: “Computer Networking” – J. Kurose, K. Ross Chapter 3: Transport.
Data Link Layer. Data link layer The communication between two machines that can directly communicate with each other. Basic property – If bit A is sent.
1 End-to-End Protocols UDP TCP –Connection Establishment/Termination –Sliding Window Revisited –Flow Control –Congestion Control –Adaptive Timeout.
CSE331: Introduction to Networks and Security Lecture 4 Fall 2002.
1 The utopia protocol  Unrealistic assumptions: –processing time ignored –infinite buffer space available –simplex: data transmitted in one direction.
Transmission Control Protocol (TCP) TCP Flow Control and Congestion Control CS 60008: Internet Architecture and Protocols Department of CSE, IIT Kharagpur.
CSEN 404 Transport Layer II Amr El Mougy Lamia AlBadrawy.
DATA LINK CONTROL. DATA LINK LAYER RESPONSIBILTIES  FRAMING  ERROR CONTROL  FLOW CONTROL.
Computer Networking Lecture 16 – Reliable Transport.
Ch 3. Transport Layer Myungchul Kim
Data Link Layer.
Univ. of TehranIntroduction to Computer Network1 An Introduction Computer Networks An Introduction to Computer Networks University of Tehran Dept. of EE.
3. END-TO-END PROTOCOLS (PART 2) Rocky K. C. Chang Department of Computing The Hong Kong Polytechnic University 22 March
Introduction of Transport Protocols
Chapter 5 TCP Sliding Window
The University of Adelaide, School of Computer Science
5. End-to-end protocols (part 2)
TCP Sliding Windows, Flow Control, and Congestion Control
Transmission Control Protocol (TCP) Part II Neil Tang 11/21/2008
The University of Adelaide, School of Computer Science
Chapter 5 TCP Sliding Window
TCP Sliding Windows, Flow Control, and Congestion Control
November 26th, 2018 Prof. Ion Stoica
TCP Sliding Windows, Flow Control, and Congestion Control
Presentation transcript:

CSE 461: Sliding Windows & ARQ

Next Topic  We begin on the Transport layer  Focus  How do we send information reliably?  Topics  The Transport layer  Acknowledgements and retransmissions (ARQ)  Sliding windows Physical Data Link Network Transport Session Presentation Application

The Transport Layer  Builds on the services of the Network layer  Communication between processes running on hosts  Naming/Addressing  Stronger guarantees of message delivery  Reliability

Example – Common Properties TCP  Connection-oriented  Multiple processes  Reliable byte-stream delivery  In-order delivery  Single delivery  Arbitrarily long messages  Synchronization  Flow control  Congestion control IP  Datagram oriented  Lost packets  Reordered packets  Duplicate packets  Limited size packets

What does it mean to be “reliable”  How can a sender “know” the sent packet was received?  sender receives an acknowledgement  How can a receiver “know” a received packet was sent?  sender includes sequence number, checksum  Do sender and receiver need to come to consensus on what is sent and received?  When is it OK for the receiver’s TCP/IP stack to deliver the data to the application?

Internet Transport Protocols  UDP  Datagram abstraction between processes  With error detection  TCP  Bytestream abstraction between processes  With reliability  Plus congestion control (later this week) SrcPortDstPort LengthChecksum Data 01631

Automatic Repeat Request (ARQ)  Packets can be corrupted or lost. How do we add reliability?  Acknowledgments (ACKs) and retransmissions after a timeout  ARQ is generic name for protocols based on this strategy SenderReceiver Frame ACK T imeout T ime SenderReceiver Frame T imeout Frame ACK T imeout

The Need for Sequence Numbers  In the case of ACK loss (or poor choice of timeout) the receiver can’t distinguish this message from the next  Need to understand how many packets can be outstanding and number the packets; here, a single bit will do SenderReceiver Frame ACK T imeout Frame ACK T imeout SenderReceiver Frame ACK T imeout Frame ACK T imeout

Stop-and-Wait  Only one outstanding packet at a time  Also called alternating bit protocol Sender Receiver

Limitation of Stop-and-Wait  Lousy performance if trans. delay << prop. delay  Max BW: B  Actual BW: M/2D Example: B = 100Mb/s, M=1500Bytes, D=50ms Actual BW = 1500Bytes/100ms --> Bytes/s --> ~100Kb/s 100Mb vs 100Kb? Data Ack

More BW Please  Want to utilize all available bandwidth  Need to keep more data “in flight”  How much? Remember the bandwidth-delay product?  Leads to Sliding Window Protocol  “window size” says how much data can be sent without waiting for an acknowledgement

Sliding Window – Sender  Window bounds outstanding data  Implies need for buffering at sender Specifically, must buffer unack’ed data  “Last” ACK applies to in-order data  Need not buffer acked data  Sender maintains timers too  Go-Back-N: one timer, send all unacknowledged on timeout  Selective Repeat: timer per packet, resend as needed  Send Window “Last” ACK’edLast Sent …… Sender:

Sliding Window – Timeline SenderReceiver T ime Data Ack Receiver ACK choices: –Individual Each packet acked –Cumulative (TCP) Ack says “got everything up to X-1…” really, “my ack means that the next byte I am expecting is X” –Selective (newer TCP) Ack says “I got X through Y” – Negative Ack says “I did not get X”

Sliding Window – Receiver  Receiver buffers too:  data may arrive out-of-order  or faster than can be consumed by receiving process  No sense having more data on the wire than can be buffered at the receiver.  In other words, receiver buffer size should limit the sender’s window size <= Receive Window Last byte read (by app) Largest Acceptable …… Receiver:

Flow Control  Sender must transmit data no faster than it can be consumed by receiver  Receiver might be a slow machine  App might consume data slowly  Accomplish by adjusting the size of sliding window used at the sender  sender adjusts based on receiver’s feedback about available buffer space  the receiver tells the sender an “Advertised Window” <= Receive Window Last byte readLargest Acceptable ……

Sender and Receiver Buffering Sending application LastByteWritten LastByteSent LastByteAcked = available buffer LastByteAcked <= LastByteSent LastByteSent <= LastByteWritten Older bytesNewer bytes These bytes have not shown up yet. Receiving application LastByteRead LastByteRcvdNextByteExpected = buffer in use LastByteRead < NextByteExpected NextByteExpected <= LastByteRvcd+1 == if data arrives in order else start of first gap. These bytes have gone to the app. Older bytesNewer bytes

Flow Control To accomplish this, receiver advertises the following window size: AdvertisedWindow = MaxRcvBuffer - ((NextByteExpected - 1) - LastByteRead ) “All the buffer space minus the buffer space that’s in use.” MaxRcvBuffer Receiver: LastByteRcvd NextByteExpected LastByteRead Sender: MaxSndBuffer LastByteWritten LastByteSent LastByteAcked Receiver’s goal: always ensure that LastByteRcvd - LastByteRead <= MaxRcvBuffer in other words, ensure it never needs to buffer more than MaxRcvBuffer data

Flow control on the receiver  As data arrives:  receiver acknowledges it so long as all preceding bytes have also arrived  ACKs also carry a piggybacked AdvertisedWindow  So, an ACK tells the sender: 1.All data up to the ACK’ed seqno has been received 2.How much more data fits in the receiver’s buffer, as of receiving the ACK’ed data  AdvertisedWindow:  shrinks as data is received  grows as receiving app. reads the data from the buffer

Flow Control On the Sender OK to send that which there is room for, which is that which was advertised (AdvertisedWindow) minus that which I’ve already sent since receiving the last advertisement. MaxRcvBuffer Receiver: LastByteRcvd NextByteExpected LastByteRead Sender: MaxSndBuffer LastByteWritten LastByteSent LastByteAcked Sender’s goal: always ensure that LastByteSent - LastByteAcked <= AdvertisedWindow in other words, don’t sent that which is unwanted Notion of “EffectiveWindow”: how much new data it is OK for sender to currently send EffectiveWindow = AdvertisedWindow - (LastByteSent - LastByteAcked)

Sending Side  As acknowledgements arrive:  advance LastByteAcked  update AdvertisedWindow  calculate new EffectiveWindow If EffectiveWindow > 0, it is OK to send more data  One last detail on the sender:  sender has finite buffer space as well LastByteWritten - LastByteAcked <= MaxSendBuffer  OS needs to block application writes if buffer fills i.e., block write(y) if (LastByteWritten - LastByteAcked) + y > MaxSendBuffer

Example – Exchange of Packets SEQ=1 SEQ=2 SEQ=3 SEQ=4 ACK=2; WIN=3 ACK=3; WIN=2 ACK=4; WIN=1 ACK=5; WIN=0 Receiver has buffer of size 4 and application doesn’t read Stall due to flow control here T=1 T=2 T=3 T=4 T=5 T=6

Example – Buffer at Sender T=1 T=2 T=3 T=4 T=5 T=6 =acked =sent =advertised

Sliding Window Functions  Sliding window is a mechanism  It supports multiple functions:  Reliable delivery If I hear you got it, I know you got it. ACK (Ack # is “next byte expected”)  In-order delivery If you get it, you get it in the right order. SEQ # (Seq # is “the byte this is in the sequence”)  Flow control If you don’t have room for it, I won’t send it. Advertised Receiver Window AdvertisedWindow is amount of free space in buffer

Key Concepts  Transport layer allows processes to communicate with stronger guarantees, e.g., reliability  Basic reliability is provided by ARQ mechanisms  Stop-and-Wait through Sliding Window plus retransmissions