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

When the DTLS server receives a large packet, there is an error: packet length and declared length do not match #601

Open
szn19930225 opened this issue Dec 14, 2023 · 0 comments

Comments

@szn19930225
Copy link

I'm trying to send DTLS packet with size about 8500 bytes but the DTLS server can't receive it and indicates error:
"dtls temporary: packet length and declared length do not match"

I checked the source codes and found that in the function: UnpackDatagram, the capacity of the buffer is 8192 bytes so when the size of the DTLS record layer is larger than 8192 bytes it can not be processed and will be discarded.

And in udp/conn.go it hardcodes this buffer size as:
const (
receiveMTU = 8192
defaultListenBacklog = 128 // same as Linux default
)

Just wonder why set the value as 8192, does any RFC define this value? So must we fragment the DTLS packets on the client side?

Thanks.

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