0% found this document useful (0 votes)
39 views44 pages

Ch10 Lec7 Error Detection10

Uploaded by

Connect Ahmed
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)
39 views44 pages

Ch10 Lec7 Error Detection10

Uploaded by

Connect Ahmed
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/ 44

PART

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:

A burst error means 2 or more bits in


the data unit have changed.
The number of bits affected depends
on the data rate and duration of noise.

www.Taleem.greatnow.com
Burst Error of Length 5

www.Taleem.greatnow.com
Error Detection

Error can be detected by adding extra


bits with the original data, a concept
called Redundancy. Adding redundant
bits allows detecting error in the data
at reception.
The error is handled by two methods.
1.Forward Error Correction
www.Taleem.greatnow.com
Forward error correction is the process
in which the receiver tries to guess the
message by using attached redundant
bits. Involves complex calculations and
as such very rarely implemented

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

2. Cyclic Redundancy Check


(CRC)

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

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

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

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, the second data
set does not follow thewww.Taleem.greatnow.com
even-parity rule and the whole
Two Dimensional Parity

In two-dimensional parity check, a


block of bits, say four characters are
divided into rows and a redundant row
of bits is added to the whole block.

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.

•All sections are added using one’s complement to get


the sum.

•The sum is complemented and becomes the checksum.

•The checksum is sent with the data.

www.Taleem.greatnow.com
The receiver follows these steps:
•The unit is divided into k sections, each of n bits.

•All sections are added using one’s complement to get


the sum.

•The sum is complemented.

•If the result is zero, the data are accepted: otherwise,


rejected.

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.

For Implementation of CRC, specially made ASICs have


been developed.

Application Specific Integrated Circuits ASIC can be for


any task that is repetitive and it is easier to use IC
instead of software.
www.Taleem.greatnow.com
Example 10
Let us calculate the checksum for a text of 8 characters
("Forouzan"). The text needs to be divided into 2-byte
(16-bit) words. We use ASCII (see Appendix A) to
change each byte to a 2-digit hexa-decimal number.
For example, F is represented as 0x46 and o is
represented as 0x6F. Figure 10.25 shows how the
checksum is calculated at the sender and receiver sites. In
part a of the figure, the value of partial sum for the first
column is 0x36. We keep the rightmost digit (6) and
insert the leftmost dight (3) as the carry in the second
column. The process is repeated for each column.

www.Taleem.greatnow.com
Figure 10.25

www.Taleem.greatnow.com

You might also like