Checksum for a data packet of max 255 bytes?

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.

Reply to
Mr
Loading thread data ...

"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

Reply to
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
Reply to
Rich Webb

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.

Reply to
Jim Stewart

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

--
Merry Christmas, Happy Hanukah, Happy New Year
        Joyeux Noel, Bonne Annee.
 Click to see the full signature
Reply to
CBFalconer

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.