Reputation: 437
If I open a raw socket, and send UDP packets with a wrong checksum, would the packets be dropped at the other side by the TCP/IP stack?
Upvotes: 8
Views: 18035
Reputation: 1216
Yes they would be dropped. If you need more reliable communication you're much better off using TCP.
For more information, take a look at this: http://www.diffen.com/difference/TCP_vs_UDP
In UDP there's no guarantee that the packets will even be sent, let alone received. If they are in fact received though, they are checked. If they fail checksum they are dropped.
EDIT: also to add to that, UDP does not by default order the packets as they are sent, that has to be done at the application level. Bear this in mind if you still intend on using UDP.
Upvotes: 6
Reputation: 1041
If comes packet with wrong checksum, OS will drop it before passing it to the socket.
Destination application cannot determine if packet was lost or comes with wrong checksum. I think that it also cannot force else behavior.
Upvotes: 5