Skip to content

feat(server): emit NetworkCharacteristicsResult with measured RTT - #1470

Open
Greg Lamberson (glamberson) wants to merge 1 commit into
Devolutions:masterfrom
lamco-admin:feat/autodetect-network-characteristics-result
Open

feat(server): emit NetworkCharacteristicsResult with measured RTT#1470
Greg Lamberson (glamberson) wants to merge 1 commit into
Devolutions:masterfrom
lamco-admin:feat/autodetect-network-characteristics-result

Conversation

@glamberson

@glamberson Greg Lamberson (glamberson) commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

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.

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).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant