Subject: CRC-32 Checksum for IPv6

From: GM Kump <[email-masked]>
Date: Thu, 24 Sep 1998 17:02:51 -0400

For RP hashing, the PIM-SM spec states that one should use the IPv4 address for
IPv6 IPv4-compatible addresses and the CRC-32 checksum for all other IPv6
addresses.  The specification then references an article by Mark R. Nelson in
the Dr. Dobb's Journal, May 1992 issue.

I obtained the Dr. Dobb's article code and found a DOS/UNIX application for
calculating CRC-32 for files in a directory.  Knowing that the most important
PIM-SM goal here is calculating a crc value that is the same throughout the
network, I got a little nervous.  Mark calculates crc for an entire file
buffer, keeping an accumulative crc.  When done, the resultant crc is returned
for the file crc, but undergoes a final one's complemented on return.

Question I have is with respect to the final XOR operation.  Is this
required/desired?  I just want to ensure that no matter how I apply the CRC-32
checksum to obtain the hash value, I'm doing it the same way as everyone else.

Thanks,
Garry

---

From: Dave Thaler <[email-masked]>
Date: Thu, 24 Sep 1998 18:39:08 -0400 (EDT)

> checksum to obtain the hash value, I'm doing it the same way as everyone else.

CRC-32 is a standard algorithm.  I think there are other references 
available in other places (I didn't have any others handy when
I inserted the CRC32 reference).  Anyway, if the article does it,
then it must be required to obtain the correct answer.

Perhaps someone else can give an alternate reference for
the CRC-32 algorithm?

-Dave

---

From: Peter Higginson <[email-masked]>
Date: Fri, 25 Sep 1998 00:23:52 +0100

The best current reference for CRC32 is probably The Ethernet Physical
Layer Specification, which while accurate is terse. (I do have an old
Defence Communications Agency Memo which has more detail on why the check
was chosen.) However the problem with these and all similar specifications
is that the basis of the description is a shift register and this isn't the
best way to do a software implementation. Hence I'd stick with what you have.

As well as inverting the result, it is important to initialize the checksum
to all ones. (Before this technique was adopted it was possible to insert
zero bytes at the start and end of messages without detection.)

It is also important to be clear about the bit and byte order in which the
message is processed.

For error checking theory to work properly, the bits are supposed to
progress through the shift register in the order they appear on the
communications link. In your case all that matters is that everyone does
the same thing - presumably (so called) network order will be used, with
the assumption that least significant bit is sent first.

Peter