Does CRC Check on Top of TCP Have Any Meaning?

tcp

For our project, a protocol is specified for communication between an embedded linux device and a PLC/HMI. This protocol includes CRC checking.

However, the communication is now done over TCP (TCP protocol includes CRC), so my question is whether or not a CRC on top of TCP has any meaning ?

Best Answer

You can get rid of your own CRC if its less than 48 bits:

TCP provides reliable and error-checked transport service. The error check is double:

As both calculations are using independent algorithms, the odds that an error remains undetected is less than 1/2^48. This calculation is based on the probabilities for the CRC32 and the checksum and the fact that CRC32 detects 100% of the most probable transmission errors.

So unless your legacy CRC is more than 48 bits long (e.g. CRC-64), maintaining it would have no benefit compared to the old situation without TCP.

Layering principle

The layering of the OSI model can be used to guide the design, without necessarily having to enter into probabilistic debates. The principle is that each layer is responsible for something, and relies on the guarantees offered by the lower levels.

So if your application no longer has to manage the lower levels of the transport (network, datalink), then you can get rid of the error checks already performed in these layers.

Checking for the higher levels of the protocol stack could add value. So checking the correct data format and encoding (presentation layer), ensuring the integrity using cryptographic means (presentation layer) or performing application domain specific verifications would still be relevant.

Related Topic