Talk:Internet checksum

Naming
The article should probably be renamed to IP Header Checksum, or else rescoped to address other protocols that use the same algorithm. Some protocols use different algorithms, such as OSI CLNP header checksum.

The article should also be expanded to discuss the properties of an IP header checksum. For example, it is order-independent, so if two 16-bit words are accidentally swapped in transit, that isn't detectable.

Perhaps a note is in order that when routers update a header, they should recalculate checksum increntally (by subtracting the old data and adding the new data) rather than recalculating the full checksum, as this makes end-to-end error detection more robust. It prevents failure to detect values that unintentionally changed in the router's memory after verifying the checksum but before adjusting it for the changed data. — Preceding unsigned comment added by Learjeff (talk • contribs) 19:40, 14 March 2012 (UTC)
 * I agree, this name is way to generic. --Cybjit (talk) 14:43, 28 April 2012 (UTC)

While I agree that the old name header checksum was too generic, I feel that "IP Header checksum" may be too specific for this algorithm, since exactly the same algorithm is also used for the entire UDP packet (including data payload) in the User Datagram Protocol, and the entire ICMP packet (including data payload) in the Internet Control Message Protocol for IPv6. (What other protocols use this same algorithm, as mentioned by Learjeff ?)

I recommend that we rename this article to the name given in RFC 1624 and most other sources, "the Internet Checksum". That seems to roll off the tongue easier than "the 16-bit one's complement of the one's complement sum". --DavidCary (talk) 00:16, 25 March 2022 (UTC)


 * I would support a move. It should probably be Internet checksum. ~Kvng (talk) 14:44, 27 March 2022 (UTC)
 * Moved ~Kvng (talk) 14:48, 22 April 2022 (UTC)

Another example
I have removed this example from IPv4. I am not replacing the example in this article as the existing example is clearer. ~Kvng (talk) 23:36, 19 February 2018 (UTC)

For example, consider hex $$ (20 bytes IP header), using a machine which uses standard two's complement arithmetic:


 * $$ + $$ + $$ + $$ + $$ + $$ + $$ + $$ + $$ + $$ = 0002BBCF (32-bit sum)
 * $$ + $$ = $$ = $$ (1's complement 16-bit sum, formed by "end around carry" of 32-bit 2's complement sum)
 * ~$$ = $$ = $$ (1's complement of 1's complement 16-bit sum)

To validate a header's checksum the same algorithm may be used – the checksum of a header which contains a correct checksum field is a word containing all zeros (value 0):


 * Good! I fixed the link in the OP (the example was removed from IPv4). Johnuniq (talk) 00:28, 20 February 2018 (UTC)
 * Good! I fixed the link in the OP (the example was removed from IPv4). Johnuniq (talk) 00:28, 20 February 2018 (UTC)
 * Good! I fixed the link in the OP (the example was removed from IPv4). Johnuniq (talk) 00:28, 20 February 2018 (UTC)
 * Good! I fixed the link in the OP (the example was removed from IPv4). Johnuniq (talk) 00:28, 20 February 2018 (UTC)