Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How reliable is the UDP checksum algorithm?

Tags:

checksum

udp

It seems that UDP uses a fairly simple checksum algorithm and mostly it would produce a desired result and detect errors.

However, as far as I can tell, the header for UDP is the same when using Jumbo frames and the checksum is the same. It's only 16 bits.

Would this increase the likelihood that errors would seep in and that the protocols that use UDP (especially those that use large packets) should not rely on the UDP checksum at all?

like image 433
hookenz Avatar asked Dec 01 '11 23:12

hookenz


1 Answers

As you pointed out, UDP uses a 16-bit checksum regardless of how large the packet is. UDP checksums are unable to detect errors if the change does not alter the sum of all the 16-bit words. This is more likely to occur as the packet size increases.

However, UDP normally runs on top of ethernet, which provides a 32-bit CRC, which is much more robust than the UDP checksum. Thus, most people rely on the etherframe to guarantee data integrity.

Large UDP packets will be fragmented into multiple IP packets, each in its own ethernet packet with a 32-bit CRC. Thus, sending large UDP packets is not a concern from a data integrity standpoint, although IP fragmentation can increase packet loss and re-ordering.

like image 168
Hugh White Avatar answered Sep 23 '22 17:09

Hugh White