Protocols
Saved & recent

Checksum

Also called: Internet checksum, error detection, checksum verification

A checksum is a compact value calculated from data to help detect accidental corruption. The receiver recomputes or verifies the value and compares the result with what the sender supplied. Internet protocols use several error-detection schemes; the Internet checksum used by TCP and UDP is a particular 16-bit arithmetic construction.

For example, a bit damaged during transmission may cause the received bytes to fail checksum verification. Some patterns of changes can still escape detection because many possible messages share the same small checksum. An attacker who can rewrite a message can also recalculate an ordinary checksum. Detecting accidental errors is therefore different from cryptographic integrity protection, which is designed to resist deliberate modification.

Read first
Encapsulation
Related
TCP, UDP, TLS
Further reading
IETF RFC 1071 — Computing the Internet Checksum
original data words 1234 5678 checksum 9753 transmitted words + checksum 1234 5678 9753 unchanged recomputed 9753 ✓ 1234 5679 9753 changed byte recomputed 9752 × simplified 16-bit error check
Simplified one-word Internet-checksum example: 0A3C has checksum F5C3. Changing the word to 0A3D fails verification with that unchanged checksum. Real protocol checks include additional fields.

View in the full Protocols collection