Course contentsShow
← Computer Science
Lesson 1447 of 2,87233. Networking FundamentalsFree lesson

Error Detection with Parity and Checksums

Using parity bits and checksums to detect transmission errors in frames.

Error Detection with Parity and Checksums

You'll learn: How networks detect corrupted data during transmission using parity bits and checksums.

The Problem

When frames travel across physical media—copper wires, fiber optics, or wireless—electromagnetic interference, noise, or hardware glitches can flip bits from 0 to 1 or vice versa. The Data Link Layer needs a way to detect these errors so corrupted frames can be discarded or retransmitted.

Parity Bits

Parity adds a single bit to a frame to make the total number of 1s either even (even parity) or odd (odd parity).

Example with even parity:

  • Data: 1011001 (four 1s)
  • Parity bit: 0 (to keep count even)
  • Transmitted: 10110010

If the receiver gets 10110110 (five 1s), it knows an error occurred. Parity catches single-bit errors but misses cases where two bits flip.

Analogy: Like a simple "sanity check" before turning in a form—count the pages to ensure none are missing.

Checksums

A checksum is a numeric summary computed over all the data bits in a frame. Common approach: sum all bytes and append the result (or a portion) to the frame. The receiver recalculates the checksum and compares.

Checksums catch more error patterns than single-parity but still aren't foolproof—some multi-bit errors can cancel out.

Why Use Them?

Both methods are lightweight—they add minimal overhead and can be computed quickly in hardware. They're the first line of defense; higher layers (like TCP) use stronger checks for critical data.

Key Takeaway:
Parity bits and checksums are simple, efficient error-detection techniques that help the Data Link Layer identify corrupted frames during transmission.