Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watnot!watmath!clyde!rutgers!seismo!mcvax!ukc!eagle!dcl-cs!david From: david@dcl-cs.UUCP Newsgroups: comp.dcom.lans Subject: Internet Protocol header checksum implementation problem Message-ID: <328@dcl-csvax.comp.lancs.ac.uk> Date: Tue, 7-Apr-87 09:16:50 EST Article-I.D.: dcl-csva.328 Posted: Tue Apr 7 09:16:50 1987 Date-Received: Sat, 11-Apr-87 06:01:14 EST Reply-To: david@comp.lancs.ac.uk (David Coffield) Distribution: world Organization: Department of Computing at Lancaster University, UK. Lines: 31 I'm posting this on behalf of a project student so if anyone has any thoughts on it, could they channel them through me. Thanks. -- INTERNET HEADER CHECKSUM I am having a no doubt trivial problem calculating the header checksum within an internet packet and would be grateful if someone could enlighten me as to my mistake. To calculate the checksum I take each 16-bits within the header ( starting with the version/IHL octet and ending with the octet immediately preceding the data portion of the Internet packet). To each of these I take the 16-bit one's complement and add them all up giving an unsigned 16-bit value. This is then one's complemented to give me the header checksum which is placed in the internet header checksum field (as per the IP spec). When calculating the checksum the checksum field is taken as containing zero. I have applied this procedure to packets taken directly from the network, the final checksum is nothing like what it should be, however, the value before taking the final one's complement is sometimes 7 sometimes 8 lower than what is in the checksum field of the packet read. Any clues? Thanks. -- janet: david@uk.ac.lancs.comp Department of Computing arpa: david@comp.lancs.ac.uk University of Lancaster uucp: ...!mcvax!ukc!dcl-cs!david Bailrigg, Lancaster, LA1 4YR, UK