Framing and Error Detection
How raw bits get organized into meaningful chunks, and how mistakes get caught.
What is Framing?
The Physical layer only understands a continuous stream of raw bits โ it has no concept of where one 'message' ends and another begins. Framing, done at the Data Link layer, groups these raw bits into manageable units called frames, each with a clear start and end, so the receiver knows exactly where each unit of data begins and finishes.
Why Errors Happen
During transmission, electrical noise, interference, or signal degradation over long distances can flip bits โ a 0 might be read as a 1, or vice versa. Since this is physically unavoidable at scale, networks need a systematic way to DETECT when this has happened, so corrupted data isn't silently accepted as correct.
Parity Check
The simplest error detection method: add one extra 'parity bit' to each unit of data, set so that the total number of 1s is always even (even parity) or always odd (odd parity). If the receiver counts the 1s and the parity doesn't match what's expected, it knows at least one bit was flipped โ though it can't tell exactly which one, or if TWO bits flipped (which would cancel out and go undetected).
Checksum
A checksum breaks the data into fixed-size blocks, adds them together using a defined arithmetic method, and sends this sum along with the data. The receiver redoes the same calculation โ if the results don't match, an error occurred. Checksums catch more error patterns than simple parity, and are used in protocols like IP and TCP.
CRC (Cyclic Redundancy Check)
CRC is a much more powerful error-detection technique that treats the data as a large binary number and divides it by a fixed 'generator polynomial', appending the remainder to the data. It catches almost all common error patterns (including bursts of consecutive bit errors) and is used in Ethernet, Wi-Fi, and most modern network hardware.
๐ Real-World Use
Every Ethernet frame your computer sends or receives includes a CRC value at the end (called the Frame Check Sequence) โ your network card automatically checks this and silently discards any frame that fails the check, without you ever noticing corrupted data slipping through.
๐ก Pro Tip
A common exam mix-up: error DETECTION (parity, checksum, CRC) only tells you SOMETHING went wrong โ it doesn't fix the error. Fixing requires either asking for a resend (common in TCP) or actual error CORRECTION codes like Hamming Code (the next topic) that can pinpoint and fix the exact bit.
๐งช Quick Self-Test
Check what you just learned โ no pressure, just practice.
1. What is the main purpose of framing at the Data Link layer?
2. Which error detection method is most powerful and widely used in Ethernet?
3. Can simple parity check detect if exactly TWO bits flipped?