Subject: Ospf Packet checksum

From: Ajay Virginkar <[email-masked]>
Date: Thu, 6 Mar 2003 10:47:36 -0800

Hi,
I have an issue where a router (from vendor X) complains of receiving
checksum FFFF and expects a zero. I checked the OSPF mailing list archives
but could not come to any conclusions from the previous discussion regarding
this.
Both sides are configured with no authentication. The question I guess is
that, is it valid to send a checksum of 0 in the OSPF packet header. It
seems that in the IP headers, a checksum of 0 is considered invalid. Does
OSPF permit checksum of value 0?
Thanks
Ajay

---

From: Dennis Ferguson <[email-masked]>
Date: Thu, 6 Mar 2003 14:59:56 -0800

Ajay,

>                                                                    It
> seems that in the IP headers, a checksum of 0 is considered invalid.

This part is wrong.  If you study the calculations in RFC 1071 very
carefully you'll discover that in almost all cases they produce checksum
values in the range 0-0xfffe, and it is 0xffff which is unlikely to
appear in the checksum field.  This is also the way most people implement
the checksum in the IP and TCP headers, in fact the only special case
I know of which is specified to work your way is the UDP checksum.  Since
the OSPF checksum is not special-cased like UDP is, the best assumption
is that it was intended that you compute it like RFC 1071 does.

Note that the receiver in this case is certainly broken since, given
how RFC 1071 defines a 1's complement sum and how it specifies that
the checksum should be checked, the values 0xffff and 0x0000 in
the header should produce identical check values (except in the very
special case that the rest of the data being checksummed is all-zeros,
in which case only 0xffff works).  To be conservative, however, you
should probably do your checksum computation *exactly* the way RFC 1071
does it, and the RFC 1071 computations (usually) produce 0-valued
checksums rather than 0xffff.

Dennis Ferguson