Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are UDP Packets dropped when UDP header checksum is incorrect?

If i open a raw socket, and send udp packets with a wrong checksum, would the packets be dropped other side by the tcp/ip stack?

like image 835
innosam Avatar asked Aug 26 '13 20:08

innosam


People also ask

What happens if UDP checksum is wrong?

There is no sequence ordering and retransmission mechanism in UDP. If the checksum does not match packet is simply discarded.

What causes dropped UDP packets?

Congestion in the network is the primary reason for packet loss in UDP, as every communication network has a flow limit. For example, network congestion is similar to a traffic jam on the road, where exceeding the maximum number of vehicles allowed on a given road may cause traffic to slow or stop during peak hours.

Does UDP lose packets?

The UDP packet loss is especially affected by TCP traffic and its flow control mechanism. This is because TCP flow control continues to increase its window size until packet loss occurs if the advertised window size is large enough.

What does the checksum do in the UDP header?

Checksum. The final two bytes of the UDP header is the checksum, a field that's used by the sender and receiver to check for data corruption.


1 Answers

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

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.

like image 192
user2366842 Avatar answered Sep 22 '22 09:09

user2366842