22
f10 Module 2 Data Communication Fundamentals Lesson 6 Error Detection and Correction

Module 2 Data Communication Fundamentals Lesson

  • Upload
    others

  • View
    7

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Module 2 Data Communication Fundamentals Lesson

f10

Module 2

Data Communication

Fundamentals

Lesson 6

Error Detection andCorrection

Page 2: Module 2 Data Communication Fundamentals Lesson

f10

Specific Instructional ObjectivesSpecific Instructional Objectives

On completion of this lesson, the student will be able to:

Explain the need for error detection and correction

State how simple parity check can be used to detect error

Explain how two-dimensional parity check extends error detection capability

State how checksum is used to detect error

Explain how cyclic redundancy check works

Explain how Hamming code is used to correct error

Page 3: Module 2 Data Communication Fundamentals Lesson

f10

Why do we need error detection Why do we need error detection and correction?and correction?

Environmental interference and physical defects in the communication medium can cause random bit errors during data transmission.

Error correction increases the efficiency in transmission; and

Decrease the traffic by reducing frame retransmission

Page 4: Module 2 Data Communication Fundamentals Lesson

f10

Types of Transmission ErrorsTypes of Transmission Errors

Single-bit Error

Burst Error

Page 5: Module 2 Data Communication Fundamentals Lesson

f10

Error Detecting CodesError Detecting Codes

Simple Parity check

Two-dimensional Parity check

Checksum

Cyclic redundancy check

Page 6: Module 2 Data Communication Fundamentals Lesson

f10

Simple Parity CheckingSimple Parity Checking

Also known as One-dimension Parity Check

A redundant bit called parity bit, is appended to every data unit so that the number of 1s in the unit (including the parity becomes even).

It is also possible to use odd-parity checking, where the number of 1’s should be odd.

Detects any odd number of errors but cannot detect even number of errors.

Page 7: Module 2 Data Communication Fundamentals Lesson

f10

Simple Parity Check Code TableSimple Parity Check Code Table

Page 8: Module 2 Data Communication Fundamentals Lesson

f10

Two-dimension Parity CheckTwo-dimension Parity Check

Page 9: Module 2 Data Communication Fundamentals Lesson

f10

2-D Parity Check Limitation2-D Parity Check Limitation

Can detect burst errors with high likelihood

But, If two bits in one data unit are damaged and two bits in exactly same position in another data unit are also damaged, the 2-D Parity check checker will not detect an error

Page 10: Module 2 Data Communication Fundamentals Lesson

f10

ChecksumChecksum

The data is divided into k segments/units each of m bits.

Form the sum (using 1's compliment) of all units. The sum is complemented to get the checksum.

Transmit the checksum with the message.

At the receiver's end, all received segments are added using 1’s complement arithmetic to get the sum.

The sum is complemented. If the result is zero, the received data is accepted; otherwise discarded

Easy to implement in software.

Used in the Internet Protocol

Page 11: Module 2 Data Communication Fundamentals Lesson

f10

ChecksumChecksum

Page 12: Module 2 Data Communication Fundamentals Lesson

f10

Cyclic Redundancy Checks (CRC)Cyclic Redundancy Checks (CRC)

a sequence of redundant bits, called cyclic redundancy check bits, are appended to the end of data unit;

the data unit becomes exactly divisible by a second, predetermined binary number.

at the destination, the incoming data unit is divided by the same number.

if at this step there is no remainder, the data unit is assumed to be correct and is therefore accepted.

a remainder indicates that the data unit has been damaged in transit and therefore must be rejected.

Page 13: Module 2 Data Communication Fundamentals Lesson

f10

CRC Basic SchemeCRC Basic Scheme

Page 14: Module 2 Data Communication Fundamentals Lesson

f10

CRC – Polynomial GeneratorCRC – Polynomial Generator

A predetermined polynomial coefficients of x.

A polynomial is selected to have at least the following properties:

It should not be divisible by x.

It should not be divisible by (x+1).

Example

If k is 4-bits then G(x) could be 1x3+0x2+1x+1 then our divisor is 1011.

Page 15: Module 2 Data Communication Fundamentals Lesson

f10

CRC Coding SampleCRC Coding Sample

Page 16: Module 2 Data Communication Fundamentals Lesson

f10

Common divisor polynomialsCommon divisor polynomials

Page 17: Module 2 Data Communication Fundamentals Lesson

f10

CRC PerformanceCRC Performance

CRC is a very effective error detection technique. If the divisor is chosen according to the previously mentioned rules, its performance can be summarized as follows:

CRC can detect all single-bit errors

CRC can detect all double-bit errors (three 1’s)

CRC can detect any odd number of errors (X+1)

CRC can detect all burst errors of less than the degree of the polynomial.

CRC detects most of the larger burst errors with a high probability.

For example CRC-12 detects 99.97% of errors with a length 12 or more.

Page 18: Module 2 Data Communication Fundamentals Lesson

f10

Single Bit Error CorrectionSingle Bit Error CorrectionHamming CodeHamming Code

Hamming Code – A technique developed by Richard W. Hamming provides

Page 19: Module 2 Data Communication Fundamentals Lesson

f10

Hamming Code Basic ApproachHamming Code Basic Approach

• 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.

Page 20: Module 2 Data Communication Fundamentals Lesson

f10

Hamming CodeHamming CodeParity Bit Positions CheckingParity Bit Positions Checking

Each data bit is included in a unique set of 2 or more parity bits, as determined by the binary form of its bit position.

In general each parity bit covers all bits where the binary AND of the parity position and the bit position is non-zero.

Example

Parity bit 1 checks 1, 3, 5, 7, 9,......

Parity bit 2 checks 2, 3, 6, 7, 10, ....

Parity bit 4 checks 4, 5, 6, 7, 12, 13, 14, 15,....

Page 21: Module 2 Data Communication Fundamentals Lesson

f10

Hamming Code SampleHamming Code Sample

Page 22: Module 2 Data Communication Fundamentals Lesson

f10

Hamming CodeHamming CodeError CorrectionError Correction

In case of single bit reversal detections, error can be corrected by simply getting the decimal equivalent of the parity bits

The parity bits tells where the error occurs and hence corrected