feat(server): add auto-detect RTT measurement#1177
feat(server): add auto-detect RTT measurement#1177Benoît Cortier (CBenoit) merged 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.
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.
|
Great, an update is going through my own ci then will hit here. Thanks. |
3be5c43 to
0b9c7dd
Compare
Add client-side handling for Auto-Detect Request PDUs in the x224 session layer: - RTT Measure Request: respond with RTT Response containing matching sequence number for round-trip time calculation - Bandwidth Measure Start/Stop: log and acknowledge - Network Characteristics Result: log server's measurement results - Other auto-detect types: log at debug level Based on MS-RDPBCGR §2.2.14 and upstream PRs Devolutions#1177/Devolutions#1178 design. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
0b9c7dd to
985edf8
Compare
There was a problem hiding this comment.
Pull request overview
Adds server-side RTT measurement using the MS-RDPBCGR auto-detect mechanism (2.2.14), sent over the IO channel via Share Data PDUs, and exposes a small API surface on RdpServer to enable probing and query recent RTT stats.
Changes:
- Introduces
AutoDetectManagerto track pending RTT probes and compute min/max/avg RTT over an 8-sample sliding window. - Wires auto-detect request/response handling into the server event loop, including a helper to encode server-initiated Share Data PDUs.
- Adds integration tests in
ironrdp-testsuite-corefor the auto-detect RTT manager behavior.
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| crates/ironrdp-server/src/autodetect.rs | New AutoDetectManager + RttSnapshot types for tracking RTT probes and aggregating stats. |
| crates/ironrdp-server/src/server.rs | Adds enable_autodetect() / rtt_snapshot(), new ServerEvent to trigger probes, request send + response handling, and encode_share_data_pdu() helper. |
| crates/ironrdp-server/src/lib.rs | Exposes the new autodetect module publicly. |
| crates/ironrdp-testsuite-core/tests/server/mod.rs | Registers the new autodetect test module. |
| crates/ironrdp-testsuite-core/tests/server/autodetect.rs | Adds tests validating sequence, response matching, wrap-around, snapshot behavior, and stale expiry. |
| crates/ironrdp-testsuite-core/Cargo.toml | Adds ironrdp-server dependency for the new tests. |
| Cargo.lock | Locks the new dependency edge. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
- 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
Head branch was pushed to by a user without write access
19cf7d8 to
ee7a50d
Compare
2515470
into
Devolutions:master
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.