Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UDP calculated checksum 0 should be set as 0xFFFF in the frame #160

Closed
pstavirs opened this issue Oct 7, 2015 · 1 comment
Closed

UDP calculated checksum 0 should be set as 0xFFFF in the frame #160

pstavirs opened this issue Oct 7, 2015 · 1 comment
Labels

Comments

@pstavirs
Copy link
Owner

pstavirs commented Oct 7, 2015

As per RFC 768, if the calculated UDP checksum is 0, it should be instead set as 0xFFFF in the frame. A value of 0 in the checksum field indicates to the receiver that no checksum was calculated and hence it should not verify the checksum.

Reported on the mailing list -
https://groups.google.com/forum/#!topic/ostinato/6HnlOihYJ40

@pstavirs pstavirs added the bug label Oct 7, 2015
cdm-work pushed a commit to cdm-work/ostinato that referenced this issue Dec 7, 2017
… frame as per RFC 768. A checksum value of 0 in the frame is "special" and indicates that no checksum was calculated and hence receiver should not verify the same. This special case seems to be only for UDP, not TCP though.

Fixes pstavirs#160
@Filgs
Copy link

Filgs commented Apr 24, 2019

Hello pstavirs,
Thanks a lot for your comments about UDP checksum calculation resulting in 0x0000, which must be converted to 0xFFFF according to 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).

It took me a long time trying to identify where my Library code was wrong and the result is simply no error at all, it is just a question to add a final check of this UDP checksum Rule.

Just as extra info this rule is not applicable to TCP checksum, which is OK to be 0x0000.

For those who want to know the checksum algorithm in C, see RFC1071 https://tools.ietf.org/html/rfc1071
Just pay attention that it is not included the final check and transformation from 0x0000 to 0xFFFF required by UDP checksum.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants