feat(server): add auto-detect RTT measurement#1177
Open
Greg Lamberson (glamberson) wants to merge 2 commits intoDevolutions:masterfrom
Open
feat(server): add auto-detect RTT measurement#1177Greg Lamberson (glamberson) wants to merge 2 commits intoDevolutions:masterfrom
Greg Lamberson (glamberson) wants to merge 2 commits intoDevolutions:masterfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Adds server-side RTT measurement using MS-RDPBCGR auto-detect PDUs routed through Share Data (IO channel), exposing an opt-in API on RdpServer and validating behavior with new tests.
Changes:
- Introduces
AutoDetectManagerto track outstanding RTT probes and compute min/max/avg over a sliding window. - Wires auto-detect request/response handling into
ironrdp-server(new event + IO channel dispatch) and exports the module publicly. - Extends
ironrdp-pduShare Data dispatch/encoding to support auto-detect PDUs and adds integration tests.
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| crates/ironrdp-testsuite-core/tests/server/mod.rs | Registers new auto-detect server tests module. |
| crates/ironrdp-testsuite-core/tests/server/autodetect.rs | Adds integration tests for sequence, matching, snapshots, wrapping, expiry. |
| crates/ironrdp-testsuite-core/Cargo.toml | Adds ironrdp-server dependency for testsuite usage. |
| crates/ironrdp-server/src/server.rs | Adds opt-in autodetect state, new event to trigger probes, IO-channel handling for responses, and Share Data encoding helper. |
| crates/ironrdp-server/src/lib.rs | Exports the new autodetect module publicly. |
| crates/ironrdp-server/src/autodetect.rs | Implements RTT probe tracking/statistics + unit tests. |
| crates/ironrdp-pdu/src/rdp/headers.rs | Adds ShareDataPdu variants/type for auto-detect and routes decode/encode accordingly. |
| Cargo.lock | Updates workspace lockfile for new dependency edge. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Member
Benoît Cortier (CBenoit)
left a comment
There was a problem hiding this comment.
Looking good to me! Waiting on the Copilot comments to be addressed / dismissed.
Add server-side RTT measurement using the protocol-standard auto-detect mechanism (MS-RDPBCGR 2.2.14). Depends on Devolutions#1176 for ShareDataPdu routing. New AutoDetectManager tracks outstanding RTT probes and computes min/max/avg statistics over a sliding window. Wired into the server event loop via ServerEvent::AutoDetectRttRequest and IO channel response handling. Public API: enable_autodetect() / rtt_snapshot() on RdpServer.
Contributor
Author
|
Great, an update is going through my own ci then will hit here. Thanks. |
- Fix pdu_source set to io_channel_id instead of user_channel_id in encode_share_data_pdu (matches legacy.rs initiator_id convention) - Fix handle_response accepting any AutoDetectResponse variant; now matches only RttResponse via let-else, returns None for others - Add RTT_PROBE_MAX_AGE constant (30s) and call expire_stale_probes before each send to bound pending_probes growth - Relax timing assertion from <10ms to <100ms for CI stability - Fix wrap test to resolve each probe immediately, avoiding 65k-entry pending_probes allocation
3be5c43 to
0b9c7dd
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.
Depends on #1176. Related to #1158.
Adds server-side RTT measurement using the protocol-standard auto-detect
mechanism (MS-RDPBCGR 2.2.14), building on the PDU types from #1168.
Auto-detect operates on the IO channel via Share Data PDUs, independent
of the ECHO DVC. This makes it available even when DVC setup fails, and
the protocol also supports bandwidth measurement (not yet implemented)
and connect-time detection for future work.
Changes:
min/max/avg RTT over a sliding window of 8 samples
368 lines, 7 files.