Understand the need to check for errors after data transmission

Methods of Error Detection 🚨

Why Check for Errors? 🔍

When we send data over a network, it can get garbled, just like a message in a bottle that gets scratched on the way. Checking for errors ensures the receiver gets the exact information the sender intended.

Common Error‑Detection Techniques

  • Parity Bit (even/odd)
  • Checksum (sum of bytes)
  • Cy­clic Redundancy Check (CRC)

Parity Bit Example

Imagine a line of students holding a flag. If the number of students holding the flag is even, we say “even parity”; if odd, “odd parity”. The flag is the parity bit.

Suppose we send the binary word $1011$. Count the 1’s: there are three (odd). If we use odd parity, we add a parity bit $1$ so the total number of 1’s is even (4). The transmitted word becomes $10111$.

Checksum Example

Add all byte values and send the sum. The receiver adds again and compares.

  1. Sender: $0x12 + 0x34 + 0x56 = 0x9A$
  2. Send $0x9A$ as checksum.
  3. Receiver recomputes; if matches, data is likely correct.

Cyclic Redundancy Check (CRC)

CRC treats the data as a polynomial over GF(2). It divides by a fixed generator polynomial and sends the remainder.

Example: data $1101\,0110$, generator $1011$. The remainder $01$ is appended, giving $1101\,0110\,01$.

Error Detection in Practice

📦 USB flash drives use CRC to ensure files are copied correctly.

📡 Wi‑Fi uses parity bits in control frames.

Summary

- Errors can happen during transmission.
- Parity bits are simple but only detect odd numbers of bit errors.
- Checksums are better for larger data blocks.
- CRC is the most powerful, used in many protocols.

Quick Quiz

  1. What parity would you use if you want the total number of 1’s to be odd?
  2. Why is CRC more reliable than a simple parity bit?

Table: Comparison of Methods

Method Complexity Typical Use
Parity Bit Low Control signals
Checksum Medium File transfer
CRC High Network protocols

Revision

Log in to practice.

1 views 0 suggestions