feat(server): measure bandwidth and report it in NetworkCharacteristicsResult - #1471
Open
Greg Lamberson (glamberson) wants to merge 2 commits 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).
…csResult Builds on the RTT-only Network Characteristics Result: the server now runs a continuous Bandwidth Measure over the MCS message channel and folds the result into the report, so a participating client (mstsc, RDM, FreeRDP) receives the full baseRTT + bandwidth + averageRTT characteristics rather than RTT alone. Once per BW_MEASURE_INTERVAL_TICKS auto-detect ticks the AutoDetectManager emits a Bandwidth Measure transaction (Start -> Payload -> Stop, request type 0x0014 / 0x0429) back-to-back so the client counts only the payload window; its Bandwidth Measure Results reply (timeDelta + byteCount) is turned into a kbps figure that upgrades the emitted result to the all-fields form. A measurement is never started while one is outstanding. Reuses the existing message-channel framing; no new PDU types.
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.
Stacked on #1470; review and merge that first. This branch's first commit is #1470 and the second is the change here.
Extends the server-side auto-detect added by #1470. The RTT-only Network Characteristics Result becomes the full baseRTT plus bandwidth plus averageRTT report by adding a continuous Bandwidth Measure over the MCS message channel.
Change: once per N auto-detect ticks, AutoDetectManager emits a Bandwidth Measure transaction (Start, Payload, Stop; continuous request type 0x0014 / 0x0429) back to back on the message channel. The client counts the payload window and replies with a Bandwidth Measure Results PDU (timeDelta plus byteCount); the manager turns that into a kbps figure and upgrades the next Network Characteristics Result from the RTT-only form to the all-fields form (NETCHAR_RESULT_ALL). A new measurement is never started while one is outstanding. It reuses the message-channel framing from #1348 and adds no new PDU types.
Testing: unit and integration tests cover pacing, the Start/Payload/Stop transaction sharing one sequence number, bandwidth-results handling, and the RTT-only to all-fields upgrade. All cargo xtask check gates (fmt, lints, tests) pass locally.