Ch10 Lec7 Error Detection10
Ch10 Lec7 Error Detection10
III
Data Link Layer
www.Taleem.greatnow.com
Position of the data-link layer
www.Taleem.greatnow.com
Data link layer Functions
www.Taleem.greatnow.com
Chapter 10
Error Detection
and Correction
at
Data Link Layer
www.Taleem.greatnow.com
Sources of Error
Data can be corrupted during transmission.
For reliable communication, errors must be
prevented, or detected and corrected.
www.Taleem.greatnow.com
Sources of Error
White Noise: Or thermal noise is an unwanted signal generated
due to the heat created by the movement of electrons. This is
controllable. We can reduce its effect by using suitable
equipment.
Impulse Noise: We never know when it comes. We can not
predict it. i.e : spike noise is a scratch on a CD surface.
Crosstalk: is the effect of one medium on another. It can be
prevented by shielding the cables to protect the signals.
Echo: We have echo when a sending device receives back
some of the energy it has sent. Echo can be a problem if the
devices and medium are not correctly designed. Echo can be
prevented with good design and appropriate devices.
www.Taleem.greatnow.com
Sources of Error
Jitter: is the result of a change in the signal when it passes
through an electronic device. The device (such as amplifier)
may create extra harmonics in the signal. Jitter is not a problem
if it is week.
Attenuation: A signal may become too weak if it travels a
long distance. Some of the energy of the signal may be
converted into heat to overcome the resistance of the medium.
It can be prevented by placing repeaters at suitable distances or
using better quality wires.
Distortion:
a. An undesired change in the shape of an electromagnetic
wave or signal due to external interference
b. Such a change results in changes in the shape of waveform,
resulting in loss of clarity in radio reception or sound
reproduction www.Taleem.greatnow.com
Distorted Signals that may not
be correctly understood by the
receiver
www.Taleem.greatnow.com
Types of Error
Single-Bit Error
Burst Error
www.Taleem.greatnow.com
A single-bit error occurs, when only
one bit in the data unit has changed
during transmission.
www.Taleem.greatnow.com
Single-bit error
www.Taleem.greatnow.com
Burst Error:
www.Taleem.greatnow.com
Burst Error of Length 5
www.Taleem.greatnow.com
Error Detection
www.Taleem.greatnow.com
In correction by retransmission, the
receiver detects the occurrence of an
error and asks the sender to resend the
message. Resending is repeated until a
message arrives that the receiver
believes is error-free
www.Taleem.greatnow.com
Error Detection Techniques
1. Parity Check
3. Checksum
www.Taleem.greatnow.com
Redundancy
www.Taleem.greatnow.com
1. Parity Check
In Even parity check, a parity bit is
added to every data unit so that the
total number of 1s is even
(or odd for odd-parity).
www.Taleem.greatnow.com
Even-parity concept
www.Taleem.greatnow.com
Example 1
www.Taleem.greatnow.com
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.
www.Taleem.greatnow.com
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. The receiver discards
the data and asks for retransmission.
www.Taleem.greatnow.com
Simple parity check can detect single-
bit errors. It can detect burst errors
only if the total number of errors in
each data unit is odd.
www.Taleem.greatnow.com
Example 4
Suppose the following block is sent which has 1 parity bit
10101001 00111001 11011101 11100111
10101010
When the receiver checks the parity bits, the second data
set does not follow thewww.Taleem.greatnow.com
even-parity rule and the whole
Two Dimensional Parity
www.Taleem.greatnow.com
Two-dimensional parity
www.Taleem.greatnow.com
2. Cyclic Redundancy Check CRC
generator and checker
www.Taleem.greatnow.com
CRC generator
If Divisor is 4 bit,
we add three
extra zeros (4-1)
Then
XOR Operation
www.Taleem.greatnow.com
CRC checker
XOR Operation
www.Taleem.greatnow.com
Division in the CRC decoder for two cases
One bit changed
www.Taleem.greatnow.com
3. CHECKSUM
www.Taleem.greatnow.com
Checksum
www.Taleem.greatnow.com
Data unit and checksum
www.Taleem.greatnow.com
The sender follows these steps:
•The data is divided into k sections, each of n bits.
www.Taleem.greatnow.com
The receiver follows these steps:
•The unit is divided into k sections, each of n bits.
www.Taleem.greatnow.com
Example 5
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
www.Taleem.greatnow.com
Example 6
Now suppose the receiver receives the pattern sent in Example 7
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.
www.Taleem.greatnow.com
Example 7
Now suppose there is a burst error of length 5 that affects 4 bits.
10101111 11111001 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.
www.Taleem.greatnow.com
Example 8
Suppose our data is a list of five 4-bit numbers that we want to
send to a destination. In addition to sending these numbers, we
send the sum of the numbers. For example, if the set of numbers is
(7, 11, 12, 0, 6), we send (7, 11, 12, 0, 6, 36), where 36 is the sum
of the original numbers. The receiver adds the five numbers and
compares the result with the sum. If the two are the same, the
receiver assumes no error, accepts the five numbers, and discards
the sum. Otherwise, them is an error somewhere and the data are
not accepted.
www.Taleem.greatnow.com
Example 9
We can make the job of the receiver easier if we send the negative
(complement) of the sum, called the checksum. In this case, we
send (7, 11, 12, 0, 6, -36). The receiver can add all the numbers
received (including the checksum). If the result is 0, it assumes no
error; otherwise, there is an error.
www.Taleem.greatnow.com
The nature of the checksum (treating words as numbers
and adding and complementing them) is well-suited for
software implementation. Short programs can be written
to calculate the checksum at the receiver site or to
check the validity of the message at the receiver site.
www.Taleem.greatnow.com
Figure 10.25
www.Taleem.greatnow.com