Skip to content

feat(server): measure bandwidth and report it in NetworkCharacteristicsResult - #1471

Open
Greg Lamberson (glamberson) wants to merge 2 commits into
Devolutions:masterfrom
lamco-admin:feat/autodetect-bandwidth-measurement
Open

feat(server): measure bandwidth and report it in NetworkCharacteristicsResult#1471
Greg Lamberson (glamberson) wants to merge 2 commits into
Devolutions:masterfrom
lamco-admin:feat/autodetect-bandwidth-measurement

Conversation

@glamberson

Copy link
Copy Markdown
Contributor

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.

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.
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