Jaimin chp-3 - data-link layer- 2011 batch

Jaimin Jani
Jaimin JaniAssistant Professor
Chapter 3 The Data Link Layer
Data Link Layer Design Issues ,[object Object],[object Object],[object Object],[object Object]
Functions of the Data Link Layer ,[object Object],[object Object],[object Object],[object Object]
Services Provided to Network Layer (2) ,[object Object]
Types of services provided to the Network Layer ,[object Object],[object Object],[object Object]
(1)  Unacknowledged Connectionless service ,[object Object],[object Object],[object Object]
(2)  Acknowledged Connectionless service ,[object Object],[object Object],[object Object],[object Object]
(3) Acknowledged Connection-oriented service ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Data Link Layer Design Issues ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Services Provided to Network Layer  (1) ,[object Object],Virtual communication. Actual communication.
Services Provided to Network Layer (2) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Services Provided to Network Layer (3) ,[object Object],[object Object],[object Object],[object Object],[object Object]
Services Provided to Network Layer (4) ,[object Object],[object Object],[object Object],[object Object]
Different  methods of Framing  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Framing -  Character Count ,[object Object],[object Object],[object Object],[object Object],   Without errors    With one error
Framing -  Character Count ,[object Object]
Problem with Framing with CC ,[object Object],[object Object],[object Object],[object Object]
Coding: Character Count
 
Framing - Byte Stuffing
Framing  - Byte Stuffing ,[object Object],[object Object]
Framing - Byte Stuffing - Continue ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Framing with byte stuffing ,[object Object],[object Object],[object Object]
Coding: Byte Stuffing
 
 
Framing - Bit Stuffing
Framing  - Bit Stuffing ,[object Object],[object Object],[object Object],[object Object]
Coding: Bit Stuffing
 
 
Framing -  Encoding Violations
Framing  ,[object Object],[object Object],[object Object],[object Object],[object Object]
Error Control  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Error detection and error correction  ,[object Object],[object Object],[object Object],[object Object],[object Object],m  bits n  = ( m + r  )  bit  codeword r  bits redundancy Messages (frames)  data
[object Object],[object Object],[object Object],Error Detection and Correction
1 Types of Errors ,[object Object],[object Object]
2 Detection ,[object Object]
(normally implemented in link layer) (used primarily by upper layers) 3 common error detection techniques Parity Check Cyclic Redundancy Check (CRC) Checksum (most basic)
Parity check: 2 method ,[object Object],[object Object],[object Object]
Parity : 2 type ,[object Object],[object Object]
Parity Check ,[object Object],[object Object],[object Object]
Data  #1's in data  P  Total # 1's (data and P)  0110110  4 (Even)  0  4 (Even)  0011111  5 (Odd)  1  6 (Even)  0000000  0 (Even)  0  0 (Even)  1010100  3 (Odd)  1  4 (Even)  1111111  7 (Odd)  1  8 (Even)  Even Parity Generator
 
What is VRC and LRC? VRC  is  Character Parity LRC  is  Block Parity
 
[object Object],[object Object],[object Object],[object Object],Horizontal parity  Vertical parity  H 1 D 1m … . D 12 D 11 H 2 D 2m … . D 22 D 21 .. .. … .. H n D nm … . D n2 D n1 V m+1 V m … V 2 V 1
[object Object]
Example 1 Even Parity Suppose the sender wants to send the word  world . In ASCII the five characters are coded as  1110111  1101111  1110010  1101100  1100100 The following shows the actual bits sent 1110111 0   1101111 0   1110010 0   1101100 0   1100100 1
Example 2 Even Parity  Now suppose the word world in Example 1 is received by the receiver without being corrupted in transmission.  11101110  11011110  11100100  11011000  11001001 The receiver counts the 1s in each character and comes up with even numbers (6, 6, 4, 4, 4). The data are accepted.
Example 3 Even Parity  Now suppose the word world in Example 1 is corrupted during transmission.  11111110  11011110  11101100  11011000  11001001 The receiver counts the 1s in each character and comes up with even and odd numbers (7, 6, 5, 4, 4). The receiver knows that the data are corrupted, discards them, and asks for retransmission.
VRC Performance ,[object Object],[object Object],[object Object]
VRC Coding
Sender Site: Main File Which define VRC  procedure   Page - 1
Receiver Site: Main File Which define VRC  procedure   Page - 1
L ONGITUDINAL  R EDUNDANCY  C HECK (LRC) IN longitudinal redundancy check LRC, a block of bits is divided into rows and a redundant row of bits is added to the whole block
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
e.g. problem in LRC ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Performance of LRC ,[object Object],[object Object],[object Object]
Coding: LRC
Sender Site: Main File Which define LRC  procedure  Page -1
Sender Site: Main File Which define LRC  procedure  Page -2
Receiver Site: Main File Which define LRC  procedure  Page -1
Receiver Site: Main File Which define LRC  procedure  Page -2
Checksum
Checksum ,[object Object],[object Object],[object Object],Ethernet frame
Checksum generator ,[object Object],[object Object],[object Object],[object Object],[object Object]
Data unit and checksum
Checksum checker ,[object Object],[object Object],[object Object]
The sender follows these steps: ,[object Object],[object Object],[object Object],[object Object]
The receiver follows these steps ,[object Object],[object Object],[object Object],[object Object]
Example 6 Suppose the following block of 16 bits is to be sent using a checksum of 8 bits.  10101001  00111001  The numbers are added using one’s complement 10101001  00111001   ------------ Sum   11100010 Checksum  00011101 The pattern sent is  10101001  00111001  00011101
Example 7 Now suppose the receiver receives the pattern sent in Example 6 and there is no error.  10101001  00111001  00011101 When the receiver adds the three sections, it will get all 1s, which, after complementing, is all 0s and shows that there is no error.  10101001 00111001  00011101  ------------ Sum 11111111  Complement  00000000   means that the pattern is OK.
Example 8 Now suppose there is a burst error of length 5 that affects 4 bits.  Original data  10101001  00111001  00011101 Corrupted data  10101 111  11 111001  00011101 When the receiver adds the three sections, it gets  10101111 11111001  00011101  Partial Sum  1  11000101 Carry   1 Sum 11000110  Complement  00111001   the pattern is corrupted.
 
 
Coding:  Checksum
Sender Site: Main File Which define Checksum  procedure  Page - 1
Receiver Site: Main File Which define Checksum  procedure  Page - 1
Sender Site: Main File Which define Checksum  procedure  Page - 3
Hamming Code
Error Correction ,[object Object],[object Object],[object Object],[object Object]
Data and redundancy bits To calculate the no. of redundancy bits  use : 2 r   ≥ m + r + 1 Number of data bits m Number of  redundancy bits r Total  bits m + r 1 2 3 2 3 5 3 3 6 4 3 7 5 4 9 6 4 10 7 4 11
Positions of redundancy bits in Hamming code (11,7) * Check bits occupy positions that are powers of 2 In the Hamming code, each r bit is the VRC bit for one combination of data bits: r 1  is the VRC bit for one combination of data bits,  r 2  is the VRC bit for another combination of data bits, and so on. The combinations used to calculate each of the four r values for a seven-bit data sequence are as follows: r 1  :  bits 1, 3, 5, 7, 9, 11 r 2  :  bits 2, 3, 6, 7, 10, 11 r 4  :  bits 4, 5, 6, 7 r 5  :  bits 8, 9, 10,  11
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Redundancy bits calculation
r 1  will take care of these bits d d d d d d d r 1 r 2 r 4 r 8 0001 0101 1011 0111 0011 1001 11 9 7 5 3 1
r 2  will take care of these bits 0010 0011 0110 0111 1010 1011 11 10 7 6 3 2 d d d d d d d r 1 r 2 r 4 r 8
r 4  will take care of these bits 0110 0111 0101 0100 7 6 4 5 d d d d d d d r 1 r 2 r 4 r 8
r 8  will take care of these bits 1000 1001 1010 1011 11 10 9 8 d d d d d d d r 1 r 2 r 4 r 8
Example of redundancy bit calculation
Single-Bit Error
Error  Detection Error detection using Hamming code
Example Question The data is 1011011 Add the parity bit.  ??????????????? Consider the transmitted data to be 001 0 101 0 1 11 . Show how the error bit position is determined ???????????????
[object Object],[object Object],[object Object],[object Object],101 0 101 0 1 11 1011 = 11
Error detection and error correction (2) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Hamming Codes ,[object Object],[object Object],[object Object]
Calculating a Hamming Code ,[object Object],[object Object],[object Object],[object Object]
Hamming Code Example Message to be sent: 1 0 1 1 1  0  1  1 1  2  3  4  5  6  7 2 0   2 1   2 2 2 n :  check bits Position
 
Hamming Code Example 1 Starting with the 2 0  position: Look at positions with 1’s  in them Count the number of 1’s in the corresponding message bits If even, place a 1 in the 2 0 check bit, i.e., use odd parity Otherwise, place a 0 Calculate check bits: 3  =  2 1  + 2 0   =  0  1  1 5  =  2 2   + 2 0   =  1  0  1 6  =  2 2  + 2 1  +  =  1  1  0 7  =  2 2  + 2 1  + 2 0   =  1  1  1 Message to be sent: 1 0 1 1 1  0  1  1 1 2  3  4  5  6  7 2 0  2 1   2 2 2 n : check bits Position
Hamming Code Example Repeat with the 2 1  position: Look at positions those  positions with 1’s in them Count the number of 1’s in the corresponding message bits If even, place a 1 in the 2 1 check bit Otherwise, place a 0 1 0 Calculate check bits: 3  =  2 1  + 2 0   =  0  1  1 5  =  2 2   + 2 0   =  1  0  1 6  =  2 2  + 2 1  +  =  1  1  0 7  =  2 2  + 2 1  + 2 0   =  1  1  1 Message to be sent: 1 0 1 1 1  0  1  1 1  2  3  4  5  6  7 2 0   2 1   2 2 2 n : check bits Position
Hamming Code Example 1 0 Repeat with the 2 2  position: Look at positions those  positions with 1’s in them Count the number of 1’s in the corresponding message bits If even, place a 1 in the 2 2 check bit Otherwise, place a 0 1 Calculate check bits: 3  =  2 1  + 2 0   =  0  1  1 5  =  2 2   + 2 0   =  1  0  1 6  =  2 2  + 2 1  +  =  1  1  0 7  =  2 2  + 2 1  + 2 0   =  1  1  1 Message to be sent: 1 0 1 1 1  0  1  1 1  2  3  4  5  6  7 2 0   2 1   2 2 2 n : check bits Position
Hamming Code Example ,[object Object],[object Object],[object Object]
Using Hamming Codes to Correct Single-Bit Errors Received message: 1 0 1 1 0 0 1 2 n : check bits Calculate check bits: 3  =  2 1  + 2 0   =  0  1  1 5  =  2 2   + 2 0   =  1  0  1 6  =  2 2  + 2 1   =  1  1  0 7  =  2 2  + 2 1  + 2 0   =  1  1  1 1  0  1  1  0  0  1 1  2  3  4  5  6  7 2 0   2 1   2 2 Position
Using Hamming Codes to Correct Single-Bit Errors Starting with the 2 0  position: Look at positions with 1’s  in them Count the number of 1’s in  both the corresponding  message bits and the 2 0  check  bit and compute the parity. If even parity, there is an error in one of the four bits that were checked.  Odd parity: No error in bits 1, 3, 5, 7 Received message: 1 0 1 1 0 0 1 2 n : check bits Calculate check bits: 3  =  2 1  + 2 0   =  0  1  1 5  =  2 2   + 2 0   =  1  0  1 6  =  2 2  + 2 1   =  1  1  0 7  =  2 2  + 2 1  + 2 0   =  1  1  1 1  0  1  1  0  0  1 1  2  3  4  5  6  7 2 0   2 1   2 2 Position
Using Hamming Codes to Correct Single-Bit Errors Repeat with the 2 1  position: Look at positions with 1’s  in them Count the number of 1’s in  both the corresponding  message bits and the 2 1  check  bit and compute the parity. If even parity, there is an error in one of the four bits that were checked.  Even parity: ERROR in bit 2, 3, 6 or 7! Received message: 1 0 1 1 0 0 1 2 n : check bits Calculate check bits: 3  =  2 1  + 2 0   =  0  1  1 5  =  2 2   + 2 0   =  1  0  1 6  =  2 2  + 2 1   =  1  1  0 7  =  2 2  + 2 1  + 2 0   =  1  1  1 1  0  1  1  0  0  1 1  2  3  4  5  6  7 2 0   2 1   2 2 Position
Using Hamming Codes to Correct Single-Bit Errors Repeat with the 2 2  position: Look at positions with 1’s  in them Count the number of 1’s in  both the corresponding  message bits and the 2 2  check  bit and compute the parity. If even parity, there is an error in one of the four bits that were checked.  Even parity: ERROR in bit 4, 5, 6 or 7! Received message: 1 0 1 1 0 0 1 2 n : check bits Calculate check bits: 3  =  2 1  + 2 0   =  0  1  1 5  =  2 2   + 2 0   =  1  0  1 6  =  2 2  + 2 1   =  1  1  0 7  =  2 2  + 2 1  + 2 0   =  1  1  1 1  0  1  1  0  0  1 1  2  3  4  5  6  7 2 0   2 1   2 2 Position
Finding the error’s location 1  0  1  1  0  0  1 1  2  3  4  5  6  7 Position
Finding the error’s location No error in bits 1, 3, 5, 7 1  0  1  1  0  0  1 1  2  3  4  5  6  7 Position
Finding the error’s location ERROR in bit 2, 3, 6 or 7 ERROR in bit 4, 5, 6 or 7 Error must be in bit 6 because bits 3, 5, 7 are correct, and all the remaining information agrees on bit 6 erroneous bit, change to 1 1  0  1  1  0  0  1 1  2  3  4  5  6  7 Position
Finding the error’s location An Easier Alternative to the Last Slide 3  =  2 1  + 2 0   =  0  1  1 5  =  2 2   + 2 0   =  1  0  1 6  =  2 2  + 2 1   =  1  1  0 7  =  2 2  + 2 1  + 2 0   =  1  1  1 E E NE 1 1 0 = 6 E = error in column NE = no error in column
Hamming Codes ,[object Object],[object Object],[object Object]
Hamming Code : In short  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],P 1 P 2 D 3 P 4 D 5 D 6 D 7 P 8 D 9 … .
Hamming Code : In short  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],   send: 110 0 1 10 Error
Hamming Code : In short  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],g=2 r 2 r  -1>=D+r P 1 P 2 D 3 P 4 D 5 … … P g
Hamming Code :  Correct burst errors ,[object Object],[object Object],[object Object],[object Object]
Coding: Hamming Code
Sender Site: Main File Which define Hamming Code  procedure  Page - 1
Sender Site: Main File Which define Hamming Code  procedure  Page - 2
Receiver Site: Main File Which define Hamming Code  procedure  Page - 1
Receiver Site: Main File Which define Hamming Code  procedure  Page - 2
Receiver Site: Main File Which define Hamming Code  procedure  Page - 3
CRC
Error detection and error correction (3) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Parity bit Messages (frames)  data
Error detection and error correction (4) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],CRC bits Messages (frames)  data
CRC ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
CRC generator and checker ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Division in CRC encoder
Division in the CRC decoder for two cases
CRC ,[object Object],[object Object],[object Object],[object Object],[object Object]
A polynomial representing a divisor
Standard polynomials Name Polynomial Application CRC-8 x 8  +   x 2  +   x   +  1 ATM header CRC-10 x 10   +   x 9  +   x 5  +   x 4  +   x  2   +  1 ATM AAL ITU-16 x 16   +   x 12   +   x 5  +  1 HDLC ITU-32 x 32   +   x 26  +   x 23   +   x 22   +   x 16   +   x 12   +   x 11   +   x 10   +  x 8  +   x 7   +   x 5   +   x 4   +   x 2   +   x  +  1 LANs
Error detection and error correction (5) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Error detection and error correction (6) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Error detection and error correction (7) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
CRC Polynomial Codes ,[object Object],[object Object],[object Object],[object Object],[object Object]
Cyclic Redundancy Check ,[object Object],[object Object],[object Object],[object Object],[object Object]
Generating a CRC Example Message :  1011 1  x  x 3  + 0  x  x 2  + 1  x  x + 1  = x 3  + x + 1   Code Polynomial :  x 2  + 1  (101) Step 1 :  Compute  S(x) r =  2 S(x)  = 101100
Generating a CRC Example   (cont’d) Step 2 :  Modulo 2 divide Remainder 101100 101 101 001 000 010 000 100 101 01 1001
Generating a CRC Example   (cont’d) Step 3 :  Modulo 2 subtract the remainder from  S(x) 101100 -  01 101101 Checksummed Message
Decoding a CRC ,[object Object],[object Object],[object Object]
Decoding a CRC Example 101101 Checksummed message ( n  = 6) 1011 Original message (if there are no errors) Remainder = 0 (No error detected) 101101 101 101 001 000 010 000 101 101 00 1001
Decoding a CRC Another Example ,[object Object],Remainder = 1 (Error detected) 101001 101 101 000 000 000 000 001 000 01 1000
Choosing a CRC polynomial ,[object Object],[object Object],[object Object],[object Object],[object Object]
Coding :  CRC
Sender Site: Main File Which define CRC procedure  Page - 1
Sender Site: Main File Which define CRC procedure  Page - 2
Receiver Site: Main File Which define CRC procedure  Page - 1
 
 
Flow control  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
 
NOISELESS CHANNELS Let us first assume we have an ideal channel in which no frames are lost, duplicated, or corrupted. We introduce two protocols for this type of channel. Protocol 1: Simplest Protocol Protocol 2: Stop-and-Wait Protocol Topics discussed in this section:
  Protocol 1 :   Design , Implementation and Coding   of    Simplest  Protocol
Protocol 1 :  The design of the  simplest protocol  with no flow or error control
Figure  Flow diagram for Example
11. Algorithm 1   Sender-site  algorithm for the  simplest protocol
11. Algorithm 1   Receiver-site  algorithm for the  simplest protocol
Data Link Layer protocols (1) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Coding : Protocol1(Utopia) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
  Protocol 2 :   Design , Implementation and Coding   of    Stop-and-Wait Protocol
11. Protocol 2 :  Design of  Stop-and-Wait Protocol
11. Algorithm 2   Sender-site algorithm for  Stop-and-Wait Protocol
11. Algorithm 2  Receiver-site  algorithm for  Stop-and-Wait Protocol
11. Figure shows an example of communication using this protocol. It is still very simple.  The sender sends one frame and waits for feedback from the receiver.  When the ACK arrives, the sender sends the next frame.  Note that sending two frames in the protocol involves the sender in four events and the receiver in two events. Example
11. Figure  Flow diagram for Example
Coding : Protocol2(Stop-and-wait) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Flow control:  Drop the ability of receiving from network layer unrestricted
11. NOISY CHANNELS Although the Stop-and-Wait Protocol gives us an idea of how to add flow control to its predecessor, noiseless channels are nonexistent. We discuss three protocols in this section that use error control. Protocol 3: Stop-and-Wait ARQ (Automatic Repeat Request) Protocol 4:  Go-Back-N ARQ (Automatic Repeat Request) Protocol 5: Selective Repeat ARQ (Automatic Repeat Request) Topics discussed in this section:
Protocol 3 :   Design , Implementation and Coding  of    Stop-and-Wait ARQ (Automatic Repeat Request)
Error correction in Stop-and-Wait ARQ is done by  keeping a copy of the sent frame and retransmitting of the frame when the timer expires. Note
In Stop-and-Wait ARQ, we use sequence numbers to number the frames. The sequence numbers are based on  modulo-2 arithmetic . Note
In Stop-and-Wait ARQ, the acknowledgment number always announces in modulo-2 arithmetic the sequence number of the next frame expected. Note
Protocol 3 :  Design of the  Stop-and-Wait ARQ  Protocol
Algorithm 3   Sender-site   algorithm for  Stop-and-Wait ARQ (continued)
Algorithm 3   Sender-site  algorithm for  Stop-and-Wait ARQ (continued)
Algorithm 3   Receiver-site  algorithm for  Stop-and-Wait ARQ Protocol
11. Figure  shows an example of  Stop-and-Wait ARQ .  Frame 0 is sent and acknowledged.  Frame 1 is lost and resent after the time-out.  The resent frame 1 is acknowledged and the timer stops. Frame 0 is sent and acknowledged, but the acknowledgment is lost.  The sender has no idea if the frame or the acknowledgment is lost, so after the time-out, it resends frame 0, which is acknowledged. Example
11. Figure  Flow diagram for above Example
Protocol3( Stop and Wait with ARQ) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Protocol3(ARQ) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Coding:  Protocol3(Stop-n-Wait  ARQ) Sender Site   A Simplex Protocol for a Noisy Channel (3) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Coding:  Protocol3(Stop-n-Wait  ARQ) Receiver Site ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
11. Stop-and-Wait ARQ is a special case of Go-Back-N ARQ in which the size of the send window is 1. Note
Efficiency of 1-bit sliding window protocol
Protocols (4) 1 bit Sliding Window - Stop-and-wait ,[object Object],Host A  Host B  ( seq ,  ack ,  packet number ) *=Accepted: To network layer
Sliding Window Protocols  - Stop-and-wait ,[object Object],[object Object],Always, frames receive in order Host A  Host B  ( seq ,  ack ,  packet number ) *=Accepted: To network layer
Sliding Window Protocols  - Stop-and-wait ,[object Object],[object Object],Line utilization = 20/520=3.85% !!    sender is blocked 96.15% of time ! Sender Receiver first packet bit transmitted, t = 0 500   first packet bit arrives:  500/2=250   ACK arrives:  500+20=520 last packet bit transmitted, t =  20 500/2=250   500/2=250   1000 bits/50,000 bps=20 msec
Sliding Window Protocols  Reason:  sender can only have one unACKed frame outstanding. This cause the problem only when  R  is more larger than  L/B   first packet bit transmitted, t = 0 R last packet bit transmitted,  t = L / B first packet bit arrives last packet bit arrives, send ACK ACK arrives, send next  packet,  t = R + L / B Sender Receiver U sender = L / B R + L / B = L RB + L
Sliding Window Protocols  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Sliding Window Protocols  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Protocols  4 : Design, Implementation and Coding  of  Sliding Window Protocol
Protocols  4 :Sliding Window ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Sliding Window Protocols  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Sliding Window Protocols  ,[object Object],[object Object],[object Object],[object Object],[object Object]
Sliding Window Protocols  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Sliding Window Protocols  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Sliding Window Protocols  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Sliding Window Protocols (13)- Go-Back-N ,[object Object],[object Object],[object Object]
In the Go-Back-N Protocol, the sequence numbers are modulo 2 m , where m is the size of the sequence number field in bits. Note
Figure  Send window  for  Go-Back-N ARQ
The send window is an abstract concept defining an imaginary box of size 2 m  − 1 with three variables: Sf, Sn, and S size . Note
The send window can slide one or more slots when a valid acknowledgment arrives. Note
Figure  Receive window  for  Go-Back-N ARQ
The receive window is an abstract concept defining an imaginary box  of size 1 with one single variable  R n .  The window slides when a correct frame has arrived; sliding occurs one slot at a time. Note
11. Figure  Design  of  Go-Back-N ARQ
11. Figure  Window size for Go-Back-N ARQ
In Go-Back-N ARQ, the size of the send window must be less than 2 m ; the size of the receiver window  is always 1. Note
Algorithm 4   Go-Back-N sender algorithm (continued)
Algorithm 4   Go-Back-N sender algorithm  (continued)
Algorithm 4   Go-Back-N receiver algorithm
Example  Figure shows an example of Go-Back-N. This is an example of a case where the forward channel is reliable, but the reverse is not. No data frames are lost, but some ACKs are delayed and one is lost. The example also shows how cumulative acknowledgments can help if acknowledgments are delayed or lost. After initialization, there are seven sender events. Request events are triggered by data from the network layer; arrival events are triggered by acknowledgments from the physical layer. There is no time-out event here because all outstanding frames are acknowledged before the timer expires. Note that although ACK 2 is lost, ACK 3 serves as both ACK 2 and ACK 3.
Figure  Flow diagram for Example
Figure  shows what happens when a frame is lost. Frames 0, 1, 2, and 3 are sent. However, frame 1 is lost. The receiver receives frames 2 and 3, but they are discarded because they are received out of order. The sender receives no acknowledgment about frames 1, 2, or 3. Its timer finally expires. The sender sends all outstanding frames (1, 2, and 3) because it does not know what is wrong. Note that the resending of frames 1, 2, and 3 is the response to one single event. When the sender is responding to this event, it cannot accept the triggering of other events. This means that when ACK 2 arrives, the sender is still busy with sending frame 3.  Example
The physical layer must wait until this event is completed and the data link layer goes back to its sleeping state. We have shown a vertical line to indicate the delay. It is the same story with ACK 3; but when ACK 3 arrives, the sender is busy responding to ACK 2. It happens again when ACK 4 arrives. Note that before the second timer expires, all outstanding frames have been sent and the timer is stopped. Example  (continued)
Figure  Flow diagram for Example
Stop-and-Wait ARQ is a special case of Go-Back-N ARQ in which the size of the send window is 1. Note
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Protocols  4 : Design, Implementation and Coding  of  Selective Repeat
In Selective Repeat ARQ, the size of the sender and receiver window must be at most one-half of 2 m . Note
Algorithm  Sender-site   Selective Repeat  algorithm (continued)
Algorithm  Sender-site Selective Repeat  algorithm (continued) (continued)
Algorithm  Sender-site Selective Repeat algorithm (continued)
11. Algorithm 11.10   Receiver-site Selective Repeat algorithm
11. Algorithm 11.10   Receiver-site Selective Repeat algorithm
11. Figure 11.22  Delivery of data in Selective Repeat ARQ
11. This example is similar to Example 11.3 in which frame 1 is lost. We show how Selective Repeat behaves in this case. Figure 11.23 shows the situation. One main difference is the number of timers. Here, each frame sent or resent needs a timer, which means that the timers need to be numbered (0, 1, 2, and 3). The timer for frame 0 starts at the first request, but stops when the ACK for this frame arrives. The timer for frame 1 starts at the second request, restarts when a NAK arrives, and finally stops when the last ACK arrives. The other two timers start when the corresponding frames are sent and stop at the last arrival event. Example 11.8
11. At the receiver site we need to distinguish between the acceptance of a frame and its delivery to the network layer. At the second arrival, frame 2 arrives and is stored and marked, but it cannot be delivered because frame 1 is missing. At the next arrival, frame 3 arrives and is marked and stored, but still none of the frames can be delivered. Only at the last arrival, when finally a copy of frame 1 arrives, can frames 1, 2, and 3 be delivered to the network layer. There are two conditions for the delivery of frames to the network layer: First, a set of consecutive frames must have arrived. Second, the set starts from the beginning of the window.  Example 11.8 (continued)
11. Another important point is that a NAK is sent after the second arrival, but not after the third, although both situations look the same. The reason is that the protocol does not want to crowd the network with unnecessary NAKs and unnecessary resent frames. The second NAK would still be NAK1 to inform the sender to resend frame 1 again; this has already been done. The first NAK sent is remembered (using the nakSent variable) and is not sent again until the frame slides. A NAK is sent once for each window position and defines the first slot in the window. Example 11.8 (continued)
11. The next point is about the ACKs. Notice that only two ACKs are sent here. The first one acknowledges only the first frame; the second one acknowledges three frames. In Selective Repeat, ACKs are sent when data are delivered to the network layer. If the data belonging to n frames are delivered in one shot, only one ACK is sent for all of them. Example 11.8 (continued)
11. Figure 11.23  Flow diagram for Example 11.8
11. Figure 11.24  Design of piggybacking in Go-Back-N ARQ
Sliding Window Protocols (14)- Selective-Repeat ,[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Protocol Verification ,[object Object],[object Object],[object Object],[object Object]
Example Data Link Protocols ,[object Object],[object Object]
Hamming Codes : for ED n EC ,[object Object],[object Object],[object Object]
HD of a coding scheme ,[object Object],[object Object],[object Object],[object Object],[object Object]
HD of a list of legal codewords ,[object Object],[object Object]
Use of HD for error detection ,[object Object],[object Object]
Continued… ,[object Object],[object Object],[object Object],[object Object]
Continued… ,[object Object],[object Object]
Use of HD for error correction ,[object Object],[object Object],[object Object],[object Object]
Continued.. ,[object Object],[object Object]
Continue… ,[object Object],[object Object]
Hamming Code to correct one bit errors ,[object Object],[object Object]
Continued… ,[object Object],[object Object],[object Object],[object Object]
Error-Correcting Codes ,[object Object]
Error detecting code ,[object Object]
CRC ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Error-Detecting Codes Calculation of the polynomial code checksum.
CRC contd.. ,[object Object],[object Object],[object Object],[object Object]
CRC ,[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object]
G(x) = a general polyn of degree r ,[object Object],[object Object],[object Object],[object Object]
Detecting single burst of length k <=r with a gen polyn of degree r ,[object Object],[object Object],[object Object]
IEEE 802 LANs use  ,[object Object],[object Object],[object Object],[object Object]
Elementary Data Link Protocols ,[object Object],[object Object],[object Object]
Protocol Definitions Continued   Some definitions needed in the protocols to follow.  These are located in the file protocol.h.
Protocol  Definitions (ctd.) Some definitions needed in the protocols to follow.  These are located in the file protocol.h.
Unrestricted  Simplex  Protocol
Simplex Stop-and-Wait Protocol
A Simplex Protocol for a Noisy Channel A positive acknowledgement with retransmission protocol. Continued  
A Simplex Protocol for a Noisy Channel (ctd.) A positive acknowledgement with retransmission protocol.
Sliding Window Protocols ,[object Object],[object Object],[object Object]
Sliding Window Protocols (2) ,[object Object],[object Object],[object Object],[object Object],[object Object]
A One-Bit Sliding Window Protocol Continued  
A One-Bit Sliding Window Protocol (ctd.)
A One-Bit Sliding Window Protocol (2) ,[object Object]
A Protocol Using Go Back N ,[object Object],[object Object],[object Object]
Sliding Window Protocol Using Go Back N Continued  
Sliding Window Protocol Using Go Back N Continued  
Sliding Window Protocol Using Go Back N Continued  
Sliding Window Protocol Using Go Back N
Sliding Window Protocol Using Go Back N (2) ,[object Object]
A Sliding Window Protocol Using Selective Repeat Continued  
A Sliding Window Protocol Using Selective Repeat (2) Continued  
A Sliding Window Protocol Using Selective Repeat (3) Continued  
A Sliding Window Protocol Using Selective Repeat (4)
A Sliding Window Protocol Using Selective Repeat (5) ,[object Object],[object Object],[object Object],[object Object]
Protocol Verification ,[object Object],[object Object]
Finite State Machined Models ,[object Object]
Petri Net Models ,[object Object]
Petri Net Models (2) ,[object Object]
Example Data Link Protocols ,[object Object],[object Object]
High-Level Data Link Control ,[object Object]
High-Level Data Link Control (2) ,[object Object],[object Object],[object Object],[object Object]
The Data Link Layer in the Internet ,[object Object]
PPP – Point to Point Protocol ,[object Object]
PPP – Point to Point Protocol (2) ,[object Object]
PPP – Point to Point Protocol (3) ,[object Object]
1 von 292

Recomendados

Data link layer von
Data link layerData link layer
Data link layerst2112
2.7K views34 Folien
Jaimin chp-6 - transport layer- 2011 batch von
Jaimin   chp-6 - transport layer- 2011 batchJaimin   chp-6 - transport layer- 2011 batch
Jaimin chp-6 - transport layer- 2011 batchJaimin Jani
907 views35 Folien
Data link layer von
Data link layerData link layer
Data link layerHassanein Alwan
196 views18 Folien
Transport layer (computer networks) von
Transport layer (computer networks)Transport layer (computer networks)
Transport layer (computer networks)Fatbardh Hysa
18.1K views110 Folien
Computer Networks for Computer Science Student von
Computer Networks for Computer Science StudentComputer Networks for Computer Science Student
Computer Networks for Computer Science Studentrprajat007
1.5K views139 Folien
data-link layer protocols von
data-link layer protocols  data-link layer protocols
data-link layer protocols BE Smârt
13.3K views49 Folien

Más contenido relacionado

Was ist angesagt?

Introduction to the Data Link Layer von
Introduction to the Data Link LayerIntroduction to the Data Link Layer
Introduction to the Data Link LayerMeenakshi Paul
569 views27 Folien
Multiple access protocol von
Multiple access protocolMultiple access protocol
Multiple access protocolMerlin Florrence
66K views35 Folien
Application layer von
Application layerApplication layer
Application layerreshmadayma
833 views34 Folien
Data link layer von
Data link layerData link layer
Data link layersbkbca
446 views46 Folien
Media Access Control von
Media Access ControlMedia Access Control
Media Access ControlVijayaLakshmi514
4.5K views20 Folien
The mac layer von
The mac layerThe mac layer
The mac layeraazamk
2.5K views16 Folien

Was ist angesagt?(20)

Introduction to the Data Link Layer von Meenakshi Paul
Introduction to the Data Link LayerIntroduction to the Data Link Layer
Introduction to the Data Link Layer
Meenakshi Paul569 views
Data link layer von sbkbca
Data link layerData link layer
Data link layer
sbkbca446 views
The mac layer von aazamk
The mac layerThe mac layer
The mac layer
aazamk2.5K views
Congestion control and quality of services von Jawad Ghumman
Congestion control and quality of servicesCongestion control and quality of services
Congestion control and quality of services
Jawad Ghumman5.6K views
Computer Networks Unit 2 UNIT II DATA-LINK LAYER & MEDIA ACCESS von Dr. SELVAGANESAN S
Computer Networks Unit 2 UNIT II DATA-LINK LAYER & MEDIA ACCESSComputer Networks Unit 2 UNIT II DATA-LINK LAYER & MEDIA ACCESS
Computer Networks Unit 2 UNIT II DATA-LINK LAYER & MEDIA ACCESS
Dr. SELVAGANESAN S3.1K views
Media Access Control (MAC Layer) von Meenakshi Paul
Media Access Control (MAC Layer)Media Access Control (MAC Layer)
Media Access Control (MAC Layer)
Meenakshi Paul940 views
Transport protocols von Online
Transport protocolsTransport protocols
Transport protocols
Online 4.2K views
Congestion on computer network von Disi Dc
Congestion on computer networkCongestion on computer network
Congestion on computer network
Disi Dc15.9K views
Computer Networks Unit 1 Introduction and Physical Layer von Dr. SELVAGANESAN S
Computer Networks Unit 1 Introduction and Physical Layer Computer Networks Unit 1 Introduction and Physical Layer
Computer Networks Unit 1 Introduction and Physical Layer
Dr. SELVAGANESAN S3.4K views

Destacado

Chapter3 von
Chapter3Chapter3
Chapter3Nagarajan
8.5K views46 Folien
Data link layer von
Data link layer Data link layer
Data link layer Mukesh Chinta
62.1K views101 Folien
Unit 4 data link layer von
Unit 4 data link layerUnit 4 data link layer
Unit 4 data link layermekind
11.3K views37 Folien
The Data Link Layer von
The Data Link LayerThe Data Link Layer
The Data Link Layeradil raja
4.9K views35 Folien
Data Link Layer von
Data Link LayerData Link Layer
Data Link LayerKamal Acharya
1.1K views56 Folien
New framing-protocols von
New framing-protocolsNew framing-protocols
New framing-protocolsNitesh Singh
2.3K views63 Folien

Destacado(20)

Chapter3 von Nagarajan
Chapter3Chapter3
Chapter3
Nagarajan8.5K views
Unit 4 data link layer von mekind
Unit 4 data link layerUnit 4 data link layer
Unit 4 data link layer
mekind11.3K views
The Data Link Layer von adil raja
The Data Link LayerThe Data Link Layer
The Data Link Layer
adil raja4.9K views
New framing-protocols von Nitesh Singh
New framing-protocolsNew framing-protocols
New framing-protocols
Nitesh Singh2.3K views
Ccn unit-2- data link layer by prof.suresha v von SURESHA V
Ccn unit-2- data link layer by prof.suresha vCcn unit-2- data link layer by prof.suresha v
Ccn unit-2- data link layer by prof.suresha v
SURESHA V5K views
Data link control von Iffat Anjum
Data link controlData link control
Data link control
Iffat Anjum8.6K views
Error Detection And Correction von Renu Kewalramani
Error Detection And CorrectionError Detection And Correction
Error Detection And Correction
Renu Kewalramani123.9K views
The Data Link Layer von robbbminson
The Data Link LayerThe Data Link Layer
The Data Link Layer
robbbminson13.7K views
Networking von Ranglaz
NetworkingNetworking
Networking
Ranglaz938 views
Computer Networks- Introduction and Data Link Layer von Deepak John
Computer Networks- Introduction and Data Link LayerComputer Networks- Introduction and Data Link Layer
Computer Networks- Introduction and Data Link Layer
Deepak John2.9K views
Error Detection and Correction von TechiNerd
Error Detection and CorrectionError Detection and Correction
Error Detection and Correction
TechiNerd15.5K views
Switching Tech And Data Link von anishgoel
Switching Tech And Data LinkSwitching Tech And Data Link
Switching Tech And Data Link
anishgoel1.4K views
Error Correction And Hamming Code Ibrar von ibrar562
Error Correction And Hamming Code IbrarError Correction And Hamming Code Ibrar
Error Correction And Hamming Code Ibrar
ibrar56217.4K views
CRC Error coding technique von Mantra VLSI
CRC Error coding techniqueCRC Error coding technique
CRC Error coding technique
Mantra VLSI41K views

Similar a Jaimin chp-3 - data-link layer- 2011 batch

chp2 - data link layer.pptx von
chp2 - data link layer.pptxchp2 - data link layer.pptx
chp2 - data link layer.pptxChakra Pani
15 views73 Folien
datalinklayermukesh-150130061041-conversion-gate01.pptx von
datalinklayermukesh-150130061041-conversion-gate01.pptxdatalinklayermukesh-150130061041-conversion-gate01.pptx
datalinklayermukesh-150130061041-conversion-gate01.pptxlathass5
8 views70 Folien
DLL von
DLLDLL
DLLLaxma Reddy
91 views100 Folien
Unit 2 von
Unit 2Unit 2
Unit 2APARNA P
94 views101 Folien
datalinklayermukesh von
datalinklayermukeshdatalinklayermukesh
datalinklayermukeshTamiratDejene1
2 views101 Folien
Chapter 2.1.1.pptx von
Chapter 2.1.1.pptxChapter 2.1.1.pptx
Chapter 2.1.1.pptxbotAlert
3 views62 Folien

Similar a Jaimin chp-3 - data-link layer- 2011 batch(20)

chp2 - data link layer.pptx von Chakra Pani
chp2 - data link layer.pptxchp2 - data link layer.pptx
chp2 - data link layer.pptx
Chakra Pani15 views
datalinklayermukesh-150130061041-conversion-gate01.pptx von lathass5
datalinklayermukesh-150130061041-conversion-gate01.pptxdatalinklayermukesh-150130061041-conversion-gate01.pptx
datalinklayermukesh-150130061041-conversion-gate01.pptx
lathass58 views
Chapter 2.1.1.pptx von botAlert
Chapter 2.1.1.pptxChapter 2.1.1.pptx
Chapter 2.1.1.pptx
botAlert3 views
Computer Network Notes UNIT II von NANDINI SHARMA
Computer Network Notes UNIT IIComputer Network Notes UNIT II
Computer Network Notes UNIT II
NANDINI SHARMA6.3K views
Direct Link Lan von yanhul
Direct Link LanDirect Link Lan
Direct Link Lan
yanhul2.6K views
Introduction to data link layer von Shashank HP
Introduction to data link layerIntroduction to data link layer
Introduction to data link layer
Shashank HP96 views

Más de Jaimin Jani

BE_6_SEM_EE_MP_MC-_COMP._OF_8086_FAMILY-AMIT_THAKUR-converted-converted.pdf von
BE_6_SEM_EE_MP_MC-_COMP._OF_8086_FAMILY-AMIT_THAKUR-converted-converted.pdfBE_6_SEM_EE_MP_MC-_COMP._OF_8086_FAMILY-AMIT_THAKUR-converted-converted.pdf
BE_6_SEM_EE_MP_MC-_COMP._OF_8086_FAMILY-AMIT_THAKUR-converted-converted.pdfJaimin Jani
4 views23 Folien
Jaimin chp-7 - application layer- 2011 batch von
Jaimin   chp-7 - application layer- 2011 batchJaimin   chp-7 - application layer- 2011 batch
Jaimin chp-7 - application layer- 2011 batchJaimin Jani
916 views103 Folien
Jaimin chp-5 - network layer- 2011 batch von
Jaimin   chp-5 - network layer- 2011 batchJaimin   chp-5 - network layer- 2011 batch
Jaimin chp-5 - network layer- 2011 batchJaimin Jani
2.4K views154 Folien
Jaimin chp-4 - media access sub-layer- 2011 batch von
Jaimin   chp-4 - media access sub-layer- 2011 batchJaimin   chp-4 - media access sub-layer- 2011 batch
Jaimin chp-4 - media access sub-layer- 2011 batchJaimin Jani
1.8K views192 Folien
Jaimin chp-2 - 2011 batch von
Jaimin   chp-2  - 2011 batchJaimin   chp-2  - 2011 batch
Jaimin chp-2 - 2011 batchJaimin Jani
620 views130 Folien
Jaimin chp-1 - introduction - 2011 batch von
Jaimin   chp-1  - introduction - 2011 batchJaimin   chp-1  - introduction - 2011 batch
Jaimin chp-1 - introduction - 2011 batchJaimin Jani
707 views98 Folien

Más de Jaimin Jani(7)

BE_6_SEM_EE_MP_MC-_COMP._OF_8086_FAMILY-AMIT_THAKUR-converted-converted.pdf von Jaimin Jani
BE_6_SEM_EE_MP_MC-_COMP._OF_8086_FAMILY-AMIT_THAKUR-converted-converted.pdfBE_6_SEM_EE_MP_MC-_COMP._OF_8086_FAMILY-AMIT_THAKUR-converted-converted.pdf
BE_6_SEM_EE_MP_MC-_COMP._OF_8086_FAMILY-AMIT_THAKUR-converted-converted.pdf
Jaimin Jani4 views
Jaimin chp-7 - application layer- 2011 batch von Jaimin Jani
Jaimin   chp-7 - application layer- 2011 batchJaimin   chp-7 - application layer- 2011 batch
Jaimin chp-7 - application layer- 2011 batch
Jaimin Jani916 views
Jaimin chp-5 - network layer- 2011 batch von Jaimin Jani
Jaimin   chp-5 - network layer- 2011 batchJaimin   chp-5 - network layer- 2011 batch
Jaimin chp-5 - network layer- 2011 batch
Jaimin Jani2.4K views
Jaimin chp-4 - media access sub-layer- 2011 batch von Jaimin Jani
Jaimin   chp-4 - media access sub-layer- 2011 batchJaimin   chp-4 - media access sub-layer- 2011 batch
Jaimin chp-4 - media access sub-layer- 2011 batch
Jaimin Jani1.8K views
Jaimin chp-2 - 2011 batch von Jaimin Jani
Jaimin   chp-2  - 2011 batchJaimin   chp-2  - 2011 batch
Jaimin chp-2 - 2011 batch
Jaimin Jani620 views
Jaimin chp-1 - introduction - 2011 batch von Jaimin Jani
Jaimin   chp-1  - introduction - 2011 batchJaimin   chp-1  - introduction - 2011 batch
Jaimin chp-1 - introduction - 2011 batch
Jaimin Jani707 views
Jaimin chp-8 - network security-new -use this - 2011 batch von Jaimin Jani
Jaimin   chp-8 - network security-new -use this -  2011 batchJaimin   chp-8 - network security-new -use this -  2011 batch
Jaimin chp-8 - network security-new -use this - 2011 batch
Jaimin Jani1.2K views

Último

Structure and Functions of Cell.pdf von
Structure and Functions of Cell.pdfStructure and Functions of Cell.pdf
Structure and Functions of Cell.pdfNithya Murugan
368 views10 Folien
Class 10 English lesson plans von
Class 10 English  lesson plansClass 10 English  lesson plans
Class 10 English lesson plansTARIQ KHAN
257 views53 Folien
2022 CAPE Merit List 2023 von
2022 CAPE Merit List 2023 2022 CAPE Merit List 2023
2022 CAPE Merit List 2023 Caribbean Examinations Council
4.2K views76 Folien
Psychology KS4 von
Psychology KS4Psychology KS4
Psychology KS4WestHatch
68 views4 Folien
JiscOAWeek_LAIR_slides_October2023.pptx von
JiscOAWeek_LAIR_slides_October2023.pptxJiscOAWeek_LAIR_slides_October2023.pptx
JiscOAWeek_LAIR_slides_October2023.pptxJisc
79 views8 Folien
Dance KS5 Breakdown von
Dance KS5 BreakdownDance KS5 Breakdown
Dance KS5 BreakdownWestHatch
68 views2 Folien

Último(20)

Structure and Functions of Cell.pdf von Nithya Murugan
Structure and Functions of Cell.pdfStructure and Functions of Cell.pdf
Structure and Functions of Cell.pdf
Nithya Murugan368 views
Class 10 English lesson plans von TARIQ KHAN
Class 10 English  lesson plansClass 10 English  lesson plans
Class 10 English lesson plans
TARIQ KHAN257 views
Psychology KS4 von WestHatch
Psychology KS4Psychology KS4
Psychology KS4
WestHatch68 views
JiscOAWeek_LAIR_slides_October2023.pptx von Jisc
JiscOAWeek_LAIR_slides_October2023.pptxJiscOAWeek_LAIR_slides_October2023.pptx
JiscOAWeek_LAIR_slides_October2023.pptx
Jisc79 views
Dance KS5 Breakdown von WestHatch
Dance KS5 BreakdownDance KS5 Breakdown
Dance KS5 Breakdown
WestHatch68 views
11.28.23 Social Capital and Social Exclusion.pptx von mary850239
11.28.23 Social Capital and Social Exclusion.pptx11.28.23 Social Capital and Social Exclusion.pptx
11.28.23 Social Capital and Social Exclusion.pptx
mary850239281 views
UWP OA Week Presentation (1).pptx von Jisc
UWP OA Week Presentation (1).pptxUWP OA Week Presentation (1).pptx
UWP OA Week Presentation (1).pptx
Jisc74 views
Sociology KS5 von WestHatch
Sociology KS5Sociology KS5
Sociology KS5
WestHatch64 views
American Psychological Association 7th Edition.pptx von SamiullahAfridi4
American Psychological Association  7th Edition.pptxAmerican Psychological Association  7th Edition.pptx
American Psychological Association 7th Edition.pptx
SamiullahAfridi482 views
Scope of Biochemistry.pptx von shoba shoba
Scope of Biochemistry.pptxScope of Biochemistry.pptx
Scope of Biochemistry.pptx
shoba shoba124 views
EIT-Digital_Spohrer_AI_Intro 20231128 v1.pptx von ISSIP
EIT-Digital_Spohrer_AI_Intro 20231128 v1.pptxEIT-Digital_Spohrer_AI_Intro 20231128 v1.pptx
EIT-Digital_Spohrer_AI_Intro 20231128 v1.pptx
ISSIP317 views
Lecture: Open Innovation von Michal Hron
Lecture: Open InnovationLecture: Open Innovation
Lecture: Open Innovation
Michal Hron96 views
Community-led Open Access Publishing webinar.pptx von Jisc
Community-led Open Access Publishing webinar.pptxCommunity-led Open Access Publishing webinar.pptx
Community-led Open Access Publishing webinar.pptx
Jisc74 views

Jaimin chp-3 - data-link layer- 2011 batch

  • 1. Chapter 3 The Data Link Layer
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 19.  
  • 20. Framing - Byte Stuffing
  • 21.
  • 22.
  • 23.
  • 25.  
  • 26.  
  • 27. Framing - Bit Stuffing
  • 28.
  • 30.  
  • 31.  
  • 32. Framing - Encoding Violations
  • 33.
  • 34.
  • 35.
  • 36.
  • 37.
  • 38.
  • 39. (normally implemented in link layer) (used primarily by upper layers) 3 common error detection techniques Parity Check Cyclic Redundancy Check (CRC) Checksum (most basic)
  • 40.
  • 41.
  • 42.
  • 43. Data #1's in data P Total # 1's (data and P) 0110110 4 (Even) 0 4 (Even) 0011111 5 (Odd) 1 6 (Even) 0000000 0 (Even) 0 0 (Even) 1010100 3 (Odd) 1 4 (Even) 1111111 7 (Odd) 1 8 (Even) Even Parity Generator
  • 44.  
  • 45. What is VRC and LRC? VRC is Character Parity LRC is Block Parity
  • 46.  
  • 47.
  • 48.
  • 49. Example 1 Even Parity Suppose the sender wants to send the word world . In ASCII the five characters are coded as 1110111 1101111 1110010 1101100 1100100 The following shows the actual bits sent 1110111 0 1101111 0 1110010 0 1101100 0 1100100 1
  • 50. Example 2 Even Parity Now suppose the word world in Example 1 is received by the receiver without being corrupted in transmission. 11101110 11011110 11100100 11011000 11001001 The receiver counts the 1s in each character and comes up with even numbers (6, 6, 4, 4, 4). The data are accepted.
  • 51. Example 3 Even Parity Now suppose the word world in Example 1 is corrupted during transmission. 11111110 11011110 11101100 11011000 11001001 The receiver counts the 1s in each character and comes up with even and odd numbers (7, 6, 5, 4, 4). The receiver knows that the data are corrupted, discards them, and asks for retransmission.
  • 52.
  • 54. Sender Site: Main File Which define VRC procedure Page - 1
  • 55. Receiver Site: Main File Which define VRC procedure Page - 1
  • 56. L ONGITUDINAL R EDUNDANCY C HECK (LRC) IN longitudinal redundancy check LRC, a block of bits is divided into rows and a redundant row of bits is added to the whole block
  • 57.
  • 58.
  • 59.
  • 61. Sender Site: Main File Which define LRC procedure Page -1
  • 62. Sender Site: Main File Which define LRC procedure Page -2
  • 63. Receiver Site: Main File Which define LRC procedure Page -1
  • 64. Receiver Site: Main File Which define LRC procedure Page -2
  • 66.
  • 67.
  • 68. Data unit and checksum
  • 69.
  • 70.
  • 71.
  • 72. Example 6 Suppose the following block of 16 bits is to be sent using a checksum of 8 bits. 10101001 00111001 The numbers are added using one’s complement 10101001 00111001 ------------ Sum 11100010 Checksum 00011101 The pattern sent is 10101001 00111001 00011101
  • 73. Example 7 Now suppose the receiver receives the pattern sent in Example 6 and there is no error. 10101001 00111001 00011101 When the receiver adds the three sections, it will get all 1s, which, after complementing, is all 0s and shows that there is no error. 10101001 00111001 00011101 ------------ Sum 11111111 Complement 00000000 means that the pattern is OK.
  • 74. Example 8 Now suppose there is a burst error of length 5 that affects 4 bits. Original data 10101001 00111001 00011101 Corrupted data 10101 111 11 111001 00011101 When the receiver adds the three sections, it gets 10101111 11111001 00011101 Partial Sum 1 11000101 Carry 1 Sum 11000110 Complement 00111001 the pattern is corrupted.
  • 75.  
  • 76.  
  • 78. Sender Site: Main File Which define Checksum procedure Page - 1
  • 79. Receiver Site: Main File Which define Checksum procedure Page - 1
  • 80. Sender Site: Main File Which define Checksum procedure Page - 3
  • 82.
  • 83. Data and redundancy bits To calculate the no. of redundancy bits use : 2 r ≥ m + r + 1 Number of data bits m Number of redundancy bits r Total bits m + r 1 2 3 2 3 5 3 3 6 4 3 7 5 4 9 6 4 10 7 4 11
  • 84. Positions of redundancy bits in Hamming code (11,7) * Check bits occupy positions that are powers of 2 In the Hamming code, each r bit is the VRC bit for one combination of data bits: r 1 is the VRC bit for one combination of data bits, r 2 is the VRC bit for another combination of data bits, and so on. The combinations used to calculate each of the four r values for a seven-bit data sequence are as follows: r 1 : bits 1, 3, 5, 7, 9, 11 r 2 : bits 2, 3, 6, 7, 10, 11 r 4 : bits 4, 5, 6, 7 r 5 : bits 8, 9, 10, 11
  • 85.
  • 87. r 1 will take care of these bits d d d d d d d r 1 r 2 r 4 r 8 0001 0101 1011 0111 0011 1001 11 9 7 5 3 1
  • 88. r 2 will take care of these bits 0010 0011 0110 0111 1010 1011 11 10 7 6 3 2 d d d d d d d r 1 r 2 r 4 r 8
  • 89. r 4 will take care of these bits 0110 0111 0101 0100 7 6 4 5 d d d d d d d r 1 r 2 r 4 r 8
  • 90. r 8 will take care of these bits 1000 1001 1010 1011 11 10 9 8 d d d d d d d r 1 r 2 r 4 r 8
  • 91. Example of redundancy bit calculation
  • 93. Error Detection Error detection using Hamming code
  • 94. Example Question The data is 1011011 Add the parity bit. ??????????????? Consider the transmitted data to be 001 0 101 0 1 11 . Show how the error bit position is determined ???????????????
  • 95.
  • 96.
  • 97.
  • 98.
  • 99. Hamming Code Example Message to be sent: 1 0 1 1 1 0 1 1 1 2 3 4 5 6 7 2 0 2 1 2 2 2 n : check bits Position
  • 100.  
  • 101. Hamming Code Example 1 Starting with the 2 0 position: Look at positions with 1’s in them Count the number of 1’s in the corresponding message bits If even, place a 1 in the 2 0 check bit, i.e., use odd parity Otherwise, place a 0 Calculate check bits: 3 = 2 1 + 2 0 = 0 1 1 5 = 2 2 + 2 0 = 1 0 1 6 = 2 2 + 2 1 + = 1 1 0 7 = 2 2 + 2 1 + 2 0 = 1 1 1 Message to be sent: 1 0 1 1 1 0 1 1 1 2 3 4 5 6 7 2 0 2 1 2 2 2 n : check bits Position
  • 102. Hamming Code Example Repeat with the 2 1 position: Look at positions those positions with 1’s in them Count the number of 1’s in the corresponding message bits If even, place a 1 in the 2 1 check bit Otherwise, place a 0 1 0 Calculate check bits: 3 = 2 1 + 2 0 = 0 1 1 5 = 2 2 + 2 0 = 1 0 1 6 = 2 2 + 2 1 + = 1 1 0 7 = 2 2 + 2 1 + 2 0 = 1 1 1 Message to be sent: 1 0 1 1 1 0 1 1 1 2 3 4 5 6 7 2 0 2 1 2 2 2 n : check bits Position
  • 103. Hamming Code Example 1 0 Repeat with the 2 2 position: Look at positions those positions with 1’s in them Count the number of 1’s in the corresponding message bits If even, place a 1 in the 2 2 check bit Otherwise, place a 0 1 Calculate check bits: 3 = 2 1 + 2 0 = 0 1 1 5 = 2 2 + 2 0 = 1 0 1 6 = 2 2 + 2 1 + = 1 1 0 7 = 2 2 + 2 1 + 2 0 = 1 1 1 Message to be sent: 1 0 1 1 1 0 1 1 1 2 3 4 5 6 7 2 0 2 1 2 2 2 n : check bits Position
  • 104.
  • 105. Using Hamming Codes to Correct Single-Bit Errors Received message: 1 0 1 1 0 0 1 2 n : check bits Calculate check bits: 3 = 2 1 + 2 0 = 0 1 1 5 = 2 2 + 2 0 = 1 0 1 6 = 2 2 + 2 1 = 1 1 0 7 = 2 2 + 2 1 + 2 0 = 1 1 1 1 0 1 1 0 0 1 1 2 3 4 5 6 7 2 0 2 1 2 2 Position
  • 106. Using Hamming Codes to Correct Single-Bit Errors Starting with the 2 0 position: Look at positions with 1’s in them Count the number of 1’s in both the corresponding message bits and the 2 0 check bit and compute the parity. If even parity, there is an error in one of the four bits that were checked. Odd parity: No error in bits 1, 3, 5, 7 Received message: 1 0 1 1 0 0 1 2 n : check bits Calculate check bits: 3 = 2 1 + 2 0 = 0 1 1 5 = 2 2 + 2 0 = 1 0 1 6 = 2 2 + 2 1 = 1 1 0 7 = 2 2 + 2 1 + 2 0 = 1 1 1 1 0 1 1 0 0 1 1 2 3 4 5 6 7 2 0 2 1 2 2 Position
  • 107. Using Hamming Codes to Correct Single-Bit Errors Repeat with the 2 1 position: Look at positions with 1’s in them Count the number of 1’s in both the corresponding message bits and the 2 1 check bit and compute the parity. If even parity, there is an error in one of the four bits that were checked. Even parity: ERROR in bit 2, 3, 6 or 7! Received message: 1 0 1 1 0 0 1 2 n : check bits Calculate check bits: 3 = 2 1 + 2 0 = 0 1 1 5 = 2 2 + 2 0 = 1 0 1 6 = 2 2 + 2 1 = 1 1 0 7 = 2 2 + 2 1 + 2 0 = 1 1 1 1 0 1 1 0 0 1 1 2 3 4 5 6 7 2 0 2 1 2 2 Position
  • 108. Using Hamming Codes to Correct Single-Bit Errors Repeat with the 2 2 position: Look at positions with 1’s in them Count the number of 1’s in both the corresponding message bits and the 2 2 check bit and compute the parity. If even parity, there is an error in one of the four bits that were checked. Even parity: ERROR in bit 4, 5, 6 or 7! Received message: 1 0 1 1 0 0 1 2 n : check bits Calculate check bits: 3 = 2 1 + 2 0 = 0 1 1 5 = 2 2 + 2 0 = 1 0 1 6 = 2 2 + 2 1 = 1 1 0 7 = 2 2 + 2 1 + 2 0 = 1 1 1 1 0 1 1 0 0 1 1 2 3 4 5 6 7 2 0 2 1 2 2 Position
  • 109. Finding the error’s location 1 0 1 1 0 0 1 1 2 3 4 5 6 7 Position
  • 110. Finding the error’s location No error in bits 1, 3, 5, 7 1 0 1 1 0 0 1 1 2 3 4 5 6 7 Position
  • 111. Finding the error’s location ERROR in bit 2, 3, 6 or 7 ERROR in bit 4, 5, 6 or 7 Error must be in bit 6 because bits 3, 5, 7 are correct, and all the remaining information agrees on bit 6 erroneous bit, change to 1 1 0 1 1 0 0 1 1 2 3 4 5 6 7 Position
  • 112. Finding the error’s location An Easier Alternative to the Last Slide 3 = 2 1 + 2 0 = 0 1 1 5 = 2 2 + 2 0 = 1 0 1 6 = 2 2 + 2 1 = 1 1 0 7 = 2 2 + 2 1 + 2 0 = 1 1 1 E E NE 1 1 0 = 6 E = error in column NE = no error in column
  • 113.
  • 114.
  • 115.
  • 116.
  • 117.
  • 119. Sender Site: Main File Which define Hamming Code procedure Page - 1
  • 120. Sender Site: Main File Which define Hamming Code procedure Page - 2
  • 121. Receiver Site: Main File Which define Hamming Code procedure Page - 1
  • 122. Receiver Site: Main File Which define Hamming Code procedure Page - 2
  • 123. Receiver Site: Main File Which define Hamming Code procedure Page - 3
  • 124. CRC
  • 125.
  • 126.
  • 127.
  • 128.
  • 129. Division in CRC encoder
  • 130. Division in the CRC decoder for two cases
  • 131.
  • 133. Standard polynomials Name Polynomial Application CRC-8 x 8 + x 2 + x + 1 ATM header CRC-10 x 10 + x 9 + x 5 + x 4 + x 2 + 1 ATM AAL ITU-16 x 16 + x 12 + x 5 + 1 HDLC ITU-32 x 32 + x 26 + x 23 + x 22 + x 16 + x 12 + x 11 + x 10 + x 8 + x 7 + x 5 + x 4 + x 2 + x + 1 LANs
  • 134.
  • 135.
  • 136.
  • 137.
  • 138.
  • 139. Generating a CRC Example Message : 1011 1 x x 3 + 0 x x 2 + 1 x x + 1 = x 3 + x + 1 Code Polynomial : x 2 + 1 (101) Step 1 : Compute S(x) r = 2 S(x) = 101100
  • 140. Generating a CRC Example (cont’d) Step 2 : Modulo 2 divide Remainder 101100 101 101 001 000 010 000 100 101 01 1001
  • 141. Generating a CRC Example (cont’d) Step 3 : Modulo 2 subtract the remainder from S(x) 101100 - 01 101101 Checksummed Message
  • 142.
  • 143. Decoding a CRC Example 101101 Checksummed message ( n = 6) 1011 Original message (if there are no errors) Remainder = 0 (No error detected) 101101 101 101 001 000 010 000 101 101 00 1001
  • 144.
  • 145.
  • 146. Coding : CRC
  • 147. Sender Site: Main File Which define CRC procedure Page - 1
  • 148. Sender Site: Main File Which define CRC procedure Page - 2
  • 149. Receiver Site: Main File Which define CRC procedure Page - 1
  • 150.  
  • 151.  
  • 152.
  • 153.  
  • 154. NOISELESS CHANNELS Let us first assume we have an ideal channel in which no frames are lost, duplicated, or corrupted. We introduce two protocols for this type of channel. Protocol 1: Simplest Protocol Protocol 2: Stop-and-Wait Protocol Topics discussed in this section:
  • 155. Protocol 1 : Design , Implementation and Coding of Simplest Protocol
  • 156. Protocol 1 : The design of the simplest protocol with no flow or error control
  • 157. Figure Flow diagram for Example
  • 158. 11. Algorithm 1 Sender-site algorithm for the simplest protocol
  • 159. 11. Algorithm 1 Receiver-site algorithm for the simplest protocol
  • 160.
  • 161.
  • 162. Protocol 2 : Design , Implementation and Coding of Stop-and-Wait Protocol
  • 163. 11. Protocol 2 : Design of Stop-and-Wait Protocol
  • 164. 11. Algorithm 2 Sender-site algorithm for Stop-and-Wait Protocol
  • 165. 11. Algorithm 2 Receiver-site algorithm for Stop-and-Wait Protocol
  • 166. 11. Figure shows an example of communication using this protocol. It is still very simple. The sender sends one frame and waits for feedback from the receiver. When the ACK arrives, the sender sends the next frame. Note that sending two frames in the protocol involves the sender in four events and the receiver in two events. Example
  • 167. 11. Figure Flow diagram for Example
  • 168.
  • 169. 11. NOISY CHANNELS Although the Stop-and-Wait Protocol gives us an idea of how to add flow control to its predecessor, noiseless channels are nonexistent. We discuss three protocols in this section that use error control. Protocol 3: Stop-and-Wait ARQ (Automatic Repeat Request) Protocol 4: Go-Back-N ARQ (Automatic Repeat Request) Protocol 5: Selective Repeat ARQ (Automatic Repeat Request) Topics discussed in this section:
  • 170. Protocol 3 : Design , Implementation and Coding of Stop-and-Wait ARQ (Automatic Repeat Request)
  • 171. Error correction in Stop-and-Wait ARQ is done by keeping a copy of the sent frame and retransmitting of the frame when the timer expires. Note
  • 172. In Stop-and-Wait ARQ, we use sequence numbers to number the frames. The sequence numbers are based on modulo-2 arithmetic . Note
  • 173. In Stop-and-Wait ARQ, the acknowledgment number always announces in modulo-2 arithmetic the sequence number of the next frame expected. Note
  • 174. Protocol 3 : Design of the Stop-and-Wait ARQ Protocol
  • 175. Algorithm 3 Sender-site algorithm for Stop-and-Wait ARQ (continued)
  • 176. Algorithm 3 Sender-site algorithm for Stop-and-Wait ARQ (continued)
  • 177. Algorithm 3 Receiver-site algorithm for Stop-and-Wait ARQ Protocol
  • 178. 11. Figure shows an example of Stop-and-Wait ARQ . Frame 0 is sent and acknowledged. Frame 1 is lost and resent after the time-out. The resent frame 1 is acknowledged and the timer stops. Frame 0 is sent and acknowledged, but the acknowledgment is lost. The sender has no idea if the frame or the acknowledgment is lost, so after the time-out, it resends frame 0, which is acknowledged. Example
  • 179. 11. Figure Flow diagram for above Example
  • 180.
  • 181.
  • 182.
  • 183.
  • 184. 11. Stop-and-Wait ARQ is a special case of Go-Back-N ARQ in which the size of the send window is 1. Note
  • 185. Efficiency of 1-bit sliding window protocol
  • 186.
  • 187.
  • 188.
  • 189. Sliding Window Protocols Reason: sender can only have one unACKed frame outstanding. This cause the problem only when R is more larger than L/B first packet bit transmitted, t = 0 R last packet bit transmitted, t = L / B first packet bit arrives last packet bit arrives, send ACK ACK arrives, send next packet, t = R + L / B Sender Receiver U sender = L / B R + L / B = L RB + L
  • 190.
  • 191.
  • 192. Protocols 4 : Design, Implementation and Coding of Sliding Window Protocol
  • 193.
  • 194.
  • 195.
  • 196.
  • 197.
  • 198.
  • 199.
  • 200. In the Go-Back-N Protocol, the sequence numbers are modulo 2 m , where m is the size of the sequence number field in bits. Note
  • 201. Figure Send window for Go-Back-N ARQ
  • 202. The send window is an abstract concept defining an imaginary box of size 2 m − 1 with three variables: Sf, Sn, and S size . Note
  • 203. The send window can slide one or more slots when a valid acknowledgment arrives. Note
  • 204. Figure Receive window for Go-Back-N ARQ
  • 205. The receive window is an abstract concept defining an imaginary box of size 1 with one single variable R n . The window slides when a correct frame has arrived; sliding occurs one slot at a time. Note
  • 206. 11. Figure Design of Go-Back-N ARQ
  • 207. 11. Figure Window size for Go-Back-N ARQ
  • 208. In Go-Back-N ARQ, the size of the send window must be less than 2 m ; the size of the receiver window is always 1. Note
  • 209. Algorithm 4 Go-Back-N sender algorithm (continued)
  • 210. Algorithm 4 Go-Back-N sender algorithm (continued)
  • 211. Algorithm 4 Go-Back-N receiver algorithm
  • 212. Example Figure shows an example of Go-Back-N. This is an example of a case where the forward channel is reliable, but the reverse is not. No data frames are lost, but some ACKs are delayed and one is lost. The example also shows how cumulative acknowledgments can help if acknowledgments are delayed or lost. After initialization, there are seven sender events. Request events are triggered by data from the network layer; arrival events are triggered by acknowledgments from the physical layer. There is no time-out event here because all outstanding frames are acknowledged before the timer expires. Note that although ACK 2 is lost, ACK 3 serves as both ACK 2 and ACK 3.
  • 213. Figure Flow diagram for Example
  • 214. Figure shows what happens when a frame is lost. Frames 0, 1, 2, and 3 are sent. However, frame 1 is lost. The receiver receives frames 2 and 3, but they are discarded because they are received out of order. The sender receives no acknowledgment about frames 1, 2, or 3. Its timer finally expires. The sender sends all outstanding frames (1, 2, and 3) because it does not know what is wrong. Note that the resending of frames 1, 2, and 3 is the response to one single event. When the sender is responding to this event, it cannot accept the triggering of other events. This means that when ACK 2 arrives, the sender is still busy with sending frame 3. Example
  • 215. The physical layer must wait until this event is completed and the data link layer goes back to its sleeping state. We have shown a vertical line to indicate the delay. It is the same story with ACK 3; but when ACK 3 arrives, the sender is busy responding to ACK 2. It happens again when ACK 4 arrives. Note that before the second timer expires, all outstanding frames have been sent and the timer is stopped. Example (continued)
  • 216. Figure Flow diagram for Example
  • 217. Stop-and-Wait ARQ is a special case of Go-Back-N ARQ in which the size of the send window is 1. Note
  • 218.
  • 219. Protocols 4 : Design, Implementation and Coding of Selective Repeat
  • 220. In Selective Repeat ARQ, the size of the sender and receiver window must be at most one-half of 2 m . Note
  • 221. Algorithm Sender-site Selective Repeat algorithm (continued)
  • 222. Algorithm Sender-site Selective Repeat algorithm (continued) (continued)
  • 223. Algorithm Sender-site Selective Repeat algorithm (continued)
  • 224. 11. Algorithm 11.10 Receiver-site Selective Repeat algorithm
  • 225. 11. Algorithm 11.10 Receiver-site Selective Repeat algorithm
  • 226. 11. Figure 11.22 Delivery of data in Selective Repeat ARQ
  • 227. 11. This example is similar to Example 11.3 in which frame 1 is lost. We show how Selective Repeat behaves in this case. Figure 11.23 shows the situation. One main difference is the number of timers. Here, each frame sent or resent needs a timer, which means that the timers need to be numbered (0, 1, 2, and 3). The timer for frame 0 starts at the first request, but stops when the ACK for this frame arrives. The timer for frame 1 starts at the second request, restarts when a NAK arrives, and finally stops when the last ACK arrives. The other two timers start when the corresponding frames are sent and stop at the last arrival event. Example 11.8
  • 228. 11. At the receiver site we need to distinguish between the acceptance of a frame and its delivery to the network layer. At the second arrival, frame 2 arrives and is stored and marked, but it cannot be delivered because frame 1 is missing. At the next arrival, frame 3 arrives and is marked and stored, but still none of the frames can be delivered. Only at the last arrival, when finally a copy of frame 1 arrives, can frames 1, 2, and 3 be delivered to the network layer. There are two conditions for the delivery of frames to the network layer: First, a set of consecutive frames must have arrived. Second, the set starts from the beginning of the window. Example 11.8 (continued)
  • 229. 11. Another important point is that a NAK is sent after the second arrival, but not after the third, although both situations look the same. The reason is that the protocol does not want to crowd the network with unnecessary NAKs and unnecessary resent frames. The second NAK would still be NAK1 to inform the sender to resend frame 1 again; this has already been done. The first NAK sent is remembered (using the nakSent variable) and is not sent again until the frame slides. A NAK is sent once for each window position and defines the first slot in the window. Example 11.8 (continued)
  • 230. 11. The next point is about the ACKs. Notice that only two ACKs are sent here. The first one acknowledges only the first frame; the second one acknowledges three frames. In Selective Repeat, ACKs are sent when data are delivered to the network layer. If the data belonging to n frames are delivered in one shot, only one ACK is sent for all of them. Example 11.8 (continued)
  • 231. 11. Figure 11.23 Flow diagram for Example 11.8
  • 232. 11. Figure 11.24 Design of piggybacking in Go-Back-N ARQ
  • 233.
  • 234.
  • 235.
  • 236.
  • 237.
  • 238.
  • 239.
  • 240.
  • 241.
  • 242.
  • 243.
  • 244.
  • 245.
  • 246.
  • 247.
  • 248.
  • 249.
  • 250.
  • 251. Error-Detecting Codes Calculation of the polynomial code checksum.
  • 252.
  • 253.
  • 254.
  • 255.
  • 256.
  • 257.
  • 258.
  • 259.
  • 260. Protocol Definitions Continued  Some definitions needed in the protocols to follow. These are located in the file protocol.h.
  • 261. Protocol Definitions (ctd.) Some definitions needed in the protocols to follow. These are located in the file protocol.h.
  • 262. Unrestricted Simplex Protocol
  • 264. A Simplex Protocol for a Noisy Channel A positive acknowledgement with retransmission protocol. Continued 
  • 265. A Simplex Protocol for a Noisy Channel (ctd.) A positive acknowledgement with retransmission protocol.
  • 266.
  • 267.
  • 268. A One-Bit Sliding Window Protocol Continued 
  • 269. A One-Bit Sliding Window Protocol (ctd.)
  • 270.
  • 271.
  • 272. Sliding Window Protocol Using Go Back N Continued 
  • 273. Sliding Window Protocol Using Go Back N Continued 
  • 274. Sliding Window Protocol Using Go Back N Continued 
  • 275. Sliding Window Protocol Using Go Back N
  • 276.
  • 277. A Sliding Window Protocol Using Selective Repeat Continued 
  • 278. A Sliding Window Protocol Using Selective Repeat (2) Continued 
  • 279. A Sliding Window Protocol Using Selective Repeat (3) Continued 
  • 280. A Sliding Window Protocol Using Selective Repeat (4)
  • 281.
  • 282.
  • 283.
  • 284.
  • 285.
  • 286.
  • 287.
  • 288.
  • 289.
  • 290.
  • 291.
  • 292.