Error Detection and Correction
Error Detection and Correction
• Error correction and error detection techniques are work on the data-link layer.
• The data link layer ensures the frames are sent from the sender to the receiver with
accuracy.
• The data can be corrupted during transmission.
• Some application requires that the errors being detected or corrected
Error
• An error is a situation when the data send by the sender and receive by the receiver,
but that data doesn't match the sender data.
• For example, the sender sends the 010101 data, and the receiver receives the 110101.
Types of errors:
• Whenever the bits flow from one point to another, some unpredictable changes occur
because of an interference.
• The interference can change the shape of the signal. There are two types of errors.
• Single bit error
• Burst error
Example: (0 to 1) or (1 to 0).
For example, the sender sends the data (01010100) in the frame, and the receiver receives the
data (11010100) in the frame.
Example
0 1 0
1 0 1 0 0 1 1 0 1 0 1 0 0
Data Sent Data Received
Multi bit Error
0 1 0 1 0 1 0 0 1 1 0 1 0 1 1 0
Data Sent Data Received
Burst error:
In the burst error, one or more than one bits is corrupted in the frame.
For example, the sender sends the data (01010100) in the frame, and the receiver receives the
data (11010100) in the frame.
0 1 0 1 0 1 0 0 1 1 0 1 1 1 1 1
Data Sent Data Received
Error Detection Techniques
There are three main techniques for detecting errors in frames: Parity Check, Checksum and
Cyclic Redundancy Check (CRC).
Parity Check
The parity check is done by adding an extra bit, called parity bit to the data to make a number
of 1s either even in case of even parity or odd in case of odd parity.
even parity:
odd parity:
• 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.
3. Checksum
In this error detection scheme, the following procedure is applied
• Data is divided into fixed sized frames or segments.
• The sender adds the segments using 1’s complement arithmetic to get the sum. It then
complements the sum to get the checksum and sends it along with the data frames.
• The receiver adds the incoming segments along with the checksum using 1’s
complement arithmetic to get the sum and then complements it.
• If the result is zero, the received frames are accepted; otherwise, they are discarded.
Error-Correcting Codes
• Hamming code is a set of error-correction codes that can be used to detect and
correct the errors that can occur when the data is moved or stored from the sender to
the receiver.
• It is a technique developed by R.W. Hamming for error correction.
• Hamming code is a liner code that is useful for error detection up to two immediate
bit errors. It is capable of single-bit errors.
• In Hamming code, the source encodes the message by adding redundant bits in the
message. These redundant bits are mostly inserted and generated at certain positions
in the message to accomplish error detection and correction process.
Error detection and correction by using hamming code is as follows
• To each group of m information bits k parity bits are added to form (m+k) bit code
• Location of each of the (m+k) digits is assigned a decimal value.
• The k parity bits are placed in positions 1, 2, …, 2k-1 positions.–K parity checks are
performed on selected digits of each codeword.
• At the receiving end the parity bits are recalculated. The decimal value of the k
parity bits provides the bit-position in error, if any.
• Use of Hamming code for error correction for a 4-bit data
• This examples illustrates an (12, 3, 4) LDPC matrix, i.e. n = 12, j = 3 and k = 4. This
implies that each equation operates on 4 code symbols and each code symbol
appears in 3 equations.
• Unlike parity check matrix of the Hamming code, this code does not have any
diagonal 1s in parity bits.