What are the major error detection techniques used in computer networks? Describe Parity Check, Checksum and CRC with suitable examples.
10 marks
Question source
- Exam year
- 2083 BS / 2026 AD
- Level
- Fifth Level
- Paper
- Paper II – Information Technology and Management
- Section
- Section B: Medium Answer Questions
Model answer
Error Detection in Computer Networks
Error detection is the process of identifying errors that occur in data during transmission over a network or storage medium. Errors are caused by noise, signal interference, and hardware faults that flip bits (0 becomes 1 or vice versa).
Major error detection techniques:
- Parity Check
- Checksum
- Cyclic Redundancy Check (CRC)
- Longitudinal Redundancy Check (LRC)
- Hamming Code (error detection and correction)
1. Parity Check
Parity check is the simplest error detection method. An extra parity bit is appended to each data unit so that the total number of 1-bits in the unit (data + parity bit) is either always even (even parity) or always odd (odd parity).
How it works:
- Even Parity: The parity bit is chosen so that the total count of 1-bits is even.
- Odd Parity: The parity bit is chosen so that the total count of 1-bits is odd.
Example — Even Parity:
| Data (7 bits) | Number of 1s | Parity Bit | Transmitted (8 bits) |
|---|---|---|---|
1010001 | 3 (odd) | 1 (to make it 4, even) | 10100011 |
1101011 | 5 (odd) | 1 (to make it 6, even) | 11010111 |
1100110 | 4 (even) | 0 (already even) | 11001100 |
At the receiver: Count the 1s in the received byte. If it is odd (for even parity), an error occurred.
Limitation: Parity check cannot detect errors when an even number of bits are flipped (the parity still checks out). It also cannot detect which bit is in error.
2. Checksum
Checksum is an error detection method used in network protocols (IP, TCP, UDP). The sender divides the data into equal-sized segments, adds them together, takes the one's complement of the sum, and transmits this value (the checksum) alongside the data. The receiver performs the same calculation; if the result is all 1s (0xFFFF), no error is detected.
How it works (one's complement addition):
Example:
Data to transmit (two 8-bit segments): 10101001 and 00111001
Step 1 — Add the segments:
10101001
+ 00111001
----------
11100010
Step 2 — Take one's complement of the sum (invert all bits):
11100010 → 00011101 (this is the checksum)
Step 3 — Sender transmits: 10101001 00111001 00011101
Step 4 — Receiver adds all three:
10101001
+ 00111001
+ 00011101
----------
11111111 (all 1s = no error detected)
If the receiver's sum is not all 1s, an error occurred.
Used in: IP header checksum, TCP checksum, UDP checksum.
3. Cyclic Redundancy Check (CRC)
CRC is the most powerful and widely used error detection technique. It treats the entire data block as a large binary polynomial and divides it by a pre-agreed generator polynomial. The remainder of this division is called the CRC code (or Frame Check Sequence — FCS), which is appended to the data before transmission.
How it works:
Both sender and receiver agree on a generator polynomial (e.g., 1011 for CRC-3).
Example:
Data (message): 1101011011
Generator: 1011
Step 1 — Append zeros: Append (n−1) zeros to the data, where n = length of generator = 4, so append 3 zeros:
1101011011 000
Step 2 — Perform binary division (XOR-based, no carries):
1101011011000 ÷ 1011
-----------
1011
----
1101
1011
----
1100
1011
----
1111
1011
----
1001
1011 ← pad with next bit
----
... (continue until all data bits are processed)
(The full XOR long division yields a 3-bit remainder — the CRC.)
Step 3 — Sender replaces the appended zeros with the CRC remainder and transmits the full frame.
Step 4 — Receiver divides the received frame by the same generator. If the remainder is zero, no error is detected. If non-zero, the frame contains an error.
Why CRC is better:
- Detects all single-bit errors
- Detects all burst errors of length ≤ n−1 bits
- Detects most burst errors of longer length
- Used in Ethernet (CRC-32), USB, Bluetooth, storage devices
| Technique | Detects | Limitation | Used In |
|---|---|---|---|
| Parity Check | Single-bit errors | Cannot detect even-number bit flips | Serial communication, ASCII |
| Checksum | Burst errors in segments | Weak against systematic errors | IP, TCP, UDP headers |
| CRC | Burst errors, most multi-bit errors | Cannot correct errors, only detect | Ethernet, WiFi, USB, storage |