Networks -
|
|
Data Link Level -
|
|
|
Error Detection and Correction
|
LRC/VRC Longitudinal/Vertical Redundancy Check
You can use parity checking to find and correct 1 bit errors in a message.
You can use EVEN parity or ODD parity. In this example, I will use ODD
parity.
Given an 8 bit message: 11001010
Put the message into a table with 3 columns:
110
010
10
Square off the table with anything:
110
010
100
For each row, compute the ODD parity for that row and append the parity bit
onto the end of each row. (ODD parity means the total number of 1 bits,
is an odd number.)
110 1
010 0
100 0
For each column, compute the ODD parity for that column and append the parity
bit onto the bottom of each column.
110 1
010 0
100 0
111 0
Send the 16 bits to the other machine. 110 1 010 0 100 0 111 0
Suppose the other machine receives the following: 110 1 110 0 100 0 111 0
(Notice that bit 5 has been changed.) Construct the table and check
the parity of the rows and columns:
110 1
110 0 --
100 0
111 0
|
You will notice that row 2 and column 1 have EVEN parity, therefore the
bit at Row 2, Column 1 is wrong. Change it.
110 1
010 0 --
100 0
111 0
|
Now strip off the parity bits ...
110
010
100
Get rid of the extra bit used to square off the table ...
110
010
10
Put the bits backtogether into 1 byte ...
11001010
And we have what we started out with, although 1 bit was lost in transit.
------------------------------------------------------------------------
This method is also called a Rectangular Code.