Skip to content
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

Network Profiler greatly underreports bandwidth usage #91869

Open
romlok opened this issue May 12, 2024 · 2 comments
Open

Network Profiler greatly underreports bandwidth usage #91869

romlok opened this issue May 12, 2024 · 2 comments

Comments

@romlok
Copy link
Contributor

romlok commented May 12, 2024

Tested versions

Reproducible in: v4.2.2.stable.official [15073af]

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:
Screenshot_20240511_161134

And the traffic in only one direction (client->server) as monitored by Wireshark:
Screenshot_20240511_161025
(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 😕

Screenshot_20240512_103846

Steps to reproduce

  1. Open MRP in editor
  2. Editor: Debug->Run Multiple Instances->Run 2 Instances
  3. Run Project (F5)
  4. Start Wireshark and capture loopback traffic
  5. Filter on udp.dstport == 12345
  6. Wireshark: Statistics->I/O Graphs
  7. Set Y Axis to bytes for the data row at the bottom
  8. 👀

Minimal reproduction project (MRP)

network-bandwidth-test.zip

@Calinou
Copy link
Member

Calinou commented May 15, 2024

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.

@romlok
Copy link
Contributor Author

romlok commented May 16, 2024

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? 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants