[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: node types etc.

On Tue, 16 Jan 2001, Philipp Rumpf wrote:

> On Tue, Jan 16, 2001 at 02:32:29PM +0000, David Woodhouse wrote:
> >
> > bjorn.wesen@xxxxxxx.com said:
> > >  How can something be cheaper than a single addition ? :)
> >
> > TCP checksums aren't just a simple addition. You have to fold back into 16
> Yes.  They're a simple addition of one's-complement 16 bit units (at least
> in the actual loop).
> > bits. I'm told that CRC can be cheaper on 32-bit machines. A straight
> > 32-bit checksum, on the other hand, can quite possibly be cheaper than
> > either.
> I don't think there's any noticeable difference, considering we're dealing
> with very small blocks of data here (which our tcp checksum routines should
> be optimized for anyway).

You are missing my point.

It is proven that checksums have a pretty high probability to miss data
corruption caused by hardware defect or whatever.  The bits of a checksum
are highly correlated to the bits of the data, especially for the MSB.

The simpliest example is the following:  Suppose that bit 31 of every flash
word is deffective, your data will be corrupted if you can't set that bit to
1 for one word.  Incidentally that bit won't be set in the checksum either
thus the corruption will go unnoticed.  This problem is extremely less
probable with a CRC.  One can arg that xoring the checksum will solve that
problem but this is still far from the ideal solution.

Simple CRC routines are pretty light to implement and have better
error-checking properties.


To unsubscribe from this list: send the line "unsubscribe jffs-dev" in
the body of a message to majordomo@xxxxxxx.com