Error Detection – Checksum

So how does the checksum works ?

  • Both devices needs to agree on checksum number – will it be odd or even
  • The higher the number is the more precise is the check

Let’s take the example from one of YouTube videos with a great explanation of how Checksum is working.

Taking the numbers which we want to transmit :

25 11 12 7 13 4

Both devices should agree on checksum – let it be number 16

  1. Sum up the numbers 25+11+12+7+13+4=72
  2. Divide them by checksum 72/16=4.5(ignore what is after the .) so we have 4
  3. 4*16=64 = 72 – 64 = 8  
  4. Now 8 is a checksum
  5. First device takes the numbers and writes them to tcp/ip stack, puts also the number 8 to the checksum field – to transmit it with actual message, this part helps to know if the rest of message is correct and right
  6. Second device reads the numbers from tcp/ip stack and performs the checksum check, if it get’s the same value = 8 that means that data wasn’t corrupted and we can trust it.

This is a very fast check to compute, but unfortunately checksum is not robust and not reliable it can help only against single bit error.

For example if we would send 25 11 12 7 13 4 but message will arrive as 24 12 12 7 13 4 it will also be 72 and checksum won’t detect any problems here.


IP Checksum picture taken from Stanford Networking Course

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s