Framing and Error Detection
[!NOTE] This module explores the core principles of Framing and Error Detection, deriving solutions from first principles and hardware constraints to build world-class, production-ready expertise.
1. What is a Frame?
A frame is the digital data transmission unit in the Data Link Layer. It wraps the Network Layer (IP) packet with headers and trailers necessary for delivery within a local network segment.
2. Ethernet Frame Structure
(Standard IEEE 802.3)
| Preamble (7B) | SFD (1B) | Dest MAC (6B) | Src MAC (6B) | Type/Length (2B) | Payload (46-1500B) | FCS (4B) | | :— | :— | :— | :— | :— | :— | :— |
- Preamble & SFD: Used for clock synchronization between NICs.
- MAC Addresses: The source and destination physical IDs.
- Payload: The actual data (IP Packet).
- MTU (Maximum Transmission Unit): The maximum size of the payload. For standard Ethernet, this is 1500 bytes.
3. Error Detection (CRC)
The FCS (Frame Check Sequence) field contains a checksum calculated using a Cyclic Redundancy Check (CRC).
- Sender: Performs a polynomial division of the frame data and stores the remainder in the FCS.
- Receiver: Performs the same division.
- Check: If the remainder matches the FCS, the frame is assumed correct. If not, the frame is Discarded.
4. Interactive: The CRC Scanner
Watch the checksum verification.
5. Errors in Data Link Layer
[!WARNING] The Data Link Layer provides Detection, but usually NOT Correction. If a frame is corrupted, the NIC just throws it away. It’s up to higher layers (like TCP) to notice the missing data and ask for a retransmission.