Checksums (was Re: Ping, checksum algorithm?)

gordan (mnetor!spectrix!yunexus!maccs!
23 Mar 88 01:03:47 GMT

In article <In article <123@heart-of-gold> In article <123@heart-of-gold> jc@heart-of-gold (John M Chambers x7780 1E342) writes:
-Does anyone have a PD version of ping? How about a C-coded routine that
-does the IP checksum calculation? We have one that is written in VAX
-assembly language, which is OK for a VAX, but it doesn't work too well
-on a 68020....

  -- One's complement of the one's complement sum checksum in TCP/IP --

In the RFC documents, the "one's complement of the one's complement sum"
checksums are mentioned in a single paragraph, and are never even
described, an omission that seems incredible.

Although the algorithm must be well known to many people, a written
description seems to be lacking. So here's an attempt to provide a
short description (with examples). The only authority I can cite for
the following is myself (but it seems to work, judging from actual
TCP/IP packets). Someone kindly let me know if this is horribly wrong.

Basically, IP, TCP, and UDP require doing one's complement sums of

This archive was generated by hypermail 2.0b3 on Thu Mar 09 2000 - 14:41:07 GMT