TCP / UDP question

Everything else that doesn't fall into one of the other PB categories.
User avatar
helpy
Enthusiast
Enthusiast
Posts: 552
Joined: Sat Jun 28, 2003 12:01 am

TCP / UDP question

Post 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
Windows 10 / Windows 7
PB Last Final / Last Beta Testing
User avatar
Michael Vogel
Addict
Addict
Posts: 2867
Joined: Thu Feb 09, 2006 11:27 pm
Contact:

Post 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
Post Reply