feat(server): emit NetworkCharacteristicsResult with measured RTT - #1470
Open
Greg Lamberson (glamberson) wants to merge 1 commit into
Open
Conversation
The server-side AutoDetectManager measures RTT but never reports the result back to the client, so clients cannot use the measurement to size their receive buffers. Add a NETCHAR_RESULT_RTT emission on the MCS message channel: a netchar_result_rtt() constructor (baseRTT + averageRTT, no bandwidth), an AutoDetectManager::build_netchar_result() that reports the lowest and average observed RTT once samples exist, and a send site on the existing auto-detect tick that reuses the message-channel framing from the RTT request path. Bandwidth is intentionally omitted here; a follow-up adds continuous bandwidth measurement and upgrades the result to NETCHAR_RESULT_ALL. Also corrects a stale doc comment on send_rtt_request that referred to the IO channel Share Data PDU (auto-detect moved to the MCS message channel).
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.
Adds the missing server-to-client half of RDP auto-detection: the server now reports its measured round-trip time to the client via a Network Characteristics Result PDU on the MCS message channel.
Background: AutoDetectManager already measures RTT from the continuous RTT probe exchange, but the result was never sent back to the client, so a client that participates in auto-detection (mstsc, RDM, FreeRDP) receives no measured figures to size its receive or jitter buffers with. This completes the server-side path opened by #1347 and #1348 (auto-detect on the MCS message channel) and builds on the existing AutoDetectManager probing.
Change: adds AutoDetectRequest::netchar_result_rtt(seq, base_rtt, avg_rtt), a constructor for the RTT-only Network Characteristics Result (NETCHAR_RESULT_RTT: baseRTT plus averageRTT, no bandwidth), alongside the existing all-fields netchar_result. Adds AutoDetectManager::build_netchar_result(), which reports the lowest observed RTT as baseRTT and the window average as averageRTT, or None before any sample exists. The server emits the result on the same auto-detect tick that sends the RTT request, reusing the message-channel framing. It also fixes a stale doc comment on send_rtt_request that still referred to an I/O channel Share Data PDU (auto-detect moved to the message channel in #1348).
Bandwidth is intentionally out of scope here; a follow-up (#1471) adds continuous bandwidth measurement and upgrades the result to NETCHAR_RESULT_ALL.
Testing: unit and integration tests for the constructor, the wire format (encode and decode round-trip), and build_netchar_result. Verified end to end against FreeRDP 3.15: the client receives the Network Characteristics Result on the message channel and decodes it with the real measured RTT, no parse errors, stable session. All cargo xtask check gates (fmt, lints, tests) pass locally.