Principles of Reliable Data Transfer

Similar documents
The Transport Layer Reliability

Reliable Data Transfer

Chapter 3 Transport Layer

Reliable Transport : Fundamentals of Computer Networks Bill Nace

Chapter 3 outline. 3.5 connection-oriented transport: TCP segment structure reliable data transfer flow control connection management

Chapter 3: Transport Layer Part A

Chapter 3: Transport Layer

CMSC 332 Computer Networks Reliable Data Transfer

CSC 4900 Computer Networks: Reliable Data Transport

Transport services and protocols. Chapter 3 outline. Internet transport-layer protocols Chapter 3 outline. Multiplexing/demultiplexing

Computer Networking. Reliable Transport. Reliable Transport. Principles of reliable data transfer. Reliable data transfer. Elements of Procedure

rdt2.0 has a fatal flaw!

Internet transport-layer protocols. Transport services and protocols. Sending and receiving. Connection-oriented (TCP) Connection-oriented

Data Communications & Networks. Session 6 Main Theme Reliable Data Transfer. Dr. Jean-Claude Franchitti

Rdt2.0: channel with packet errors (no loss!)

CS 3516: Advanced Computer Networks

Lecture 7: Flow Control"

CSCD 330 Network Programming

CC451 Computer Networks

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

Chapter III: Transport Layer

Chapter 3 Transport Layer

CSC 401 Data and Computer Communications Networks

Lecture 5. Transport Layer. Transport Layer 1-1

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

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

The Transport Layer Multiplexing, Error Detection, & UDP

Transport layer. Our goals: Understand principles behind transport layer services: Learn about transport layer protocols in the Internet:

Transport layer: Outline

Chapter 3 Transport Layer

CMPE 150/L : Introduction to Computer Networks. Chen Qian Computer Engineering UCSC Baskin Engineering Lecture 8

Chapter 3 Transport Layer

Lecture 10: Transpor Layer Principles of Reliable Data Transfer

TDTS06: Computer Networks

ELEN Network Fundamentals Lecture 15

Lecture 4: CRC & Reliable Transmission. Lecture 4 Overview. Checksum review. CRC toward a better EDC. Reliable Transmission

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

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

CSCE 463/612 Networks and Distributed Processing Spring 2018

Lecture 11: Transport Layer Reliable Data Transfer and TCP

Announcements. No book chapter for this topic! Slides are posted online as usual Homework: Will be posted online Due 12/6

Computer Networking: A Top Down Approach

ICS 451: Today's plan. Sliding Window Reliable Transmission Acknowledgements Windows and Bandwidth-Delay Product Retransmission Timers Connections

CSC 401 Data and Computer Communications Networks

file:///c:/users/hpguo/dropbox/website/teaching/fall 2017/CS4470/H...

CSCE 463/612 Networks and Distributed Processing Spring 2018

COSC4377. Useful Linux Tool: screen

Fall 2012: FCM 708 Bridge Foundation I

Transport Layer. Application / Transport Interface. Transport Layer Services. Transport Layer Connections

The GBN sender must respond to three types of events:

Chapter 3 outline. TDTS06 Computer networks. Principles of Reliable data transfer. Reliable data transfer: getting started

No book chapter for this topic! Slides are posted online as usual Homework: Will be posted online Due 12/6

Lecture - 14 Transport Layer IV (Reliability)

Chapter 3 Transport Layer

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

Communications Software. CSE 123b. CSE 123b. Spring Lecture 3: Reliable Communications. Stefan Savage. Some slides couresty David Wetherall

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

Lecture 3 The Transport Control Protocol (TCP) Antonio Cianfrani DIET Department Networking Group netlab.uniroma1.it

Chapter 3: Transport Layer. Chapter 3 Transport Layer. Chapter 3 outline. Transport services and protocols

Computer Networks & Security 2016/2017

CSC 4900 Computer Networks: TCP

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

UNIT IV -- TRANSPORT LAYER

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

Course on Computer Communication and Networks. Lecture 4 Chapter 3; Transport Layer, Part A

TCP reliable data transfer. Chapter 3 outline. TCP sender events: TCP sender (simplified) TCP: retransmission scenarios. TCP: retransmission scenarios

CSC 401 Data and Computer Communications Networks

Computer Communication Networks Midterm Review

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

Sliding Window Protocols, Connection Management, and TCP Reliability

Data Link Control Protocols

CS 655 System and Network Architectures and Implementation. Module 3 - Transport

Question 1 (6 points) Compare circuit-switching and packet-switching networks based on the following criteria:

Direct Link Networks (II)

Peer-to-Peer Protocols and Data Link Layer. Chapter 5 from Communication Networks Leon-Gracia and Widjaja

Lecture 6: The Transport Layer

CSE 461: Introduction to Computer Communication Networks. Chunjong Park

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

Networking Link Layer

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

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

Chapter 3 Transport Layer

CSC 8560 Computer Networks: Transport Layer

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

CSC358 Week 4. Adapted from slides by J.F. Kurose and K. W. Ross. All material copyright J.F Kurose and K.W. Ross, All Rights Reserved

Transport Layer (TCP/UDP)

NWEN 243. Networked Applications. Layer 4 TCP and UDP

Transport Layer Marcos Vieira

Course on Computer Communication and Networks. Lecture 4 Chapter 3; Transport Layer, Part A

Problem 7. Problem 8. Problem 9

CMPE150 Midterm Solutions

CMPE 150/L : Introduction to Computer Networks. Chen Qian Computer Engineering UCSC Baskin Engineering Lecture 9

Lecture 7: Flow & Media Access Control"

TCP : Fundamentals of Computer Networks Bill Nace

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

Lecture 07 The Transport Layer (TCP & UDP) Dr. Anis Koubaa

Foundations of Telematics

CS 3516: Computer Networks

ECE697AA Lecture 3. Today s lecture

CRC. Implementation. Error control. Software schemes. Packet errors. Types of packet errors

Transcription:

Principles of Reliable Data Transfer 1

Reliable Delivery Making sure that the packets sent by the sender are correctly and reliably received by the receiver amid network errors, i.e., corrupted/lost packets Can be implemented at LL, NL or TL of the protocol stack. Totally a design choice When and why should this be used? Link Layer Rarely done over twisted-pair or fiber optic links Usually done over lossy links (wireless) for performance improvement (versus correctness) in P2P links Network/Transport Layers Necessary if the application requires the data to be reliably delivered to the receiver, e.g., file transfer 2

Reliable Delivery: Service Model 4 3 2 1 4 3 2 1 RDT_Send Reliable Data Transfer Protocol (Sender Side) Deliver_Data Reliable Data Transfer Protocol (Receiver Side) UDT_Send unreliable channel Reliable, In-order Delivery RDT_Receive Reliable, In-order delivery Typically done when reliability is implemented at the transport layer, e.g., TCP Example application: File transfer 3

We ll: Reliable Delivery: Assumptions Consider only unidirectional data transfer A sender sending packets to a receiver Bidirectional communication is a simple extension, where there are 2 sender/receiver pairs Start with simple a protocol and make it complex as we continue 4

RDT over Unreliable Channel 4 3 2 1 4 3 2 1 RDT_Send Reliable Data Transfer Protocol (Sender Side) UDT_Send Unreliable channel Deliver_Data Reliable Data Transfer Protocol (Receiver Side) RDT_Receive Channel may flip bits in packets/lose packets The received packet may have been corrupted during transmission, or dropped at an intermediate router due to buffer overflow The question: how to recover from errors? ACKs, NACKs, Timeouts Next 5

RDT over Unreliable Channel Two fundamental mechanisms to accomplish reliable delivery over Unreliable Channels Acknowledgements (ACK), Negative ACK (NACK) Small control packets (header without any data) that a protocol sends back to its peer saying that it has received an earlier packet (positive ACK) or that it has not received a packet (NACK). Sent by the receiver to the sender Timeouts Set by the sender for each transmitted packet If an ACK is received before the timer expires, then the packet has made it to the receiver If the timeout occurs, the sender assumes that the packet is lost (corrupted) and retransmits the packet 6

ARQ The general strategy of using ACKs (NACKs) and timeouts to implement reliable delivery is called Automatic Repeat request (ARQ) 3 ARQ Mechanisms for Reliable Delivery Stop and Wait Concurrent Logical Channels Sliding Window 7

Timeout Stop and Wait Simplest ARQ protocol Sender: Send a packet Stop and wait until an ACK arrives If received ACK, send the next packet If timeout, ReTransmit the same packet Receiver: When you receive a packet correctly, send an ACK Time Sender Receiver 8

Timeout Timeout Timeout Timeout Timeout Timeout Recovering from Error Time Packet lost ACK lost Early timeout Does this protocol work? When an ACK is lost or a early timeout occurs, how does the receiver know whether the packet is a retransmission or a new packet? Use sequence numbers: Both Packets and ACKs 9

Timeout Timeout Timeout Timeout Timeout Timeout Stop & Wait with Seq #s Time Packet lost ACK lost Early timeout Sequence # in packet is finite -- how big should it be? One bit won t send Pkt #1 until received ACK for Pkt #0 10

Performance of Stop and Wait Can only send one packet per round trip example: 1 Gbps link, 15 ms e-e prop. delay, 1KB packet: first packet bit transmitted, t = 0 last packet bit transmitted, t = L / R sender receive r RTT first packet bit arrives last packet bit arrives, send ACK ACK arrives, send next packet, t = RTT + L / R U sender = L / R.008 = 0.00027 RTT + L / R = = 0.027% 30.008 microsec microsec 1KB pkt every 30 msec -> 33kB/sec throughput over 1 Gbps link network protocol limits use of physical resources! 11

Pipelining: Increasing Utilization Pipelining: sender allows multiple, in-flight, yet-to-be-acknowledged pkts without waiting for first to be ACKed to keep the pipe full Capacity of the Pipe = RTT * BW first packet bit transmitted, t = 0 last bit transmitted, t = L / R sender receiver RTT ACK arrives, send next packet, t = RTT + L / R first packet bit arrives last packet bit arrives, send ACK last bit of 2 nd packet arrives, send ACK last bit of 3 rd packet arrives, send ACK Increase utilization by a factor of 3! U sender = 3 * L / R RTT + L / R =.024 30.008 = 0.0008 microsecon 12

Sliding Window Protocols Reliable, in-order delivery of packets Sender can send window of up to N, consecutive unack ed packets Receiver makes sure that the packets are delivered in-order to the upper layer 2 Generic Versions Go-Back-N Selective Repeat 13

Sliding Window: Generic Sender/Receiver States Sender Receiver Last ACK Received (LAR) Last Packet Sent (LPS) Next Packet Expected (NPE) Last Packet Acceptable (LPA) Sender Window Size Receiver Window Size Sent & Acked Sent Not Acked Received & Acked Acceptable Packet OK to Send Not Usable Not Usable 14

Sliding Window- Sender Side The sender maintains 3 variables Sender Window Size (SWS) Upper bound on the number of in-flight packets Last Acknowledgement Received (LAR) Last Packet Sent (LPS) We want LPS LAR <= SWS <= SWS LAR LPS 15

Sliding Window- Receiver Side The receiver maintains 3 variables Receiver Window Size (RWS) Upper bound on the number of buffered packets Last Packet Acceptable (LPA) Next Packet Expected (NPE) We want LPS NPE + 1 <= RWS <= RWS NPE LPA 16

Go-Back-N Sender Receiver Last ACK Received (LAR) Last Packet Sent (LPS) Next Packet Expected (NPE) Last Packet Acceptable (LPA) SWS = N RWS = 1 packet Sent & Acked Sent Not Acked Received & Acked Acceptable Packet OK to Send Not Usable Not Usable SWS = N: Sender can send up to N consecutive unack ed pkts RWS = 1: Receiver has buffer for just 1 packet Always sends ACK for correctly-rcvd pkt with highest in-order seq # Cumulative ACK Out-of-order pkt: discard & re-ack pkt with highest in-order seq # 17

Go-Back-N: Sender Actions Data From Above: Send packets as long as LPS-LAR <= SWS ACK(k): An ACK with seqno = k arrives: If k > LAR then, increase LAR until LAR hits a packet for which ACK has not arrived yet, or LAR == LPS Send packet(s) as long as LPS-LAR <= SWS Associate a timer with the oldest packet sent Single timer for all packets in transit Timeout: Retransmit ALL packets that have been previously sent, but not yet ACKed Therefore the name Go-Back-N 18

Go-Back-N: Receiver Actions A packet with seqno arrives: If seqno == NPE then // in-order packet Deliver the packet to the upper layer Send an ACK for pkt# = seqno This is called cumulative ACK scheme ACKs not only the current packet, but also all packets before it If seqno!= NPE then // out of order packet Since sequence # of the last packet received is NPE 1, send an ACK for pkt# = NPE-1 Still using cumulative ACK scheme. 19

GBN in action (SWS = 4) 20

Why use GBN? Very simple receiver GBN: Last Word Why NOT use GBN? Throwing away out-of-order packets at the receiver results in extra transmissions, thus lowering the channel utilization: The channel may become full of retransmissions of old packets rather than useful new packets Can we do better? Yes: Buffer out-of-order packets at the receiver and do Selective Repeat (Retransmissions) at the sender 21

Selective Repeat Sender Receiver Last ACK Received (LAR) Last Packet Sent (LPS) Next Packet Expected (NPE) Last Packet Acceptable (LPA) SWS = N RWS = N Sent & Acked Sent Not Acked Received & Acked Acceptable Packet OK to Send Not Usable Not Usable SWS = RWS = N consecutive packets: Sender can send up to N consecutive unack ed pkts, Receiver can buffer up to N consecutive packets Receiver individually acknowledges all correctly received pkts buffers pkts, as needed, for eventual in-order delivery to upper layer Sender only resends pkts for which ACK not received sender timer for each unacked pkt 22

sender data from above : if next available seq # in window, send pkt timeout(k): resend pkt k, restart timer ACK(k) in [LAR+1, LPS] Mark pkt k as received if k == LAR +1 then, advance LAR to next unacked pkt # Selective repeat receiver pkt k in [NPE, LPA] send ACK(k) out-of-order (k!= NPE): buffer in-order (k == NPE): deliver (also deliver buffered, in-order pkts), advance NPE to next notyet-received pkt pkt k in [NPE-N, LPA-1] Send ACK(k) otherwise: ignore 23

Selective repeat in action 24

Selective Repeat: Sequence Numbers How large do sequence numbers need to be? Must be able to detect wrap-around Depends on sender/receiver window size E.g. Assume SWS = RWS = 7. Also assume that we use 3-bit sequence numbers, i.e., 0..7 Sender sends frames 0..6 Assume receiver received all these frames successfully BUT all ACKs are lost Receiver expects 7,0..5 Sender timeouts and retransmits old 0..6 Receiver receives these but assumes these are new frames!! It turns out that the sending window size can be no more than half as big as the number of available sequence numbers WS <= (MaxSeqNo +1)/2 25

Sliding Window: Last Word Go-Back-N and Selective Repeat are NOT the only sliding Window protocol alternatives Other variations exist: Let SWS = RWS = N and use cumulative ACKs Simplifies the sender: Can have a single timer instead of a timer for each packet in transit This is in fact what TCP does! Let SWS = RWS = N, and use Negative ACKs Can be used when the channel is pretty reliable, i.e., packet loss is very rare Only notify the sender when something goes wrong 26