Time Synchros
Time Synchros
Chapter 9: Roadmap
The time synchronization problem!
Time synchronization in wireless sensor networks!
Basic techniques for time synchronization!
Time synchronization protocols!
1!
Clock Parameters
Clock offset: difference between the local times of two nodes!
Synchronization is required to adjust clock readings such that they match!
Clock rate: frequency at which a clock progresses!
Clock skew: difference in frequencies of two clocks!
Clock rate dC/dt depends on temperature, humidity, supply voltage, age of
quartz, etc., resulting in drift rate (dC/dt-1)!
Clock Parameters
Maximum drift rate ρ given by manufacturer (typical 1ppm to 100ppm)!
Guarantees that: dC
1− ρ ≤ ≤ 1+ ρ
dt
Clock Parameters
C(t) must be piecewise continuous (strictly monotone function of time)!
clock adjustments should occur gradually, e.g., using a linear
compensation function that changes the slope of the local time!
simply jumping forward/backward in time can have unintended
consequences!
time-triggered events may be repeated or skipped!
2!
Time Synchronization
External synchronization!
clocks are synchronized with external source of time (reference clock)!
reference clock is accurate real-time standard (e.g., UTC)!
Internal synchronization!
clocks are synchronized with each other (no support of reference clock)!
goal is to obtain consistent view of time across all nodes in network!
network-wide time may differ from external real-time standards!
External synchronization also provides internal synchronization!
Accuracy: maximum offset of a clock with respect to reference clock!
Precision: maximum offset between any two clocks!
If two nodes synchronized externally with accuracy of Δ, also synchronized
internally with precision 2Δ!
3!
Challenges for Time Synchronization
Traditional protocols (e.g., NTP) are designed for wired networks!
WSNs pose a variety of additional challenges!
Environmental effects!
sensors often placed in harsh environments!
fluctuations in temperature, pressure, humidity!
Energy constraints!
finite power sources (batteries)!
time synchronization solutions should be energy-efficient!
Wireless medium and mobility!
throughput variations, error rates, radio interferences, asymmetric links!
topology changes, density changes!
node failure (battery depletion)!
Other challenges!
limited processor speeds or memory (lightweight algorithms)!
cost and size of synchronization hardware (GPS)!
Synchronization Messages
Pairwise synchronization: two nodes synchronize using at least one
message!
Network-wide synchronization: repeat pairwise synchronization throughout
network!
One-way message exchange:!
single message containing a time stamp!
difference can be obtained from (t2-t1)=D+δ (D=propagation delay)!
Synchronization Messages
Two-way message exchange:!
receiver node responds with message containing three time stamps!
assumption: propagation delay is identical in both directions and clock
drift does not change between measurements!
(t 2 − t1 ) + (t 4 − t 3 ) (t 2 − t1 ) − (t 4 − t 3 )
D= offset =
2 2
€ €
4!
Receiver-Receiver Synchronization
So far: sender-receiver approaches!
Receiver-receiver: multiple receivers of broadcast messages exchange their
message arrival times to compute offsets among them!
Example: 2 receivers; 3 messages (1 broadcast, 2 exchange messages)!
No time stamp in broadcast message required!
5!
Reference Broadcasts
Global Positioning System (GPS) is a well-known global source of time!
time measured from epoch started at 0h January 6, 1980 UTC!
unlike UTC, GPS not perturbed by leap seconds!
GPS is ahead by 15 seconds (and increasing)!
Terrestrial radio stations!
WWV/WWVH & WWVB (National Institute of Standards & Technology)!
continuously broadcast time based on atomic clocks!
t 2 − t 4 − t1 + t 3
offset =
2
€
Fundamentals of Wireless Sensor Networks: Theory and Practice
Waltenegus Dargie and Christian Poellabauer © 2010 John Wiley & Sons Ltd.
17!
6!
Lightweight Tree-Based Synchronization
Distributed multi-hop version of LTS!
one or more reference nodes contacted by sensors whenever
synchronization is required!
nodes determine resynchronization period based on desired clock
accuracy, distance to reference node, clock drift ρ, time of last
synchronization!
node can query neighbors for pending synchronization requests, i.e.,
node synchronizes with neighbor instead of reference node!
7!
Timing-sync Protocol for Sensor Networks
Synchronization phase!
pairwise synchronization along the edges of hierarchical structure!
each node on level i synchronizes with nodes on level i-1!
approach similar to LTS:!
– node j issues synchronization pulse at t1 (containing level and
time stamp)!
– node k receives message at t2 and responds with an ACK at t3
(containing t1, t2, t3, and level)!
– node j receives ACK at t4!
node j calculates drift and propagation delay!
(t 2 − t1 ) + (t 4 − t 3 )
D=
2
(t − t ) − (t 4 − t 3 )
offset = 2 1
2
8!
Flooding Time Synchronization Protocol
t1: wireless radio informs CPU that it is ready for next message!
d1: interrupt handling time (few microseconds)!
t2: CPU generates time stamp!
d2: encoding time (transform message into electromagnetic waves; deterministic, low hundreds of microseconds)!
d3: propagation delay (from t3 on node i to t4 on node j; typically very small and deterministic)!
d4: decoding time (deterministic, low hundreds of microseconds)!
d5: byte alignment time (delay caused by different byte alignments (bit offsets), i.e., receiving radio has to
determine the offset from a known synchronization byte and then shift incoming message accordingly); can reach
several hundreds of microseconds!
t7: interrupt, CPU obtains time stamp!
9!
Flooding Time Synchronization Protocol
Multi-hop synchronization!
root node is elected based on unique node IDs!
root node maintains global time and all other nodes synchronize to root!
synchronization is triggered by broadcast message by the root node!
whenever node does not receive synchronization message for
certain amount of time, it declares itself to be the new root!
whenever root receives a message from node with lower node ID, it
gives up root status!
all receiver nodes within range establish synchronization points!
other nodes establish synchronization points from broadcasts of
synchronized nodes that are closer to the root!
a new node joining the network with lowest node ID will first collect
synchronization messages to adjust its own clock before claiming root
status!
Reference-Broadcast Synchronization
Key idea of RBS: in the wireless medium, broadcast messages will arrive at receivers
at approximately the same time!
set of receivers synchronize with each other using a broadcast message!
variability in message delay dominated by propagation delay and time needed to
receive and process incoming message (send delay and access delay are
identical)!
RBS critical path is short than critical path of traditional techniques!
Reference-Broadcast Synchronization
Example with 2 receivers:!
receivers record arrival of synchronization message!
receivers exchange recorded information!
receivers calculate offset (difference of arrival times)!
More than 2 receivers:!
maximum phase error between all receiver pairs is expressed as group
dispersion!
likelihood that a receiver is poorly synchronized increases with the
number of receivers (larger group dispersion)!
increasing the number of broadcasts can reduce group dispersion!
Offsets between two nodes can be computed as the average phase offsets
for all m packets received by receivers i and j:!
1 m
offset[i, j] = ∑ (T − Ti,k )
m k =1 j,k
10!
Reference-Broadcast Synchronization
Multi-hop scenarios possible by establishing multiple reference beacons,
each with its own broadcast domain!
Domains can overlap and nodes within overlapping regions serve as
bridges to allow synchronization across domains!
11!
Mini-Sync and Tiny-Sync
Pairwise synchronization approaches with low bandwidth, storage, and
processing requirements!
Two clocks C1(t) and C2(t) can be represented as:!
C1 (t) = a12C2 (t) + b12
a12 = relative drift
b12 = relative offset
Nodes can use two-way messaging scheme to determine these parameters:!
node 1 sends a time-stamped probe at t0!
€
node 2 responds with time-stamped replay at t1!
node 1 records arrival time of reply at t2!
results in data point (t0,t1,t2), which must satisfy:!
t 0 < a12 t1 + b12
t 2 > a12 t1 + b12
12!