2

I am designing an application protocol, and i am wondering if i still need include checksum in the protocol since tcp/ip already has checksum. what's your opinion?

Benny
  • 8,547
  • 9
  • 60
  • 93

3 Answers3

3

The BitTorrent protocol has a heavy amount of additional error correction and detection layered on top of TCP, so clearly the protocol designers saw the need for it.

skaffman
  • 398,947
  • 96
  • 818
  • 769
2

The TCP checksum is quite weak, so you probably want an application level one if you are at all worried about reliability.

In particular the TCP checksum is not a secure hash, and there is no signature, so if you're worried about malicious changes then you need to add the security yourself.

Douglas Leeder
  • 52,368
  • 9
  • 94
  • 137
0

To add to the other answers, you should probably look into Message Authentication Codes. MACs are a more robust way to detect errors than a simple TCP checksum.

If you want something robust, take a look at [HMAC][2]. HMAC provides both error detection and authentication (via shared keys).

If you want something quick and dirty, why not use sha1 hashes?

jbenet
  • 3,030
  • 3
  • 22
  • 25