How to calculate Internet checksum?

It uses addition, hence the name “sum”. 10101001 + 00111001 = 11100010.

For example:

+------------+-----+----+----+----+---+---+---+---+--------+
| bin value  | 128 | 64 | 32 | 16 | 8 | 4 | 2 | 1 | result |
+------------+-----+----+----+----+---+---+---+---+--------+
| value 1    |   1 |  0 |  1 |  0 | 1 | 0 | 0 | 1 |    169 |
| value 2    |   0 |  0 |  1 |  1 | 1 | 0 | 0 | 1 |     57 |
| sum/result |   1 |  1 |  1 |  0 | 0 | 0 | 1 | 0 |    226 |
+------------+-----+----+----+----+---+---+---+---+--------+

Leave a Comment