0% found this document useful (0 votes)
21 views15 pages

13 Error Detection and Correction 23122024 024244pm

dcn

Uploaded by

Khadija Afzal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views15 pages

13 Error Detection and Correction 23122024 024244pm

dcn

Uploaded by

Khadija Afzal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 15

Data Link Layer:

Error Detection and Correction

Data Communication and Computer Networks

dapted from lecture slides by Behrouz A. Forouzan


© The McGraw-Hill Companies, Inc. All rights reserved
Data Link Layer

2
Error Control

 Detecting errors
 Correcting errors
 Forward error correction
 Automatic repeat request

3
Types of Errors
 Single-bit errors

 Burst errors

4
Redundancy

 To detect or correct errors, redundant bits of data must be


added

5
Coding

 Process of adding redundancy for error detection or


correction
 Two types:
 Block codes
 Divides the data to be sent into a set of blocks
 Extra information attached to each block
 Memoryless
 Convolutional codes
 Treats data as a series of bits, and computes a code over a
continuous series
 The code computed for a set of bits depends on the current and
previous input

6
XOR Operation

 Main operation for computing error detection/correction


codes
 Similar to modulo-2 addition

7
Block Coding

 Message is divided into k-bit blocks


 Known as datawords
 r redundant bits are added
 Blocks become n=k+r bits
 Known as codewords

8
Example: 4B/5B Block Coding

Data Code Data Code


0000 11110 1000 10010
0001 01001 1001 10011
k=?
r=?
0010 10100 1010 10110
n=?
0011 10101 1011 10111
0100 01010 1100 11010
0101 01011 1101 11011
0110 01110 1110 11100
0111 01111 1111 11101

9
Error Detection in Block Coding
Block Diagram

10
Notes

Data Word Code Word Data Word Code Word


00 000 10 101
01 011 11 110
 Suppose:
 Rx= 011  Valid code  extract data word  01
 Error occurred Rx=111 left most bit is corrupted  Discard
 Error occurred  Rx= 000  Rx will accept this code wrongly.

 An error-detecting code can detect


only the types of errors for which it is designed
 Other types of errors may remain undetected.
 There is no way to detect every possible error

11
Error Correction

12
Hamming Distance

Hamming
Hamming Distance
Distance between
between two two words
words is
is the
the
number
number of of differences
differences between
between corresponding
corresponding
bits.
bits.
 d(01, 00) = ?
 d(11, 00) = ?
 d(010, 100) = ?
 d(0011, 1000) = ?
 How many 8-bit words are n bits away from 10000111?
(Next Slide)

13
Parity Check

 Most common, least complex


 Single bit is added to a block
 Two schemes:
 Even parity – Maintain even number of 1s
 E.g., 1011  10111
 Odd parity – Maintain odd number of 1s
 E.g., 1011  10110

14
Example: Parity Check

Suppose the sender wants to send the word world. In


ASCII the five characters are coded (with even parity) as
1110111 1101111 1110010 1101100 1100100
The following shows the actual bits sent
11101110 11011110 11100100 11011000 11001001

Receiver receives this sequence of words:


11111110 11011110 11101100 11011000 11001001
Which blocks are accepted? Which are rejected?
15

You might also like