Unit 1 · Data Communication Fundamentals

1.8Error detection basics

Noise can flip bits. Common detection methods: parity bit, checksum and Cyclic Redundancy Check (CRC). Ethernet uses CRC in its frame trailer; if the check fails, the frame is discarded and higher layers (TCP) may retransmit.

Sendercalculates CRC fromheader + dataHeaderDataCRCnoise may flip bits on the wayReceiverrecalculates CRCand comparesmatch: accept framediffer: discard frame
Error detection with CRC: the sender adds a check value; the receiver recalculates it and discards the frame if they differ

Why errors happen

Electrical noise from motors and power cables, radio interference, a weak signal at the end of a long cable, a damaged connector or a loose plug can each change a 0 into a 1 or a 1 into a 0. A change to a single bit is a single-bit error. Noise that lasts a little longer often damages several bits in a row; this is a burst error, and it is the more common kind on real networks.

Parity

The sender adds one extra bit so that the total number of 1s is even (even parity) or odd (odd parity).

DataNumber of 1sEven parity bitSent
10110014010110010
11100003111100001

The receiver counts the 1s. If even parity was agreed and the count is odd, an error has happened. Parity is simple, but if two bits flip, the count is even again and the error is missed. It also cannot tell which bit is wrong.

Checksum

The sender adds up the data in blocks and sends the total (the checksum) with it. The receiver adds the blocks up again and compares. If the totals differ, the data is damaged. IP, TCP and UDP headers all carry checksums. They are quick to calculate, but they can miss some patterns of errors.

CRC (Cyclic Redundancy Check)

A CRC treats the data as one very long binary number and divides it by a fixed number agreed in the standard. The remainder of this division is the check value, and it is sent in the frame's trailer (Ethernet calls it the FCS, frame check sequence). The receiver does the same division. If its remainder differs, the frame is corrupted. CRCs detect all single-bit and double-bit errors and almost all burst errors, which is why they are used at the data link layer for every Ethernet and Wi-Fi frame.

Detection and correction

ApproachWhat happensUsed by
Detect and discardThe damaged frame is dropped; a higher layer notices that it is missing and asks for it againEthernet with TCP
Detect and request again (ARQ)The receiver asks the sender to retransmitTCP, Wi-Fi acknowledgements
Forward error correction (FEC)Extra bits let the receiver repair errors without asking againSatellite links, 4G/5G, storage, streaming

FEC costs extra bits on every transmission, but it avoids waiting for a resend, which matters when the delay is long (satellite) or the data is live.

Remember

  • Parity detects single-bit errors; a checksum adds up the data; a CRC is the strongest common method.
  • Ethernet uses a CRC and discards bad frames; TCP resends the missing data.
  • Forward error correction repairs errors without resending.