Page 1 of 1

TCP / UDP question

Posted: Wed Jul 29, 2009 8:18 pm
by helpy
Hello to all network profis ;-)

In the TCP and the UDP protocol there is already a checksum used.

Is PB checking these checksums? I assume: YES!
I do not have (and do not need) access to these checksum!

The reason for the question is:
If I receive data (with ReceiveNetworkData) can I assume that the data is OK (i.e. checksum of TCP respectively of UDP is OK)?

I recognized that some people still put checksums in the data, which is sent/received with the PB commands Send/ReceiveNetworkData. Is this necessary?
One reason for working with these "additional" checksums could be to check my own code and if my code merges the received data properly if it is received in more than one block.

Thank you for all your insights!
cu, guido

Posted: Thu Jul 30, 2009 7:17 am
by Michael Vogel
The checksums of an IP packet have to be checked by the IP stack (something like a driver) as the frame checksum will have been checked already by the network interface before passing it to the upper layer.

That means, only correct frames addressed to the device will be seen in the IP layer and only if these packets have a correct IP checksum they are passed to the UDP or TCP layer and if the checksum is correct here also, PB will be able to see these packets now.

The high number of checksums in nearly each layer is a relict from the "ancient" networking technologies where the cabling (and everything else;) has been very unreliable, so the newer IPv6 does not have a checksum in its header...

Michael