Reliable Transmission

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.
2.5 Reliable Transmission
Chapter 11 Data Link Control
Data link control. Data Link Control –Flow Control how much data may sent –Error Control How can error be detected and corrected.
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.
Spring 2002CS 4611 Outline Encoding Framing Error Detection Sliding Window Algorithm Point-to-Point Links.
1 Outline Encoding Framing Error Detection Sliding Window Algorithm Point-to-Point Links.
ACN: TCP Sliding Windows1 TCP Sliding Windows, with Flow Control, and Congestion Control Based on Peterson and Davie Textbook.
Advanced Computer Networks : TCP Sliding Windows1 TCP Sliding Windows, Flow Control, and Congestion Control Lecture material taken from “Computer Networks.
Spring 2004 EE4272 Direct Link Networks (I) Hardware Building Blocks (nodes & links) 5 Issues before Exchanging Packets  Encoding  Framing  Error Detection.
18-Aug-154/598N: Computer Networks Overview Direct link networks –Error detection - Section 2.4 –Reliable transmission - Section 2.5.
Principles of Reliable Data Transfer. Reliable Delivery Making sure that the packets sent by the sender are correctly and reliably received by the receiver.
McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Chapter 11 Data Link Control Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction.
11.1 Chapter 11 Data Link Control Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
ECE 4450:427/527 - Computer Networks Spring 2015 Dr. Nghi Tran Department of Electrical & Computer Engineering Lecture 5.3: Reliable Transmission Dr. Nghi.
Data Link Layer We have now discussed the prevalent shared channel technologies  Ethernet/IEEE  Wireless LANs (802.11) We have now covered chapters.
1 Transport Layer Lecture 10 Imran Ahmed University of Management & Technology.
Transport Layer: Sliding Window Reliability
COSC 3213: Computer Networks I Instructor: Dr. Amir Asif Department of Computer Science York University Section M Topics: 1.Flow Control and ARQ Protocols.
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.
1 The utopia protocol  Unrealistic assumptions: –processing time ignored –infinite buffer space available –simplex: data transmitted in one direction.
DATA LINK CONTROL. DATA LINK LAYER RESPONSIBILTIES  FRAMING  ERROR CONTROL  FLOW CONTROL.
Computer Networking Lecture 16 – Reliable Transport.
NET 222: COMMUNICATIONS AND NETWORKS FUNDAMENTALS ( NET 222: COMMUNICATIONS AND NETWORKS FUNDAMENTALS (PRACTICAL PART) Tutorial 4 : Chapter 7 Data & computer.
Data Link Layer.
CS380 Int. to Comp. Networks Data Link Networks - Part II1 Reliable Transmission How to fix corrupted frames. –Error correcting codes too expensive –Should.
Chapter 3: The Data Link Layer –to achieve reliable, efficient communication between two physically connected machines. –Design issues: services interface.
PROTOCOL BASICS. 2 Introduction In chapter 3: Circuits and techniques can be employed to transmit a frame of information between 2 DTEs Error detection.
Powerpoint Templates Data Communication Muhammad Waseem Iqbal Lec # 15.
Computer Communication & Networks
2.10 Flow and Error Control Before that ...
Data Link Layer Flow Control.
Data Link Layer - 3 Dr. Sanjay P. Ahuja, Ph.D.
Part III Datalink Layer 10.
Getting Connected (Chapter 2 Part 3)
B. R. Chandavarkar CSE Dept., NITK Surathkal
10. Principles of Reliable Data Transport – Part 2
Chap. 4 Data link layer 2.
Instructor Mazhar Hussain
Data Link Layer What does it do?
Introduction of Transport Protocols
Flow Control.
ECE 4450:427/527 - Computer Networks Spring 2017
Chapter 5 TCP Transmission Control
Data Link Layer: Data Link Control
Flow and Error Control.
Overview Jaringan Komputer (2)
Chapter 5 Peer-to-Peer Protocols and Data Link Layer
Getting Connected (Chapter 2 Part 3)
Reliable transmission
Point-to-Point Links Outline Encoding Framing Error Detection
CSS432 (Link Level Protocols) Reliable Transmission Textbook Ch 2.5
TCP Sliding Windows, Flow Control, and Congestion Control
CS4470 Computer Networking Protocols
Advanced Computer Networks
Chapter 11 Data Link Control
Getting Connected (Chapter 2 Part 3)
The Transport Layer Reliability
Transport Layer Outline Intro to transport UDP
Chapter 5 Peer-to-Peer Protocols and Data Link Layer
Lecture 4 Peer-to-Peer Protocols and Data Link Layer
TCP Sliding Windows, Flow Control, and Congestion Control
Error detection: Outline
Error Checking continued
data link Control layer (DLC) – ARQ protocols
TCP Sliding Windows, Flow Control, and Congestion Control
Presentation transcript:

Reliable Transmission The University of Adelaide, School of Computer Science 18 April 2018 Reliable Transmission CRC is used to detect errors. Some error codes are strong enough to correct errors. The overhead is typically too high. Corrupt frames must be discarded. A link-level protocol that wants to deliver frames reliably must recover from these discarded frames. This is accomplished using a combination of two fundamental mechanisms Acknowledgements and Timeouts Chapter 2 — Instructions: Language of the Computer

Reliable Transmission The University of Adelaide, School of Computer Science 18 April 2018 Reliable Transmission An acknowledgement (ACK for short) is a small control frame that a protocol sends back to its peer saying that it has received the earlier frame. A control frame is a frame with header only (no data). The receipt of an acknowledgement indicates to the sender of the original frame that its frame was successfully delivered. Chapter 2 — Instructions: Language of the Computer

Reliable Transmission The University of Adelaide, School of Computer Science 18 April 2018 Reliable Transmission If the sender does not receive an acknowledgment after a reasonable amount of time, then it retransmits the original frame. The action of waiting a reasonable amount of time is called a timeout. The general strategy of using acknowledgements and timeouts to implement reliable delivery is sometimes called Automatic Repeat reQuest (ARQ). Chapter 2 — Instructions: Language of the Computer

The University of Adelaide, School of Computer Science 18 April 2018 Stop and Wait Protocol Idea of stop-and-wait protocol is straightforward After transmitting one frame, the sender waits for an acknowledgement before transmitting the next frame. If the acknowledgement does not arrive after a certain period of time, the sender times out and retransmits the original frame Chapter 2 — Instructions: Language of the Computer

Stop and Wait Protocol Timeline showing four different scenarios for the stop-and-wait algorithm. (a) The ACK is received before the timer expires; (b) the original frame is lost; (c) the ACK is lost; (d) the timeout fires too soon

The University of Adelaide, School of Computer Science 18 April 2018 Stop and Wait Protocol If the acknowledgment is lost or delayed in arriving The sender times out and retransmits the original frame, but the receiver will think that it is the next frame since it has correctly received and acknowledged the first frame As a result, duplicate copies of frames will be delivered How to solve this Use 1 bit sequence number (0 or 1) When the sender retransmits frame 0, the receiver can determine that it is seeing a second copy of frame 0 rather than the first copy of frame 1 and therefore can ignore it (the receiver still acknowledges it, in case the first acknowledgement was lost) Chapter 2 — Instructions: Language of the Computer

Stop and Wait Protocol Timeline for stop-and-wait with 1-bit sequence number

Sliding Window Protocol Timeline for Sliding Window Protocol

Sliding Window Protocol The University of Adelaide, School of Computer Science 18 April 2018 Sliding Window Protocol Sender assigns a sequence number denoted as SeqNum to each frame. Assume it can grow infinitely large Sender maintains three variables Sending Window Size (SWS) Upper bound on the number of outstanding (unacknowledged) frames that the sender can transmit Last Acknowledgement Received (LAR) Sequence number of the last acknowledgement received Last Frame Sent (LFS) Sequence number of the last frame sent Chapter 2 — Instructions: Language of the Computer

Sliding Window Protocol The University of Adelaide, School of Computer Science 18 April 2018 Sliding Window Protocol Sender also maintains the following invariant LFS – LAR ≤ SWS Sliding Window on Sender Chapter 2 — Instructions: Language of the Computer

Sliding Window Protocol The University of Adelaide, School of Computer Science 18 April 2018 Sliding Window Protocol When an acknowledgement arrives the sender moves LAR to right, thereby allowing the sender to transmit another frame Also the sender associates a timer with each frame it transmits It retransmits the frame if the timer expires before the ACK is received Note that the sender has to be willing to buffer up to SWS frames WHY? Chapter 2 — Instructions: Language of the Computer

Sliding Window Protocol The University of Adelaide, School of Computer Science 18 April 2018 Sliding Window Protocol Receiver maintains three variables Receiving Window Size (RWS) Upper bound on the number of out-of-order frames that the receiver is willing to accept Largest Acceptable Frame (LAF) Sequence number of the largest acceptable frame Last Frame Received (LFR) Sequence number of the last frame received Chapter 2 — Instructions: Language of the Computer

Sliding Window Protocol The University of Adelaide, School of Computer Science 18 April 2018 Sliding Window Protocol Receiver also maintains the following invariant LAF – LFR ≤ RWS Sliding Window on Receiver Chapter 2 — Instructions: Language of the Computer

Sliding Window Protocol The University of Adelaide, School of Computer Science 18 April 2018 Sliding Window Protocol When a frame with sequence number SeqNum arrives, what does the receiver do? If SeqNum ≤ LFR or SeqNum > LAF Discard it (the frame is outside the receiver window) If LFR < SeqNum ≤ LAF Accept it Now the receiver needs to decide whether or not to send an ACK Chapter 2 — Instructions: Language of the Computer

Sliding Window Protocol The University of Adelaide, School of Computer Science 18 April 2018 Sliding Window Protocol Let SeqNumToAck Denote the largest sequence number not yet acknowledged, such that all frames with sequence number less than or equal to SeqNumToAck have been received The receiver acknowledges the receipt of SeqNumToAck even if high-numbered packets have been received This acknowledgement is said to be cumulative. The receiver then sets LFR = SeqNumToAck and adjusts LAF = LFR + RWS Chapter 2 — Instructions: Language of the Computer

Sliding Window Protocol The University of Adelaide, School of Computer Science 18 April 2018 Sliding Window Protocol For example, suppose LFR = 5 and RWS = 4 (i.e. the last ACK that the receiver sent was for seq. no. 5) LAF = 9 If frames 7 and 8 arrive, they will be buffered because they are within the receiver window But no ACK will be sent since frame 6 is yet to arrive Frames 7 and 8 are out of order Frame 6 arrives (it is late because it was lost first time and had to be retransmitted) Now Receiver Acknowledges Frame 8 and bumps LFR to 8 and LAF to 12 Chapter 2 — Instructions: Language of the Computer

Issues with Sliding Window Protocol The University of Adelaide, School of Computer Science 18 April 2018 Issues with Sliding Window Protocol When timeout occurs, the amount of data in transit decreases Since the sender is unable to advance its window When the packet loss occurs, this scheme is no longer keeping the pipe full The longer it takes to notice that a packet loss has occurred, the more severe the problem becomes How to improve this Negative Acknowledgement (NAK) Additional Acknowledgement Selective Acknowledgement Chapter 2 — Instructions: Language of the Computer

Issues with Sliding Window Protocol The University of Adelaide, School of Computer Science 18 April 2018 Issues with Sliding Window Protocol Negative Acknowledgement (NAK) Receiver sends NAK for frame 6 when frame 7 arrive (in the previous example) However this is unnecessary since sender’s timeout mechanism will be sufficient to catch the situation Additional Acknowledgement Receiver sends additional ACK for frame 5 when frame 7 arrives Sender uses duplicate ACK as a clue for frame loss Selective Acknowledgement Receiver will acknowledge exactly those frames it has received, rather than the highest number frames Receiver will acknowledge frames 7 and 8 Sender knows frame 6 is lost Sender can keep the pipe full (additional complexity) Chapter 2 — Instructions: Language of the Computer

Issues with Sliding Window Protocol The University of Adelaide, School of Computer Science 18 April 2018 Issues with Sliding Window Protocol How to select the window size SWS is easy to compute Delay  Bandwidth RWS can be anything Two common setting RWS = 1 No buffer at the receiver for frames that arrive out of order RWS = SWS The receiver can buffer frames that the sender transmits It does not make any sense to keep RWS > SWS WHY? Chapter 2 — Instructions: Language of the Computer

Issues with Sliding Window Protocol The University of Adelaide, School of Computer Science 18 April 2018 Issues with Sliding Window Protocol Finite Sequence Number Frame sequence number is specified in the header field Finite size 3 bit: eight possible sequence number: 0, 1, 2, 3, 4, 5, 6, 7 It is necessary to wrap around Chapter 2 — Instructions: Language of the Computer

Issues with Sliding Window Protocol The University of Adelaide, School of Computer Science 18 April 2018 Issues with Sliding Window Protocol How to distinguish between different incarnations of the same sequence number? Number of possible sequence number must be larger than the number of outstanding frames allowed Stop and Wait: One outstanding frame 2 distinct sequence number (0 and 1) Let MaxSeqNum be the number of available sequence numbers SWS + 1 ≤ MaxSeqNum Is this sufficient? Chapter 2 — Instructions: Language of the Computer

Issues with Sliding Window Protocol The University of Adelaide, School of Computer Science 18 April 2018 Issues with Sliding Window Protocol SWS + 1 ≤ MaxSeqNum Is this sufficient? Depends on RWS If RWS = 1, then sufficient If RWS = SWS, then not good enough For example, we have eight sequence numbers 0, 1, 2, 3, 4, 5, 6, 7 RWS = SWS = 7 Sender sends 0, 1, …, 6 Receiver receives 0, 1, … ,6 Receiver acknowledges 0, 1, …, 6 ACK (0, 1, …, 6) are lost Sender retransmits 0, 1, …, 6 Receiver is expecting 7, 0, …., 5 Chapter 2 — Instructions: Language of the Computer

Issues with Sliding Window Protocol The University of Adelaide, School of Computer Science 18 April 2018 Issues with Sliding Window Protocol To avoid this, If RWS = SWS SWS < (MaxSeqNum + 1)/2 Chapter 2 — Instructions: Language of the Computer

Issues with Sliding Window Protocol The University of Adelaide, School of Computer Science 18 April 2018 Issues with Sliding Window Protocol Serves three different roles Reliable Preserve the order Each frame has a sequence number The receiver makes sure that it does not pass a frame up to the next higher-level protocol until it has already passed up all frames with a smaller sequence number Frame control Receiver is able to throttle the sender Keeps the sender from overrunning the receiver From transmitting more data than the receiver is able to process Chapter 2 — Instructions: Language of the Computer