Title: Clock Synchronization in Sensor Networks*
1Clock Synchronization in Sensor Networks
Timing-sync Protocol for Sensor Networks (SenSys
2003) Saurabh Ganeriwal, Ram Kumar Mani B.
Srivastava Fine-Grained Network Time
Synchronization using Reference Broadcasts
Jeremy Elson, Lewis Girod Deborah Estrin
(OSDI 2002)
2Introduction
- Sensor nodes maintain local clocks
- Typically lower precision clocks (crystal
oscillators) - Clocks need to be synchronized to determine
- Exact timing of events
- Chronology of events
- Clock synchronization
- Global all nodes are synchronized to a single
clock - Example NTP (often used in LANS)
- Local a set of localized nodes are
synchronized - Reference Broadcast Synchronization (RBS)
- Post-facto Synchronization
3Challenges
- Scalability
- Must be scalable to a large number of nodes
- Energy Efficiency
- Limited messaging
- GPS technology cannot be employed
- Requirements are more stringent
- Microsecond precision desirable
- Local a set of localized nodes are
synchronize - Clock skew is large
- Two node clocks might drift 1100µsec per second
4Clock Synchronization Models
- Maintain relative notion of time
- Generate the right chronology of events
- Clocks need not be synchronized
- Relative Clocks
- Nodes maintain individual clocks
- Maintain relative drift information with other
clocks - RBS
- Always On Model
- Every clock is synchronized to a reference clock
- Superset of the above models
- TSPN
5Todays Talk
- TSPN Time-Sync Protocol for Sensor Networks
- Sender-Receiver synchronization (classical
approach) - needs MAC level integration
- Always-On
- RBS Reference Broadcast Synchronization
- Receiver-Receiver synchronization
- Could be implemented at user-level
- Relative Sync
6Packet Delay (Uncertainty) Model
- Sender Uncertainty
- Send, Access, Transmission
- Propagation Uncertainty
- Negligible
- Speed thru medium 1foot/nanosecond c
- Receiver Uncertainty
- Packet reception
- Packet processing
7TSPN
- Clock Sync Algorithm involves 2 steps
- Level Discovery phase
- Synchronization phase
- TSPN makes the following assumptions
- Sensor nodes have unique identifiers
- Node is aware of its neighbors
- Bi-directional links
- Creating the hierarchical tree is not exclusive
to TSPN
8TSPN Level Discovery
- Algorithm
- Root node is assigned level i 0
- broadcasts level discovery pkt.
- Neighbors get packet and assign level i1 to
themselves - Ignore discovery pkts. once level has been
assigned - Broadcast level discovery pkt. with own level
- STOP when all nodes have been assigned a level
- Optimization
- Use minimum spanning trees instead of flooding
9TSPN Synchronization phase
- Synchronization using handshake between a pair of
nodes (sender-initiated)
- Assuming no clock drift and propagation delay do
not change
Clock drift
Delay
- A can now synchronize with B
10TSPN Synchronization
- Algorithm
- Root node initiates the protocol
- broadcasts time sync pkt.
- Nodes at level 1
- Wait for a random time, initiate time-sync with
root - On receiving ACK .. Synchronize with root
- Nodes at level 2 overhear sync from nodes at
level 1 - Do a random back-off, initiate time-sync with
level 1 node - Nodes sends ACK only if it has been synchronized
- If a node does not receive an ACK, resend
time-sync pulse after a timeout.
11RBS Reference Broadcast Synchronization
- Eliminate non-deterministic latency at the
sender - NIC delay
- Protocol processing
- Critical path length reduced
- Packets do not need to store explicit timing
information - Relative time synchronization
RBS
12RBS How it Works?
- Characterize Receiver Error
- Determine Phase Offset between nodes
- Determine Clock Skew between nodes
- Empirically determined
- With knowledge of phase offset and clock skew,
the clocks of any two nodes can be synchronized
13RBS Receiver Error Characterization
- Histogram showing the distribution of
inter-receiver phase offsets recorded for 1,478
broadcast packets, grouped into 1µsec buckets.
The curve is a plot of the best-fit Gaussian
parameters. (µ 0s 111µsec, confidence99.8)
Accuracy can be increased by increasing the
number of sync messages
14RBS Phase Offset Estimation
15RBS Phase Offset Estimation
Analysis of expected group dispersion (i.e.,
maximum pair-wise error) after reference-broadcast
synchronization. Each point represents the
average of 1,000 simulated trials. The underlying
receiver is assumed to report packet arrivals
with error conforming to last figure. Mean group
dispersion, and standard deviation from the
mean, for a 2-receiver (bottom) and 20-receiver
(top) group.
16RBS Phase Offset with Skew
Each point represents the phase offset between
two nodes as implied by the value of their clocks
after receiving a reference broadcast. A node can
compute a least-squared error fit to these
observations (diagonal line), and convert time
values between its own clock and that of its
peer. Synchronization of the Motes internal
clock
17RBS Multi-hop Time Synchronization
18RBS Multi-hop Time Synchronization
Example, we can compare the time of E1(R1) with
E10(R10) by transforming E1(R1) ? E1(R4) ? E1(R8)
? E1(R10).
Conversions can be made automatically by using
the shortest path algorithm
19Error Analysis TPSN RBS
- Analyze sources of error for the algorithms
- Compare TPSN and RBS
- Trade-Offs
Clock drift
20Error Analysis TPSN
Drift between A B
21Error Analysis TPSN
By rearranging the terms, we get
22Error Analysis RBS
23Error Comparison TPSN RBS
TPSN
RBS
- Comparison/Discussion
- Sender delays
- Receiver delays
- Relative Skews
24Performance (RBS vs. NTP)
25Performance (TPSN vs. RBS)