-
Notifications
You must be signed in to change notification settings - Fork 455
feat: Update UTP to 1.4 and add ability to set UTP's MTU #2716
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
Conversation
NetworkManager has a MaximumTransmissionUnit property which controls how big a single batch of messages can be before it gets passed to the transport. Should that be tied into this value in some way? NetworkManager also has the ability to set this value per-peer based on MTU negotiation. Should UTP also support that? |
I hadn't noticed this. Should be pretty simple to use that instead of introducing a different knob in the transport itself.
UTP itself doesn't have per-peer MTU. It might be possible to somewhat mimic the functionality in the |
Actually was easier than I thought to add support for peer MTUs in the wrapper, so I did that. It only works for reliable sends, but I think that's okay because that's the majority of NGO traffic. Plus for unreliable sends, the peer MTU support in NGO itself should ensure no messages larger than the MTU get to the transport. |
Update UTP to 1.4. Since that version (and the newly-released 2.1) support setting the MTU at the transport level, add an API to configure that. The parameter can only be changed programmatically (it's not serialized) because we don't want users randomly messing with this value. It's really only meant for users that know what they're doing. For example we've had a few users report issues in restricted network environments where the MTU is abnormally low.
Changelog
MTU
property toUnityTransport
, which controls the low-level maximum datagram size that the transport will send. Unlike the MTU-related methods described below, this low-level MTU also applies to the individual chunks of a fragmented message. Typically there should be no need to change it unless you know your application is operating in an environment with an abnormally low MTU.com.unity.transport
to version 1.4.0.Testing and Documentation