0% found this document useful (0 votes)
28 views31 pages

Error Detection and Correction

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views31 pages

Error Detection and Correction

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 31

ERROR DETECTION AND CORRECTION

Definition
 Error detection is the ability to detect the presence of

errors caused by noise or other impairments during

transmission from the transmitter to the receiver.

 Error correction is the additional ability to reconstruct

the original, error-free data.

NEED FOR ERROR DETECTION AND CORRECTION


Consider a communication system in which the transmitted bit

stream is

1 0 1 1 0 1 1 1 0
The transmitted electrical signal corresponding to this bit stream

and the received waveform are shown in Figure 1. Due to the noise

introduced in the transmission medium, the electrical signal is

distorted. By using a threshold, the receiver determines whether a 1

is transmitted or a 0 is transmitted. In this case, the receiver decodes

the bit stream as


1 0 1 0 0 1 0 1 0

Fig. 1. Error introduced by transmission medium

In a digital communication system, some bits are likely to be

received in error due to the noise in the communication channel. As

a result, 1 may become 0 or 0 may become 1. The Bit Error Rate

(BER) is a parameter used to characterize communication systems.

Note

: The bit error rate (BER) is defined as the ratio of no. of

bits received in error divided by the total no. of bits received.

As an example, assume this transmitted bit sequence:


110001011

and the following received bit sequence:

010101001

In this case, the number of bit errors (the underlined bits) is 3. The

BER is 3 incorrect bits divided by 9 transferred bits, resulting in a

BER of 0.333 or 33.3%.

For instance, a BER of 10-6 means that, on average, one-bit error

occurs every one million bits transmitted. In contrast, a BER of 10 -9

signifies an error occurrence of one bit in every billion transmitted

bits, indicating a significantly more reliable system.

How many errors can be tolerated by a communication system?

It depends on the application. For instance, if English text is

transmitted, and a few letters are received in error, it is tolerable.

Studies indicate that even if 20% of the letters are missing, human

beings can understand the text.


Suppose the communication system is used to transmit digitized

voice from one place to another. Studies indicate that even if the Bit

Error Rate is 10−3, the listener will be able to understand the speech.

In other words, a voice communication system can tolerate one

error for every 1000 bits transmitted.

For banking application not even, a single error can be tolerated.

Hence, it is very important to detect the errors for data applications.

Errors can be classified as

 Content errors

 Flow integrity errors

Content errors are the errors in the content of the message; a binary

1 may be received as a binary 0.

Single Bit Error: Only one bit gets corrupted.

Transmit bits: 1011001

Received bits: 1010001


Burst Error: More than one bit gets corrupted. Multiple errors in a

data block are referred to as burst error and occur when the

duration of noise is longer than the duration of one bit

Duration of noise
Transmit bit: 101100101……………01

Receive bit: 101011010…………….01

Length of the burst error is defined from the first corrupted bit to

the last corrupted bit. For example, burst error in fig. below is 6 bits

long. An error burst may contain uncorrupted bit as well.

Transmitted bit: 0 1 1 0 1 0 1 1 1 0 0 1 0 0 0 1

Received bit: 0110011101010001

There can be several causes of content errors

Signal impairment: Distortion of electrical signal and noise are the

main causes of content errors.


Loss of synchronization: loss of synchronization results in form of

burst till the synchronization is reestablished between transmitter

and receiver clocks.

Transmission channel switching: Transmission channels of

telecommunication network are usually protected, i.e. if the main

path fails due to any reason (cut in channel), the signals are switched

over to standby path (alternate route). The switchover may take

about 10 to 50 ms, and it causes momentary loss of signal lead to

burst error.

Flow Integrity Errors

Data is sent as a data packet across a data network. It is not

necessary that data packets sent by a source to the destination take

the same path. In the fig., packet 1and 2 goes via nodes as shown in

the figure. Packet 4 goes directly from source node to the destination

node. Packet 3 starts its journey from source node and follow other
route than packets 1, 2 and 4. Flow of these data packets from the

source to the destination may be affected in several ways:

Flow Integrity Error

 The packets may be delivered out-of-sequence. Packet 4 takes

shorter path and it may arrive at destination node ahead of

packet 1and 2.

 A data packet may not arrive at the destination at all. Reasons

of packet loss can be several:

 A packet may get corrupted due to content errors and

may be rejected by a node


 It may be delivered to wrong address due to errors that

could not be detected.

 A node may not forward the packet due to congestion in

the network.

 Each data packet has limited lifetime in the network. This

is called time to live (TTL). TTL can be defined in terms

of number of hops. A network node dumps all the TTL

expired packets.

 The sender at times expects from the receiver an

acknowledgement of having received a packet. If the

acknowledgement is not received within a defined time

interval, the sender resends the packet. It may happen the

receiver sends the acknowledgement, but the

acknowledgement from the receiver is lost in the network. In

such situation, the receiver will receive duplicate data packets

eventually.
Thus, a packet may be delivered to a wrong destination, or may be

delivered out of sequence, or may not be delivered or delivered in

duplicate. All these are instances of flow integrity errors.

ERROR DETECTION
The three widely used techniques for error detection are

 parity

 checksum

 cyclic redundancy check (CRC)

PARITY
A parity bit is a basic way to check for errors in digital

communications and data storage, used to make sure data stays

accurate. It’s an extra binary digit added to a string of binary code.

In digital systems, when binary data is transmitted and processed,

data may be subjected to noise so that such noise can alter 0s (of

data bits) to 1s and 1s to 0s.


Hence, a Parity Bit is added to the word containing data in order to

make number of 1s either even or odd. The message containing the

data bits along with parity bit is transmitted from transmitter to the

receiver. At the receiving end, the number of 1s in the message is

counted and if it doesn’t match with the transmitted one, it means

there is an error in the data. Thus, the Parity Bit it is used to detect

errors, during the transmission of binary data.

Even parity

The parity bit is adjusted so that the total number of 1s in the code,

including the parity bit, is even. If there are already an even number

of 1s, the parity bit is 0. If there are an odd number of 1s, the parity

bit is 1. Hence, if any error occurs, the parity check circuit will

detect it at the receiver’s end.


Even Parity Check

Odd parity

The parity bit is adjusted to make the total number of 1s in the

code, including parity bit, is odd. If there are already an odd

number of 1s, the parity bit is 0. If it’s even, the parity bit is set to

1.

So if sender is an odd parity generator then there must be an odd

number of 1’s in received binary string. If an error occurs to a

single bit that is either bit is changed to 1 to 0 or 0 to 1, received

binary bit will have an even number of 1’s which will indicate an

error.

The bit stream transmitted is ASCII letter G


1110001

using odd parity, it will append a 1 and transmit

11100011

The receiver examines the received character and, if the total

number of 1s is odd, assumes that no error has occurred.

If one bit (or any odd number of bits) is erroneously inverted during

transmission for example,

11000011

then the receiver will detect an error.

At Sender Side (For the above Example)

 Total number of 1’s in the data unit is counted.

 Total number of 1’s in the data unit = 4.

 Clearly, odd parity is used and total number of 1’s is odd.

 So, parity bit = 1 is added to the data unit to make total

number of 1’s odd.


 Then, the code word 11100011 is transmitted to the

receiver.

At Receiver Side

 After receiving the code word, total number of 1’s in the code

word is counted.

 Consider receiver receives the correct code word = 1 1100

011

 Odd parity is used and total number of 1’s is odd.

 So, receiver assumes that no error occurred in the data during

the transmission.
Performance
 If two (or any even number) of bits are inverted due to error,

an undetected error occurs. It is very easy to verify that parity

can detect errors only if there are an odd number of errors. If

the number of errors is 1, 3, or 5, the error can be detected. If

the number of errors is even, parity bit cannot detect the

error.
Error is not detected (Even parity Check)

CHECKHSUM

Error detection using checksum method involves the following

steps-

Step-01:

At sender side,

 If m bit checksum is used, the data unit to be transmitted is

divided into segments of m bits.

 All the m bit segments are added.

 The result of the sum is then complemented using 1’s

complement arithmetic.
 The value so obtained is called as checksum.

Step-02:

 The data along with the checksum value is transmitted to the

receiver.

Step-03:

At receiver side,
 If m bit checksum is being used, the received data unit is

divided into segments of m bits.

 All the m bit segments are added along with the checksum

value.

 The value so obtained is complemented and the result is

checked.

Then, following two cases are possible-


Case-01: Result = 0

If the result is zero,

 Receiver assumes that no error occurred in the data during the

transmission.

 Receiver accepts the data.

Case-02: Result ≠ 0

If the result is non-zero,

 Receiver assumes that error occurred in the data during the

transmission.

 Receiver discards the data and asks the sender for

retransmission.
Checksum Example

Suppose that the sender wants to send 4 frames each of 8 bits, where

the frames are 11001100, 10101010, 11110000 and 11000011.

The sender adds the bits. While adding two numbers, if there is a

carry over, it is added to the sum.

After adding all the 4 frames, the sender complements the sum to

get the checksum, 11010011, and sends it along with the data

frames. The packet contains


Checksum Checker

A Checksum is verified at the receiving side. The receiver subdivides

the incoming data into equal segments of n bits each, and all these

segments are added together, and then this sum is complemented. If

the complement of the sum is zero, then the data is accepted

otherwise data is rejected.

Important Notes-

Note-01:
 Consider while adding the m bit segments, the result obtained

consists of more than m bits.

 Then, wrap around the extra bits and add to the result so that

checksum value consists of m bits.

Note-02:

 After calculating the checksum value, substitute the checksum

value in the checksum field.

The checksum cannot detect all the errors. Checksum, for example,

is not changed by:

 Reordering of the bytes in the message.

However, checksum is used mainly because its computation is very

easy.

Note: Checksum is used for error detection in TCP/IP protocols to

check whether packets are received correctly.


The 1’s complement is obtained by converting all the 0s to 1s and

converting all the 1s to 0s. Thus the 1’s complement of the sum

1100101011001010 is 0011010100110101, which becomes the

checksum. At the receiver, all three 16-bit words are added,

including the checksum. If the result is zero, no errors are

introduced into the segment. If one of the bits is a not zero, then we

know that errors have been introduced into the segment and discard

the data.
CYCLIC REDUNDANCY CHECK (CRC)

 Can detect errors on large chunks of data

 It is based on binary division

 Has low overhead

 More robust than parity bit


 Requires the use of a “code polynomial”

– Example: x2 + 1

CRC Generator

 CRC generator is an algebraic polynomial represented as a bit

pattern.

 Bit pattern is obtained from the CRC generator using the

following rule-

The power of each term gives the position of the bit and the coefficient

gives the value of the bit.


Consider the CRC generator or code polynomial is x7 + x6 + x4 + x3 +

x + 1.

Procedure:

1. The CRC error detection method treats the Message or

information (data) viewed as a sequence of bits.

Example: Let M = 1011

The message M(x) represent as a polynomial,

M(x) = x3+x +1.

2. Both transmitter and receiver must be agreed upon a code

polynomial P(x) with degree r.

P(x) = x2+1, degree r = 2


= 101
3. Append r zero bit into M (message) such that M(x) =

101100
4. Divide M(x) by P(x).

5. The quotient is discarded.

6. Append the remainder at the end of message M(x) and the

result is T(x). The result is the check-summed message.

7. T(x) is transmitted.

8. At the receiving end, divide the check-summed message by

the same code polynomial. If the remainder is zero, there is

no error detected.

Let us now consider a simple example.

At sender side,
 A string of n 0’s is appended to the data unit to be transmitted.

 Here, n is one less than the number of bits in CRC generator.

 Binary division is performed of the resultant string with the

CRC generator.

 After division, the remainder so obtained is called as CRC.

 It may be noted that CRC also consists of n bits.


Given Message M = 10 0 1 0 0 (6 bits)

CRC Polynomial P = x3 +x2 +1 (1 1 0 1) (4 bits)

CRC or FCS (Frame Check Sequence) R = to be calculated.

2. Append 3 zero bits yields 1 0 01 0 0 0 0 0.

3. This is divided by P:

The Frame Check Sequence R = 001


Appending CRC to Data Unit
 The CRC is obtained after the binary division.

 The string of n 0’s appended to the data unit earlier is

replaced by the CRC remainder.

Transmission to Receiver

 The newly formed code word (Original data + CRC) is

transmitted to the receiver.

Checking at Receiver Side

At receiver side,

 The transmitted code word is received.

 The received code word is divided with the same CRC

generator.

 On division, the remainder so obtained is checked.


The following two cases are possible:

Case-01: Remainder = 0

If the remainder is zero,

 Receiver assumes that no error occurred in the data during the

transmission.

 Receiver accepts the data.


Case-02: Remainder ≠ 0

If the remainder is non-zero,

 Receiver assumes that some error occurred in the data during

the transmission.

 Receiver rejects the data and asks the sender for

retransmission.

Example 2

1. Given Message M = 1010001101 (10 bits)

CRC Polynomial P = x5 + x4 +x2 +1 (1 1 0 1 0 1) (6 bits)


FCS (Frame Check Sequence) R = to be calculated.

2. Append 5 zero bits, yielding 1 0 1 0 0 0 1 1 0 1 0 0 0 0 0.

3. This is divided by P:
4. The remainder (R = 01110) is appended to M to give

T=101000110101110

which is transmitted.

5. If there are no errors, the receiver receives T intact. The received

frame is divided by P and the remainder will be zero.


Because there is no remainder, it is assumed that there have been no

errors.

Three versions of P(X) are widely used:

CRC-16 = x16 + x15 + x2 + 1= 11000000000000101

CRC-CCITT = x16 + x12 + x5 + 1= 10001000000100001


= 100000100110000010001110110110111

For an error correction:

Reverse Error Correction (REC): The transmitter sends the data

and also an error detection code, which the receiver uses to check

for errors, and request retransmission of erroneous data. In many

cases, the request is implicit; the receiver sends an

acknowledgement (ACK) of correctly received data, and the

transmitter re-sends anything not acknowledged within a reasonable

period of time.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy