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

Large UDP packet: Length field get overwritten with length of first IP fragment #203

Open
arvindpdmn opened this issue Sep 29, 2023 · 0 comments

Comments

@arvindpdmn
Copy link

arvindpdmn commented Sep 29, 2023

Using iperf we send large UDP packets, say 2000 bytes. The networking stack will send the packet as two IPv4 fragments.

At the receiver we use this .NET library. When the receiver gets the first fragment, it decodes the IPv4 packet/fragment correctly. But then it also proceeds to decode the UDP header in the first fragment. Because only part of the UDP payload has come in, it updates the Length field of UDP packet to the smaller value. This is wrong. Higher layer decoding should be deferred until all IP fragments are received.

In our application, the receiver is an intermediate node. It's meant to transparently pass on IP and higher layer content.

If this library had used ReadOnlySpan<byte>, this bug could have been avoided. Library should not modify packet contents that it receives.

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

No branches or pull requests

1 participant