0% found this document useful (0 votes)
20 views46 pages

WINSEM2023-24 CSI2007 ETH VL2023240501831 2024-02-06 Reference-Material-I

1) Error detection codes add redundant bits to transmitted data so receivers can detect errors. Common methods are parity checks and cyclic redundancy checks (CRCs). 2) Error correction codes allow receivers to automatically correct certain errors. Hamming codes use redundant bits to identify the location of single-bit errors. 3) The data link layer or transport layer implement error detection and correction to ensure reliable data transmission. Common methods are parity checks, CRCs, checksums, and Hamming codes.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views46 pages

WINSEM2023-24 CSI2007 ETH VL2023240501831 2024-02-06 Reference-Material-I

1) Error detection codes add redundant bits to transmitted data so receivers can detect errors. Common methods are parity checks and cyclic redundancy checks (CRCs). 2) Error correction codes allow receivers to automatically correct certain errors. Hamming codes use redundant bits to identify the location of single-bit errors. 3) The data link layer or transport layer implement error detection and correction to ensure reliable data transmission. Common methods are parity checks, CRCs, checksums, and Hamming codes.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 46

Data Link Layer

Error Detection and Correction


Data can be corrupted during transmission.
For reliable communication, error must be
detected and corrected.
Error Detection and Correction are
implemented either at the data link layer or
the transport layer of the OSI model.
Type of Errors
Single-Bit
~ is when only one bit in the data unit has
changed
Burst Error

~ means that 2 or more consecutive bits in the


data unit have changed
Detection
• Error detection uses the concept of
redundancy, which means adding extra bits for
detecting errors at the destination.
Detection(cont’d)
• Redundancy
Error Detection Methods
Parity Check(Vertical Redundancy
Check)
– A parity bit is added to every data unit so that the total number of
1s (including the parity bit) becomes even for even-parity check or
odd for odd-parity check
– Simple parity check
Parity Calculation
Assuming even parity, Assuming odd parity,
find the parity bit for find the parity bit for
each of the following each of the following
data units. data units.
• a. 1001011 • a. 1001011
• b. 0001100 • b. 0001100
• c. 1000000 • c. 1000000
• d. 1110111 • d. 1110111
Detection- Example-1

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
11101110 11011110 11100100 11011000 11001001
Detection – Example-2
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.
Detection – Example-3
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.
Two –Dimensional Parity Check (LRC)
Longitudinal Redundancy Check
Detection – Example-4
Suppose the following block is sent:
10101001 00111001 11011101 11100111 10101010
However, it is hit by a burst noise of length 8, and some bits are corrupted.
10100011 10001001 11011101 11100111 10101010
When the receiver checks the parity bits, some of the bits do not follow the
even-parity rule and the whole block is discarded.
10100011 10001001 11011101 11100111 10101010
CRC(Cyclic Redundancy Check)
~ is based on binary division.
Detection(cont’d)
• Polynomials
– CRC generator(divisor) is most often represented
not as a string of 1s and 0s, but as an algebraic
polynomial.
Detection(cont’d)
• A polynomial representing a divis or
Detection(cont’d)
• Standard polynomials
• Sender
~ uses modular-2 division.
Receiver
Checksum
~ used by the higher layer protocols
~ is based on the concept of redundancy(VRC,
LRC, CRC ….)
• Checksum Generator
Detection(cont’d)
• To create the checksum the sender does the
following:
– The unit is divided into K sections, each of n bits.
– Section 1 and 2 are added together using one’s
complement.
– Section 3 is added to the result of the previous step.
– Section 4 is added to the result of the previous step.
– The process repeats until section k is added to the
result of the previous step.
– The final result is complemented to make the
checksum.
Detection(cont’d)
• data unit and checksum
Detection(cont’d)
• Sender
Original data : 10101001 00111001
10101001
00111001
--------------
11100010 Sum
00011101 Checksum
10101001 00111001 00011101  Checksum
Detection(cont’d)
• Receiver
Received data : 10101001 00111001 00011101
10101001
00111001
00011101
---------------
11111111  Sum
00000000  Complement
Error Correction
~ can be handled in two ways

when an error is discovered, the receiver can


have the sender retransmit the entire data
unit.

a receiver can use an error-correcting code,


which automatically corrects certain errors.
Hamming Code Generation
Single-bit error correction
To correct an error, the receiver reverses the value of the
altered bit. To do so, it must know which bit is in error.
Number of redundancy bits needed
Let data bits = m
Redundancy bits = r
Total message sent = m+r
The value of r must satisfy the following relation:
2r ≥ m+r+1
Hamming Code
Hamming Code
Hamming Code
Example of Hamming Code
Single-bit error
Error
Detection
Error Correction(cont’d)
• Single-Bit Error Correction
– parity bit
– The secret of error correction is to locate the
invalid bit or bits
Error Correction(cont’d)
• Hamming Code
~ developed by R.W.Hamming
• positions of redundancy bits in Hamming code
Error Correction(cont’d)
• Redundancy bits calculation(cont’d)
Error Correction(cont’d)
• Redundancy bits calculation
Error Correction(cont’d)
• each r bit is the VRC bit for one combination
of data bits
r1 = bits 1, 3, 5, 7, 9, 11
r2 = bits 2, 3, 6, 7, 10, 11
r4 = bits 4, 5, 6, 7
r8 = bits 8, 9, 10, 11
Sender Side Calculation
Error Correction(cont’d)
• Error Detection and Correction
Receiver Side Calculation
Practice Problems
1) Suppose the data to be transmitted is 1011001.
Generate the hamming code using the data word and
assume 6th bit is corrupted during transmission.
Perform the receiver side calculation on the received
message.
2) Differentiate between backward and forward error
correction techniques. The source is transmitting a 32
bit of data as follows:
00110010 11101100 00101010 0001001
Engrave the steps involved at the sender side for finding
the checksum. Ensure that the same data is received at
the receiver side.
Practice Problems
3)Given the dataword 1010011110 and the divisor 10111,
Show the generation of the codeword at the sender site
(using binary division).
Suppose the leftmost bit of the message is inverted due to
the noise on the transmission link.
What is the result of the receiver’s CRC calculation? How
does the receiver know that an error has occurred?

You might also like