Subject: Ftp-WG: Updating the checksum

From: "Mohammad Awad" <[email-masked]>
Date: Sun, 16 Feb 2003 02:28:26 -0500

Hi All,
It's written in RFC1071 that updating the Internet Header Checksum after one 
field (m), had changed, can be carried out this way:
C' = C + (-m) + m' = C + (m' - m)
where C' is the new checksum, C is the old one, m is the old value of the 
field and m' is the new value of it.
However I used the following values as an example to apply the equation and 
found out that something is wrong.
asume that we are calculating the 16 bit checksum for 2 fields m1,m2.

Original values:
m1: 1234
m2: 5678
C, from the definition equation:  9753

After updating m1
m1':1235
m2 :the same
C' from the update equation: 9754
C', from the definition equation: 9752
may be I've some troubles in understanding the application of 1's complement 
summation and subtraction!
Can anyone help please?

_________________________________________________________________
MSN 8 helps eliminate e-mail viruses. Get 2 months FREE*. 
http://join.msn.com/?page=features/virus

---

From: Robert Elz <[email-masked]>
Date: Sun, 16 Feb 2003 03:19:57 -0500

Date:        Sun, 16 Feb 2003 02:28:26 -0500
    From:        "Mohammad Awad" <[email-masked]>
    Message-ID:  <[email-masked]>

You probably shouldn't be sending questions about IP checksums
to the FTP extensions working group mailing list (we also
probably shouldn't be answering them here).

  | Can anyone help please?

I suspect that 1071 is incorrect, or meant to be interpreted differently
(the C in the example may be meant to be the calculated sum, not the 1's
complement of that which is stored in the checksum field).

But in any case, it is obvious that if you add 1 to a word in the message
you must subtract 1 from the checksum (word, in the message) as the sum
of all words in the message must be 0 for the message to be considered
valid (that it is a 1's complement sum, and a 1's complement "0" is irrelevant
for this - though obviously important for the implementation).

kre