The Transport Layer Reliability

Similar documents
Principles of Reliable Data Transfer

Chapter III: Transport Layer

Lecture 7: Flow Control"

rdt2.0 has a fatal flaw!

CSC 401 Data and Computer Communications Networks

Lecture 10: Transpor Layer Principles of Reliable Data Transfer

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

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

Reliable Transport : Fundamentals of Computer Networks Bill Nace

Chapter 3 Transport Layer

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

Chapter 3: Transport Layer Part A

Direct Link Networks (II)

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

CSC 4900 Computer Networks: Reliable Data Transport

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

Reliable Data Transfer

Chapter 3 Transport Layer

CS 3516: Advanced Computer Networks

CMSC 332 Computer Networks Reliable Data Transfer

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

Lecture 11: Transport Layer Reliable Data Transfer and TCP

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

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

Flow Control, and Congestion Control

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

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

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

Chapter 3: Transport Layer

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

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

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

Transport Layer Marcos Vieira

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

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

Lecture 7: Flow & Media Access Control"

Flow Control, and Congestion Control

Lecture 5. Transport Layer. Transport Layer 1-1

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

CC451 Computer Networks

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

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

Data Link Layer, Part 5 Sliding Window Protocols. Preface

Chapter 3 Transport Layer

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

NWEN 243. Networked Applications. Layer 4 TCP and UDP

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

TDTS06: Computer Networks

Chapter 3 Transport Layer

Computer Networking: A Top Down Approach

CSCI-1680 Link Layer Reliability Rodrigo Fonseca

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

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

Networking Link Layer

CSE 461: Introduction to Computer Communication Networks. Chunjong Park

CSC 401 Data and Computer Communications Networks

Data Link Control Protocols

ECE697AA Lecture 3. Today s lecture

CSCI-1680 Link Layer Reliability John Jannotti

The flow of data must not be allowed to overwhelm the receiver

Transport layer: Outline

The Transport Layer Multiplexing, Error Detection, & UDP

ERROR AND FLOW CONTROL. Lecture: 10 Instructor Mazhar Hussain

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

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

TCP : Fundamentals of Computer Networks Bill Nace

CSCI-1680 Link Layer I Rodrigo Fonseca

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

CSCD 330 Network Programming

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

CSCE 463/612 Networks and Distributed Processing Spring 2018

CSC 4900 Computer Networks: TCP

CSCE 463/612 Networks and Distributed Processing Spring 2018

Reliable Transmission

The Transport Layer: TCP & Reliable Data Transfer

Computer Networks & Security 2016/2017

Transport Layer (TCP/UDP)

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

CS 3516: Computer Networks

Reliable Transport I: Concepts and TCP Protocol

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

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

16.682: Communication Systems Engineering. Lecture 17. ARQ Protocols

COSC4377. Useful Linux Tool: screen

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

Computer Communication Networks Midterm Review

CS321: Computer Networks Error and Flow Control in TCP

Fall 2012: FCM 708 Bridge Foundation I

Reliable Transport II: TCP and Congestion Control

The GBN sender must respond to three types of events:

Problem 7. Problem 8. Problem 9

Internet Networking recitation #10 TCP New Reno Vs. Reno

CSCI Topics: Internet Programming Fall 2008

CS519: Computer Networks. Lecture 5, Part 1: Mar 3, 2004 Transport: UDP/TCP demux and flow control / sequencing

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

Reliable Transport I: Concepts and TCP Protocol

Transport layer. UDP: User Datagram Protocol [RFC 768] Review principles: Instantiation in the Internet UDP TCP

Transport layer. Review principles: Instantiation in the Internet UDP TCP. Reliable data transfer Flow control Congestion control

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

Transcription:

The Transport Layer Reliability CS 3, Lecture 7 http://www.cs.rutgers.edu/~sn4/3-s9 Srinivas Narayana (slides heavily adapted from text authors material)

Quick recap: Transport Provide logical communication between app processes running on different hosts Providing reliable communication: Stop and wait protocols Concepts: Acknowledgements (ACKs) Timeouts Retransmission Sequence numbers application transport network data link physical application transport network data link physical

Stop-and-wait: normal operation Packet Length = L; Bandwidth =R; RTT = *Prop Delay sender receiver first packet bit transmitted, t = 0 last packet bit transmitted, t = L / R RTT first packet bit arrives last packet bit arrives, send ACK ACK arrives, send next packet, t = RTT + L / R 3

Stop-and-wait: packet corrupted Packet Length = L; Bandwidth =R; RTT = *Prop Delay sender receiver first packet bit transmitted, t = 0 last packet bit transmitted, t = L / R RTT ACK arrives, send next packet, t = RTT + L / R NAK first packet bit arrives last packet bit arrives, Corrupted! send NAK 4

Stop-and-wait: packet lost sender receiver Timeout Packet retransmission

Stop-and-wait: ACK lost! sender receiver Timeout Packet retransmission Duplicate transmission received

Stop-and-wait: ACKs may be delayed! sender receiver Timeout Timeout too short Duplicate Transmission 7

Stop-and-wait: Sequence numbers sender receiver 0 Timeout Ack Sequence numbers help detect duplicate transmissions at the receiver. Ack 8

Often, protocols just use ACKs (no NAKs) Instead of NAK, receiver sends ACK for last packet received OK receiver must explicitly include seq # of pkt being ACKed sender Timeout 0 Ack0 receiver Duplicate ACK at sender results in same action as NAK: retransmit current packet Ack

Discussion of stop and wait protocols sender: seq # added to pkt two seq. # s (0,) will suffice. Why? must check if received ACK/NAK corrupted receiver: must check if received packet is duplicate ACK indicates received packet, but also next packet expected note: receiver cannot know if its last ACK/NAK received OK at sender Problem with stop and wait: low utilization of available capacity Reason: Transmitting one packet per round-trip time 0

Pipelined protocols Pipelining: sender allows multiple, in-flight, yet-to-be-acknowledged pkts

Pipelining Example: increased utilization 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 nd packet arrives, send ACK last bit of 3 rd packet arrives, send ACK

Sliding Window Protocols: Definitions Window: informally, a subset of packets the sender or receiver consider in flight Sequence Number: Each frame is assigned a sequence number that is incremented as each frame is transmitted Sender Window: Keeps track of sequence numbers for frames that have been sent but not yet acknowledged Sender Window size: The maximum number of frames the sender may transmit without receiving any acknowledgements Last Frame sent: The highest sequence number frames sent Last Ack received: sequence number of last ACK 3

Sliding Window with Maximum Sender Window Size SWS With a maximum window size of SWS, the sender can transmit up to SWS frames before stopping and waiting for ACKs This allows the sender to transmit several frames before waiting for an acknowledgement SWS Seq Number increasing 0 3 4 7 0 LAR LFS LFS - LAR <= SWS 4 Sequence numbers wrap around! (limited number of bits in header)

Sender-Side Window with W S = 4 3 4 3 4 3 4 (a) (b) (c) (d) 3 4 3 4 3 4 3 4 (e) (f) (g) (h) 3 (a) Initial window state (b) Send frame 0 (c) Send frame (d) ACK for frame 0 arrives (e) Send frame (f ) ACK for frame arrives (g) ACK for frame arrives, send frame 3 (h) ACK for frame 3 arrives

Sliding Window Protocols Receiver Definitions Receiver Window: Keeps track of sequence numbers for frames the receiver is allowed to accept Receiver Window size: The maximum number of frames the receiver may receive before returning an acknowledgement to the sender Largest Frame received: The highest in-sequence numbered frame received Largest Acceptable Frame: Highest sequence number acceptable

Sliding Window with Maximum Receiver Window Size RWS With window RWS, receiver rejects pkts if SeqNum <= LFR or SeqNum > LAF RWS Seq Number increasing LFR LAF - LFR <= RWS LAF Receiver acknowledges seqnumber s.t all earlier frames have been received Cumulative ACK 7

Receiver-Side Window with W R = 4 3 4 3 4 3 4 (a) (b) (c) (d) 3 4 3 4 3 4 3 4 (e) (f) (g) (h) 3 (a) Initial window state (b) Nothing happens (c) Frame 0 arrives, ACK frame 0 (d) Nothing happens (e) Frame arrives, ACK frame (f) Frame arrives, ACK frame (g) Nothing happens (h) Frame 3 arrives, ACK frame 3 8

What about Errors? What if a data or acknowledgement frame is lost when using a sliding window protocol? Two Solutions: Go Back N Selective Repeat 9

Sliding Window with Go Back N When the receiver notices a missing or erroneous frame, it simply discards all frames with greater sequence numbers and sends no ACK The sender will eventually time out and retransmit all the frames in its sending window 0

Go Back N Timeout interval Sender Maximum window size = 8 0 3 4 3 4 Receiver Maximum window size = 8 ACK 0 0 ACK E D D ACK Discarded by receiver ACK 3 ACK 4 ACK 3 4 ACK Frame with error Time

Go Back N (cont d) Go Back N can recover from erroneous or missing frames But It is wasteful. If there are errors, the sender will spend time retransmitting frames the receiver has already seen

Sliding Window with Selective Repeat Idea: sender should only retransmit dropped/corrupted segments. The receiver stores all the correct frames that arrive following the bad one. (Note that the receiver requires a memory buffer for each sequence number in its receiver window.) When the receiver notices a skipped sequence number, it keeps acknowledging the last good sequence number (cumulative ACK) When the sender times out waiting for an acknowledgement, it just retransmits the one unacknowledged frame, not all its successors. 3

Selective Repeat Timeout interval Sender Maximum window size = 8 Receiver Maximum window size = 8 0 ACK 0 0 ACK E 3 4 NACK NACK 3 4 ACK 4 ACK ACK Buffered by receiver Frame with error Time 4

Pipelined protocols: overview Go-back-N: sender can have up to N unacked packets in pipeline receiver only sends cumulative ack doesn t ack packet if there s a gap sender has timer for oldest unacked packet when timer expires, retransmit all unacked packets Selective Repeat: sender can have up to N unacked packets in pipeline receiver sends individual ack for each packet sender maintains timer for each unacked packet when timer expires, retransmit only that unacked packet

Selective repeat in action sender window (N=4) 0 3 4 7 8 0 3 4 7 8 0 3 4 7 8 0 3 4 7 8 0 3 4 7 8 0 3 4 7 8 0 3 4 7 8 0 3 4 7 8 0 3 4 7 8 0 3 4 7 8 sender send pkt0 send pkt send pkt send pkt3 (wait) rcv ack0, send pkt4 rcv ack, send pkt record ack3 arrived pkt timeout send pkt record ack4 arrived record ack arrived Xloss receiver receive pkt0, send ack0 receive pkt, send ack receive pkt3, buffer, send ack3 receive pkt4, buffer, send ack4 receive pkt, buffer, send ack rcv pkt; deliver pkt, pkt3, pkt4, pkt; send ack Q: what happens when ack arrives?

Selective repeat: dilemma example: seq # s: 0,,, 3 window size=3 receiver sees no difference in two scenarios! duplicate data accepted as new in (b) Q: what relationship between seq # size and window size to avoid problem in (b)? sender window (after receipt) 0 3 0 0 3 0 0 3 0 0 3 0 pkt0 0 3 0 pkt 0 3 0 pkt X X timeout retransmit pkt0 X 0 3 0 pkt0 (b) oops! pkt0 pkt pkt 0 3 0 pkt3 0 3 0 (a) no problem pkt0 X receiver window (after receipt) 0 3 0 0 3 0 0 3 0 will accept packet with seq number 0 receiver can t see sender side. receiver behavior identical in both cases! something s (very) wrong! 0 3 0 0 3 0 0 3 0 will accept packet with seq number 0 Transport Layer 3-7

Summary Reliability using sliding window/pipelined protocols Continue to use concepts from stop and wait ACKs, sequence numbers, timeouts Downside: More complexity, memory buffers on either side Benefit: higher throughput and resource utilization Sliding window protocol used extensively: TCP!