Computer Network & Network Security System — Data Link Layer, NEC licence examination syllabus (Nepal Engineering Council).
Error Detection and Correction: catching (and fixing) corrupted bits
The single most numerical-heavy topic in this whole subject.
Every Wi-Fi packet, every downloaded file, every streamed video frame — somewhere along its journey, electrical noise has a chance to flip a bit from 0 to 1 or vice versa. This topic is entirely about catching that before it causes chaos.
🔢 Parity Check and Checksum
Parity checkAdd one extra bit so the total number of 1s is always even (or always odd). Catches single-bit errors, but misses two-bit errors that cancel out.
ChecksumSum up data blocks (with wraparound), send the complement as a check value. Receiver adds everything including the checksum — result should be all 1s if nothing was corrupted.
CRC — Cyclic Redundancy Check
2^r ≥ m + r + 1 With m = 8.
8 data bits need 4 parity bits — a 50% overhead. 128 data bits need 8, which is about 6%. The check bits identify WHICH position is wrong, and numbering more positions costs only one more bit each time you double.
CRC treats the message as a giant binary number and divides it by a fixed "generator polynomial," keeping the remainder as the check value.
Worked CRC example:
Data: 1101011011, Generator: 10011 (4-bit CRC, degree 4)
Step 1: Append four 0s to data → 11010110110000
Step 2: XOR-divide by 10011 (like long division, but using XOR)
Step 3: The remainder (say it comes out to 1110) is the CRC.
Step 4: Transmitted frame = original data + CRC = 1101011011 1110
Receiver divides the FULL received frame by 10011 again —
remainder of 0000 means no error detected.
💡 CRC numerical is a guaranteed question — practice the XOR long-division process by hand at least 3 times until the pattern feels automatic (it's just like normal division, but subtraction becomes XOR).
Hamming Code — actually FIXING the error, not just spotting it
Parity and CRC can tell you SOMETHING is wrong. Hamming code goes further — it can tell you exactly WHICH bit is wrong, and fix it.
Redundant bits formula: 2^r ≥ m + r + 1
m = number of data bits, r = number of redundancy (parity) bits
Example: for m=4 data bits, try r=3: 2³=8 ≥ 4+3+1=8 ✓ → need 3 parity bits
Parity bits are placed at positions 1, 2, 4, 8... (powers of 2)
Each parity bit covers a specific set of positions (based on binary position numbers)
The genius of Hamming code: at the receiver, you recompute each parity bit and combine the results into a binary number — that number directly tells you the POSITION of the error bit, ready to be flipped back. No searching required.
💡 Practice a full 7-bit or 8-bit Hamming code example: encoding 4 data bits into 7 total bits, then working through error detection AND correction for one flipped bit.
Syllabus points
Parity check, checksum
Cyclic Redundancy Check (CRC) — numerical
Hamming code (error correction) — numerical
Create a free account to tick topics off, take notes as you read, watch the video lessons and get a day-by-day study plan built around your exam date.