Chapter 3

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-rr generator has r+1r+1 bits and produces exactly rr check bits, including leading zeroes.

Error patternGuarantee and condition
One flipped bitDetected for degree r≥1r\ge1 and constant term one
Two flipped bits, separation ssDetected exactly when g(x)g(x) does not divide xs+1x^s+1
Odd number of flipsAll detected if x+1x+1 is a factor of gg
Burst of length b≤rb\le rAll detected; burst length includes both erroneous endpoints
Burst of length r+1r+1Miss fraction 2−(r−1)2^{-(r-1)} if its interior bits are uniformly random
Burst longer than r+1r+1Miss fraction 2−r2^{-r} under the uniform random-interior model

The random-burst fractions are not guarantees for an adversarial error pattern. A multiple of gg is always an undetectable pattern. A primitive degree-rr generator detects double-bit errors with separation less than 2r−12^r-1; 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-rr CRC appends rr 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.

Revise offline: the whole Computer Networks handbook as one PDF

47 pages · 2.1 MBFree to read online. Sign in to download the PDF.We save the handbook, version and request time in My downloads. Privacy policy

All chapters · Corrections