Parity Bits and Checksums Explained
- Networking Fundamentals & OSI Model
- TCP/IP Model
- Network Topologies
- IP Addressing & Subnetting
- Routing Algorithms & Protocols
- Switching Concepts
- Transport Layer Protocols (TCP & UDP)
- Application Layer Protocols
- Network Security & Firewalls
- Wireless Networking & Wi-Fi
- Network Address Translation (NAT)
- DNS Deep Dive
- Congestion Control & Flow Control
- Error Detection & Correction
- Network Devices
- VPN & Tunneling
- Load Balancing & CDN Networking
- Socket Programming
- Network Troubleshooting Tools
- Physical Layer & Transmission Media
- Data Link Layer & MAC Addressing
- Ethernet Protocol
- ARP (Address Resolution Protocol)
- ICMP Protocol
- Unicast, Multicast, Broadcast and Anycast
- Proxy Servers
- Port Numbers Reference
- Network Performance Metrics
- Quality of Service (QoS)
- Software-Defined Networking (SDN)
- HTTP/2 and HTTP/3 Overview
- 5G and Mobile Networks
- IoT Networking Basics
- VoIP Networking Basics
Why Transmitted Data Needs Error Checking at All
Electrical noise, interference, and imperfect hardware can all flip a bit during transmission - turning a 0 into a 1, or vice versa. Error detection techniques let a receiver notice when this has happened, even without knowing exactly which bit was affected.
Parity Bits: The Simplest Approach
A parity bit is one extra bit added to a group of data bits, set so that the total count of 1-bits (including the parity bit itself) is always even (even parity) or always odd (odd parity), by agreement.
Data: 1 0 1 1 0 0 1 (four 1-bits - already even)
Even parity bit added: 0 -> final: 1 0 1 1 0 0 1 0
If one bit flips during transmission, the total count of 1s becomes odd,
and the receiver immediately knows an error occurred.A Key Limitation of Simple Parity
A single parity bit can only reliably detect an odd number of flipped bits (1, 3, 5...). If exactly two bits flip at the same time, the total count of 1s returns to matching the expected parity, and the error goes completely undetected.
Checksums: A Stronger Alternative
A checksum treats a larger block of data as a sequence of numbers, adds them together using a defined arithmetic method, and sends the result alongside the data. The receiver repeats the same calculation and compares its result to the sent checksum - a mismatch means something was altered in transit.
Why Even Checksums Aren't Foolproof
Both parity bits and simple checksums can, in rare cases, fail to detect certain specific patterns of errors - which is exactly why CRC, covered in the next note, was developed as a much stronger detection method for real-world networking.