0

I read UDP checksum from Wikipedia that "If the checksum calculation results in the value zero (all 16 bits 0) it should be sent as the one's complement (all 1s) as a zero-value checksum indicates no checksum has been calculated. In this case, any specific processing is not required at the receiver, because all 0s and all 1s are equal to zero in 1's complement arithmetic."

I don't understand when checksum calculation be zero in one's complement, but all 1's possible to get. My understanding Zero sum means there is no data to calculate. Please help.

3

A UDP checksum value of zero indicates that the checksum option isn't used (checksum value is not to be verified). Therefore, a calculated checksum of zero is replaced by all ones to indicate that case unambiguously.

See RFC 768:

If the computed checksum is zero, it is transmitted as all ones (the equivalent in one's complement arithmetic). An all zero transmitted checksum value means that the transmitter generated no checksum (for debugging or for higher level protocols that don't care).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.