Error Control: of Detecting Errors Combined With A Relatively Low Number of Redundant Bits
Error Control: of Detecting Errors Combined With A Relatively Low Number of Redundant Bits
Bit errors may be sometimes introduced into the frames due to electrical
interference and noise. These errors need to be detected and corrected.
Whenever a recipient receives a message and detects error in the received
message, it can handle the situation in two ways:
1. Notify the sender about the error so that the sender retransmit the
message once again
or
2. Reconstruct the message from the corrupted message using error
correcting codes
The basic idea behind any error detection scheme is to add redundant
information to a frame that can be used to determine if errors have been
introduced. In the extreme, we could imagine transmitting two complete
copies of the data. If the two copies are identical at the receiver, then it is
probably the case that both are correct. If they differ, then an error was
introduced into one (or both) of them, and they must be discarded.
This is a rather poor error detection scheme for two reasons.
First, it sends n redundant bits for an n-bit message.
Second, many errors will go undetectedany error that happens to
corrupt the same bit positions in the first and second copies of the
message.
In general, the goal of error detecting codes is to provide a high probability
of detecting errors combined with a relatively low number of redundant bits.
Hence the objective is to provide quite strong error detection capability while
sending only
k redundant bits for an n-bit message, where k n (k being very small
compared to n)
We say that the extra bits we send are redundant because they add no new
information to the message. Instead, they are derived directly from the
original message using some well-defined algorithm. Both the sender and
the receiver know exactly what that algorithm is. The sender applies the
algorithm to the message to generate the redundant bits. It then transmits
both the message and those few extra bits. When the receiver applies the
same algorithm to the received message, it should (in the absence of errors)
come up with the same result as the sender. It compares the result with the
one sent to it by the sender. If they match, it can conclude (with high
likelihood) that no errors were introduced in the message during
transmission. If they do not match, it can be sure that either the message or
the redundant bits were corrupted, and it must take appropriate actionthat
Reference: Computer Networks- A systems approach by Larry Peterson and Bruce Davie,
Fifth Edition, Morgan Kaufman Publishers
The frame shown in the example contains 6 bytes. Each byte contains 7 bits
of original information. Eighth bit is parity bit. This bit is set to 1 or 0
according to the number of 1s in the byte so that total number of 1s in any
byte is even.
Parity byte at the very bottom is calculated by counting 1s in the same bit
position across all 6 frames and adding a bit accordingly to make the number
of 1s in the given bit position even.
The shown example contains 6 bytes and each byte contains 7 bits of
original information. Hence 42 bits of original information is carried. In order
to facilitate error detection 14 redundant bits are added (Parity byte at the
bottom 8+ 1 parity bit per byte for each of the 6 bytes in the frame 6=> 8+6
=14)
Two-dimensional parity catches all 1-, 2-, and 3-bit errors, and most 4-bit
errors.
Reference: Computer Networks- A systems approach by Larry Peterson and Bruce Davie,
Fifth Edition, Morgan Kaufman Publishers
Though the error detection capability of this scheme is good, the length of
the error detecting code is inconsistent as the number of redundant bits
added depends on the length of the original message
For the purposes of calculating a CRC, a sender and receiver have to agree
on a divisor polynomial, C(x). C(x) is a polynomial of degree k. For example,
suppose C(x) = x3 +x2 +1. In this case, k = 3.
Choice of C(x) has a significant impact on what types of errors can be reliably
detected. Hence C(X) is chosen from a handful of divisor polynomials that are
very good choices for various environments, and the exact choice is normally
made as part of the protocol design. For example, the Ethernet standard
uses well-known polynomial of degree 32.
CRC is computed by creating a polynomial for transmission that is derived
from the original message M(x) and is k bits longer than M(x), and is exactly
divisible by C(x). This is achieved by performing following steps:
1. Multiply M(x) by xk; that is, add k zeros at the end of the message.
2. Call this zero-extended message T(x).
3. Divide T(x) by C(x) and find the remainder.
4. Subtract the remainder from T(x).
Use long division method for step 3 and use modulo 2 arithmetics(i.e use
XOR operation for subtraction)
Consider the example given below:
M(x) = x7 +x4 +x3 +x or 10011010
C(x) = x3+x2+1 or 1101
Since k=3 , add three zeros at the end of M(x)
T(x) = 10011010000
Now perform long division using XOR operation
Take reminder 101 and subtract from M(x) : i.e XOR 10011010000 with 101
to obtain P(x).
P(x) = 10011010101
Reference: Computer Networks- A systems approach by Larry Peterson and Bruce Davie,
Fifth Edition, Morgan Kaufman Publishers
This P(x) would be transmitted. The receiver would be aware of the CRC
mechanism and divisor polynomial used. Hence it divides the received
message with the C(X).
If c(x) divides the received message evenly i.e with no reminder, receiver
concludes that the message has been received without any error
Else, if the division of received message by c(x) produces a reminder, then
the receiver concludes that the received message contains error.
The only way that an error could slip by undetected is when the error
introduced, say E(x) can be divided evenly by C(x). The trick is to pick C(x) so
that this is very unlikely for common types of errors.
In general, it is possible to prove that the following types of errors can be
detected by a C(x) with the stated properties:
1. All single-bit errors, as long as the xk and x0 terms have nonzero
coefficients
2. All double-bit errors, as long as C(x) has a factor with at least three
terms
3. Any odd number of errors, as long as C(x) contains the factor (x+1)
4. Any burst error (i.e., sequence of consecutive errored bits) for which
the length of the burst is less than k bits (Most burst errors of length
greater than k bits can also be detected.)
Note:
The use of error-correcting codes in networking is sometimes referred to as forward error
correction (FEC) because the correction of errors is handled in advance by sending extra
information, rather than waiting for errors to happen and dealing with them later by
retransmission. FEC is commonly used in wireless networks such as 802.11.
Reference: Computer Networks- A systems approach by Larry Peterson and Bruce Davie,
Fifth Edition, Morgan Kaufman Publishers