Path: utzoo!attcan!uunet!ncrlnk!ncrcae!hubcap!gatech!rutgers!tut.cis.ohio-state.edu!ucbvax!UM.CC.UMICH.EDU!Dave_Katz From: Dave_Katz@UM.CC.UMICH.EDU Newsgroups: comp.protocols.tcp-ip Subject: TCP-IP zero checksum (with segue question) Message-ID: <4109706@um.cc.umich.edu> Date: 10 Mar 89 14:09:18 GMT Sender: daemon@ucbvax.BERKELEY.EDU Organization: The Internet Lines: 14 > The reason for jamming in 0xFFFF into the checksum field when the computed sum > is zero is to allow the receiving machine to be able to distinguish between > an incoming TCP packet that has a checksum to verify against a packet that had > not computed the checksum before putting it out on the net. The spec calls for the "ones complement of the ones complement sum." Ones complement arithmetic never results in -0 (0xFFFF) as a result, so the ones complement of that never results in 0. If you can really do ones complement arithmetic (don't throw away those PDP 11s!), there's no "jamming" involved; it just comes out that way. This is handy for detecting a zero checksum (if the semantics of that are meaningful), but it's also handy because you can verify the checksum of a received packet by running the algorithm with the received checksum in place; a result of zero means that the checksum was valid.