Beruflich Dokumente
Kultur Dokumente
Networking
Data Communication & Computer Networks
Lecture 17
Error Detection
and
Correction
Types of Error
1. Single-Bit Error
2. Burst Error
Single-Bit Error
Burst Error
Burst error does not necessarily mean that the errors occur in
consecutive bits
Most likely to happen in a serial transmission
Number of bits affected depends on the data rate and duration of
noise If the data is sent at 1 kbps, a noise of 1/100 s can affect 10
bits.
If the data is sent at 1 Mbps, a noise of 1/100 s can affect
10000 bits.
Redundancy
Detection methods
Even-parity concept
Example 1
Supposethesenderwantstosendthewordworld.In
ASCIIthefivecharactersarecodedas
1110111 1101111 1110010 1101100 1100100
Thefollowingshowstheactualbitssent
1110111011011110111001001101100011001001
Example 2
NowsupposethewordworldinExample1isreceivedby
thereceiverwithoutbeingcorruptedintransmission.
11101110110111101110010011011000
11001001
Thereceivercountsthe1sineachcharacterandcomesup
withevennumbers(6,6,4,4,4).Thedataareaccepted.
Example 3
NowsupposethewordworldinExample1iscorrupted
duringtransmission.
11111110110111101110110011011000
11001001
Thereceivercountsthe1sineachcharacterandcomesup
withevenandoddnumbers(7,6,5,4,4).Thereceiver
knowsthatthedataarecorrupted,discardsthem,andasks
forretransmission.
Two-dimensional parity
A block of bits is divided into rows and a
redundant row of bits is added to the whole block.
Examples:
dataword 0100 codeword received 0100011 syndrome = 000
no errors
0111 0111001 received 0011001 syndrome 011 (b2) flip
b2 error is corrected
Dataword 1101 1101000 received 0001000 syndrome 101
(b0) flip b0 0000 wrong data word
When a burst of error of size 4 corrupts the frame, only 1 bit from
each codeword is corrupted the corrupted bit can be easily be
corrected at the receiver
Checksum
The receiver follows these steps:
1. The unit is divided into k
sections, each of n bits.
2. All sections are added using
ones complement to get the
sum.
3. The sum is complemented.
4. If the result is zero, the data
are accepted: otherwise,
rejected
Example
Supposethefollowingblockof16bitsistobesentusinga
checksumof8bits.
1010100100111001
Thenumbersareaddedusingonescomplement
10101001
00111001
Sum 11100010
Checksum00011101
Thepatternsentis101010010011100100011101
Example
NowsupposethereceiverreceivesthepatternsentinExample7
andthereisnoerror.
101010010011100100011101
Whenthereceiveraddsthethreesections,itwillgetall1s,which,
aftercomplementing,isall0sandshowsthatthereisnoerror.
10101001
00111001
00011101
Sum
11111111
Complement
00000000meansthatthepatternisOK.
Example
Nowsupposethereisabursterroroflength5thataffects4bits.
101011111111100100011101
Whenthereceiveraddsthethreesections,itgets
10101111
11111001
00011101
PartialSum111000101
Carry
Sum
1
11000110
Complement00111001thepatterniscorrupted.
implementation of checksum
The sender initializes the checksum to 0 and adds all data items and the
checksum.
36 cannot be expressed in 4 bits. The extra two bits are wrapped and added
with the sum to create the wrapped sum value 6.
The sum is then complemented, resulting in the checksum value 9 (15 6 =
9).
11 1
1
Receiver site: