Skip to content

Static MTU value is too high, and doesn't work with other transports #2431

@austin-space

Description

@austin-space

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

  1. Use the litenetlib transport
  2. Connect to the server
  3. 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.

Metadata

Metadata

Assignees

Labels

priority:lowThis issue has low priority and will take some time to be resolvedstat:importedStatus - Issue is tracked internally at Unitytype:featureNew feature, request or improvement

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions