halflife icon indicating copy to clipboard operation
halflife copied to clipboard

How many packets and what size are being sent per second with the provided cvars?

Open ivan8m8 opened this issue 3 years ago • 2 comments

With the following cvars:

rate "100000"
cl_updaterate "102"
cl_cmdrate "105"
cl_cmdbackup "8"

How many packets and what size are being sent per second to the server from my client? (assuming the server cvars are the same)

ivan8m8 avatar Jan 31 '22 15:01 ivan8m8

Traffic is highly dependent on your fps, because the client sends every frame to the server.

In this case, if your fps is less than 105, then pps will be equal to fps, if more than 105, then pps will be 105 (new ticks will be held before sending).

The size of the packets will also vary greatly from 20+ bytes to several hundred (this is only the data segment, excluding headers). In each packet, the client sends clc_move with one new tick (old ticks can also be held here if fps > cl_cmdrate) + 8 backup ticks (cl_cmdbackup), all using delta compression. Delta compression compresses empty fields well. Also, at the end of each packet, the client appends + 2 bytes of clc_delta.

Splatt581 avatar Feb 01 '22 06:02 Splatt581

You can use Wireshark to see this data more accurately as well, do a capture then use a filter like udp && ip.addr == SERVERIP. Then you can use the IO graph function and PacketLengths statistics, then apply filter there for source traffic and destination traffic. (updaterate/cmdrate etc)

https://www.wireshark.org/docs/wsug_html_chunked/ChStatPacketLengths.html (avg packet sizes) https://www.wireshark.org/docs/wsug_html_chunked/ChStatIOGraphs.html (packets per second) https://wiki.wireshark.org/DisplayFilters https://packetlife.net/media/library/13/Wireshark_Display_Filters.pdf

I think a good point is that cl_cmdbackup just includes more data per packet based on @Splatt581 description vs a multiplier of total packets sent which seems to align with what I've seen before in Wireshark.

djdallmann avatar Feb 09 '22 05:02 djdallmann