-
Notifications
You must be signed in to change notification settings - Fork 457
Description
Description
At least two of the transports in Unity-Technologies/multiplayer-community-contributions (Ruffles and LiteNetLib) do some form of mtu negotiation. As of right now, netcode for gameobjects has a static mtu that is much higher than the starting value for either of those two transports. In the case where we attempt to send a packet exceeding that size, we will throw an exception with ends up crashing the entire networking stack.
It’s also especially egregious in this case because we’re not even sending individual messages anywhere near that size. Instead the messages are getting aggregated together until they’re too large for the underlying MTU that the protocol is using.
Also the starting value is too high since we can definitely find values below the 1300 + overhead that NFGO uses(hence the reason that these protocols negotiate up).
Reproduce Steps
- Use the litenetlib transport
- Connect to the server
- Within a minute or so(before the MTU has been appropriately negotiated up), attempt to send a packet of size 1299(less than the 1300 limit)
Actual Outcome
An exception is thrown by the underlying transport and the networking stack never recovers.
Expected Outcome
Messages are never aggregated up to a value too large for the underlying MTU.
Screenshots
Environment
- OS: All platforms
- Unity Version: 2020.3
- Netcode Version: 1.2.0
- Netcode Commit:
Additional Context
Add any other context about the problem here. Logs, code snippets would be useful here but please also consider attaching a minimal Unity project that reproduces the issue.