Error detection
An error detector checks whether the received bit pattern belongs to a permitted set. Detection is not correction: a valid-looking received word can still differ from what was sent. CRC arithmetic is over binary polynomials, not ordinary integer division.
3.1 Parity and minimum distance
Past papers · CS 2014–2026 (23 papers): 2 questions, 4 marks
Even parity chooses the extra bit so the total number of ones is even; odd parity makes it odd. A single parity bit detects every odd number of bit flips and misses every even number. With row and column parity, a single flipped data bit identifies a row and column; a four-corner rectangle can evade both checks. Do not treat successful single-error correction as a general multiple-error correction scheme.
3.2 CRC generation and detection
Past papers · CS 2014–2026 (23 papers): 3 questions, 6 marks
Write the leftmost transmitted bit as the highest-degree coefficient. Polynomial addition and subtraction are XOR: no carries or borrows. A degree- generator has bits and produces exactly check bits, including leading zeroes.
| Error pattern | Guarantee and condition |
|---|---|
| One flipped bit | Detected for degree and constant term one |
| Two flipped bits, separation | Detected exactly when does not divide |
| Odd number of flips | All detected if is a factor of |
| Burst of length | All detected; burst length includes both erroneous endpoints |
| Burst of length | Miss fraction if its interior bits are uniformly random |
| Burst longer than | Miss fraction under the uniform random-interior model |
The random-burst fractions are not guarantees for an adversarial error pattern. A multiple of is always an undetectable pattern. A primitive degree- generator detects double-bit errors with separation less than ; check the actual frame length and generator before using this shortcut.
3.3 Internet checksum
The Internet checksum uses one's-complement addition of 16-bit words. Carry out of bit 15 is added back into bit zero, repeatedly if needed. Pad an odd final byte with a zero byte for the calculation; this arithmetic padding is not extra application data.
IPv4 checks its header only. TCP checks a pseudo-header containing endpoint IP addresses, protocol and TCP length, together with TCP header and data. The pseudo-header is used in computation; it is not inserted as another transmitted TCP header.
Last-minute recall
- One parity bit detects odd-weight errors, not every burst.
- Minimum distance must be computed over every distinct codeword pair.
- Detection and correction guarantees are different.
- A degree- CRC appends bits.
- CRC uses XOR; the leading zeroes of its remainder still occupy bits.
- A zero CRC syndrome can hide a nonzero multiple of the generator.
- Burst length is from first flipped bit to last, inclusive.
- Internet checksums use end-around carry, not CRC division.