Skip to main content

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​

MetricDescription
MinFastest round-trip observed
MaxSlowest round-trip observed
MeanAverage latency
StddevStandard deviation (jitter indicator)
p50Median - 50% of samples below this
p9090th percentile
p9999th percentile - typical worst case
p99.999.9th percentile - rare outliers
LostSamples 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​

EnvironmentExpected RTT
Localhost (loopback)20-50 µs
Same LAN (1 Gbps)80-200 µs
Same LAN (10 Gbps)40-100 µs
Cross-datacenter1-10 ms
WiFi0.5-5 ms

Comparison with Other Tools​

Featurehdds-latency-probeiperf3ping
ProtocolDDS/RTPSTCP/UDPICMP
Application-levelYesNoNo
PercentilesYesNoNo
Warmup phaseYesYesNo
Payload sizeVariableVariableVariable
QoS testingYesNoNo

Troubleshooting​

No Response (100% Lost)​

  1. Ensure pong responder is running on remote host
  2. Check domain IDs match
  3. Check QoS profiles match (both reliable or both best-effort)
  4. Verify multicast connectivity between hosts
  5. Check firewall allows UDP ports 7400-7500

High Latency​

  1. Check network congestion
  2. Try best-effort QoS (no ACK overhead)
  3. Increase ping interval to reduce load
  4. Check CPU usage on both hosts

High Jitter (Stddev)​

  1. Check for background processes
  2. Disable CPU frequency scaling
  3. Use real-time priority if available
  4. Check for network packet loss

Exit Codes​

CodeMeaning
0Success
1Error (DDS init failed, no responder, etc.)