Time Synchronization in DaaS-IoT¶
Time synchronization is a foundational requirement in distributed systems. Correctly aligned timestamps ensure:
- Chronological consistency across events
- Reliable logging and auditing
- Accurate fault diagnosis
- Deterministic distributed control
- Coherent security mechanisms
- Stable overlay operation (routing, discovery, monitoring)
In heterogeneous IoT networks, where nodes span different hardware, operating
systems, delays and multi-hop paths, maintaining accurate time synchronization
is a non-trivial challenge.
The DaaS-IoT framework implements a fully distributed synchronization method
called dATS, built upon previous approaches ATS and RoATS.
This section provides a unified explanation of the evolution from ATS → RoATS → dATS and summarizes how the DaaS-IoT overlay achieves reliable temporal alignment.
1. Background: ATS (Average Time Synchronization)¶
ATS provides a distributed, non-hierarchical method for aligning the clocks of multiple nodes through three iterative phases:
1. Relative Skew Estimation¶
Each node estimates the relative speed of its clock compared to neighbors.
2. Skew Compensation¶
Nodes update their virtual clock speed (skew) by averaging it with that of neighbors.
3. Offset Compensation¶
Nodes iteratively reduce timestamp differences with a consensus algorithm.
Benefits¶
- No hierarchy or master node required
- Fully distributed
- Robust to node failures
- Conceptually simple
Limitations¶
Despite its elegance, ATS faces several weaknesses:
| Limitation | Description |
|---|---|
| No delay handling | Assumes ideal, zero-latency communication between nodes. |
| Sensitive to packet loss | Performance degrades in noisy or unstable networks. |
| Scalability constraints | Accuracy deteriorates as hop count grows. |
| Real-world drift complexity | Hardware clocks introduce noisy skew estimations. |
Because real DaaS-IoT networks introduce delays, jitter, and multi-hop paths, ATS alone is insufficient.
2. RoATS: Robust Average Time Synchronization¶
RoATS improves ATS by introducing mechanisms to deal with variable delays and asynchronous communication.
Key Enhancements¶
- Delay compensation for non-negligible transmission time
- Asynchronous update rules
- Improved scalability in multi-hop networks
- Greater resilience under dynamic topologies
- Better tolerance to packet loss and noise
RoATS moves closer to real-world applicability by acknowledging that messages take time to propagate and that nodes may update asynchronously.
Although RoATS solves several ATS limitations, its implementation complexity and computational cost make it less suitable for resource-constrained IoT devices.
3. dATS: Dynamic Average Time Synchronization (DaaS-IoT Implementation)¶
dATS is the synchronization mechanism implemented in DaaS-IoT.
It is designed to be:
- Fully distributed
- Scalable
- Resilient to latency and jitter
- Compatible with heterogeneous hardware
- Lightweight (suited for embedded systems)
- Independent of hardware clock access
Why dATS differs from ATS/RoATS¶
In IoT environments the software does not have direct access to hardware clocks. Instead:
- Different OSs (Linux, Windows, macOS, Android…) expose only software clocks
- Hardware skew cannot be compensated directly
- Clock APIs vary across platforms
Therefore, dATS synchronizes only the drift, not the skew.
dATS Timestamp Model¶
For a node:
timestamp = software_clock + drift
Where:
- software_clock → obtained from the operating system
- drift → correction term adjusted during synchronization
dATS State Machine¶
dATS operates through a four-stage protocol:
Stage 1 — Initiation¶
Node A sends a synchronization packet containing its current drift.
Stage 2 — Drift Estimation¶
Node B:
1. Receives A’s drift
2. Applies an exponential low-pass filter to update its drift
3. Compensates for measured average communication delay
4. Sends its updated drift back to A
Stage 3 — Error Check¶
Node A evaluates timestamp difference:
ΔT = |timestamp_A - timestamp_B|
- If ΔT > ε → restart protocol at Stage 1
- If ΔT ≤ ε → proceed to Stage 4
Stage 4 — Convergence¶
Synchronization is successful and each node stores updated drift values.
4. Dynamic ε Adjustment¶
The maximal allowed error ε is:
- defined at network setup (based on the oldest node capabilities)
- made dynamic after initial synchronization
Updated using:
ε(t+1) = f( max_error, network conditions, timing stability )
This allows tighter synchronization when the network is stable and wider bounds when conditions deteriorate.
5. Integration with Overlay Networking¶
Time synchronization in DaaS-IoT is deeply integrated with:
Discovery¶
Nodes align their clocks immediately after mutual discovery, establishing a coherent temporal domain within each SID.
Routing & Link Quality¶
Timestamped control messages allow:
- latency estimation
- link health evaluation
- dynamic routing decisions
Frisbees (Heartbeats)¶
Frisbees help monitor drift changes and detect desynchronization events.
DDO Timestamping¶
All DDOs include timestamps to:
- estimate delays
- detect ordering violations
- provide determinism in distributed logic
6. Why dATS Suits DaaS-IoT¶
Because DaaS-IoT targets highly heterogeneous devices—Linux nodes, embedded platforms, Android devices, PC-based controllers—dATS provides:
- Consistency across OSs
- Low CPU overhead
- Delay-aware synchronization
- Synchronization without hardware-level access
- Resilience in multi-hop topologies and noisy links
This results in a practical, lightweight, and robust synchronization method ideal for distributed IoT overlay networks.
Summary¶
- ATS introduced distributed time synchronization but lacked delay handling.
- RoATS extended ATS with delay compensation and asynchronous updates.
- dATS is the DaaS-IoT implementation: drift-only, delay-aware, lightweight, portable, and built for real deployments.
- dATS is tightly integrated into discovery, overlay networking, routing and heartbeat logic.
Together, these mechanisms ensure a reliable and temporally coherent operation across the entire DaaS-IoT overlay.