Repository navigation
feat(network): Measure connection latency, jitter and loss with packet feedback - #657
Open
tintinhamans wants to merge 4 commits into
Conversation
tintinhamans
force-pushed
the
arctic/go/stack2/02-packet-feedback-measurement
branch
4 times, most recently
from
October 26, 2026 15:39
2249a03 to
fc648ec
Compare
tintinhamans
force-pushed
the
arctic/go/stack2/02-packet-feedback-measurement
branch
from
October 28, 2026 01:47
fc648ec to
11f1f99
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Merge after #656. Conflicts with #625 in
NetworkMesh.handNextGenTransport.cpp; this stack gets rebased once #625 lands.There were no numbers for how a connection behaves beyond the lobby ping, and the only loss figure was a guess from command retries.
ConnectionStats(new) keeps latency, jitter and loss of one connection over a 10 s window, and a retry whose earlier send was acked after all counts as a late ack, not as loss. The mesh also probes each peer on the ping channel, everyconnection.probe_lobby_interval_msin the lobby (250) andconnection.probe_match_interval_msin a match (1000), timed from when the transport received the probe so a slow frame is not counted as network delay.PacketFeedback(new) measures real packet loss per direction. Every game packet gets a sequence number and the receiver reports what it got over the last 64 packets, at most every 250 ms. It only sees byte buffers and a clock, so GNS, EOS or any other transport can share it.Wire change: game packets start with a 3 byte envelope (u16 sequence, u8 flags) plus a 5 byte feedback record when due, and
GENERALS_MAGIC_NUMBERis0xF00E, so this build does not talk to an older one. A packet without a valid envelope, or on an unknown channel, is dropped. A failed GNS send is retried once and returned as a failure. Thesend.flagskey is removed. The numbers show in the debug stats display.Tested: builds x86 Release
z_generals. The full stack had 0 CRC mismatches in 3 player rig runs, n=1.