SlideShare una empresa de Scribd logo
1 de 292
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]

Más contenido relacionado

La actualidad más candente

La actualidad más candente (20)

FDDI
FDDIFDDI
FDDI
 
Distance Vector Routing Protocols
Distance Vector Routing ProtocolsDistance Vector Routing Protocols
Distance Vector Routing Protocols
 
Lecture 18
Lecture 18Lecture 18
Lecture 18
 
Data Link Layer| Error Detection
Data Link Layer| Error DetectionData Link Layer| Error Detection
Data Link Layer| Error Detection
 
transport layer
transport layertransport layer
transport layer
 
Data link layer
Data link layer Data link layer
Data link layer
 
Ai Tdma
Ai TdmaAi Tdma
Ai Tdma
 
Flow & Error Control
Flow & Error ControlFlow & Error Control
Flow & Error Control
 
Congestion control
Congestion controlCongestion control
Congestion control
 
aloha
alohaaloha
aloha
 
DLL
DLLDLL
DLL
 
Quality of Service
Quality of ServiceQuality of Service
Quality of Service
 
Aloha
AlohaAloha
Aloha
 
Routing protocols-network-layer
Routing protocols-network-layerRouting protocols-network-layer
Routing protocols-network-layer
 
Congestion control
Congestion controlCongestion control
Congestion control
 
Convolutional Codes And Their Decoding
Convolutional Codes And Their DecodingConvolutional Codes And Their Decoding
Convolutional Codes And Their Decoding
 
Chap 8 switching
Chap 8 switchingChap 8 switching
Chap 8 switching
 
Traffic and Congestion Control in ATM Networks Chapter 13
Traffic and Congestion Control in ATM Networks Chapter 13Traffic and Congestion Control in ATM Networks Chapter 13
Traffic and Congestion Control in ATM Networks Chapter 13
 
go back n protocol
go back n protocolgo back n protocol
go back n protocol
 
The Network Layer
The Network LayerThe Network Layer
The Network Layer
 

Destacado

Unit 4 data link layer
Unit 4 data link layerUnit 4 data link layer
Unit 4 data link layermekind
 
The Data Link Layer
The Data Link LayerThe Data Link Layer
The Data Link Layeradil raja
 
New framing-protocols
New framing-protocolsNew framing-protocols
New framing-protocolsNitesh Singh
 
Ccn unit-2- data link layer by prof.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 vSURESHA V
 
Data link control
Data link controlData link control
Data link controlIffat Anjum
 
Error Detection And Correction
Error Detection And CorrectionError Detection And Correction
Error Detection And CorrectionRenu Kewalramani
 
The Data Link Layer
The Data Link LayerThe Data Link Layer
The Data Link Layerrobbbminson
 
Computer Networks for Computer Science Student
Computer Networks for Computer Science StudentComputer Networks for Computer Science Student
Computer Networks for Computer Science Studentrprajat007
 
Networking
NetworkingNetworking
NetworkingRanglaz
 
Computer Networks- Introduction and Data Link Layer
Computer Networks- Introduction and Data Link LayerComputer Networks- Introduction and Data Link Layer
Computer Networks- Introduction and Data Link LayerDeepak John
 
Error Detection and Correction
Error Detection and CorrectionError Detection and Correction
Error Detection and CorrectionTechiNerd
 
Switching Tech And Data Link
Switching Tech And Data LinkSwitching Tech And Data Link
Switching Tech And Data Linkanishgoel
 
Error Correction And Hamming Code Ibrar
Error Correction And Hamming Code IbrarError Correction And Hamming Code Ibrar
Error Correction And Hamming Code Ibraribrar562
 
CRC Error coding technique
CRC Error coding techniqueCRC Error coding technique
CRC Error coding techniqueMantra VLSI
 

Destacado (20)

Unit 4 data link layer
Unit 4 data link layerUnit 4 data link layer
Unit 4 data link layer
 
The Data Link Layer
The Data Link LayerThe Data Link Layer
The Data Link Layer
 
Data Link Layer
Data Link LayerData Link Layer
Data Link Layer
 
New framing-protocols
New framing-protocolsNew framing-protocols
New framing-protocols
 
Ccn unit-2- data link layer by prof.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
 
Data link control
Data link controlData link control
Data link control
 
Error Detection And Correction
Error Detection And CorrectionError Detection And Correction
Error Detection And Correction
 
The Data Link Layer
The Data Link LayerThe Data Link Layer
The Data Link Layer
 
Computer Networks for Computer Science Student
Computer Networks for Computer Science StudentComputer Networks for Computer Science Student
Computer Networks for Computer Science Student
 
Networking
NetworkingNetworking
Networking
 
Computer Networks- Introduction and Data Link Layer
Computer Networks- Introduction and Data Link LayerComputer Networks- Introduction and Data Link Layer
Computer Networks- Introduction and Data Link Layer
 
Framing Protocols
Framing ProtocolsFraming Protocols
Framing Protocols
 
Datalinklayer tanenbaum
Datalinklayer tanenbaumDatalinklayer tanenbaum
Datalinklayer tanenbaum
 
Error Detection and Correction
Error Detection and CorrectionError Detection and Correction
Error Detection and Correction
 
Switching Tech And Data Link
Switching Tech And Data LinkSwitching Tech And Data Link
Switching Tech And Data Link
 
DDL and Physical Layer
DDL and Physical LayerDDL and Physical Layer
DDL and Physical Layer
 
data link layer
data link layerdata link layer
data link layer
 
Error Correction And Hamming Code Ibrar
Error Correction And Hamming Code IbrarError Correction And Hamming Code Ibrar
Error Correction And Hamming Code Ibrar
 
CRC Error coding technique
CRC Error coding techniqueCRC Error coding technique
CRC Error coding technique
 
Chapter 3 final
Chapter 3 finalChapter 3 final
Chapter 3 final
 

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

Chapter 4 data link layer
Chapter 4 data link layerChapter 4 data link layer
Chapter 4 data link layerNaiyan Noor
 
chp2 - data link layer.pptx
chp2 - data link layer.pptxchp2 - data link layer.pptx
chp2 - data link layer.pptxChakra Pani
 
datalinklayermukesh-150130061041-conversion-gate01.pptx
datalinklayermukesh-150130061041-conversion-gate01.pptxdatalinklayermukesh-150130061041-conversion-gate01.pptx
datalinklayermukesh-150130061041-conversion-gate01.pptxlathass5
 
U2CH1Data Link Layerxxxxxxxxxxxxxxxxx.pptx
U2CH1Data Link Layerxxxxxxxxxxxxxxxxx.pptxU2CH1Data Link Layerxxxxxxxxxxxxxxxxx.pptx
U2CH1Data Link Layerxxxxxxxxxxxxxxxxx.pptxk2w9psdb96
 
Chapter 2.1.1.pptx
Chapter 2.1.1.pptxChapter 2.1.1.pptx
Chapter 2.1.1.pptxbotAlert
 
Computer Networks Unit 2 UNIT II DATA-LINK LAYER & MEDIA ACCESS
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 ACCESSDr. SELVAGANESAN S
 
unit2-210710110327.pdf
unit2-210710110327.pdfunit2-210710110327.pdf
unit2-210710110327.pdfssuser3aa461
 
Computer Network Notes UNIT II
Computer Network Notes UNIT IIComputer Network Notes UNIT II
Computer Network Notes UNIT IINANDINI SHARMA
 
chapter-3-data-link-layer.ppt
chapter-3-data-link-layer.pptchapter-3-data-link-layer.ppt
chapter-3-data-link-layer.pptYashikaAsrani
 
Direct Link Lan
Direct Link LanDirect Link Lan
Direct Link Lanyanhul
 
Introduction to the OSI 7 layer model and Data Link Layer
Introduction to the OSI 7 layer model and Data Link LayerIntroduction to the OSI 7 layer model and Data Link Layer
Introduction to the OSI 7 layer model and Data Link LayerVNIT-ACM Student Chapter
 
Introduction to data link layer
Introduction to data link layerIntroduction to data link layer
Introduction to data link layerShashank HP
 
data link layer - Chapter 3
data link layer - Chapter 3data link layer - Chapter 3
data link layer - Chapter 3SakthiVinoth78
 
data link layer to print
data link layer to printdata link layer to print
data link layer to printBishalWosti1
 
CN R16 -UNIT-3.pdf
CN R16 -UNIT-3.pdfCN R16 -UNIT-3.pdf
CN R16 -UNIT-3.pdfJoshuaeeda1
 

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

Chapter 4 data link layer
Chapter 4 data link layerChapter 4 data link layer
Chapter 4 data link layer
 
chp2 - data link layer.pptx
chp2 - data link layer.pptxchp2 - data link layer.pptx
chp2 - data link layer.pptx
 
datalinklayermukesh-150130061041-conversion-gate01.pptx
datalinklayermukesh-150130061041-conversion-gate01.pptxdatalinklayermukesh-150130061041-conversion-gate01.pptx
datalinklayermukesh-150130061041-conversion-gate01.pptx
 
Unit 2
Unit 2Unit 2
Unit 2
 
U2CH1Data Link Layerxxxxxxxxxxxxxxxxx.pptx
U2CH1Data Link Layerxxxxxxxxxxxxxxxxx.pptxU2CH1Data Link Layerxxxxxxxxxxxxxxxxx.pptx
U2CH1Data Link Layerxxxxxxxxxxxxxxxxx.pptx
 
datalinklayermukesh
datalinklayermukeshdatalinklayermukesh
datalinklayermukesh
 
Chapter 2.1.1.pptx
Chapter 2.1.1.pptxChapter 2.1.1.pptx
Chapter 2.1.1.pptx
 
Unit 3 - Data Link Layer - Part A
Unit 3 - Data Link Layer - Part AUnit 3 - Data Link Layer - Part A
Unit 3 - Data Link Layer - Part A
 
Data link layer
Data link layerData link layer
Data link layer
 
Computer Networks Unit 2 UNIT II DATA-LINK LAYER & MEDIA ACCESS
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
 
unit2-210710110327.pdf
unit2-210710110327.pdfunit2-210710110327.pdf
unit2-210710110327.pdf
 
Computer Network Notes UNIT II
Computer Network Notes UNIT IIComputer Network Notes UNIT II
Computer Network Notes UNIT II
 
Unit 2 [autosaved]
Unit 2 [autosaved]Unit 2 [autosaved]
Unit 2 [autosaved]
 
chapter-3-data-link-layer.ppt
chapter-3-data-link-layer.pptchapter-3-data-link-layer.ppt
chapter-3-data-link-layer.ppt
 
Direct Link Lan
Direct Link LanDirect Link Lan
Direct Link Lan
 
Introduction to the OSI 7 layer model and Data Link Layer
Introduction to the OSI 7 layer model and Data Link LayerIntroduction to the OSI 7 layer model and Data Link Layer
Introduction to the OSI 7 layer model and Data Link Layer
 
Introduction to data link layer
Introduction to data link layerIntroduction to data link layer
Introduction to data link layer
 
data link layer - Chapter 3
data link layer - Chapter 3data link layer - Chapter 3
data link layer - Chapter 3
 
data link layer to print
data link layer to printdata link layer to print
data link layer to print
 
CN R16 -UNIT-3.pdf
CN R16 -UNIT-3.pdfCN R16 -UNIT-3.pdf
CN R16 -UNIT-3.pdf
 

Más de Jaimin Jani

BE_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.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
 
Jaimin chp-7 - application layer- 2011 batch
Jaimin   chp-7 - application layer- 2011 batchJaimin   chp-7 - application layer- 2011 batch
Jaimin chp-7 - application layer- 2011 batchJaimin Jani
 
Jaimin chp-5 - network layer- 2011 batch
Jaimin   chp-5 - network layer- 2011 batchJaimin   chp-5 - network layer- 2011 batch
Jaimin chp-5 - network layer- 2011 batchJaimin Jani
 
Jaimin chp-4 - media access sub-layer- 2011 batch
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
 
Jaimin chp-2 - 2011 batch
Jaimin   chp-2  - 2011 batchJaimin   chp-2  - 2011 batch
Jaimin chp-2 - 2011 batchJaimin Jani
 
Jaimin chp-1 - introduction - 2011 batch
Jaimin   chp-1  - introduction - 2011 batchJaimin   chp-1  - introduction - 2011 batch
Jaimin chp-1 - introduction - 2011 batchJaimin Jani
 
Jaimin chp-8 - network security-new -use this - 2011 batch
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 batchJaimin Jani
 

Más de Jaimin Jani (7)

BE_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.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 chp-7 - application layer- 2011 batch
Jaimin   chp-7 - application layer- 2011 batchJaimin   chp-7 - application layer- 2011 batch
Jaimin chp-7 - application layer- 2011 batch
 
Jaimin chp-5 - network layer- 2011 batch
Jaimin   chp-5 - network layer- 2011 batchJaimin   chp-5 - network layer- 2011 batch
Jaimin chp-5 - network layer- 2011 batch
 
Jaimin chp-4 - media access sub-layer- 2011 batch
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 chp-2 - 2011 batch
Jaimin   chp-2  - 2011 batchJaimin   chp-2  - 2011 batch
Jaimin chp-2 - 2011 batch
 
Jaimin chp-1 - introduction - 2011 batch
Jaimin   chp-1  - introduction - 2011 batchJaimin   chp-1  - introduction - 2011 batch
Jaimin chp-1 - introduction - 2011 batch
 
Jaimin chp-8 - network security-new -use this - 2011 batch
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
 

Último

Music 9 - 4th quarter - Vocal Music of the Romantic Period.pptx
Music 9 - 4th quarter - Vocal Music of the Romantic Period.pptxMusic 9 - 4th quarter - Vocal Music of the Romantic Period.pptx
Music 9 - 4th quarter - Vocal Music of the Romantic Period.pptxleah joy valeriano
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptxmary850239
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Celine George
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSJoshuaGantuangco2
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptxmary850239
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfErwinPantujan2
 
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...JojoEDelaCruz
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)lakshayb543
 
Integumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.pptIntegumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.pptshraddhaparab530
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17Celine George
 
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptxAUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptxiammrhaywood
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPCeline George
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4MiaBumagat1
 
Active Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfActive Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfPatidar M
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management systemChristalin Nelson
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxHumphrey A Beña
 

Último (20)

Music 9 - 4th quarter - Vocal Music of the Romantic Period.pptx
Music 9 - 4th quarter - Vocal Music of the Romantic Period.pptxMusic 9 - 4th quarter - Vocal Music of the Romantic Period.pptx
Music 9 - 4th quarter - Vocal Music of the Romantic Period.pptx
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17
 
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTSGRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
GRADE 4 - SUMMATIVE TEST QUARTER 4 ALL SUBJECTS
 
4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx4.18.24 Movement Legacies, Reflection, and Review.pptx
4.18.24 Movement Legacies, Reflection, and Review.pptx
 
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptxYOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
YOUVE_GOT_EMAIL_PRELIMS_EL_DORADO_2024.pptx
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptxLEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
 
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
 
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
 
Integumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.pptIntegumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.ppt
 
How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17How to Add Barcode on PDF Report in Odoo 17
How to Add Barcode on PDF Report in Odoo 17
 
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptxAUDIENCE THEORY -CULTIVATION THEORY -  GERBNER.pptx
AUDIENCE THEORY -CULTIVATION THEORY - GERBNER.pptx
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERP
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4
 
Active Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdfActive Learning Strategies (in short ALS).pdf
Active Learning Strategies (in short ALS).pdf
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management system
 
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptxINTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
INTRODUCTION TO CATHOLIC CHRISTOLOGY.pptx
 

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.