Error
• When data is being transmitted from one machine to
another, it may be possible that data become
corrupted on its way.
• Some of the bits may be altered, damaged or lost
during transmission, such a condition is known as
error.
• The error may occur because of noise on line,
attenuation and distortion. For reliable
communication, it is important that errors are
detected and corrected.
1
Types of Errors
• There are 2 types of errors:
1. Single Bit error
2. Burst error
2
Contd…
• The fig. illustrates single bit error .here ----00000011
had been sent but 00001011 was received.
0 0 0 0 0 0 1 1
sent
0 changed to 1
0 0 0 0 1 0 1 1
received
3
BURST ERROR
• Burst error means that 2 or more than 2 bits in the data unit or packet
have changed form 0 to 1 or 1 to 0.
sent Length of burst error 5 bits
0 1 0 0 0 1 0 0 0 1 0 0 0 0 1 1
receiver Bits corrupted by burst error
0 1 0 1 1 1 0 1 0 1 0 0 0 0 1 1
4
Methods of Error Detection
• We transmit the data from one device to another. If
the receiving device does not have an original copy of
the transmitted data it is not easy to detect error
without comparison of the received data and the
original date.
• One error mechanism that would satisfy these
requirements would be to send every data unit twice.
The receiving device can compare both versions of
data bit by bit. any discrepancy would indicate an
error and an appropriate correction mechanism could
be set in place.
5
Contd…
• This procedure would be completely accurate but it
would be very slow because transmission time of data
will be doubled and additional time would be needed
for the comparison of both versions of data bit by bit.
• The concept of including extra information in the
transmission solely for the purpose of comparison is a
good one. But instead of repeating the entire data
stream a shorter group of bits may be appended to
the end of each unit. This technique is called
Redundancy because extra bits are redundant to the
info. And they are discarded as soon as the accuracy
of the transmission has been determined.
6
Data Unit Group of bits
1 0 1 0 0 0 0 0 0 1 1 0 1 1 1 0 0 1 1 0
Appended group of bits
1 0 1 0 0 0 0 0 0 1 1 0 1 1 1 0 0 1 1 0
Data Transmission
Receiver
If accepted,
Checking Function redundant bits
are discarded
1 0 1 0 0 0 0 0 0 1 1 0 1
7
Contd..
• The sender sends data unit after the addition of group of
bits and the receiver checks the concept of bit stream
through the checking function. If the received bit stream
passes the checking criteria the data portion of the data
unit is accepted ,subsequently the redundant bits are
discarded.
8
Contd..
• 4 types of redundancy checks are used in data transmission:
1. Parity check/Vertical Redundancy Check.
2. Longitudinal Redundancy Check.
3. Cyclic Redundancy Check.
4. Checksum
9
1.PARITY CHECK/VERTICAL
REDUNDANCY CHECK
• The most common approach is parity checking which involves
counting all the 1 bits in the data and adding 1 more bit to make the
total no. of 1 bit even (even parity) or odd (odd parity).
• The extra bit is called parity redundant bit. This method is also called
VRC.
10
Parity Bit
1 1 0 0 0 1 0 Even Parity Generator
1 1 0 0 0 1 0 1
Is the total no. of 1s
CHECKING FUNCTION even?
YES Receiver accepts
the data
1 1 0 0 0 1 0
Parity Check
11
CONTD.
• Before transmitting we pass the data unit through a
parity generator.It counts 1s and appends the parity
bit (1) to the end.
• The system now transmits the entire expanded unit
across the n/w data link.When it reaches the
destination,the receiver puts all 8 bits through the
even parity checking function.If the receiver (1100001
---- 11000011) sees 11000011, it counts four 1s the
even 1s, the data unit passes.
12
CONTD.
• If instead of 11000011 the receiver sees 11001011, the parity checker
counts the 1s-5-odd no. the receiver knows that an error has been
introduced into the data and therefore rejects the whole unit.
13
Longitudinal Redundancy Check (LRC)
• This approach is also known as 2-dimensional parity
check.
• In this technique a block of bits is organized in the
form of rows and columns.
• For example: Suppose the sender wants to send a
block of 32 bits. Before transmitting ,we organize the
32bits in a table form which consists of 4 rows and 8
columns.
14
Contd.---
• We then calculate the parity bit for each column and
create a new row of 8 bits which are the parity bits for
the whole block. Here the first parity bit in the 5th row is
calculated based on all first bits.
• We then attach the 5th row which consists of 8 parity
bits to the original data
(32 bits) and send them to the receiver.
15
11100111 11011101 00111001 10101001
I row 1 1 1 0 0 1 1 1
II row 1 1 0 1 1 1 0 1
III row 0 0 1 1 1 0 0 1
1 0 1 0 1 0 0 1
IV row
V LRC 1 0 1 0 1 0 1 0
11100111 11011101 00111001 10101001 10101010
16
11100111 11011101 00111001 10101001 10101010
Original data LRC
11100111 11011101 00111001 10101001 10101010
LRC uncorrupted data
The receiver checks the LRC block, 10101010 and
follows the even parity rule. After this , the block of
data unit is accepted.
17
3. CHECKSUM
• The error detection method used by the higher layer protocols is
called checksum.
• Checksum is based on the concept of redundancy.
• Here the sender uses checksum generator and receiver uses
checksum checker.
18
CHECKSUM GENERATOR
• It subdivides the data unit into equal segments of n
bits (usually 16).These segments are added together .
• The complement of the result obtained by adding the
segments , called the checksum field is added to the
end of the original data unit as the redundancy unit.
The sender transmits the data unit plus checksum.
19
Contd.--
• Example of checksum generator:
• The example data unit consists of 16 bits are
10101001 , 00111001.
• The data unit is divided into 2 segments of 8 bits as
10101001 and 00111001. Both segments are added
using 1’s complement arithmetic as:
20
Contd.--
10101001
00111001
11100010 SUM
Checksum is the complement of the sum ie. 00011101.
The checksum is added to the data unit.
The pattern sent is 10101001 00111001 00011101.
21
CHECKSUM CHECKER
• The receiver receives the above pattern. The receiver then
adds the 3 sections together and will get all 1s which after
complementing is all 0s.This shows that there is no error in
the transmission ie.
10101001
00111001 Data segment
00011101 Data segment
11111111 checksum
00000000 Sum
Thus the complement contains only 0s.So the receiver accepts
Complement
the data.
22
CYCLIC REDUNDANCY CHECK (CRC)
• One of the most common and one of the most powerful of
the redundancy checking technique is cyclic Redundancy
Check.
• PR and VRC are based on addition while CRC is based on
binary division.
• In CRC instead of adding bits to achieve a desired parity, a
sequence of redundant bits,called CRC or CRC remainder is
appended to the data unit so that the resulting data unit
becomes exactly divisible by a second predetermined no.
23
Contd…
• At its destination , the incoming data unit is divided by the same no. If
at this step there is no remainder, the data unit is assumed to be
intact and is therefore accepted.A remainder indicates that the data
unit has been damaged in transit and therefore must be rejected.
• The redundancy bits used by CRC are derived by dividing the data unit
by a predetermined divisor,the remainder is CRC.
24
Contd.---
• A CRC must have 2 qualities:
1. It must have exactly one less bit than the divisor.
2. Appending it to the end of the data string must take the resulting
bit sequence exactly divisible by the divisor.
25
CRC• Generator
CRC generator uses modulo-2 division.
• Process of Division:
1. The 4 bit divisor is subtracted from I 4 bits of dividend.
2. Each bit of the divisor is subtracted from corresponding bit of the
dividend without disturbing the next higher bit.
3. The next unused bit from the dividend is then pulled down to make the
no. of bits in the remainder equal to the no. of bits in the divisor.
4. A) In this process,the divisor always begins with 1.
B) The divisor is subtracted from a portion of the
previous-dividend/remainder that is equal to it in length.
C) The divisor can only be subtracted from a dividend/remainder whose
leftmost bit is 1.
D) Anytime the leftmost bit of remainder is 0 , a string of 0s of same
length as divisor replaces the divisor.
26
CRC Checker
• A CRC checker functions exactly as generator does.
• After receiving the data appended with CRC,it does the same mosulo-
2 division.
• If the remainder is all 0s the CRC is dropped and data is accepted
otherwise the received stream of bits is discarded and the data is
resent.
27
1101 100100 0 0 0 111101 Quotient
divisor
110 1
10 0 0
11 0 1
1 0 1 0
1 1 0 1
1 1 1 0
1 1 0 1
When the leftmost bit
0 1 1 0 of remainder is 0 , we
0 0 0 0 must use 0000 instead
of the original divisor.
1 1 0 0
1 1 0 1
0 0 1 REMAINDER
BINARY DIVISION IN CRC GENERATOR 28
1101 100100001 111101
Data plus CRC received
1101
1000
1101
1010
1101
1110
1101
0110
0000 When leftmost bit is
zero,use 0000 = no. of
110 1 bits in the divisor.
1 101
000 Result
BINARY DIVISION IN CRC CHECKER 29