Networking 2
Data Communication Errors
are undesirable changes in the bit pattern of
data that occur after the data goes from the
internal PC data bus enroute to an external
device or computer
can appear at any point along a
communication link
Communication Error Correction and Detection Page 1 of 24
Redundancy
Error-Detection Techniques
To detect and correct communication errors, a
sender must provide a receiver with
information that allows the receiver to verify
proper receipt of information or data.
This additional information is called
error checking data or redundancy
data.
Error-Detection Techniques
Parity Checking
primarily for detecting errors when the
number of information bits is small and
the probability of an error being present is
small
Two Kinds of Parity Checking:
1. Even Parity
2. Odd Parity
Even Parity
Even Parity. The number of 1’s in a
word should be even.
Example: In ASCII
A= 1000001
B= 1000010
C= 1000011
Applying the parity bit:
A = 0 1000001
B = 0 1000010
C = 1 1000011
Odd Parity
Odd Parity. The number of 1’s in a word
should be odd.
Example: In ASCII
A= 1000001
B= 1000010
C= 1000011
Applying the parity bit:
A = 1 1000001
B = 1 1000010
C = 0 1000011
Block Sum Checking
Parity checking is done on a per block
basis. Example: Transmit DATACOM
D = 1000100 C = 1000011
A = 1000001 O = 1001111
T = 1010100 M = 1001101
(odd)
1 1 0 0 0 1 0 0 D
1 1 0 0 0 0 0 1 A
0 1 0 1 0 1 0 0 T
1 1 0 0 0 0 0 1 A
0 1 0 0 0 0 1 1 C
0 1 0 0 1 1 1 1 O
1 1 0 0 1 1 0 1 M
0 1 0 1 0 0 0 1 (even)
Longitudinal
Traverse (Row) (Column)
Parity Bits Parity Bits
Polynomial Codes
In using polynomial codes, a single set of check
digits referred to as the frame check
sequence (FCS) or cyclic redundancy check
is generated or computed for each frame.
Polynomial codes are based upon treating bit
strings as representations of polynomials
with coefficients of 0 and 1 only.
Example
110001 - 6 bits (represents a 6-term
polynomial) M(X) = 1X5 + 1X4 + 0X3 + 0X2 +
0X1 + 1X0
= X 5 + X 4 + X0
= X5 + X4 + 1
Degree of 110001 = 5
(highest exponent)
Polynomial Codes
In using the polynomial code, the sender and
receiver agree upon a generator
polynomial G(X) in advanced.
Algorithm for computing the FCS:
1. Let r be the degree of G(X). Append r zero bits
to the low-order end of the message frame
M(X), so it now contains m + r bits where m is
the number of bits in M(X).
The resulting frame will be called M ’(X).
Polynomial Codes
2. Divide the bit string corresponding to G(X)
into the bit string corresponding to M‘(X) using
modulo 2 arithmetic.
Modulo 2 Arithmetic (XOR)
Examples:
10011011 00110011
+ 11001010 - 11001101
01010001 11111110
Polynomial Codes
Subtract the remainder (which is always r or
fewer bits) from M’(X) using modulo 2
subtraction. The result is the check summed
frame to be transmitted T(X).
Example
Given:
Message Frame M(X) = 1101011011
Generator G(X) = 10011 r = 4 (degree)
M’(X) = 11010110110000
Communication Error Correction and Detection Page 12 of 24
Example
To compute for T(X):
11010110110000
- 1110
11010110111110
When the receiver gets the transmitted frame
T(X), it tries dividing it by G(X). If there is a
remainder, there has been a transmission error.
Communication Error Correction and Detection Page 13 of 24
Some Points Regarding
Polynomial Codes
1. T(X) is exactly divisible (modulo 2) by G(X).
In any division problem, if the remainder is
subtracted from the dividend, what is left over is
divisible by the divisor.
Example:
M’ = 11
G = 5
Remainder of M’ / G = 1
T = 11 -1 = 10 exactly divisible by G
Some Points Regarding
Polynomial Codes
2. Assume that a transmission error occurs so that
instead of the polynomial for the transmitted
message T(X) arriving, T(X) + E(X) arrives.
Those errors that happen to correspond to
polynomials containing G(X) as a factor will
slip by unnoticed, but all other errors will
be caught.
Standards in CRC
(For Generator Polynomial)
1. CRC - 12
X12 + X11 + X3 + X2 + X + 1
2. CRC - 16
X16 + X15 + X2 + 1
3. CRC - CCITT
X16 + X12 + X5 + 1
4. CRC - 32
X32 + X26 + X23 + X22 + X16 + X12 + X11 + X10 + X8
+ X7 + X5 + X4 + X2 + X + 1
Error Correction Techniques
Error-correction techniques allow the receiver
to determine which bit or bits is/are erroneous
thereby allowing it to make the necessary
corrections.
One popular error-correction technique uses the
Hamming codes.
In using Hamming codes, the bits of the
message to be transmitted are numbered
consecutively, starting with bit 1 at the left
end.
Error Correction Techniques
The bits of the message that will be transmitted
are therefore numbered as:
b1 b2 b3 b4 b5 b6
b7 b8 b9 b10 . . .
Those bits that are powers of 2 (b1, b2, b4,
b8, etc.) are the check bits (the exact values
of which will be computed) while the rest of
the
bits (b3, b4, b5, b6, b7, b9, etc.) are the data bits.
Each check bit forces the parity of some
collection of bits, including itself, to be even
(or odd). A bit may be included in several
parity computations.
Error Correction Techniques
To determine which check bits the data bit in
position k contributes to, rewrite k as a sum of
powers of two.
Example:
11 = 1 + 2 + 8
This means that b11 is checked by b1, b2, and b8.
Case Study:
Transmit the byte 1101101
The actual bits that will be transmitted are:
b1 b2 b3 b4 b5 b6 b7 b8 b9 b10 b11
1 1 0 1 1 0 1
The values of the check bits b1, b2, b4, and b8
will have to be computed.
b3 is checked by bits b1 and b2.
b5 is checked by bits b1 and b4.
b6 is checked by bits b2 and b4.
b7 is checked by bits b1, b2 and b4.
b9 is checked by bits b1 and b8.
b10 is checked by bits b2 and b8.
b11 is checked by bits b1, b2 and b8.
Case Study:
Transmit the byte 1101101
Summarizing which data bits are checked by
a certain check bit:
b1 checks data bits b3, b5, b7, b9, b11
b2 checks data bits b3, b6, b7, b10, b11
b4 checks data bits b5, b6, b7
b8 checks data bits b9, b10, b11
Case Study:
Transmit the byte 1101101
By using the values of the data bits and by
assuming that even parity is used, the values
of the check bits are computed as:
b1 = 1
b2 = 1
b4 = 0
b8 = 0
The actual bits that will be transmitted
are therefore:
b1 b2 b3 b4 b5 b6 b7 b8 b9 b10 b11
1 1 1 0 1 0 1 0 1 0 1
Correcting Errors
Assume that the transmitted code
is: 1 1 1 0 1 0 1 0 1 0
1
However, due to impulse noise, b9 was
corrupted. The received message is
therefore:
1 1 1 0 1 0 1 0 0 0 1
The receiver checks for parity errors as follows:
1st group: b1, b3, b5, b7, b9, b11
1 1 1 1 0 1
2nd group: b2, b3, b6, b7, b10, b11
1 1 0 1 0 1
3rd group: b4, b5, b6, b7
0 1 0 1
4th group: b8, b9, b10, b11
0 0 0 1
Exercise
1. Assume that the message frame, M(x) is
111000111000. The generator polynomial,
G(x), is 110111. Compute the bit stream
T(x) to be transmitted.
2. An 8-bit byte with binary value 10101111 is to
be encoded using an even-parity Hamming
code. What is the binary value after
encoding?