Checksum for a data packet of max 255 bytes?

Dec 20, 2007 4 Replies

What kind of checksum is appropriate for a data package with a maximum length of 255 byte?



Is an one byte XOR checksum sufficient or should i use some kind of 16-bit checksum or is that overkill for so litle data?



The data is to be transmitted on an RS232 line at 115200 kbit/s.


"Mr" a écrit dans le message de news:476a88bc$0$90275$ snipped-for-privacy@news.sunsite.dk...

The rfc 1071 summarizes some algorithms :

formatting link

In one section there are example of Internet checksum implementation algorithms that have been found to be efficient on a variety of CPU's.

It's very easy to implemente...

--

-Stan

What are the consequences of a packet error? A misplaced dot on a graph that a user will eyeball-out or somebody dies?

A CRC or checksum plus structured data plus sanity checking on the receiving end is often adequate but more robust error detection and correction techniques are certainly available and may be warranted.

P(error) will never be exactly zero. How small does it need to be?

Rich Webb Norfolk, VA

Depends on how frequently you are sending packets and how much a bad one will cost you.

My personal, totally empirical, preference would be crc16. It only takes a few more instructions to implement than checksum.

I agree completely. Use the CCITCRC polynomial, and initialize the checksum to 0xffff.

Merry Christmas, Happy Hanukah, Happy New Year Joyeux Noel, Bonne Annee. Chuck F (cbfalconer at maineline dot net)

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required