error detection. error detection and correction background background –data can be corrupted...
TRANSCRIPT
Error DetectionError Detection
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
Types of ErrorsTypes of Errors
Errors
Single-Bit error Burst error
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
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
Burst Error Burst Error
ExampleExample
length of burst errorlength of burst error
7 bits7 bits
sentsent 00000000110011000001100001100110000110
receivedreceived 00001111110011001101100001100110000110
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
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
Redundancy CheckRedundancy Check
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
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
VRCVRC
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
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
Longitudinal Longitudinal Redundancy CheckRedundancy Check (LRC)(LRC)
11100111 11011101 00111001 10101001
11100111110111010011100110101001
10101010LRC
11100111 11011101 00111001 1010100110101010
Original data + LRC
Cyclic Redundancy Cyclic Redundancy Check (CRC)Check (CRC)
Based on Binary Division
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
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
PolynomialPolynomial
CRC generator (the divisor) is also represented as an algebraic polynomial
It is short
it can be used to prove the concept mathematically
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
Standard polynomialStandard polynomial
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
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
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
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
ChecksumChecksum
Example : Checksum Example : Checksum GeneratorGenerator
(sender) (sender) 1010100110101001 0011100100111001
1010100110101001
++ 0011100100111001
sumsum 11100010 11100010
checksumchecksum 0001110100011101
Data sent 10101001 00111001Data sent 10101001 00111001 0001110100011101
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
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
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
Error CorrectionError Correction
Self study if you are interested in Self study if you are interested in it.it.