The Transport Layer Reliability

Slides:



Advertisements
Similar presentations
Transport Layer 4 Slides from Kurose and Ross
Advertisements

Transport Layer 3-1 Transport services and protocols  provide logical communication between app processes running on different hosts  transport protocols.
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.
Chapter 3 outline 3.1 transport-layer services
Transport Layer Transport Layer. Reliable data transfer: getting started send side receive side rdt_send(): called from above, (e.g., by app.).
Transport Layer 3-1 Transport Layer r To learn about transport layer protocols in the Internet: m TCP: connection-oriented protocol m Reliability protocol.
Announcement Project 1 due last night, how is that ? Project 2 almost ready, out tomorrow, will post online –Much harder than project 1, start early!
Transport Layer 3-1 Transport Layer r To learn about transport layer protocols in the Internet: m TCP: connection-oriented protocol m Reliability protocol.
Transport Layer3-1 Reliable Data Transfer. Transport Layer3-2 Principles of Reliable data transfer r important in app., transport, link layers r top-10.
2: Application Layer 1 1DT066 Distributed Information System Chapter 3 Transport Layer.
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.
Go-Back-N ARQ  packets transmitted continuously (when available) without waiting for ACK, up to N outstanding, unACK’ed packets  a logically different.
McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Chapter 11 Data Link Control Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction.
ECE 4450:427/527 - Computer Networks Spring 2015 Dr. Nghi Tran Department of Electrical & Computer Engineering Lecture 5.3: Reliable Transmission Dr. Nghi.
3: Transport Layer 3a-1 8: Principles of Reliable Data Transfer Last Modified: 10/15/2015 7:04:07 PM Slides adapted from: J.F Kurose and K.W. Ross,
1 Transport Layer Lecture 10 Imran Ahmed University of Management & Technology.
Part 3: Transport Layer: Reliable Data Transfer CSE 3461/5461 Reading: Section 3.4, Kurose and Ross 1.
Transport Layer3-1 rdt2.1: sender, handles garbled ACK/NAKs Wait for call 0 from above sndpkt = make_pkt(0, data, checksum) udt_send(sndpkt) rdt_send(data)
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.
9: Pipelined Protocols and RTT Transport Layer 3-1 Slides adapted from: J.F Kurose and K.W. Ross,
1 Direct Link Networks: Reliable Transmission Sections 2.5.
CSE331: Introduction to Networks and Security Lecture 4 Fall 2002.
Chi-Cheng Lin, Winona State University CS412 Introduction to Computer Networking & Telecommunication Data Link Layer Part II – Sliding Window Protocols.
Application Layer 2-1 Chapter 3 Transport Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012.
Computer Networking Lecture 16 – Reliable Transport.
1 COMP 431 Internet Services & Protocols The Transport Layer Pipelined Transport Protocols Jasleen Kaur March 29, 2016.
NET 222: COMMUNICATIONS AND NETWORKS FUNDAMENTALS ( NET 222: COMMUNICATIONS AND NETWORKS FUNDAMENTALS (PRACTICAL PART) Tutorial 4 : Chapter 7 Data & computer.
Chapter 3: The Data Link Layer –to achieve reliable, efficient communication between two physically connected machines. –Design issues: services interface.
Go-Back-N ARQ packets transmitted continuously (when available) without waiting for ACK, up to N outstanding, unACK’ed packets a logically different sender.
Chapter 3: Transport Layer
Chapter 3 Transport Layer
Computer Communication & Networks
Reliable Transmission
Data Link Layer Flow Control.
Part III Datalink Layer 10.
Performance of rdt3.0 rdt3.0 works, but performance stinks
Chapter 3 outline 3.1 transport-layer services
B. R. Chandavarkar CSE Dept., NITK Surathkal
10. Principles of Reliable Data Transport – Part 2
Last time Reliable Data Transfer
Instructor Mazhar Hussain
Introduction of Transport Protocols
Flow Control.
ECE 4450:427/527 - Computer Networks Spring 2017
Chapter 5 TCP Transmission Control
Flow and Error Control.
rdt2.2: a NAK-free protocol
CSS432 (Link Level Protocols) Reliable Transmission Textbook Ch 2.5
rdt2.2: a NAK-free protocol
rdt2.2: a NAK-free protocol
TCP Sliding Windows, Flow Control, and Congestion Control
CS4470 Computer Networking Protocols
rdt2.2: a NAK-free protocol
Advanced Computer Networks
rdt2.2: a NAK-free protocol
Chapter 3 outline 3.1 transport-layer services
8: Principles of Reliable Data Transfer
Getting Connected (Chapter 2 Part 3)
9: Pipelined Protocols and RTT
Transport Layer Outline Intro to transport UDP
Lecture 4 Peer-to-Peer Protocols and Data Link Layer
TCP Sliding Windows, Flow Control, and Congestion Control
Chapter 3 Transport Layer
CS 5565 Network Architecture and Protocols
Error detection: Outline
rdt2.2: a NAK-free protocol
TCP Sliding Windows, Flow Control, and Congestion Control
Presentation transcript:

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

Quick recap: Transport application transport network data link physical 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

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

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

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

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

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

Discussion of stop and wait protocols sender: seq # added to pkt two seq. #’s (0,1) 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

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

Pipelining Example: increased utilization sender receiver first packet bit transmitted, t = 0 last bit transmitted, t = L / R first packet bit arrives RTT last packet bit arrives, send ACK last bit of 2nd packet arrives, send ACK last bit of 3rd packet arrives, send ACK ACK arrives, send next packet, t = RTT + L / R

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

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 Seq Number increasing SWS Sequence numbers wrap around! (limited number of bits in header) 1 2 3 4 5 6 7 1 LAR LFS LFS - LAR <= SWS

Sender-Side Window with WS=2 1 2 3 4 5 6 7 1 2 3 4 5 6 7 1 2 3 4 5 6 7 1 2 3 4 5 6 7 (a) (b) (c) (d) 1 2 3 4 5 6 7 1 2 3 4 5 6 7 1 2 3 4 5 6 7 1 2 3 4 5 6 7 (e) (f) (g) (h) (a) Initial window state (b) Send frame 0 (c) Send frame 1 (d) ACK for frame 0 arrives (e) Send frame 2 (f ) ACK for frame 1 arrives (g) ACK for frame 2 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 Receiver acknowledges seqnumber s.t all earlier frames have been received Cumulative ACK Seq Number increasing RWS LAF - LFR <= RWS LFR LAF

Receiver-Side Window with WR=2 1 2 3 4 5 6 7 1 2 3 4 5 6 7 1 2 3 4 5 6 7 1 2 3 4 5 6 7 (a) (b) (c) (d) 1 2 3 4 5 6 7 1 2 3 4 5 6 7 1 2 3 4 5 6 7 1 2 3 4 5 6 7 (e) (f) (g) (h) (a) Initial window state (b) Nothing happens (c) Frame 0 arrives, ACK frame 0 (d) Nothing happens (e) Frame 1 arrives, ACK frame 1 (f) Frame 2 arrives, ACK frame 2 (g) Nothing happens (h) Frame 3 arrives, ACK frame 3

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

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

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

Go Back N can recover from erroneous or missing frames 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.

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

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 sender window (N=4) receiver 0 1 2 3 4 5 6 7 8 send pkt0 send pkt1 send pkt2 send pkt3 (wait) 0 1 2 3 4 5 6 7 8 receive pkt0, send ack0 receive pkt1, send ack1 receive pkt3, buffer, send ack3 0 1 2 3 4 5 6 7 8 X loss 0 1 2 3 4 5 6 7 8 0 1 2 3 4 5 6 7 8 rcv ack0, send pkt4 rcv ack1, send pkt5 0 1 2 3 4 5 6 7 8 receive pkt4, buffer, send ack4 record ack3 arrived receive pkt5, buffer, send ack5 pkt 2 timeout 0 1 2 3 4 5 6 7 8 send pkt2 0 1 2 3 4 5 6 7 8 record ack4 arrived rcv pkt2; deliver pkt2, pkt3, pkt4, pkt5; send ack2 0 1 2 3 4 5 6 7 8 record ack5 arrived 0 1 2 3 4 5 6 7 8 Q: what happens when ack2 arrives?

Selective repeat: dilemma sender window (after receipt) receiver window (after receipt) 0 1 2 3 0 1 2 pkt0 pkt1 pkt2 X will accept packet with seq number 0 pkt3 (a) no problem example: seq #’s: 0, 1, 2, 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)? receiver can’t see sender side. receiver behavior identical in both cases! something’s (very) wrong! 0 1 2 3 0 1 2 pkt0 pkt1 pkt2 timeout retransmit pkt0 X will accept packet with seq number 0 (b) oops! Transport Layer

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!