Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.1 6/24/83 (MC840302); site ttds.UUCP
Path: utzoo!watmath!clyde!bonnie!akgua!sdcsvax!dcdwest!ittvax!decvax!genrad!wjh12!harvard!seismo!mcvax!enea!ttds!ahi
From: ahi@ttds.UUCP (Anders Hillbo)
Newsgroups: net.lan
Subject: (DoD) InterNet Header Checksum
Message-ID: <624@ttds.UUCP>
Date: Tue, 2-Oct-84 21:02:49 EDT
Article-I.D.: ttds.624
Posted: Tue Oct  2 21:02:49 1984
Date-Received: Sun, 30-Sep-84 03:18:38 EDT
Organization: The Royal Inst. of Techn., Stockholm
Lines: 36

I have been trying to make my Sun (version 1.0 of sun-unix) talk
to my Xerox Dandelion (1108). As is it easiest to send raw
packets on the Dlion, and I'm all going for TCP/IP I decided
to try to just implement IP on the 1108 and talk using RAW 
IP sockets on the SUN. After figuring out how to answer the 
ARP packet that the SUN sends to get the ethernet addr (I
haven't got that RFC, but looking at the Vax if_ether source was
good enuf) I sent an IP packet from the SUN. That went well
but when I tried to reply the SUN didn't receive it because
my checksum was wrong. The problem is: I can't figure out what 
I'm doing wrong in computing the checksum. Is there any way to
do it not in the document? I get the following IP header from Sun:

Version 4 IHL 5 service 0 totlen 29
id 116 flags 0 fragoffs 0
ttl 255 prot 255 chksum 43606
sadr 192 9 200 2 dadr 192 9 200 1

which gives the following 16-bit words:
17664, 29, 116, 0, 65535, 0, 49161, 51202, 49161, 51201
(yes I have zeroed the checksum before computing it again)

My checksum produced by taking the one's complement (C ~ operator)
of the 16-bit words, adding them and finally one compl the sum, was 21934
if I remember correctly. At least not 43606. If I sum all the words,
negate the sum and take the right sixteen bits I get 43611. That is
5 bigger, but that's not the proper algorithm.
For the moment I can fake the checksum it seems, but it is 
somewhat frustrating...

What is my error? 

(I did my checksum on both the Sun and on the 1108 with the same result
just to make sure it wasn't anything wrong with InterLisp-D or 1108)

decvax!mcvax!enea!ttds!ahi