2BA5
Telecommunications
Error Detection and Correction
Review
Topologies: Mesh, Star, Bus, Ring
LANs MANs & WANs or Local, Metropolitan & Wide
Area Networks
Data link layer:
Communication between two nodes on the same
network
Duties of the data link layer:
Addressing
Packetizing
Error Control
Flow Control
Medium Access Control
2BA5 Telecommunications
Overview
Causes for Errors
Types of Errors
Detection of Errors
Correction of Errors
2BA5 Telecommunications
Causes for Errors
Interference
Collision with communication from other nodes
Electrical interference from third parties
Thermal interference
2BA5 Telecommunications
Types of Errors: Single-Bit
Error
In a single-bit error, only one bit in the
data unit has changed.
* Figure is courtesy of B. Forouzan
2BA5 Telecommunications
Types of Errors: Burst Error
A burst error means that 2 or more bits in the
data unit have changed
* Figure is courtesy of B. Forouzan
2BA5 Telecommunications
Detection of Errors
Redundancy
Parity Check
Cyclic Redundancy Check (CRC)
Checksum
2BA5 Telecommunications
Redundancy
Error detection uses the concept of redundancy,
which means adding extra bits for detecting
errors at the destination
* Figure is courtesy of B. Forouzan
2BA5 Telecommunications
Detection methods
* Figure is courtesy of B. Forouzan
2BA5 Telecommunications
Even-Parity Concept
A parity bit is added to every data unit so that the total
number of 1s is even (or odd for odd-parity). * Figure is courtesy of B. Forouzan
2BA5 Telecommunications
10
Even-Parity: Example Sender
Assume you want to send the following:
1110111
1101111
1110010
1101100
1100100
The following bits are actually sent:
11101110 11011110 11100100 11011000 11001001
2BA5 Telecommunications
11
Even-Parity: Example Receiver
11101110 11011110 11100100 11011000
6
11001001
4
The receiver counts the 1s in each character and
comes up with even numbers (6, 6, 4, 4, 4). The
data are accepted.
11111110 11011110 11101100 11011000 11001001
7
6
5
4
4
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.
2BA5 Telecommunications
12
Simple Parity Check
Can detect all single-bit errors
Can detect burst errors only if the total
number of errors in each data unit is odd
2BA5 Telecommunications
13
Two-Dimensional Parity Check
In two-dimensional parity check, a block of bits is divided into rows and a
redundant row of bits is added to the whole block.
* Figure is courtesy of B. Forouzan
2BA5 Telecommunications
14
Example: 2D-Parity Check
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
2BA5 Telecommunications
15
Cyclic Redundancy Check
(CRC)
C(x)
P(x)
P(x) divided by C(x) = 0
P(x)+errors divided by C(x) should give nonzero
* Figure is courtesy of B. Forouzan
2BA5 Telecommunications
16
CRC: Sender
* Figure is courtesy of B. Forouzan
2BA5 Telecommunications
17
CRC: Receiver
* Figure is courtesy of B. Forouzan
2BA5 Telecommunications
18
Polynomial Notation
It should not be divisible by x.
It should be divisible by x+1
* Figure is courtesy of B. Forouzan
2BA5 Telecommunications
19
Exercise: CRC
Frame: 1101011011
Generator: x4+x+1
2BA5 Telecommunications
20
Exercise: CRC Solution
Frame: 1101011011
Generator: 10011
* Figure is courtesy of A. Tannenbaum
2BA5 Telecommunications
21
We cannot choose x (binary 10) or x2 + x
(binary 110) as polynomial because both are
divisible by x.
However, we can choose x + 1 (binary 11)
because it is not divisible by x, but is divisible
by x + 1. We can also choose x2 + 1 (binary
101) because it is divisible by x + 1 (binary
division).
* Figure is courtesy of B. Forouzan
2BA5 Telecommunications
22
Standard Polynomials
Name
Polynomial
Application
CRC-8
x8 + x2 + x + 1
ATM header
CRC-10
x10 + x9 + x5 + x4 + x 2 + 1
ATM AAL
ITU-16
x16 + x12 + x5 + 1
HDLC
ITU-32
x32 + x26 + x23 + x22 + x16 + x12 + x11 + x10 +
x8 + x7 + x5 + x4 + x2 + x + 1
LANs
* Figure is courtesy of B. Forouzan
2BA5 Telecommunications
23
CRC Performance
Can detect all burst errors that effect an odd
number of bits
Can detect all burst errors of the length less
than or equal to the degree of the polynomial
Can detect with a very high probability burst
errors of a length greater than the degree of
the polynomial.
2BA5 Telecommunications
24
CRC-12 Performance
The CRC-12
x12 + x11 + x3 + x + 1
which has a degree of 12, will detect all burst
errors affecting an odd number of bits, will
detect all burst errors with a length less than
or equal to 12, and will detect, 99.97 percent
of the time, burst errors with a length of 12 or
more.
2BA5 Telecommunications
25
Sample TCP / IP Packet
0000
0010
0020
0030
00
00
24
bc
07
2c
33
40
e9
db
01
8a
7c
26
bd
7c
22
40
12
00
fc
00
3f
00
00
3f
3d
85
11
06
fa
00
93
0e
0f
00
85
77
b6
00
e0
86
a8
00
c4 08 00 45 00
e2 20 37 86 e2
6f 87 c0 50 18
00
...|".........E.
.,.&@.?..w.. 7..
$3...?=....o..P.
.@.|........
Ethernet Header:
src addr: 00 07 e9 7c 22 fc
dest addr: 00 11 93 85 e0 c4
IP Header:
src addr: [Link]
dest addr: [Link]
TCP Header:
src port: 445
dest port: 4671
NetBios Information
2BA5 Telecommunications
26
Checksum
* Figure is courtesy of B. Forouzan
2BA5 Telecommunications
27
Checksum II
Sender:
The unit is divided into k sections, each of n bits.
All sections are added using ones complement to get the sum.
The sum is complemented and becomes the checksum.
The checksum is sent with the data.
Receiver:
The unit is divided into k sections, each of n bits.
All sections are added using ones complement to get the sum.
The sum is complemented.
If the result is zero, the data are accepted: otherwise, rejected.
2BA5 Telecommunications
* Figure is courtesy of B. Forouzan
28
Example: Checksum
Sender:
10101001
Sum
00111001
-----------11100010
Checksum
00011101
The data that is send:
10101001 00111001 00011101
2BA5 Telecommunications
29
Example: Checksum
Sender:
Receiver:
10101001
10101001
00111001
Sum
00111001
-----------11100010
Sum
11111111
Checksum
00011101
Complement
00000000
00011101
The data that is send:
Complement: 00000000
10101001 00111001 00011101
means that the frame is OK.
2BA5 Telecommunications
30
Example: Checksum
Sender:
Receiver:
10101001
Sum
00111001
-----------11100010
Checksum
00011101
10101111
11111001
00011101
Partial Sum 1 11000101
Carry
1
Sum
11000110
Complement
00111001
The data that is send:
Complement: 00111001
10101001 00111001 00011101
means that the frame is
corrupted.
2BA5 Telecommunications
31
Summary: Detection of Errors
Parity Check
Cyclic Redundancy Check (CRC)
Checksum
2BA5 Telecommunications
32
Correction of Errors
Error Correction through Retransmission
Forward Error Correction
Burst Error Correction
2BA5 Telecommunications
33
Hamming Code
Redundancy bits distributed throughout data
bits
Individual redundancy bits work as parity bits
for specific data bits
* Figure is courtesy of B. Forouzan
2BA5 Telecommunications
34
Data and Redundancy Bits
Number of
data bits
m
Number of
redundancy bits
r
Total
bits
m+r
10
11
* Figure is courtesy of B. Forouzan
2BA5 Telecommunications
35
Redundancy Bits Calculation
* Figure is courtesy of B. Forouzan
2BA5 Telecommunications
36
Redundancy Bit Calculation
* Figure is courtesy of B. Forouzan
2BA5 Telecommunications
37
Error Detection using Hamming
Code
* Figure is courtesy of B. Forouzan
2BA5 Telecommunications
38
Burst Error Correction
Example
* Figure is courtesy of B. Forouzan
2BA5 Telecommunications
39
Summary
Causes for Errors
Types of Errors
Single-Bit & Burst Errors
Detection of Errors
Electrical & Thermal Interference
Parity Check
Two-Dimensional Parity Check
Cyclic-Redundancy Check (CRC)
Correction of Errors
Error Correction by Retransmission
Forward Error Correction
2BA5 Telecommunications
40