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

Asymmetric client/server MTU #201

Open
dktapps opened this issue Feb 13, 2023 · 1 comment
Open

Asymmetric client/server MTU #201

dktapps opened this issue Feb 13, 2023 · 1 comment

Comments

@dktapps
Copy link
Member

dktapps commented Feb 13, 2023

Due to various bugs, the Minecraft client must be limited at 1400 MTU in common cases, because of edge cases on some devices and older routers. In these cases, the MTU probe in OpenConnectionRequest/Reply1 yields a higher MTU than is actually realistically available.

However, reducing max MTU is sub-optimal for server bandwidth, because it increases total bandwidth usage by packet headers from 4.0% to 4.3%. This doesn't sound like much, but it can make a difference on large servers.

We can avoid this by capping the client to a fixed MTU of 1400 (the client rarely sends huge packets anyway) and having the server dynamically probe the connection after the initial sequence to find out where the real MTU limit is by figuring out where packets actually get lost, and limiting its output to that instead. This way, only players with dodgy hardware experience reduced MTU, and everyone else will be unaffected.

This idea was suggested by @MCMrARM.

@GameParrot
Copy link

I implemented sending OpenConnectionReply2 with padding to test the actual MTU, and resending it with less padding every 2 seconds until ConnectionRequest is received

Also the ipv6 header is 40 bytes and not 20 bytes which can cause fragmentation

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

2 participants