Search code examples
tcpchecksum

will tcp checksum mechanism work correctly all the time?


I am wondering if the TCP checksum mechanism could ensure the TCP data is the same as original, is there any conditions that the checksum won't work? I didn't find any reference about that.

I have an example to make my opinion clear.

The original TCP data is 11111111 11111111 00000000 00000000 ...... and it is changed to 011111111 11111111 10000000 00000000 ...... when travelling on the physical layer.

The end side will have the same checksum and it will accept the TCP data which is wrong.

I am pretty new to networking.


Solution

  • There is always a very small chance that data corruption will preserve the checksum or will also corrupt the checksum so that the corrupted checksum matches the corrupted data. Applications that require a higher level of assurance than TCP provides have to add their own protection.

    Of course, this provides no protection whatsoever from a malicious adversary. They can trivially adjust both the data and the checksum if they can intercept and modify the packets.