When several DDS DataWriters update the same keyed robot instance, a reader needs a rule for deciding which value is newest. DESTINATION_ORDER supplies that rule. BY_RECEPTION_TIMESTAMP uses the order in which a subscriber receives samples. BY_SOURCE_TIMESTAMP uses timestamps assigned at the writers. Source ordering can help readers converge on the same final value, but only if the clocks and timestamp discipline make those values comparable.
Two ordering choices
BY_RECEPTION_TIMESTAMP is the DDS default. The latest value is based on reception at each subscriber, subject to ownership rules. Network paths, queuing, and scheduling can differ among subscribers, so two readers can receive concurrent updates in different orders and temporarily or finally retain different values.
BY_SOURCE_TIMESTAMP compares the timestamp attached at the source. DDS 1.4 notes that, for concurrent same-strength writers updating the same instance, source ordering is the setting that ensures subscribers end with the same final value. The writer can receive a service-generated timestamp when write is called or the application can provide one through write_w_timestamp, depending on the interface and implementation.
The promise is ordering by the supplied time value. DDS does not synchronize clocks, prove a clock's traceability, or verify that an application timestamp describes the physical event represented by the sample. A larger timestamp wins the ordering comparison even if it came from a fast clock or was copied from the wrong time domain.
How skew changes robot state
Imagine two localization writers for robot-17. Writer A's clock is correct and publishes pose A at real time 10:00:01.000 with source timestamp 10:00:01.000. Writer B's clock is 800 milliseconds fast and publishes pose B earlier, at real time 10:00:00.700, but stamps it 10:00:01.500. Under source ordering, B can appear newer even though its physical observation happened first.
The same issue affects redundant controllers. A standby with a clock far in the future can publish one sample that dominates later samples from the primary until wall time catches up. A clock step backward can make new data look older and cause it to be ignored. Source ordering therefore needs operational controls around clock offset, clock steps, writer restart, and timestamp generation.
Ownership comes first
DESTINATION_ORDER does not replace OWNERSHIP. If EXCLUSIVE ownership selects one writer for a keyed instance, samples from non-owning writers do not become current merely because their timestamps are larger. The ordering rule applies within the samples that ownership and other QoS policies permit the reader to consider.
Similarly, source ordering is not total event causality. It orders by a scalar timestamp. Two writers can use the same timestamp, clocks can overlap within uncertainty, and a physical event can travel through pipelines with different capture and publication delays. If causality matters, include sequence numbers, operation IDs, revision counters, or domain-specific version vectors in the payload.
Define a time contract
Name the clock domain used for source timestamps. For distributed robots this might be PTP-synchronized system time, GPS time converted to a declared epoch, or a controller monotonic timeline mapped through a gateway. Document expected maximum offset, step behavior, holdover, and what happens when synchronization quality falls outside limits.
Do not mix sensor capture time and publication time without a field distinction. The DDS source timestamp may represent the call to write, while the payload carries sensor_capture_time and processing_complete_time. A consumer can then use DESTINATION_ORDER for middleware state resolution and still evaluate physical age from the correct event field.
Gate source ordering on clock health. Publish or monitor synchronization offset, grandmaster identity, servo state, and uncertainty where available. If clock health is lost, an application can reject cross-writer comparisons, reduce authority, or switch to an explicit revision protocol. Changing DDS QoS at runtime has compatibility and mutability constraints, so plan the fallback rather than improvising it during an incident.
Prefer revisions for authority changes
Configuration, maps, and commands often benefit from a logical revision assigned by one authority. A monotonically increasing map_revision or command_epoch is easier to audit than distributed wall-clock order. Timestamps remain useful for age and diagnostics, while the revision defines which update supersedes another.
For multiwriter sensor fusion, preserve each source stream and fuse it in an application that understands uncertainty. Using source time to select one pose as the final value discards information and can hide disagreement. DESTINATION_ORDER is a state-resolution policy, not a fusion algorithm.
Test adversarial time
Run two writers for the same key through paths with different network delay. First use reception ordering and confirm that readers may observe different arrival sequences. Then use source ordering with synchronized clocks and verify convergence. Add known positive and negative clock offsets, repeat timestamps, a backward time step, a writer restart, and a timestamp far in the future.
Record the value each reader retains and the reason. Test interaction with EXCLUSIVE ownership and equal ownership strength. Verify offered and requested DESTINATION_ORDER compatibility, because BY_SOURCE_TIMESTAMP is a stronger request than the default reception ordering.
Operational evidence
Log writer identity, keyed instance, source timestamp, reception timestamp, payload revision, ownership state, and synchronization health. Alert when a source timestamp is implausibly ahead of reception or moves backward beyond tolerance. Keep enough history to distinguish network reordering from clock error.
DDS source ordering gives every reader a common comparison key and can make concurrent multiwriter state converge. It cannot make unsynchronized clocks truthful. Use BY_SOURCE_TIMESTAMP only with a defined and monitored time contract, and carry application revisions or causal identifiers when robot correctness depends on more than “largest timestamp wins.”