CCN L07Data Link Error Control
CCN L07Data Link Error Control
Error Control
Dr. Ajay Singh Raghuvanshi
Electronics & Communication
Engineering, NIT, Raipur
Error Detection and Correction
Two basic strategies to deal with errors:
1. Include enough redundant information to enable the
receiver to deduce what the transmitted data must
have been.
Error correcting codes.
2. Include only enough redundancy to allow the receiver
to deduce that an error has occurred (but not which
error).
Error detecting codes.
Error Detection & Correction Code
D D D P D P P 7-BIT CODEWORD
D - D - D - P (EVEN PARITY)
D D - - D P - (EVEN PARITY)
D D D P - - - (EVEN PARITY)
Hamming Code
Why Those Bits? - The three parity bits (1,2,4) are related to the data
bits (3,5,6,7) as shown at right. In this diagram, each overlapping circle
corresponds to one parity bit and defines the four bits contributing to
that parity computation. For example, data bit 3 contributes to parity
bits 1 and 2. Each circle (parity bit) encompasses a total of four bits,
and each circle must have EVEN parity. Given four data bits, the three
parity bits can easily be chosen to ensure this condition.
It can be observed that changing any one bit numbered 1..7 uniquely
affects the three parity bits. Changing bit 7 affects all three parity bits,
while an error in bit 6 affects only parity bits 2 and 4, and an error in a
parity bit affects only that bit. The location of any single bit error is
determined directly upon checking the three parity circles.
Hamming Code
Hamming Code
For example, the message 1101 would be sent
as
7 6 5 4 3 2 1
1 1 0 0 1 1 0 7-BIT CODEWORD
1 - 0 - 1 - 0 (EVEN PARITY)
1 1 - - 1 1 - (EVEN PARITY)
1 1 0 0 - - - (EVEN PARITY)
The above error (in bit 5) can be corrected by examining which of the
three parity bits was affected by the bad bit:
transmitted message received message
1 1 0 0 1 1 0 ------------> 1110110
BIT: 7 6 5 4 3 2 1 BIT: 7 6 5 4 3 2 1
7 6 5 4 3 2 1
1 1 1 0 1 1 0 7-BIT CODEWORD
1 - 1 - 1 - 0 (EVEN PARITY) NOT! 1
1 1 - - 1 1 - (EVEN PARITY) OK! 0
1 1 1 0 - - - (EVEN PARITY) NOT! 1
In fact, the bad parity bits labeled 101 point directly to the bad bit since 101 binary equals 5. Examination
of the 'parity circles' confirms that any single bit error could be corrected in this way.
The value of the Hamming code can be summarized:
1. Detection of 2 bit errors (assuming no correction is attempted);
2. Correction of single bit errors;
3. Cost of 3 bits added to a 4-bit message.
The ability to correct single bit errors comes at a cost which is less than sending the entire message twice.
(Recall that simply sending a message twice accomplishes no error correction.)
Practically Error-Detecting Codes
Cost of re-transmission over a network link is
much smaller than computational complexity
needed to implement error correction.
Hence in practical data networks Error
detection is employed with retransmission.
11100111
11011101
00111001
10101001
10101010
06/01/2023 16
Dr.Ajay Singh Raghuvanshi
Two-dimension Parity Check
Performance can be improved by using two-dimensional parity check, which organizes the block
of bits in the form of a table. Parity check bits are calculated for each row, which is equivalent to a
simple parity check bit. Parity check bits are also calculated for all columns then both are sent
along with the data. At the receiving end these are compared with the parity bits calculated on the
received data
06/01/2023 17
Checksum
In checksum error detection scheme, the data is divided into k
segments each of m bits. In the sender’s end the segments are added
using 1’s complement arithmetic to get the sum. The sum is
complemented to get the checksum. The checksum segment is sent
along with the data segments
Like LRC, but it uses one’s complement arithmetic
Performance
The checksum detects all errors involving an odd number of
bits. It also detects most errors involving even number of
bits
06/01/2023 Dr.Ajay Singh Raghuvanshi 18
At Receiver
At Sender End
End
k bits n bits