0% found this document useful (0 votes)
172 views

3-Module 3-23-Feb-2021Material I 23-Feb-2021 Error Detection and Correction

The document discusses error detection and correction methods at the data link layer. It describes common types of errors like single-bit and burst errors. It then explains various error detection techniques like vertical redundancy check (VRC), longitudinal redundancy check (LRC), checksum, and cyclic redundancy check (CRC). For error correction, it covers Hamming codes which work by sending redundant bits to detect and locate errors. The document provides examples to illustrate how different error detection and correction techniques function.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
172 views

3-Module 3-23-Feb-2021Material I 23-Feb-2021 Error Detection and Correction

The document discusses error detection and correction methods at the data link layer. It describes common types of errors like single-bit and burst errors. It then explains various error detection techniques like vertical redundancy check (VRC), longitudinal redundancy check (LRC), checksum, and cyclic redundancy check (CRC). For error correction, it covers Hamming codes which work by sending redundant bits to detect and locate errors. The document provides examples to illustrate how different error detection and correction techniques function.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 39

Error detection and

correction
By, J. Dheeba/SCOPE

J. Dheeba/SCOPE
Learning outcomes
• Understand the types of errors
• Familiarize with different error detection and correction methods
• Detect errors based on the redundancy bit

J. Dheeba/SCOPE
• At the data-link layer, if a frame is corrupted between the two nodes,
it needs to be corrected before it continues its journey to other
nodes.
• most link-layer protocols simply discard the frame and let the upper-
layer protocols handle the retransmission of the frame.
• Some multimedia applications, however, try to correct the corrupted
frame
• Error detection and correction is done in two layers: data link and
transport layer

J. Dheeba/SCOPE
Types of Errors
• Whenever bits flow from one point to another, they are subject to
unpredictable changes because of interference.
• single-bit error means that only 1 bit of a given data unit (such as a byte,
character, or packet) is changed from 1 to 0 or from 0 to 1.

• burst error means that 2 or more bits in the data unit have changed from 1 to
0 or from 0 to 1.

J. Dheeba/SCOPE
• Redundancy
• To be able to detect or correct errors, we need to send some extra bits with
our data.
• These redundant bits are added by the sender and removed by the receiver.
• Their presence allows the receiver to detect or correct corrupted bits.
• Error detection
• we are only looking to see if any error has occurred.
• The answer is a simple yes or no.
• We are not even interested in the number of corrupted bits.
• Error correction
• we need to know the exact number of bits that are corrupted and, more
importantly, their location in the message.
• The number of errors and the size of the message are important factors.

J. Dheeba/SCOPE
• Block coding
• We divide our message into blocks, each of k bits, called
datawords.
• We add r redundant bits to each block to make the length n = k + r.
• The resulting n-bit blocks are called codewords.
• How is this extra ‘r’ bits generated?
• Error detection methods
• Vertical redundancy check
• Longitudinal redundancy check
• Cyclic redundancy check
• Checksum

J. Dheeba/SCOPE
• Error Correction methods
• Hamming codes
• Error Correction can be handled in two ways:
• Backward error correction: Once the error is discovered, the receiver
requests the sender to retransmit the entire data unit.
• Forward error correction: In this case, the receiver uses the error-correcting
code which automatically corrects the errors.

Error detection/correction
Model

J. Dheeba/SCOPE
Error detection methods – Vertical Redundancy check (VRC)
• Also called as parity check Performance of VRC
• Detect single bit error
• It can detect burst errors only if the number of error is odd.
Sender 11100001 -> 10100001 -> Receiver -> Reject the data
Sender 11100001 -> 10100101 -> Receiver -> Accept the data

Accept data 1100010

Yes Even Parity


generator
count
bits
Even ? 1 Redundancy bit (VRC bit)
1100010 1 1100010 1
1100010 1 Data + redundant bit appended

Receiver Sender
J. Dheeba/SCOPE
Example Problem
Append the parity bit after each block using VRC
1110110 1101111 1110010
After adding parity
1110110 1 1101111 0 1110010 0

J. Dheeba/SCOPE
Practice Problem
1. A receiver R has received a codeword as ‘101100111’. Check for
errors using VRC (even parity).

J. Dheeba/SCOPE
Error detection methods – Longitudinal Redundancy check
(LRC)
• In LRC, the block of bits is organized into rows and columns
• Hence, LRC is also called two dimensional parity.
• The parity bit is calculated for each column and send along with the
data.
• A block of parity acts are a redundant bit.

J. Dheeba/SCOPE
Practice problem
• How the following data will be transmitted using LRC
• 11001110 10101101 01101101 11010110

11001110
10101101
01101101
11010110
11011000
Data to be send : 11001110 10101101 01101101 11010110 1 1 0 1 1 0 0 0

J. Dheeba/SCOPE
• Performance of LRC
• Increases the likelihood of detecting burst errors.
• But if the errors are at the same position in two blocks then difficult to detect

11001110 10001110
10101101 11101101
01101101 01101101
11010110 11010110

11011000 11011000

Solution

Data transmitted Is
11001111 10111011 01110010 01010011 01010101

J. Dheeba/SCOPE
Error detection methods – Checksum
• Sender creates the checksum
• Break the original message into ‘k’ number of blocks with ‘m’ bits in each
block.
• Sum all the ‘k’ data blocks
• Add the carry to the sum, if any
• Do the 1’s complement to the sum. Checksum will be also ‘m’ bits

J. Dheeba/SCOPE
• Receiver side validates the data received
• Collect all the data including the checksum
• Sum all the data blocks and the checksum
• If the results is all 1’s, ACCEPT, else, REJECT

J. Dheeba/SCOPE
J. Dheeba/SCOPE
Practice problem
• Consider the data unit to be transmitted is -
10011001111000100010010010000100
Consider 8 bit checksum is used. Calculate the checksum at the sender.

J. Dheeba/SCOPE
Cyclic redundancy check
• Powerful error detection scheme
• Rather than addition, binary division is used
• Can be easily implemented with small amount of hardware
• Shift registers
• XOR (for addition and subtraction)
• Cyclic codes are special linear block codes with one extra property. In
a cyclic code, if a codeword is cyclically shifted (rotated), the result is
another codeword.

J. Dheeba/SCOPE
J. Dheeba/SCOPE
J. Dheeba/SCOPE
J. Dheeba/SCOPE
• Using polynomials
• We can use a polynomial to represent a binary word.
• Each bit from right to left is mapped onto a power term.
• The rightmost bit represents the “0” power term. The bit next to it the “1”
power term, etc.
• If the bit is of value zero, the power term is deleted from the expression.

J. Dheeba/SCOPE
J. Dheeba/SCOPE
Practice problem
• Suppose we want to transmit the message 11001001 and protect it
from error using the CRC polynomial x3+1. use polynomial long
division to determine the message that should be transmitted.
Corrupt the left most third bit of the transmitted message and show
that the error is detected by the receiver using CRC technique
• 11101001000 -> data + 000 padded based on the divisor
• 1001 -> divisor

J. Dheeba/SCOPE
Hamming code
• Error detection and correction mechanism
• Given by R.W.hamming
• It Is a forward error correction method
• Error correction is done by sending redundant bits with the original
data.
• Hamming distance between two words of same size is the number of
difference between the corresponding bits.
• The hamming distance is denoted between two words x and y is
denoted as d(x,y)
• It is obtained by XORing the two words
J. Dheeba/SCOPE
• For example,
• if the codeword 00000 is sent and 01101 is received, 3 bits are in error and
the Hamming distance between the two is,
• d(00000, 01101) = 3.
• The Hamming distance d(000, 011) is 2 because (000 ⊕ 011) is 011 (two 1s).

J. Dheeba/SCOPE
• minimum Hamming distance is the smallest Hamming distance
between all possible pairs of codewords denoted by dmin

A code scheme has a Hamming distance dmin = 3. This code guarantees the detection of up to
Two errors (dmin = s + 1 or s = 2).
Minimum Hamming Distance dmin can fix (dmin-1)/2 errors
J. Dheeba/SCOPE
Hamming codes
• Hamming code is technique developed by R.W. Hamming for error
correction.
• This method corrects the error by finding the state at which the error
has occurred.
• To correct the error in data frame, the receiver must know exactly
which bit in the frame is corrupted.
• To locate the bit in error, redundant bits are used as parity bits for
error detection.
Data Bits + Redundant Bits
(d)+(R)
• linear block codes can be represented in two forms
• Systematic form
• redundant bits are calculated from the message bits and both are
concatenated side by side
• Say, 1010111 -> hamming code
• Then data bit = 1010 and redundant bit = 111
• non-Systematic form
• the positions of the original message bits and the redundant bits are mixed.
• Step 1 − Calculation of the number of redundant bits.
• Step 2 − Positioning the redundant bits.
• Step 3 − Calculating the values of each redundant bit.
• Step 1 − Calculation of the number of redundant bits.
2p ≥ d + p +1
Suppose the number of data bits is 7, then the number of redundant
bits can be calculated using:
2^4 ≥ 7 + 4 + 1
Thus, the number of redundant bits= 4
• Step 2 − Positioning the redundant bits
• The p redundant bits placed at bit positions of powers of 2, i.e. 1, 2, 4,
8, 16 etc.
• The following table illustrates how to calculate parity bits for the
above coding scheme.
• P1 -> 1, 3, 5, 7
• P2 -> 2, 3, 6, 7
• P4 -> 4, 5, 6, 7

1 -> 0 0 0 1
2 -> 0 0 1 0
3 -> 0 0 1 1
4 -> 0 1 0 0
5 -> 0 1 0 1
6 -> 0 1 1 0
7 -> 0 1 1 1
Example
• Let us attempt to find the Hamming code for the message bits 1101.
• The message 1101 will be sent as 1100110 using Hamming coding
algorithm as follows.
• Here the data bits and the parity bits in the codeword are mixed in
position and so it is a non-systematic code.

P1 -> 1, 3, 5, 7
P2 -> 2, 3, 6, 7
P4 -> 4, 5, 6, 7
• Single bit Error Correction
• Consider that the codeword generated as before was transmitted and
instead of receiving 1100110, we received 1110110.
• Message transmitted by the sender – 1100110
• Message received by the sender – 1110110
• A one bit error has occurred during the reception of the codeword.
Let’s see how the decoding algorithm corrects this single bit error.
• Message received by the sender – 1110110
• Practice Questions
• 1. Calculate the number of redundancy bits r required to correct n bits of
data. Apply your result for the case n = 15.
• 2. Use the Hamming code to calculate the codeword for 10011010. Explain
each stage in your calculation.
• 3. Use the Hamming code to calculate the codeword for 10011010. Assume
that instead of 011100101010 the receiver got 011100101110. Show how
the receiver can calculate which bit was wrong and correct it.
• 4. Test if code word 010101100011 is correct, assuming it was created
using an even parity Hamming code. If it is incorrect, indicate what the
correct code word should have been. Finally, indicate what the original
data was.

You might also like