Author Topic: valid tcp packet communication  (Read 5933 times)

Offline neil

  • Sr. Member
  • ****
  • Posts: 438
    • View Profile
valid tcp packet communication
« on: June 19, 2012, 06:08:04 PM »
Hi
  When a standard tcp connect is established with a server, am I right in thinking that the sending side includes a checksum of the packet? Then the server will only pass the packet to the user if the checksum is valid, is this correct?

Also, if the above is correct, then I assume there is no need to add my own checksum calculcations?

Thanks
Neil
« Last Edit: June 19, 2012, 06:16:17 PM by neil »

Offline mark

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3236
    • View Profile
    • uTasker
Re: valid tcp packet communication
« Reply #1 on: June 19, 2012, 08:56:14 PM »
Hi Neil

In the data sent there is a checksum in the IP header and also one in the TCP header. On top of this, if you are in a local network, all Ethernet frames have a more powerful CRC-32 checking them too.
Essentially one can consider that all data received by the TCP application is error-free and so an additional checksum in the user data is not usually necessary.

All TCP/IP frames received with an error are silently discarded according to the TCP/IP specifications. UDP frames have an optional checksum in their UDP header but, if enabled, also ensures that the payload is essentially error-free when it is accepted.

Regards

Mark