Open romlok opened 6 months ago
Note that Godot's network profiler does not measure the overhead added by the network protocol (or even the impact of compression) – it only measures the amount of bytes Godot sends or receives with its high-level multiplayer API.
The value reported by Godot still seems very low (I'd expect it to be at least twice that), but we can't expect it to be identical to the value reported by Wireshark for this reason.
I'm not sure if we can make it a truly accurate measurement of how much data is being sent/received, considering low-level access like Wireshark requires root access and a lot of OS-specific code.
Edit: Disregard the accidental close/reopen below.
Yeah, I don't really know how one could embed more accurate bandwidth measures either. But if the values immediately available to Godot aren't really indicative of real-world usage, the question for me is should they be shown at all? Or should people rather just be directed to the platform-specific tools for accurate bandwidth measurement?
Or else I'm wondering if there are the use cases that the currently presented values are intended for/more helpful, that I'm not thinking of? :thinking:
Or else I'm wondering if there are the use cases that the currently presented values are intended for/more helpful, that I'm not thinking of? 🤔
You can't optimize IP and protocol headers but can optimize your game code (synchronization states and RPCs).
The values shown there, helps you optimize what you can optimize, and you can use them as reference to know if changing your game code actually improve the network usage.
EDIT: In general, this is more useful for the replication system than the RPCs, because the replication system already minimize the number of packets sent (i.e. maximize the packet size while avoiding fragmentation). so the percentage of header overhead is more or less constant, while RPCs are sent immediately (not grouped), so the impact of header overhead may vary much more.
Tested versions
Reproducible in: v4.2.2.stable.official [15073afe3]
System information
Godot v4.2.2.stable - Debian GNU/Linux trixie/sid trixie - Wayland - Vulkan (Forward+) - dedicated AMD Radeon RX 7600 (RADV NAVI33) () - AMD Ryzen 5 7600 6-Core Processor (12 Threads)
Issue description
When running a multiplayer project, the "down" and "up" values of the Network Profiler don't match what I see from other network analysis tools (eg. Wireshark), by an order of magnitude!
Eg, an instance of the supplied MRP in Godot:
And the traffic in only one direction (client->server) as monitored by Wireshark: (note that this is traffic directly to the MRP's server port, so doesn't include debug traffic to the editor itself)
The MRP has each client broadcast a single parameterless unreliable RPC every physics frame (60fps). With just the server and one client this results in the Network Profiler showing a constant ~180B/s to/from each process. This calculates to 3 bytes transferred per RPC.
However, Wireshark shows that just the data portion of a single UDP packet is itself 13 bytes, and the network usage as a whole is 75 bytes on the wire! So I'm not sure how Godot is measuring or calculating these bandwidth values, but they seem at the very least highly misleading :confused:
Steps to reproduce
udp.dstport == 12345
Minimal reproduction project (MRP)
network-bandwidth-test.zip