Presentation is loading. Please wait.

Presentation is loading. Please wait.

Data Link Layer - 3 Dr. Sanjay P. Ahuja, Ph.D.

Similar presentations


Presentation on theme: "Data Link Layer - 3 Dr. Sanjay P. Ahuja, Ph.D."— Presentation transcript:

1 Data Link Layer - 3 Dr. Sanjay P. Ahuja, Ph.D.
Fidelity National Financial Distinguished Professor of CIS School of Computing, UNF 1

2 Flow Control with Error Control
Two kinds of errors are considered: Lost frame: A frame fails to arrive. Damaged frame: A recognizable frame does arrive but some bits are in error. Error control is based on some or all of: Error detection (CRC). ACKs Retransmission after timeout. NAK and retransmission. Together these mechanisms are called Automatic Repeat Request (ARQ). There are 3 versions of ARQ in use: Stop and Wait ARQ Go-Back-n ARQ Selective Repeat ARQ

3 Stop and Wait ARQ Based on Stop and Wait Flow Control protocol.
Frames are alternatively labeled with 0 or 1. This allows for easy detection of duplicate frames at the receiver. Stop and Wait ARQ is advantageous due to its simplicity but it is also inefficient.

4 Go-Back-n ARQ Based on Sliding Window Protocol. The example below shows Go-Back-n ARQ for a 3-bit sequence # (i.e. window size = 7). If sender does not receive an ACK or a NAK within a specified time period, it retransmits all frames from the last ACK. If sender sends frame i and i+1 and i is lost but i+1 is received correctly but out of order, receiver sends a NAK i. It is not required that each individual frame be acknowledged. E.g. A sends frames 0,1,2,3 to B. B responds with ACK1 after frame 0, but does not respond to frames 1,2. After frame 3 is received, B sends ACK4.

5 Selective Repeat ARQ Based on Sliding Window Protocol. The example below shows Go-Back-n ARQ for a 3-bit sequence # (i.e. window size = 7). Frames 3,4,5 which were received after frame 2 (which was received in error) are buffered by the receiver but not acknowledged because acknowledging them would implicitly acknowledge frame 2 also. Sender resends frame 2 and then receiver sends ACK6 thereby acknowledging frames 2,3,4,5. This method is more complex than Go-Back-n and uses more storage at the receiver but it minimizes the number of retransmissions.

6 Go-Back-n Window Size Why, for Go-Back-n, if sequence number field is n bits wide (i.e. range of sequence numbers is 2n), then only a window size of 2n-1 is used and not 2n? Consider the scenario where window size = 2n (i.e. 8 if n=3 bits) A sends frame 0 to B. B receives it and sends ACK1 to A. A sends frames 1,2,3,4,5,6,7,0 to B. Assume B sends ACK1 to A. Now A does not know if this is a piggybacked ACK1 sent by B because all of its frames were lost and B is merely resending the old ACK1 or if this is a new ACK1 whereby B is acknowledging the frames just sent by A. The protocol fails! The solution is keep a maximum window size of 2n-1 to avoid this situation.


Download ppt "Data Link Layer - 3 Dr. Sanjay P. Ahuja, Ph.D."

Similar presentations


Ads by Google