Time Synchronization¶
Time synchronization is a fundamental aspect of DaaS-IoT systems and is required to ensure coherent behavior, reliable measurements, and consistent event ordering across distributed nodes.
Due to heterogeneous hardware, variable network conditions, and decentralized operation, time alignment cannot be assumed and must be explicitly handled by the system.
Motivation¶
Accurate time synchronization enables:
- Consistent ordering of events across different nodes
- Reliable logging and diagnostics
- Distributed measurements and benchmarking
- Correct interpretation of network latency and delays
- Improved stability of distributed coordination mechanisms
Without synchronization, temporal correlation between events becomes unreliable, especially in multi-hop or highly dynamic networks.
Synchronization Challenges¶
Distributed and IoT environments introduce several challenges to time alignment:
- Variable latency and jitter
- Packet loss and retransmissions
- Clock drift across heterogeneous devices
- Multi-hop communication paths
- Dynamic topology changes
These factors require synchronization mechanisms that are resilient and adaptive.
Synchronization Mechanisms¶
DaaS-IoT implements internal synchronization mechanisms based on the exchange of timestamped control messages.
The system estimates clock offsets and delays by observing round-trip timing and continuously refines these estimates to compensate for drift and network variability.
Synchronization is designed to operate transparently and does not require application-level intervention.
Mandatory Synchronization Phase¶
Starting from version 0.21.03, time synchronization is a mandatory prerequisite for bidirectional communication between nodes.
When a node attempts to communicate with another node:
- An initial synchronization phase is automatically triggered
- The system ensures that a minimum synchronization state is reached
- Data exchange proceeds only after synchronization has been established
This behavior guarantees temporal consistency across the network.
Integration with Discovery¶
Time synchronization is tightly coupled with the discovery process.
The enforced sequence is:
- Discovery and admission of a node
- Assignment of identifiers (DIN and SID)
- Initial synchronization phase
- Normal data exchange
Synchronization is therefore not optional and cannot be bypassed when discovery is enabled.
Master Node Selection¶
In version 0.21.03, the selection of the synchronization reference node (master) follows updated rules:
- The node that receives the discovery packet during the creation of a new network becomes the synchronization master
- Master selection occurs only when a network is initially formed
- Nodes joining an existing network automatically synchronize with the current master
This approach ensures a single, stable temporal reference within the network.
Timestamp Handling Improvements¶
Version 0.21.03 introduces improvements to internal timestamp handling:
- Message headers and payloads are processed independently
- High-precision timestamps are captured as early as possible during packet reception
- Timing information used for synchronization is decoupled from payload decoding
These changes improve synchronization accuracy and system robustness.
Stability and Recovery¶
The synchronization subsystem continuously monitors synchronization quality.
If instability or degradation is detected:
- Corrective adjustments are applied automatically
- The system may roll back to the last stable synchronization state if necessary
These mechanisms help preserve long-term temporal coherence in dynamic conditions.
Note
Time synchronization behavior in version 0.21.03 differs from previous releases and is mandatory for correct system operation.