Error Detection and Correction Fundamentals
1. Introduction: Transmission Errors
During transmission over physical media, electromagnetic noise, thermal interference, attenuation, and line cross-talk can alter the signal, flipping bits from 0 to 1 or 1 to 0.
Types of Errors:
- Single-Bit Error:
- Only one bit in the entire data unit (byte or packet) has changed from 1 to 0 or 0 to 1.
- Rare in serial data communication because noise duration () is typically much longer than the duration of a single bit ().
- Burst Error:
- Two or more bits in the data unit have changed.
- Length of Burst: Measured from the first corrupted bit to the last corrupted bit (some intermediate bits in between may not be corrupted).
- Example: In a link (), a brief static noise burst lasting affects up to bits!
2. Redundancy Principle
To detect or correct errors without seeing the original source message, extra bits called Redundant Bits () are appended to the data bits (), creating a longer transmission unit called a Codeword ():
- Error Detection: The receiver detects that errors occurred, discards the corrupted frame, and requests retransmission (Automatic Repeat Request - ARQ).
- Error Correction (Forward Error Correction - FEC): The receiver deduces the exact positions of corrupted bits and flips them back without requiring retransmission (vital for simplex links or high-latency satellite channels).
3. Basic Error Detection Schemes
A. Simple Parity Check
Appends a single redundant parity bit () to a data block of bits to make the total number of 1s either even or odd.
- Even Parity: Parity bit is set such that the count of 1s in the codeword is even.
- Odd Parity: Parity bit is set such that the count of 1s in the codeword is odd.
- Limitation: Can detect all single-bit errors and any odd number of errors. It fails completely to detect any even number of bit errors (e.g., if two bits flip, the parity remains unchanged).
B. Two-Dimensional (2D) Parity Check
Organizes data into a table (rows and columns). A parity bit is calculated for each row, and a parity byte is calculated for all columns.
- Detection Capability: Detects all 1-bit, 2-bit, and 3-bit errors, and most burst errors.
- Correction Capability: If a single bit flips, the intersection of the corrupted row and corrupted column pinpoints the exact erroneous bit, allowing 1-bit error correction.
C. Internet Checksum
Used by network/transport layer protocols (IPv4, ICMP, UDP, TCP).
- Algorithm (Sender):
- Data unit is divided into 16-bit words.
- All 16-bit words are added using One's Complement Arithmetic (if an overflow carry occurs past 16 bits, it wraps around and is added to the least significant bit).
- The final sum is inverted (complemented bitwise) to form the Checksum.
- The checksum is sent along with the data.
- Algorithm (Receiver):
- Receiver sums all received 16-bit words including the checksum in one's complement.
- If the result is all
1s (0xFFFF, or0after complement), the data is accepted as error-free; otherwise, it is rejected.
4. Detection vs. Correction Trade-offs
| Parameter | Error Detection (with ARQ) | Error Correction (FEC) |
|---|---|---|
| Redundancy Bits () | Very small ( bits for CRC) | Much larger (Hamming, Reed-Solomon) |
| Bandwidth Overhead | Minimal | High |
| Computation Complexity | Fast, simple hardware shift registers | Complex decoding matrices |
| Channel Suitability | Channels with feedback & low error rate (LANs) | Channels with long round-trip delay (Satellites) or no feedback |
Frequently Asked Questions
QCalculate the checksum for two 8-bit bytes using 1's complement arithmetic.
- Byte 1:
10011001, Byte 2:11100010 - Sum:
\begin{array}{r@{\quad}l} & 10011001 \\ + & 11100010 \\ \hline & 101111011 \quad (\text{9-bit result, carry } = 1) \end{array} - Wrap-around carry:
- One's complement (Checksum):
QWhy does Simple Parity fail to detect double-bit errors?
Flipping two bits changes the count of 1s by , , or . In all cases, the parity (evenness or oddness) remains unchanged, leaving the error completely invisible to the receiver.
QWhat is Forward Error Correction (FEC) and where is it mandatory?
FEC is an error control method where the receiver detects and corrects errors without retransmission. It is mandatory in simplex links (no return path) and deep-space communications where round-trip propagation delay makes retransmission impractical.
QWhat is the difference between a single-bit error and a burst error?
A single-bit error changes exactly one bit in the data unit. A burst error changes two or more bits, and its length is measured from the first to the last corrupted bit. Burst errors are far more common because noise usually lasts longer than one bit time.