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

Suggestion: clear DF bit in replies (IP_MTU_DISCOVER to IP_PMTUDISC_DONT) #199

Open
subbergunz opened this issue Jul 3, 2024 · 0 comments

Comments

@subbergunz
Copy link

subbergunz commented Jul 3, 2024

Hello people and thank you for your work and for sharing it.

I have a server with pyrad, and a client is behind a PPPoE link with MTU 1492, both client and server are normal machines with the usual MTU of 1500.

Requests are always small and are OK. When the answer is small, OK. When it is big, it is fragmented at the source and the DF bit is clear, the full-size fragment is fragmented again, and everything is OK.

When the answer is between 1492 and 1500, DF bit is set, no ICMP unreachable is seen, the answer is lost. This is an unlikely "edge" situation, it took a lot of time to actually happen. When it did, it was not immediate to troubleshoot.

I ended up with the following in my code:

import socket
IP_MTU_DISCOVER = 10
IP_PMTUDISC_DONT = 0

....
     reply = self.server.CreateReplyPacket(pkt)
     pkt.fd.setsockopt(socket.SOL_IP, IP_MTU_DISCOVER, IP_PMTUDISC_DONT)
     self.server.SendReplyPacket(pkt.fd, reply) 
....

Replies now have DF bit clear and arrive, fragmented, at the client, and everything is OK.

I understand that having client and server with an MTU bottleneck in between is probably not very common, but you might want to consider adding something similar to the distributed code.

Best regards and thank you again,

Bergonz

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