error detection. error detection and correction background background –data can be corrupted...

31
Error Detection Error Detection

Upload: rodney-hines

Post on 18-Jan-2016

226 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Error Detection. Error Detection and Correction Background Background –Data can be corrupted during transmission –For reliable communication, errors must

Error DetectionError Detection

Page 2: Error Detection. Error Detection and Correction Background Background –Data can be corrupted during transmission –For reliable communication, errors must

Error Detection and Error Detection and CorrectionCorrection

BackgroundBackground– Data can be corrupted during Data can be corrupted during

transmissiontransmission– For reliable communication, errors For reliable communication, errors

must be detected and correctedmust be detected and corrected– Error detection and correction can Error detection and correction can

be implemented inbe implemented in Data link layer, orData link layer, or Transport layerTransport layer

Page 3: Error Detection. Error Detection and Correction Background Background –Data can be corrupted during transmission –For reliable communication, errors must

Types of ErrorsTypes of Errors

Errors

Single-Bit error Burst error

Page 4: Error Detection. Error Detection and Correction Background Background –Data can be corrupted during transmission –For reliable communication, errors must

Single-Bit ErrorSingle-Bit Error

Only one bit in the data units has Only one bit in the data units has changedchanged

ExampleExample

sentsent receivedreceived0000000000100100

0000000011100100

Page 5: Error Detection. Error Detection and Correction Background Background –Data can be corrupted during transmission –For reliable communication, errors must

Burst ErrorBurst Error

Two or more bits in the data unit Two or more bits in the data unit have changedhave changed

Errors do not occur in Errors do not occur in consecutive bitsconsecutive bits

The length of the burst The length of the burst measured from the first measured from the first corrupted bit to the last corrupted bit to the last corrupted bitcorrupted bit

Page 6: Error Detection. Error Detection and Correction Background Background –Data can be corrupted during transmission –For reliable communication, errors must

Burst Error Burst Error

ExampleExample

length of burst errorlength of burst error

7 bits7 bits

sentsent 00000000110011000001100001100110000110

receivedreceived 00001111110011001101100001100110000110

Page 7: Error Detection. Error Detection and Correction Background Background –Data can be corrupted during transmission –For reliable communication, errors must

Detection : Detection : RedundancyRedundancy 1) Two copies of data unit 1) Two copies of data unit

(packet) are sent(packet) are sent Receiving device compares themReceiving device compares them

– Able to detect errorsAble to detect errors

– Transmission time Transmission time double double– Computational time Computational time slow slow

Page 8: Error Detection. Error Detection and Correction Background Background –Data can be corrupted during transmission –For reliable communication, errors must

Detection : Detection : RedundancyRedundancy 2) Only extra information is added 2) Only extra information is added

– Shorter group of bits may be added Shorter group of bits may be added to each packetto each packet

– Used by the receiving device Used by the receiving device – Discarded when it is usedDiscarded when it is used

Page 9: Error Detection. Error Detection and Correction Background Background –Data can be corrupted during transmission –For reliable communication, errors must

Redundancy CheckRedundancy Check

Page 10: Error Detection. Error Detection and Correction Background Background –Data can be corrupted during transmission –For reliable communication, errors must

Redundancy CheckRedundancy Check

Four types of redundancy checksFour types of redundancy checks– Vertical redundancy check (VRC)Vertical redundancy check (VRC)– Longitudinal redundancy check Longitudinal redundancy check

(LRC)(LRC)– Cyclical redundancy check (CRC)Cyclical redundancy check (CRC)– ChecksumChecksum

Page 11: Error Detection. Error Detection and Correction Background Background –Data can be corrupted during transmission –For reliable communication, errors must

Vertical Redundancy Vertical Redundancy CheckCheck (VRC)(VRC) Implemented in the physical layerImplemented in the physical layer Most common and least expensive Most common and least expensive

mechanism for error detectionmechanism for error detection Also called Also called parity bit checkparity bit check A redundant bit, called A redundant bit, called parity bitparity bit, is , is

appended to every data unitappended to every data unit– The number of 1s for each data unit, The number of 1s for each data unit,

including the parity bit, becomes evenincluding the parity bit, becomes even– 0 is appended when the data unit consists 0 is appended when the data unit consists

of even 1s of even 1s

Page 12: Error Detection. Error Detection and Correction Background Background –Data can be corrupted during transmission –For reliable communication, errors must

VRCVRC

Page 13: Error Detection. Error Detection and Correction Background Background –Data can be corrupted during transmission –For reliable communication, errors must

VRCVRC

Original DataOriginal Data 111011111101111101111110111111001001100100

Parity Bit addedParity Bit added 1110111111011100 1101111110111100 1100100 110010011

Received dataReceived data

1111111111101110 1101111011011110 11001001 11001001

Discard this dataDiscard this data

Page 14: Error Detection. Error Detection and Correction Background Background –Data can be corrupted during transmission –For reliable communication, errors must

VRCVRC

PerformancePerformance– Detects all single-bit errors (1, 3, Detects all single-bit errors (1, 3,

5, .. Bits changed)5, .. Bits changed)– Able to detect burst errors ifAble to detect burst errors if

The total number of bits changed is oddThe total number of bits changed is odd

– Cannot detect errors where the total Cannot detect errors where the total number of bits changed is evennumber of bits changed is even

Page 15: Error Detection. Error Detection and Correction Background Background –Data can be corrupted during transmission –For reliable communication, errors must

Longitudinal Longitudinal Redundancy CheckRedundancy Check (LRC)(LRC)

11100111 11011101 00111001 10101001

11100111110111010011100110101001

10101010LRC

11100111 11011101 00111001 1010100110101010

Original data + LRC

Page 16: Error Detection. Error Detection and Correction Background Background –Data can be corrupted during transmission –For reliable communication, errors must

Cyclic Redundancy Cyclic Redundancy Check (CRC)Check (CRC)

Based on Binary Division

Page 17: Error Detection. Error Detection and Correction Background Background –Data can be corrupted during transmission –For reliable communication, errors must

CRCCRC GeneratorGeneratorData plus extra zeros. The number of zeros is one less than the number or bits in the divisor.

When the leftmost bit is zero, we must use 0000 instead of the original divisor

Page 18: Error Detection. Error Detection and Correction Background Background –Data can be corrupted during transmission –For reliable communication, errors must

CRC CheckerCRC Checker

A CRC checker functions exactly A CRC checker functions exactly like the generatorlike the generator

Data + CRC is divided by the Data + CRC is divided by the predefined divisorpredefined divisor– If the remainder is all 0s, acceptIf the remainder is all 0s, accept– Otherwise discard the received dataOtherwise discard the received data

Page 19: Error Detection. Error Detection and Correction Background Background –Data can be corrupted during transmission –For reliable communication, errors must

PolynomialPolynomial

CRC generator (the divisor) is also represented as an algebraic polynomial

It is short

it can be used to prove the concept mathematically

Page 20: Error Detection. Error Detection and Correction Background Background –Data can be corrupted during transmission –For reliable communication, errors must

PolynomialPolynomial

Polynomial properties :it should not be divisible by

x

it should be divisible by x+1

All burst errors of a length equal to the degree of polynomial are detected

Page 21: Error Detection. Error Detection and Correction Background Background –Data can be corrupted during transmission –For reliable communication, errors must

Standard polynomialStandard polynomial

Page 22: Error Detection. Error Detection and Correction Background Background –Data can be corrupted during transmission –For reliable communication, errors must

Example of CRCExample of CRC

Data = 1010001101

Polynomial = 110101

Calculate:

101000110100000

- 110101

= 011101110100000

Remainder = 1110

Send data frame = 10100011011110

Received Data = 10100011011110

Polynomial = 110101

Calculate:

101000110101110

- 110101

= 011101110101110

Remainder = 0

Page 23: Error Detection. Error Detection and Correction Background Background –Data can be corrupted during transmission –For reliable communication, errors must

ChecksumChecksum

Used by the higher-layer Used by the higher-layer protocolsprotocols

Based on concept of redundancyBased on concept of redundancy Consists of checksum generator Consists of checksum generator

and checksum checkerand checksum checker

Page 24: Error Detection. Error Detection and Correction Background Background –Data can be corrupted during transmission –For reliable communication, errors must

ChecksumChecksum

Checksum generatorChecksum generator– The data unit is divided into The data unit is divided into k k

sections, each of sections, each of n n bitsbits– All sections are added together using All sections are added together using

one’s complement to get the sumone’s complement to get the sum– The sum is complemented and The sum is complemented and

becomes the checksumbecomes the checksum– The checksum is sent with the dataThe checksum is sent with the data

Page 25: Error Detection. Error Detection and Correction Background Background –Data can be corrupted during transmission –For reliable communication, errors must

checksumchecksum

Checksum checkerChecksum checker– The data unit is divided into The data unit is divided into kk

sections, each of sections, each of nn bits bits– All sections are added together using All sections are added together using

one’s complement to get the sumone’s complement to get the sum– The sum is complementedThe sum is complemented– If the result is zero, the data are If the result is zero, the data are

accepted, otherwise, they are accepted, otherwise, they are rejectedrejected

Page 26: Error Detection. Error Detection and Correction Background Background –Data can be corrupted during transmission –For reliable communication, errors must

ChecksumChecksum

Page 27: Error Detection. Error Detection and Correction Background Background –Data can be corrupted during transmission –For reliable communication, errors must

Example : Checksum Example : Checksum GeneratorGenerator

(sender) (sender) 1010100110101001 0011100100111001

1010100110101001

++ 0011100100111001

sumsum 11100010 11100010

checksumchecksum 0001110100011101

Data sent 10101001 00111001Data sent 10101001 00111001 0001110100011101

Page 28: Error Detection. Error Detection and Correction Background Background –Data can be corrupted during transmission –For reliable communication, errors must

Example : Checksum Example : Checksum Checker Checker

Received data Received data 10101001 0011100110101001 00111001 0001110100011101

sum all sectionssum all sections 10101001 10101001 0011100100111001 0001110100011101

SumSum 11111111 11111111ComplementComplement 0000000000000000 OK OK

Page 29: Error Detection. Error Detection and Correction Background Background –Data can be corrupted during transmission –For reliable communication, errors must

Error CorrectionError Correction

Two methodsTwo methods– The sender retransmits the entire dataThe sender retransmits the entire data– The receiver corrects errors using The receiver corrects errors using

error-correction codeerror-correction code Error-correction codeError-correction code

– More sophisticated than error-More sophisticated than error-detection codesdetection codes

– Require more redundancy bits than Require more redundancy bits than error-detectionerror-detection

Page 30: Error Detection. Error Detection and Correction Background Background –Data can be corrupted during transmission –For reliable communication, errors must

Error Correction Error Correction (cont.)(cont.) Error-correction code (cont.)Error-correction code (cont.)

– The number of bits required to The number of bits required to correct multiple-bit or burst error is correct multiple-bit or burst error is highhigh

In most case it is inefficient to doIn most case it is inefficient to do Most error correction is limited to one-, Most error correction is limited to one-,

two-, or three-bit errorstwo-, or three-bit errors

Page 31: Error Detection. Error Detection and Correction Background Background –Data can be corrupted during transmission –For reliable communication, errors must

Error CorrectionError Correction

Self study if you are interested in Self study if you are interested in it.it.