Professional Documents
Culture Documents
Ch10 Lecture7 Error Detection LIU Fall 2021
Ch10 Lecture7 Error Detection LIU Fall 2021
Lecture 7
Error Detection
and
Correction
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
10.1
10-1 INTRODUCTION
10.2
Data link layer duties
Basic Concepts
▪ Networks must be able to transfer data from one
device to another with complete accuracy.
▪ Data can be corrupted during transmission.
▪ For reliable communication, errors 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.
Types of Errors
Note
10.6
Single-bit Error
Single-bit error
Burst Error
▪ The term burst error means that two or more bits in the data
unit have changed from 1 to 0 or from 0 to 1.
▪ Burst errors does not necessarily mean that the errors
occur in consecutive bits,
▪ the length of the burst is measured from the first corrupted bit
to the last corrupted bit.
▪ Some bits in between may not have been corrupted.
10.9
Error Detection
10.11
Redundancy
10.12
Detection Methods
Parity Check
▪ The simplest error-detecting scheme is to append a parity bit
to the end of a block of data.
▪ 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
▪ A typical example is character transmission, in which a parity
bit is attached to each 7-bit ASCII character
Table 10.3 Simple even parity-check code C(5, 4)
10.15
Parity Check – Example 1
Suppose the sender wants to send the word world. In ASCII
the five characters are coded as
w → (1110111) o → (1101111) r →(1110010)
l →(1101100) d(1100100)
What will be the transmitter code using even parity?
Solution:
The following shows the actual bits for the code-words sent
11101110 11011110 11100100 11011000 11001001
Example 2
Solution:
The receiver counts the 1s in each character and comes up
with even numbers (6, 6, 4, 4, 4). The data is accepted.
Example 3
Now suppose the following binary bits for the word world in
Example 1 are received by the receiver and the receiver
knows that the even parity check is used.
11111110 11011110 11101100 11011000 11001001
is the received binary bits error?
Solution:
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.
Example 4
Let us look at some transmission scenarios. Assume the
sender sends the dataword 1011. The codeword created
from this dataword is 10111, which is sent to the receiver.
We examine five cases:
10.21
Cyclic Redundancy Check (CRC)
▪ One of the most common, and one of the most powerful, error-
detecting codes is the cyclic redundancy check (CRC), which can be
described as follows:
▪ Given a k-bit block of bits, or message, the transmitter generates an
sequence, known as a frame check sequence (FCS) of n bits, such that
the resulting frame, consisting of (k+n) bits, is exactly divisible by
some predetermined number.
▪ The receiver then divides the incoming frame by the same number and,
if there is no remainder, assumes that there was no error.
FCS
FCS
CRC – Sender Operation
▪ M = original data message ( k bits)
▪ G = Predefined and agreed upon divisor pattern (n+1 bits)
▪ Mn = M concatenated with n zeros
▪ R = remainder of dividing ( Mn / G )
▪ R is also called FCS
M
MR Mn
G
FCS
R
FCS
CRC encoder and decoder
▪ Sender Operation
▪ The transmitter performs the division Mn / G
▪ The transmitter then computes the remainder R
▪ It then concatenates the remainder with the message “MR”
▪ Then it sends the encoded message over the channel “MR”.
M
Mn
R
MR
10.24
CRC Encoder and Decoder
▪ Receiver Operation:
▪ The receiver receives the message MR
▪ It then performs the division of the message by the predetermined
pattern G, “ MR / G ”
▪ If the remainder is zero, then it assumes the message is not
corrupted “Does not have any error”. Although it may have some.
▪ If the remainder is NON-zero, then for sure the message is corrupted
and contain error/s.
M
Mn
MR
10.25
CRC - Division Process
▪ The division used in the CRC is a modulo-2 arithmetic
division.
▪ Exactly like ordinary long division, only simpler, because at
each stage we just need to check whether the leading bit
(leftmost bit) of the current dividend is 0 or 1.
▪ If it's 0, we place a 0 in the quotient and exclusively OR the current
dividend bits with zeros.
▪ If it's 1, we place a 1 in the quotient and exclusively OR the dividend
current bits with the divisor.
Figure 10.4 XORing of two single bits or two words
10.27
CRC – Example 1
Using CRC for error detection and given a message M = 100100 with G =
1100, compute the following
a) Frame check Sum (FCS)
b) Transmitted frame
b) Transmitted frame
FCS
100100001
CRC – Example 2
Using CRC for error detection and given a message M = 1001 with
G = 1011, compute the following
a) Frame check Sum (FCS)
b) Transmitted frame
c) Check if there is any error in the data if the received frame
1001110 and 1000110.
(FCS)
b) Transmitted frame
CRC – Example 2 (cont.)
10.30
CRC – Exercises
Exercise 1
Using CRC for error detection and given a message
M = 10110 with G = 110, compute the following
a) Frame check Sum (FCS)
b) Transmitted frame
c) Received frame and check if there is any error in the data
Exercise 2
Using CRC for error detection and given a message
M = 111001 with G = 11001, compute the following
a) Frame check Sum (FCS)
b) Transmitted frame
c) Received frame and check if there is any error in the data
10.31
Polynomial
Polynomial and Divisor
Figure 10.21 A polynomial to represent a binary word
10.34
Figure 10.22 CRC division using polynomials
M = 1001000 → x + x 6 3
G = 1011 → x + x + 1
3
Mn = 1001000 → x 6 + x 3
10.35
Standard Polynomials
10.37
End of Lecture 7
10.38
Vertical Redundancy Check (VRC)
Longitudinal Redundancy Check (LRC)
Two-dimensional parity-check code