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

Error Detection and Correction

Pdc

Uploaded by

royal.manhas.077
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)
24 views

Error Detection and Correction

Pdc

Uploaded by

royal.manhas.077
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/ 79

Error Detection

and Correction

• Types of Errors
• Detection
• Correction
Basic concepts
 Networks must be able to transfer data from
one device to another with complete accuracy.
 Data can be corrupted during transmission.
 For reliable communication, errors must be
detected and corrected.
 Error detection and correction
are implemented either at the data link
layer or the transport layer of the OSI
model.
Types of Errors
Single-bit error
Single bit errors are the least likely type of
errors in serial data transmission because
the noise must have a very short duration
which is very rare. However this kind of
errors can happen in parallel transmission.
Example:
If data is sent at 1Mbps then each bit lasts
only 1/1,000,000 sec. or 1 μs.
For a single-bit error to occur, the noise
must have a duration of only 1 μs, which is
very rare.
Burst error
The term burst error means that two or
more bits in the data unit have changed
from 1 to 0 or from 0 to 1.

Burst errors does not necessarily mean that


the errors occur in consecutive bits, the
length of the burst is measured from the first
corrupted bit to the last corrupted bit. Some
bits in between may not have been
corrupted.
Burst error is most likely to happen in serial
transmission since the duration of noise is
normally longer than the duration of a bit.
The number of bits affected depends on the data
rate and duration of noise.
Example:
If data is sent at rate = 1Kbps then a noise of 1/100 sec
can affect 10 bits.(1/100*1000)

If same data is sent at rate = 1Mbps then a noise of


1/100 sec can affect 10,000 bits.(1/100*106)
Error detection
Error detection means to decide whether the
received data is correct or not without having a
copy of the original message.

Error detection uses the concept of redundancy,


which means adding extra bits for detecting
errors at the destination.
Redundancy
Four types of redundancy checks are used
in data communications
Vertical Redundancy Check
VRC
Performance

It can detect single bit error


It can detect burst errors only if the total
number of errors is odd.
Performance

LCR increases the likelihood of detecting


burst errors.
If two bits in one data units are damaged
and two bits in exactly the same positions in
another data unit are also damaged, the LRC
checker will not detect an error.
n :

CRC or Cyclic Redundancy Check


• CRC or Cyclic Redundancy Check is a method of
detecting accidental changes/errors in the communication
channel.
• CRC uses Generator Polynomial which is available on both
sender and receiver side.
• An example generator polynomial is of the form like x3 + x + 1.
This generator polynomial represents key 1011. Another
example is x2 + 1 that represents key 101.

• Number of bits in data to be sent from


sender side. k : Number of bits in the key
obtained from generator polynomial.
Cyclic Redundancy Check
CRC
Cyclic Redundancy Check
CRC
Sender Side (Generation of Encoded Data from
Data and Generator Polynomial (or Key)):
1. The binary data is first augmented by adding k-1 zeros
in the end of the data
2. Use modulo-2 binary division to divide binary data by
the key and store remainder of division.
3. Append the remainder at the end of the data to form the
encoded data and send the same
Cyclic Redundancy Check
CRC
Receiver Side (Check if there are errors introduced in
transmission)
Perform modulo-2 division again and if the remainder is 0,
then there are no errors.
Cyclic Redundancy Check
• Given a k-bit frame or message, the
transmitter generates an n-bit sequence,
known as a frame check sequence (FCS), so
that the resulting frame, consisting of (k+n)
bits, is exactly divisible by some
predetermined number.
• The receiver then divides the incoming
frame by the same number and, if there is
no remainder, assumes that there was no
error.
• Modulo 2 Division:
The process of modulo-2 binary division is the same as the familiar
division process we use for decimal numbers. Just that instead of
subtraction, we use XOR here.
• In each step, a copy of the divisor (or data) is XORed with the k bits of
the dividend (or key).
• The result of the XOR operation (remainder) is (n-1) bits, which is used
for the next step after 1 extra bit is pulled down to make it n bits long.
• When there are no bits left to pull down, we have a result. The (n-1)-bit
remainder which is appended at the sender side.
Example 1 (No error in transmission):
Data word to be sent - 100100 Key -
1101 [ Or generator polynomial x + x
3 2

+ 1]
Sender Side:
Therefore, the remainder is 001 and hence the encoded
data sent is 100100001.
Binary Division
Polynomial
Polynomial and Divisor
Standard Polynomials
CRC : DIGITAL LOGIC METHOD

You can see the generic case (CRC-n) as:


Here, when ak=0, the AND gate where it is connected to,
.
results in 0, what makes the XOR gate a pass thru.
When ak=1, the AND gate connects the feedback loop to
the XOR gate, as expected
Now, for your particular case, n=3, and CRC-3
defined as X3+X1+1
CRC-3
Draw the circuit with shift registers for
dividing the polynomial.
•P(X):X5+X4+X2+1
•D(X): X9+X7+X3+X2+1
Checksum
At the sender
The unit is divided into k sections, each of n
bits.
All sections are added together using one’s
complement to get the sum.
The sum is complemented and becomes the
checksum.
The checksum is sent with the data
At the receiver
The unit is divided into k sections, each of n
bits.
All sections are added together using one’s
complement to get the sum.
The sum is complemented.
If the result is zero, the data are accepted:
otherwise, they are rejected.
• Example –
If the data unit to be transmitted is
10101001 00111001, the following
procedure is used at Sender site and
Receiver site.
Sender Site :

10101001 subunit 1
00111001 subunit 2
11100010 sum (using 1s complement)
00011101 checksum (complement of
sum)
Receiver Site :

10101001 subunit 1
00111001 subunit 2
00011101 checksum
11111111
.
sum
00000000 sum's complement
Result is zero, it means no error
Performance
The checksum detects all errors involving an
odd number of bits.
It detects most errors involving an even number
of bits.
If one or more bits of a segment are damaged
and the corresponding bit or bits of opposite
value in a second segment are also damaged, the
sums of those columns will not change and the
receiver will not detect a problem.
Block Codes
• The purpose of block coding is to add
redundant information to the data, which
can be used to detect and correct errors that
may occur during transmission or storage.
• Block coding is often used in conjunction
with error correction codes (ECCs) to
provide a more robust way of transmitting
and storing data.
Error Correction
It can be handled in two ways:
1) receiver can have the sender retransmit the
entire data unit.
2) The receiver can use an error-correcting
code, which automatically corrects certain
errors.
This block is passed through an FEC decoder,
with one of four possible outcomes:
• No errors
• Detectable, correctable errors
• Detectable, not correctable errors
• Undetectable errors
Single-bit error correction
To correct an error, the receiver reverses the value
of the altered bit. To do so, it must know which bit
is in error.
Number of redundancy bits needed
• Let data bits = m
• Redundancy bits = r
Total message sent = m+r
The value of r must satisfy the following relation:
2r ≥ m+r+1
Error Correction
Block Code Principles
• Hamming Distance
suppose that a codeword block is received with the bit pattern
00100. This is not a valid codeword, and so the receiver has
detected an error. Can the error be corrected?
Hamming Code

It is a technique developed by R.W. Hamming for error


correction
The number of redundant bits can be calculated using the
following formula:

2^r ≥ m + r + 1 where, r = redundant bit, m


= data bit

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 Parity bits.
Minimum distance of the code

Maximum number of guaranteed correctable errors per


codeword satisfies

The number of errors, t, that can be detected satisfies


• Redundancy of code=n-1/k
• Code rate=k/n
• Data = k bits
• Codework=n bits
Hamming Code
Hamming Code
Hamming Code
Example of Hamming Code
Single-bit error
Error
Detection

You might also like