RevenantX / LiteNetLib

Lite reliable UDP library for Mono and .NET
https://revenantx.github.io/LiteNetLib/index.html
MIT License
3.07k stars 496 forks source link

Use real MTU size for MTU packets #243

Closed xmedeko closed 6 years ago

xmedeko commented 6 years ago

Currently, MTU packets MtuCheck, MtuOk use index to PossibleMtu array. It will break if the PossibleMtu changes. Use real size and pls add sizes: (maybe, not so often used)1232, (e.g. Google Cloud) 1460, and (many VPNs and ISPs) 1472.

Library version: 0.8indev

harleyau commented 6 years ago

I do a bit of this in my day job.

Ideally you want to discover the MTU for each connection. Or a quick fix, let the server set a number and kick anyone that cant comply.

From a consumer perspective I've seen MTUs as low as 1400 on cellular and wimax services (very common on these services). 1500 is common for LANs, fibre and most ADSL services.

Enterprise networks can have larger overhead caused by things like WAN optimisation devices and/or VPNs or other tunnels. In this case you can see lower MTUs.

A lower MTU is probably not a big deal for this lib as most people trying to use it will not be trying to transfer a large amount of data across it.

On Thu, 18 Oct. 2018, 9:16 pm Ondrej Medek, notifications@github.com wrote:

Currently, MTU packets MtuCheck, MtuOk use index to PossibleMtu array. It will break if the PossibleMtu changes. Use real size and pls add sizes: (maybe, not so often used)1232, (e.g. Google Cloud) 1460, and (many VPNs and ISPs) 1472.

Library version: 0.8indev

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/RevenantX/LiteNetLib/issues/243, or mute the thread https://github.com/notifications/unsubscribe-auth/AIaLIm85_3CXXk4W_T8Bx_OFHnB0L_Z7ks5umFT9gaJpZM4XtHmL .

xmedeko commented 6 years ago

Yes, some dynamic MTU discovery may be implemented in the next step.

xmedeko commented 6 years ago

@RevenantX I also think that the MTU code should be moved to some class NetPeerMtu - to improve code readability and make it possible to do some unit tests.