MirrorNetworking / Mirror

#1 Open Source Unity Networking Library
https://mirror-networking.com
MIT License
5.1k stars 757 forks source link

Bandwidth Abuse #3828

Open MrGadget1024 opened 3 months ago

MrGadget1024 commented 3 months ago

Too much bandwidth overhead

Pull the TestPingPong branch

Setting Up

Remedies

image

image

SoftwareGuy commented 3 months ago

I think the ping/pong stuff can be reduced.

Snapshot Timestamping etc would have to remain consistent, but the general "Are you still with me?/Yes I'm still here" network messages could have a longer delay between each PingPong.

Maybe you don't need to send the PingPongs if you're getting data network messages back and forth since the server would know the client is still there? Only send them periodically and then ramp up if the server thinks the connection is idle or in limbo?

MrGadget1024 commented 3 months ago

Part of the problem is how Ping/Pong messages evolved. Previously, Ping was only sent by clients every 2 seconds (0.5Hz), and only had client's localTime, which server would return in Pong, and client subtracted that from the current localTime and added that result to ExponentialMovingAverage _rtt.

Now Ping / Pong has been expanded to this and is sent at 10Hz by both server and clients:

image

Meanwhile, we have TimeSnapshotMessage that has no payload at all, is sent both ways independently at 60Hz, and only serves to trigger an action on the other side (there is no response msg).

I think we should consider the following: