QoS Policies Overview
DDS provides 22 Quality of Service policies to fine-tune data distribution behavior. HDDS implements all standard policies from DDS v1.4.
Most Important Policies
| Policy | Description | Default |
|---|---|---|
| Reliability | Delivery guarantee | BEST_EFFORT |
| Durability | Data persistence | VOLATILE |
| History | Sample buffering | KEEP_LAST(10) |
| Deadline | Update frequency | Infinite |
| Liveliness | Failure detection | AUTOMATIC |
All 22 QoS Policies
Data Distribution
| Policy | Purpose |
|---|---|
| Reliability | BEST_EFFORT vs RELIABLE delivery |
| History | KEEP_LAST(n) vs KEEP_ALL buffering |
| Durability | VOLATILE, TRANSIENT_LOCAL, PERSISTENT |
| DurabilityService | Late-joiner delivery configuration |
| ResourceLimits | Max samples, instances, memory |
Timing
| Policy | Purpose |
|---|---|
| Deadline | Maximum time between samples |
| LatencyBudget | Acceptable delay hint |
| Lifespan | Data expiration time |
| TimeBasedFilter | Minimum separation between samples |
Ownership
| Policy | Purpose |
|---|---|
| Ownership | SHARED vs EXCLUSIVE writer control |
| OwnershipStrength | Priority for exclusive ownership |
Ordering
| Policy | Purpose |
|---|---|
| DestinationOrder | BY_RECEPTION_TIMESTAMP vs BY_SOURCE_TIMESTAMP |
| Presentation | Coherent/ordered access scope |
Lifecycle
| Policy | Purpose |
|---|---|
| Liveliness | AUTOMATIC, MANUAL_BY_PARTICIPANT, MANUAL_BY_TOPIC |
| WriterDataLifecycle | Auto-dispose unregistered instances |
| ReaderDataLifecycle | Auto-purge samples without writers |
| EntityFactory | Auto-enable child entities |
Metadata
| Policy | Purpose |
|---|---|
| UserData | Custom user metadata |
| TopicData | Topic-level metadata |
| GroupData | Publisher/Subscriber metadata |
| Partition | Logical data separation |
| TransportPriority | Network QoS hint |
Quick Start
use hdds::prelude::*;
// Create QoS with builder pattern
let writer_qos = DataWriterQos::default()
.reliability(Reliability::Reliable {
max_blocking_time: Duration::from_secs(1),
})
.durability(Durability::TransientLocal)
.history(History::KeepLast { depth: 10 });
let writer = publisher.create_writer_with_qos(&topic, writer_qos)?;
QoS Profiles
HDDS provides built-in profiles for common scenarios:
// Low latency (gaming, real-time control)
let qos = QosProfile::low_latency();
// → KeepLast(1), 100KB quota
// High throughput (bulk data transfer)
let qos = QosProfile::high_throughput();
// → KeepLast(1000), 50MB quota
// Reliable (guaranteed delivery)
let qos = QosProfile::reliable();
// → Reliable, TransientLocal, KeepLast(100)
QoS Compatibility
Writers and readers must have compatible QoS to communicate:
| Writer | Reader | Result |
|---|---|---|
| RELIABLE | RELIABLE | Match |
| RELIABLE | BEST_EFFORT | Match |
| BEST_EFFORT | RELIABLE | No Match |
| BEST_EFFORT | BEST_EFFORT | Match |
Compatibility
A BEST_EFFORT writer cannot satisfy a RELIABLE reader. The reader expects acknowledgments that the writer won't send.
Resource Limits
Control memory usage with ResourceLimits:
let qos = DataWriterQos::default()
.resource_limits(ResourceLimits {
max_samples: 100_000, // Total samples
max_instances: 1, // Number of instances
max_samples_per_instance: 100_000, // Per-instance queue
max_quota_bytes: 100 * 1024 * 1024, // 100 MB
});
Next Steps
- Reliability - RELIABLE vs BEST_EFFORT
- Durability - Data persistence
- History - Sample buffering