I wonder, while sending data with TcpClient, is there any sort of CRC checking algorithm that works automatically? Or I have to implement my own algorithm and resend the data if it doesn't arrive to remote host correctly?
4 Answers
The TCP checksum is fairly weak, but considered good enough for a reliable stream protocol. Often, there are more robust checksums being performed at the data link layer - i.e., ethernet (IIRC) uses CRC-32.
If you really want to roll your own, here is a detailed guide to the theory and implementation.

- 21,653
- 2
- 61
- 90
TCP contains a checksum and the TCP/IP stack will detect broken packets. So you don't need to implement any error detection algorithms on your own unless you want to.

- 11,500
- 5
- 51
- 85
There is a checksum in TCP. But, as the same article says,
The TCP checksum is a weak check by modern standards. Data Link Layers with high bit error rates may require additional link error correction/detection capabilities. The weak checksum is partially compensated for by the common use of a CRC or better integrity check at layer 2, below both TCP and IP, such as is used in PPP or the Ethernet frame.
So if you have concerns about that, maybe it won't hurt to add another checking.

- 89,107
- 13
- 149
- 217
-
So, neither TCP's checksum and Data Link Layrs's CRC can ensure data correct, how can we consider data get from TCP protocol is perfect correct? – lingtianlan Aug 05 '15 at 08:01
The whole point of using TCP is that the error checking is built in the protocol. So you don't have to worry about this kind of things.

- 38,392
- 3
- 78
- 94