Error Detection
Data Transmission · 4 question types
Exam Frequency Analysis
Past paper frequency (2018 to 2024)
This topic accounts for approximately 5% of your exam marks.
Parity bits, checksums and check digits each appear in most papers. Often 3 to 4 marks.
A checksum is a value calculated from the data using an agreed algorithm, sent alongside the data, and re-calculated by the receiver to verify the data was not corrupted.
How it works
- Before transmission, the sender runs every byte of the data through a algorithm. The output is a small fixed-size number (often a single byte or a few bytes).
- The sender transmits the data together with the checksum.
- The receiver re-runs the same checksum algorithm on the received data.
- The receiver compares its calculated checksum with the one that was sent.
- If the two checksums match, no error has been detected. If they differ, the data has been corrupted in transit.
A simple example checksum algorithm
A textbook example: take each byte of the data as a number, add them all up, and keep only the last byte of the sum.
For data bytes 45, 200, 12, 99:
- Sum: 45 + 200 + 12 + 99 = 356
- Last byte (modulo 256): 356 − 256 = 100
- Transmitted checksum: 100
If a single byte changes during transmission, the receiver's sum will be different and the checksums will not match. Real algorithms (CRC, MD5, SHA) use more complex maths to catch a much wider range of corruption patterns.
What checksums can and cannot do
- Detects that an error has occurred.
- Does NOT locate where the error is.
- Does NOT correct the error.
- Can miss carefully crafted changes that happen to give the same checksum (extremely rare with good algorithms).
Explain why a checksum mismatch means an error occurred
What comes up: a 2-mark "explain why" question — you are told that two checksum values do not match and asked to explain what this shows.
Write (two marks): (1) The checksum is calculated from the data using an agreed algorithm; if one or more bytes change during transmission, the receiver's recalculated value will be different from the value that was sent. (2) Because the two values do not match, the data that arrived must be different from the data that was sent — that is, an error has occurred.
Watch out: saying "the checksums are different" is not enough for the second mark; you must link that difference to the data having changed in transit.