hdds-latency-probe
Measure DDS round-trip latency with a ping-pong benchmark.
Overview
hdds-latency-probe measures round-trip time (RTT) between two DDS participants using a ping-pong pattern. One host runs in ping mode (sender), the other in pong mode (echo responder). The tool reports detailed latency statistics including percentiles.
Installation
From Source
cd hdds/tools/hdds-latency-probe
cargo build --release
Binary at target/release/hdds-latency-probe.
From Cargo
cargo install hdds-latency-probe
Usage
hdds-latency-probe [OPTIONS] <COMMAND>
Commands:
ping Send ping messages and measure RTT
pong Echo back ping messages (run on remote host)
Global Options:
-d, --domain <DOMAIN> DDS domain ID [default: 0]
-q, --qos <QOS> QoS profile: best-effort, reliable [default: reliable]
-h, --help Print help
-V, --version Print version
Ping Mode Options
hdds-latency-probe ping [OPTIONS]
Options:
-s, --size <SIZE> Payload size in bytes [default: 64]
-n, --count <COUNT> Number of iterations (0 = unlimited) [default: 1000]
-w, --warmup <WARMUP> Warmup iterations before measurement [default: 10]
-i, --interval <INTERVAL> Interval between pings in microseconds [default: 1000]
--json Output JSON results
--quiet Only output final results
Pong Mode Options
hdds-latency-probe pong [OPTIONS]
Options:
--quiet Quiet mode
Examples
Basic Latency Test
On the responder host:
hdds-latency-probe pong
On the sender host:
hdds-latency-probe ping
Output (sender):
>>> Latency probe (ping mode)
domain=0, qos=Reliable, size=64 bytes, count=1000, warmup=10
Waiting for pong responder...
Warmup...
Progress: 1000/1000
=== HDDS Latency Probe Results ===
Payload size: 64 bytes
Samples: 1000
Lost: 0 (0.00%)
Duration: 2.15s
--- Latency (microseconds) ---
Min: 45.20 us
Max: 312.80 us
Mean: 78.45 us
Stddev: 23.12 us
--- Percentiles ---
p50: 72.30 us
p90: 105.60 us
p99: 198.40 us
p99.9: 289.50 us
Throughput: 465 msg/s
Different Payload Sizes
Test with larger messages:
hdds-latency-probe ping -s 1024 # 1 KB payload
hdds-latency-probe ping -s 65536 # 64 KB payload
More Samples
For better statistical accuracy:
hdds-latency-probe ping -n 10000
Faster Ping Rate
Reduce interval between pings (100 microseconds):
hdds-latency-probe ping -i 100
Skip Warmup
For quick tests:
hdds-latency-probe ping -w 0 -n 100
Best-Effort QoS
Lower latency but may lose samples:
# Both sides must use same QoS
hdds-latency-probe pong -q best-effort
hdds-latency-probe ping -q best-effort
JSON Output
For scripting and logging:
hdds-latency-probe ping --json
Output:
{"payload_size":64,"samples":1000,"lost":0,"duration_secs":2.154,"latency_us":{"min":45.20,"max":312.80,"mean":78.45,"stddev":23.12,"p50":72.30,"p90":105.60,"p99":198.40,"p999":289.50}}
Quiet Mode
One-line summary only:
hdds-latency-probe ping --quiet
Output:
min=45.2 max=312.8 avg=78.5 p99=198.4 us
Different Domain
hdds-latency-probe pong -d 42
hdds-latency-probe ping -d 42
Topics Used
The tool uses two internal topics:
hdds_latency_ping- Ping messages (sender → responder)hdds_latency_pong- Pong responses (responder → sender)
Statistics Explained
| Metric | Description |
|---|---|
| Min | Fastest round-trip observed |
| Max | Slowest round-trip observed |
| Mean | Average latency |
| Stddev | Standard deviation (jitter indicator) |
| p50 | Median - 50% of samples below this |
| p90 | 90th percentile |
| p99 | 99th percentile - typical worst case |
| p99.9 | 99.9th percentile - rare outliers |
| Lost | Samples that didn't receive response within 1 second |
Interpreting Results
Good Results
- p99 < 2x mean: Low jitter, stable network
- Lost = 0: Reliable delivery working
- Stddev < 50% of mean: Consistent latency
Warning Signs
- High p99.9 vs p99: Occasional spikes (GC, network congestion)
- Lost > 0 with Reliable QoS: Network issues or timeout too short
- Stddev > mean: Very high jitter
Typical Latencies
| Environment | Expected RTT |
|---|---|
| Localhost (loopback) | 20-50 µs |
| Same LAN (1 Gbps) | 80-200 µs |
| Same LAN (10 Gbps) | 40-100 µs |
| Cross-datacenter | 1-10 ms |
| WiFi | 0.5-5 ms |
Comparison with Other Tools
| Feature | hdds-latency-probe | iperf3 | ping |
|---|---|---|---|
| Protocol | DDS/RTPS | TCP/UDP | ICMP |
| Application-level | Yes | No | No |
| Percentiles | Yes | No | No |
| Warmup phase | Yes | Yes | No |
| Payload size | Variable | Variable | Variable |
| QoS testing | Yes | No | No |
Troubleshooting
No Response (100% Lost)
- Ensure pong responder is running on remote host
- Check domain IDs match
- Check QoS profiles match (both reliable or both best-effort)
- Verify multicast connectivity between hosts
- Check firewall allows UDP ports 7400-7500
High Latency
- Check network congestion
- Try best-effort QoS (no ACK overhead)
- Increase ping interval to reduce load
- Check CPU usage on both hosts
High Jitter (Stddev)
- Check for background processes
- Disable CPU frequency scaling
- Use real-time priority if available
- Check for network packet loss
Exit Codes
| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | Error (DDS init failed, no responder, etc.) |