Chi-Cheng Lin, Winona State University CS412 Introduction to Computer Networking & Telecommunication Data Link Layer Part II – Sliding Window Protocols.

Slides:



Advertisements
Similar presentations
Data Link Layer Protocols Flow Control in Data Link Layer.
Advertisements

Chapter 3: The Datalink Layer CS 455/555. Topics to be covered Design Issues Error detection and correction Elementary datalink protocols Sliding window.
By: Ashley Owens Chelsey James Dannielle Turmon. Protocols Consist of 1) Forward Channels(for data) 2)Reverse Channels(for acknowledgements)
Go-Back-N Improve Stop-and-Wait by not waiting!
Chapter 11 Data Link Control
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.
McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Chapter 11 Data Link Control and Protocols.
8-Reliability and Channel Coding Dr. John P. Abraham Professor UTPA.
The Data Link Layer 2 Chapter 3 CN5E by Tanenbaum & Wetherall, © Pearson Education-Prentice Hall and D. Wetherall, 2011 Data Link Layer Design Issues Error.
EEC-484/584 Computer Networks Lecture 12 Wenbing Zhao (Part of the slides are based on Drs. Kurose & Ross ’ s slides for their Computer.
Data Link Layer as a Reliable Data Transport Protocol Computer Networks Computer Networks Term B10.
Data Link Layer Review Advanced Computer Networks.
EEC-484/584 Computer Networks Lecture 14 Wenbing Zhao (Part of the slides are based on Drs. Kurose & Ross ’ s slides for their Computer.
EEC-484/584 Computer Networks Lecture 12 Wenbing Zhao (Part of the slides are based on Drs. Kurose & Ross ’ s slides for their Computer.
Networks: Data Link Layer1 Data Link Layer. Networks: Data Link Layer2 Data Link Layer Provides a well-defined service interface to the network layer.
Networks: Data Link Layer1 Data Link Layer. Networks: Data Link Layer2 Data Link Layer Provides a well-defined service interface to the network layer.
Computer Networks: Data Link Layer 1 Data Link Layer.
CMPE 150- Introduction to Computer Networks 1 CMPE 150 Fall 2005 Lecture 13 Introduction to Computer Networks.
EEC-484/584 Computer Networks Lecture 14 Wenbing Zhao (Part of the slides are based on Drs. Kurose & Ross ’ s slides for their Computer.
Networks: Data Link Layer1 Data Link Layer. Networks: Data Link Layer2 Data Link Layer Provides a well-defined service interface to the network layer.
EEC-484/584 Computer Networks Lecture 13 Wenbing Zhao (Part of the slides are based on Drs. Kurose & Ross ’ s slides for their Computer.
Networks: Data Link Layer1 Data Link Layer. Networks: Data Link Layer2 Data Link Layer Provides a well-defined service interface to the network 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:
CS3502: Data and Computer Networks DATA LINK LAYER - 2 WB version.
Data Link Control Protocols
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.
11.1 Chapter 11 Data Link Control Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Data Link Layer We have now discussed the prevalent shared channel technologies  Ethernet/IEEE  Wireless LANs (802.11) We have now covered chapters.
Chi-Cheng Lin, Winona State University CS 313 Introduction to Computer Networking & Telecommunication Data Link Layer Part I – Designing Issues and Elementary.
ICOM 6115©Manuel Rodriguez-Martinez ICOM 6115 – Computer Networks and the WWW Manuel Rodriguez-Martinez, Ph.D. Lecture 15.
11.1 Chapter 11 Data Link Control Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
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.
Copyright © Lopamudra Roychoudhuri
Computer Networks Lecture 3: Data Link - part II Based on slides from D. Choffnes Northeastern U. and P. Gill from StonyBrook University Revised Autumn.
CHAPTER-3 continues. Sliding Window Protocols previous protocols - data frames were transmitted in one direction In practical situations - need for transmitting.
Chapter 3: Channel Coding (part 3). Automatic repeat request (ARQ) protocols ▫Used in combination with error detection/correction ▫Block of data with.
Lecture Focus: Data Communications and Networking  Data Link Layer  Data Link Control Lecture 22 CSCS 311.
CS 453 Computer Networks Lecture 11 Layer 2 – Data Link Layer Protocols.
11.1 Flow and Error Control Flow Control Error Control.
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.
1 Flow&Error Control R. Supakorn. 2 Flow Control Flow control refers to a set of procedure used to restrict the amount of data that the sender can send.
1 Direct Link Networks: Reliable Transmission Sections 2.5.
CSCI 465 D ata Communications and Networks Lecture 11 Martin van Bommel CSCI 465 Data Communications & Networks 1.
1 The utopia protocol  Unrealistic assumptions: –processing time ignored –infinite buffer space available –simplex: data transmitted in one direction.
1 The Data Link Layer A. S. Tanenbaum Computer Networks W. Stallings Data and Computer Communications Chapter 3.
DATA LINK CONTROL. DATA LINK LAYER RESPONSIBILTIES  FRAMING  ERROR CONTROL  FLOW CONTROL.
Data Link Layer as a Reliable Data Transport Protocol Advanced Computer Networks Advanced Computer Networks Term D11.
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.
Chapter 3: The Data Link Layer –to achieve reliable, efficient communication between two physically connected machines. –Design issues: services interface.
Computer Communication & Networks
2.10 Flow and Error Control Before that ...
Reliable Transmission
Data Link Layer Flow Control.
Data Link Layer - 3 Dr. Sanjay P. Ahuja, Ph.D.
Part III Datalink Layer 10.
Instructor Mazhar Hussain
Data Link Layer.
Flow Control.
Flow and Error Control.
Overview Jaringan Komputer (2)
Data Link Layer as a Reliable Data Transport Protocol
CS412 Introduction to Computer Networking & Telecommunication
Data Link Layer (cont’d)
Chapter 11 Data Link Control
Data Link Layer (cont’d)
The Transport Layer Reliability
Presentation transcript:

Chi-Cheng Lin, Winona State University CS412 Introduction to Computer Networking & Telecommunication Data Link Layer Part II – Sliding Window Protocols

2 Part 2 - Topics l Sliding Window Protocols l Go Back N Sliding Window Protocol l Selective Repeat Sliding Window Protocol

3 Data Frame Transmission l Unidirectional in previous elementary protocols  Not general l Full-duplex - approach 1  Two separate communication channels  Forward channel for data  Reverse channel for acknowledgement  Problems: reverse channel bandwidth wasted cost

4 Data Frame Transmission l Full-duplex - approach 2  Same circuit for both directions  Data and acknowledgement are intermixed  How do we tell acknowledgement from data? "kind" field telling data or acknowledgement  Can it be improved? l Approach 3  Attaching acknowledgement to outgoing data frames  Piggybacking

5 Piggybacking l Temporarily delaying outgoing acknowledgement so that they can be hooked onto the next outgoing data frame l Advantage: higher channel bandwidth utilization l Complication:  How long to wait for a packet to piggyback?  If longer than sender timeout period then sender retransmit  Purpose of acknowledgement is lost

6 Piggybacking l Solution for timing complexion  If a new packet arrives quickly  Piggybacking  If no new packet arrives after a receiver timeout  Sending a separate acknowledgement frame

7 Sliding Window Protocol l We are going to study three bidirectional sliding window protocols  One-bit sliding window protocol  Go back N  Selective repeat l Differ in efficiency, complexity, and buffer requirements

8 Sliding Window Protocol l Each outbound frame contains an n-bit sequence number  Range: 0 - MAX_SEQ (MAX_SEQ = 2 n - 1)  For stop-and-wait, n = __. Why? l At any instance of time  Sender maintains a set of sequence numbers of frames permitted to send  These frames fall within sending window  Receiver maintains a set of sequence numbers of frames permitted to accept  These frames fall within receiving window

9 Sliding Window Protocol l Lower limit, upper limit, and size of two windows need not be the same l Fixed or variable size l Requirements  Packets delivered to the receiver's network layer must be in the same order that they were passed to the data link layer on the sending machine  Frames must be delivered by the physical communication channel in the order in which they were sent

10 Sending Window l Contains frames have been sent or can be sent but not yet acknowledged – outstanding frames l When a packet arrives from network layer  Next highest sequence number assigned  Upper edge of window advanced by 1 l When an acknowledgement arrives  Lower edge of window advanced by 1

11 Sending Window l If the maximum window size is n, n buffers is needed to hold unacknowledged frames l Window full (maximum window size reached)  shut off network layer

12 Receiving Window l Contains frames may be accepted l Frame outside the window  discarded l When a frame's sequence number equals to lower edge  Passed to the network layer  Acknowledgement generated  Window rotated by 1

13 Receiving Window l Contains frames may be accepted l Always remains at initial size (different from sending window) l Size  =1 means frames only accepted in order  >1 not so l Again, the order of packets fed to the receiver’s network layer must be the same as the order packets sent by the sender’s network layer

14 Actually, 1- bit sequence number is enough for this example. The purpose of using 3-bit is to demonstrate the idea of sliding window. In many books, an array of boxes are used to represent the window. A sliding window of size 1, with a 3-bit sequence number. (a) Initially. (b) After the first frame has been sent. (c) After the first frame has been received. (d) After the first acknowledgement has been received.

15 One Bit Sliding Window Protocol l Sending window size = receiving window size = 1 l Stop-and-wait l Refer to algorithm in Fig 3-14 l Acknowledgement = Sequence number of last frame received w/o error* l Problem of sender and receiver send simultaneously *: some protocols define the acknowledgement to be the sequence number expected to receive as in Forouzan’s

16 Try drawing the sending windows and receiving windows! (a) Case 1: Normal case. (b) Case 7: Abnormal case. The notation is (seq, ack, packet number). An asterisk indicates where a network layer accepts a packet. Case 7: simultaneous startCase 1: normal case

17 One Bit Sliding Window Protocol l Case 1: no error A B Time (0,1,A0) (0,0,B0) l Case 2: data lost A B Time X Timeout (1,0,A1) (1,1,B1) (0,1,A2) (0,0,B2) (0,1,A0) (0,0,B0) Try drawing the sending windows and receiving windows! * * * * * * * * Exp=0 Exp=1 Exp=0 Exp=1 Exp=0 Exp=1 Exp=0 Exp=1 Exp=0 Exp=1

18 One Bit Sliding Window Protocol l Case 4: ack. lost A B Time X Timeout l Case 3: data error A B Time Error Timeout (0,1,A0) (0,0,B0) (0,1,A0) (0,0,B0) duplicate, discarded Try drawing the sending windows and receiving windows! * * ** Exp=0 Exp=1 Exp=0 Exp=1

19 One Bit Sliding Window Protocol l Case 6: outgoing frame timeout A B Time Timeout l Case 5: early timeout A B Time Timeout (0,1,A0) (0,0,B0) 0,1,A0 1,1,A1 0,1,B0 Try drawing the sending windows and receiving windows! duplicate, discarded (0,0,B0) (1,0,A1) duplicate, discarded (1,1,B1) ACK 0 Exp=0 * * Exp=1 * * * Exp=0 * *

20 Performance of Stop-and-Wait Protocol l Assumption of previous protocols:  Transmission time is negligible  False, when transmission time is long l Example - satellite communication  channel capacity: 50 kbps, frame size: 1kb round-trip propagation delay: 500 msec  Time: t=0 start to send 1st bit frame t=20 msec frame sent completely t=270 msec frame arrives t=520 msec best case of ack. received  Sender blocked 500/520 = 96% of time  Bandwidth utilization 20/520 = 4% t

21 l If channel capacity = b, frame size = L, and round-trip propagation delay = R, then bandwidth utilization = _____ l Conclusion:  Long transit time + high bandwidth + short frame length  disaster Performance of Stop-and-Wait Protocol

22 l Solution: Pipelining  Allowing w frames sent before blocking l In our example, for 100% utilization  w = __, max window size = __  sequence number = __ bits l Problem: errors l Solutions  Go back n protocol (GNP)  Selective repeat protocol (SRP) Acknowledge n means frames n,n-1,n-2,… are acknowledged (i.e., received correctly) Performance of Stop-and-Wait Protocol

23 Go Back n Protocol l Receiver discards all subsequent frames following an error one, and send no acknowledgement for those discarded l Receiving window size = 1 (i.e., frames must be accepted in the order they were sent) l Sending window might get full  If so, re-transmitting unacknowledged frames l Wasting a lot of bandwidth if error rate is high

24 Go Back n Protocol

Control variables

Go-Back-N ARQ, normal operation In Forouzan’s book, an ACK n means “I am expecting frame n,” which is one off from Tanenbaum’s. To be consistent, I modified examples adopted from Forouzan’s book. When you read Forouzan’s book, be aware of the difference! 1 2

Go-Back-N ARQ, lost frame 1 2

28 Go Back n Protocol l What is the maximum sending window size? l Maximum sending window size of = MAX_SEQ, not MAX_SEQ+1  With n-bit sequence number, MAX_SEQ = 2 n – 1, maximum sending window size = 2 n - 1  e.g., for 3-bit window, MAX_SEQ = 7, so window size = 7 although max. size could be 8 l Why?

29 Go Back n Protocol - Window Size l Suppose 3-bit window is used and max sending window size = MAX_SEQ+1 = 8  Sender sends frames 0 through 7  Piggybacked ack 7 comes back  Sender sends anther 8 frames w/ sequence numbers 0 through 7  Another piggybacked ack 7 comes back  Q: Did all second 8-frames arrive successfully or did all of them get lost?  Ack 7 for both cases  Ambiguous  Max. window size = 7

Go-Back-N ARQ: sender window size

31 Go Back n Protocol Implementation l Sender has to buffer unacknowledged frames l Acknowledge n means frames n,n-1,n-2,... are acknowledged (i.e., received correctly) and those buffers can be released l One timer for each outstanding frame in sending window

32 Select Repeat Protocol l Receiver stores correct frames following the bad one l Sender retransmits the bad one after noticing l Receiver passes data to network layer and acknowledge with the highest number l Receiving window > 1 (i.e., any frame within the window may be accepted and buffered until all the preceding one passed to the network layer l Might need large memory

33 Negative Acknowledgement (NAK) l SRP is often combined with NAK l When error is suspected by receiver, receiver request retransmission of a frame  Arrival of a damaged frame  Arrival of a frame other than the expected l Does receiver keeps track of NAK? l What if NAK gets lost? l To nak, or not to nak: that is the question

34 Selective Repeat with NAK Nak 2, lost

Selective Repeat ARQ, sender and receiver windows

Selective Repeat ARQ, lost frame 1 What’s the new window here? What’s the ACK or NAK here? 0

37 Select Repeat Protocol Implementation l Receiver has a buffer for each sequence number within receiving window l Each buffer is associated with an "arrived" bit l Check whether sequence number of an arriving frame within window or not  If so, accept and store l Maximum window size = ? Can it be MAX_SEQ ?

38 Select Repeat Protocol - Window Size l Suppose 3-bit window is used and window size = MAX_SEQ = 7 sender receiver sent accepted 0 through 6 to network layer all acknowledgements lost 0 retransmitted 0 accepted acknowledgement 6 received 7 sent 7 accepted 7 and 0 to network layer

Selective Repeat ARQ, sender window size 0 0 1

40 Select Repeat Protocol - Window Size l Problem is caused by new and old windows overlapped l Solution  Window size=(MAX_SEQ+1)/2  E.g., if 4-bit window is used, MAX_SEQ = 15  window size = (15+1)/2 = 8 l Number of buffers needed = window size

41 Select Repeat Protocol (a) Initial situation with a window size seven. (b) After seven frames sent and received, but not acknowledged. (c) Initial situation with a window size of four. (d) After four frames sent and received, but not acknowledged.

42 Acknowledgement Timer l Problem  If the reverse traffic is light, effect?  If there is no reverse traffic, effect? l Solution  Acknowledgement timer: If no reverse traffic before timeout send separate acknowledgement  Essential: ack timeout < data frame timeout Why?