ECE 4450:427/527 - Computer Networks Spring 2017

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
ECE 4450:427/527 - Computer Networks Spring 2015
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.
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.
Networking. Protocol Stack Generally speaking, sending an message is equivalent to copying a file from sender to receiver.
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.
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.
Eighth Edition by William Stallings Chapter 7 – Data Link Control Protocols Data Link Control Protocols need layer of logic above Physical to manage exchange.
Transport Layer: Sliding Window Reliability
CS 453 Computer Networks Lecture 11 Layer 2 – Data Link Layer Protocols.
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 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.
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.
Powerpoint Templates Data Communication Muhammad Waseem Iqbal Lec # 15.
Protocols and layering Network protocols and software Layered protocol suites The OSI 7 layer model Common network design issues and solutions.
9. Principles of Reliable Data Transport – Part 1
Computer Communication & Networks
Reliable Transmission
Data Link Layer Flow Control.
Part III Datalink Layer 10.
Getting Connected (Chapter 2 Part 3)
Chapter 23 Introduction To Transport Layer
B. R. Chandavarkar CSE Dept., NITK Surathkal
10. Principles of Reliable Data Transport – Part 2
CMPT 371 Data Communications and Networking
Instructor Mazhar Hussain
Introduction of Transport Protocols
Flow Control.
Chapter 5 TCP Transmission Control
TCP - Part II Relates to Lab 5. This is an extended module that covers TCP flow control, congestion control, and error control in TCP.
Data Link Layer: Data Link Control
Flow and Error Control.
ECE 4450:427/527 - Computer Networks Spring 2017
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
TCP Sliding Windows, Flow Control, and Congestion Control
Presentation transcript:

ECE 4450:427/527 - Computer Networks Spring 2017 Dr. Nghi Tran Department of Electrical & Computer Engineering Lecture 5.3: Reliable Transmission Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

Link Layer: Five Common Problems Basic problem: you can’t just send IP datagrams over the link! We first consider how to encode bits into the signal at the source and recover bits at the receiving node Once it is possible to transmit bits, we need to figure out how to package these bits into FRAME Assume each node is able to recognize the collections of bits making up a frame, the third problem is to determine if those bits are in error: Error Detection and Correction If frames arriving at destination contain errors, how to recover from such losses: ARQ Final problem related to multiple-access link: how mediate access to a shared link so that all nodes have a chance to transmit: We focus on Ethernet Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

Discussions We have learned so far: Error Detection to detect errors in Frames Error Correction to correct errors in Frames But sometimes, errors are too severe to be corrected and corrupted frames must be discarded. Now we consider a link-level protocol to deal with this issue so that frames can be delivered reliably: A combination of two fundamental mechanisms: Acknowledgement (ACK) and Timeout – Automatic Repeat reQuest (ARQ). Error detection? Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

Acknowledgement 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. Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

Timeout 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). We now study different ARQ algorithms. We shall use generic language, i.e., do not give detail about header fields. Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

Stop-and-Wait 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 Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

Stop-and-Wait Protocol Let assume we transmit a frame. How many scenarios we can have with Stop-and-Wait? Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

Stop-and-Wait Protocol: Issue ACK is lost or arrives after timeout: what happen? Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

Stop-and-Wait Protocol: Issue How to deal with this issue: duplicate copies of frames will be delivered Use 1 bit sequence number (0 or 1) in the header 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) Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

Stop-and-Wait Protocol: Inefficiency How many outstanding frames on the link at a time? This may be far below the link’s capacity Consider a 1.5 Mbps link with a 45 ms RTT The link has a delay  bandwidth product of 67.5 Kb or approximately 8 KB Since the sender can send only one frame per RTT and assuming a frame size of 1 KB Maximum Sending rate Bits per frame  Time per frame = 1024  8  0.045 = 182 Kbps Or about one-eighth of the link’s capacity How can we use the link fully? Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

Sliding-Window Protocol Main idea: Leave up to N frames unacknowledged at any given time: Sender ready to send (N+1)th frame at the same moment ACK for the first frame arrives first packet bit transmitted sender receiver RTT last packet bit transmitted first packet bit arrives last packet bit arrives, send ACK ACK arrives, send next Packet Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

Sliding-Window Protocol Main idea: Leave up to N frames/packets unacknowledged at any given time: Sender ready to send (N+1)th frame at the same moment ACK for the first frame arrives sender receiver RTT last bit transmitted first packet bit arrives last packet bit arrives, send ACK ACK arrives, send next packet last bit of 2nd packet arrives, send ACK last bit of 3rd packet arrives, send ACK first packet bit transmitted Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

Sliding-Window Protocol Perhaps the best known algorithm in computer networking: Need to understanding it thoroughly!!! It can be used to serve different roles in different layers: Reliable delivery at Link Layer Flow control: managing the rate of data transmission between two nodes to prevent a fast sender from outrunning a slow receiver TCP: Also reliable deliver We shall consider those later on Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

Sliding-Window Protocol: Algorithm Sender assigns a sequence number denoted as SeqNum to each frame 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 Sender also maintains the following invariant LFS – LAR ≤ SWS Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

Sliding-Window Protocol Sliding Window on Sender Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

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? Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

Sliding-Window Protocol: Example first packet bit transmitted sender receiver RTT last bit transmitted first packet bit arrives last packet bit arrives, send ACK ACK arrives, send next packet last bit of 2nd packet arrives, send ACK last bit of 3rd packet arrives, send ACK Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

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 (and ACK to the sender) Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

Sliding-Window Protocol Receiver also maintains the following invariant LAF – LFR ≤ RWS Sliding Window on Receiver Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

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 Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

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 . This acknowledgement is said to be cumulative. The receiver then sets LFR = SeqNumToAck and adjusts LAF = LFR + RWS Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

Sliding-Window Protocol For example, suppose LFR = 5 and RWS = 4 ->LAF = 9 (i.e. the last ACK that the receiver sent was for seq. no. 5) 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 for some reason) Now Receiver Acknowledges Frame 8 and bumps LFR to 8 and LAF to 12 Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

Sliding-Window Protocol: Issues 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 Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

Sliding-Window Protocol: Issues Negative Acknowledgement (NAK) Receiver sends NAK for frame 6 as soon as frame 7 arrive (in the previous example) 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, but…..?? Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

Sliding-Window: Comment Settings In practice, how to select SWS? Depending on a quite number of factors (which?) Now for RWS: RWS=1: Go-back-N protocol. But what does this mean if RWS=1? Should we set RWS>SWS? RWS=SWS with Selective ACK: Selective Repeat Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

Maximum Sequence Number MaxSeqNum We already discussed Stop-and-Wait: We need only 1 bit-header: Two sequence numbers 0 and 1, and reuse them - MaxSeqNum=2; Now, for Sliding-Window Protocol: Should sequence numbers go to infinity? We have a finite sequence number: Example, 3-bit header: 8 sequences Need to reuse or wrap around So how we select MaxSeqNum? Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

Maximum Sequence Number MaxSeqNum 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 1, 2, 3, 4, 5, 6, 7,8 RWS = SWS = 7 Sender sends 1, 2, …, 7 Receiver receives 1, 2, … ,7 Receiver acknowledges 1, 2, …, 7 ACK (1, 2, …, 7) are lost Sender retransmits 1, 2, …, 7 Receiver is expecting 8, 1, …., 6 Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

Maximum Sequence Number MaxSeqNum To avoid this, If RWS = SWS SWS < (MaxSeqNum + 1)/2 Note that this rule is specific to the situation where RWS=SWS. We might see a more general rule for arbitrary values of RWS and SWS in assignment Also, at this moment, we assume frames are not re-ordered in transit, which is ony correct for direct point to point. For different environment, we need another rule (e.g., in TCP). Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

Sliding Window Protocol: Summary Sender maintains three variables Sending Window Size (SWS) Last Acknowledgement Received (LAR) Last Frame Sent (LFS) Sender also maintains the following invariant LFS – LAR ≤ SWS When ACK arrives Move LAR to right, transmit another frame Retransmit frame if time expires (time out) Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

Sliding-Window Protocol: Summary Receiver maintains three variables Receiving Window Size (RWS) Largest Acceptable Frame (LAF) Last Frame Received (LFR) Receiver also maintains the following invariant LAF – LFR ≤ RWS When a frame with sequence number SeqNum arrives, only accept it if If LFR < SeqNum ≤ LAF ACK? SeqNumToAck : 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 then sets LFR = SeqNumToAck and adjusts LAF = LFR + RWS Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

Sliding-Window Protocol: Example 1 Considering the case that SWS=RWS=3. Timeout interval is about 2RTT. Draw a timeline diagram of the following Frame 4 is lost Frames 4-6 are lost Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

Sliding-Window Protocol: Issues 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 Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

Sliding-Window Protocol: Issues Negative Acknowledgement (NAK) Receiver sends NAK for frame 6 as soon as frame 7 arrive (in the previous example) 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, but…..?? Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

Sliding-Window Protocol: Example 2 In the following example, we will see the efficiency of using NAK or additional ACK Considering the case that SWS=RWS=4 and frame 2 is lost. Timeout interval is about 2RTT. First, draw a timeline diagram with re-transmission taking place upon time out as usual Now, assume NAK[2]/DUPACK[2] is sent after frame 3 is received. Re-transmission now take paces either upon time out or upon receipt of NAK[2]/DUPACK[2] Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

Sliding-Window: Comment Settings In practice, how to select SWS? Depending on a quite number of factors!! Now for RWS: RWS=1: Go-back-N protocol Should we set RWS>SWS? RWS=SWS with Selective ACK: Selective Repeat Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

Go-Back-N Protocol It is Sliding Window Protocol with RWS=1: Receiver will not buffer any frames that arrive out of order Demo: http://media.pearsoncmg.com/aw/aw_kurose_network_4/applets/go-back-n/index.html Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

Selective Repeat Window size can be very large for nets with large delay x bandwidth Inefficient to retransmit all N frames if one is lost Selective repeat allows the re-transmission of only the lost packets Accepts out-of-order packets Simply increase the RWS up to SWS (does not make sense to allow for RWS > SWS) Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

Example with Selective Repeat Demo: http://media.pearsoncmg.com/aw/aw_kurose_network_4/applets/SR/index.html Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

Sliding-Window Protocol Perhaps the best known algorithm in computer networking Serves three different roles Reliable Preserve the order: 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 sender- Keeps sender from overrunning receiver from transmitting more data than the receiver is able to process Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527

Sliding-Window Protocol Perhaps the best known algorithm in computer networking It can be used to serve different roles in different layers: Reliable delivery at Link Layer TCP: Also reliable deliver Up to now, we already learned quite a few techniques/protocols considered in Transport Layer Dr. Nghi Tran (ECE-University of Akron) ECE 4450:427/527