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

Unable to send UDP packet of size 9400 bytes on Mac #9

Closed
richardeakin opened this issue Dec 18, 2014 · 4 comments
Closed

Unable to send UDP packet of size 9400 bytes on Mac #9

richardeakin opened this issue Dec 18, 2014 · 4 comments

Comments

@richardeakin
Copy link

We're not sure why, but we can't send a packet over UDP of 9400 bytes on Mac OS X, though it works fine on Windows. We are getting an error callback with error string "Message too long". AFAIK we should be able to send up to 65507, any idea why we can't?

You can test by modifying line 207 of UdpClientApp.cpp(dev branch) to be:

ci::Buffer buffer( 9400 );
mSession->write( buffer );

Maybe we are missing an option or setting?

@pizthewiz
Copy link

Doesn't the packet need to be smaller than the MTU? I'd have to think your config has jumbo frames enabled to even send packets of 9400 bytes, my wireless interface seems to be set to 1500:

$  networksetup -getMTU en0
Active MTU: 1500 (Current Setting: 1500)

@f0ster
Copy link

f0ster commented Dec 18, 2014

IP fragmentation should allow sending packets larger than the MTU, and up to the theoretical limit ~ 65k.

By default OSX won't allow a larger datagram size than 9216 bytes, however. You can change it as so

sudo sysctl -w net.inet.udp.maxdgram=65535

@richardeakin
Copy link
Author

Yep, the above sysctl command solved the issue for us, so I'll close this.

@pizthewiz
Copy link

IP fragmentation will totally allow packets larger than the MTU, but UDP does not guarantee any ordering so it can be dangerous!

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

3 participants