Time Synchronization Protocols in Wireless Sensor Networks
Time Synchronization Protocols in Wireless Sensor Networks
M. Maroti, B. Kusy, G. Simon, A. LedecziSenSys 2004
The Flooding Time Synchronization Protocol
The Flooding Time Synchronization Protocol
S. Ganeriwal, R. Kumar, M. B. Srivastava Sensys 2003
Timing-sync protocol for sensor networks
Timing-sync protocol for sensor networks
Three Papers Three Papers
Jeremy Elson, Lewis Girod and Deborah EstrinOSDI 2002
Fine-Grained Network Time Synchronization using Reference
Broadcasts
Fine-Grained Network Time Synchronization using Reference
Broadcasts
3
Time Synchronization.Time Synchronization.
Getting all devices in a distributed system to the same time (clock Skew/offset) at exactly the same rate (clock drift).
4
Applications of Time Synchronization Applications of Time Synchronization
List a set of functions that need time synchronization
Synchronized MAC
Power Management
Data TimeStamp
Tracking3.
2. 1.
4.
Localization5. Real-time Services6.
Profiling & Debug7. Coordinated Actuation8.
5
Why Time Synchronization is Needed? Why Time Synchronization is Needed?
Clock skew (offset): Difference between time on two clocks.
Different start times
Only local clock available initially
Clock drift: Count at different rates.
Different frequency of the oscillator.
Accuracy : agreement between the oscillators expected and actual frequencies (freq. error) (PPM)
Stability: drifting in frequency over time, because of short term factors (temperature Etc.) and long term factors (Aging)
6
The accuracy and driftThe accuracy and drift
Rubidium
Cesium
Quartz
Drift rate Cost
~10-15 s / day
~10-12 s / day
~10-6 s / day
High
Low~10-6 s / s1s /12 day
~10-6 s / hr
Desktop
IPAQs
AtomicClocks
embeded
7
Why Not Atomic clockWhy Not Atomic clock
CPU power drawn by motes ~ 25 mWCost will be the deciding factor!
8
State-of-the-ArtState-of-the-Art
General solutions for time sync problem:
GPS (Global Positioning System)
NTP (Network Time Protocol)
9
GPS overviewGPS overview
T1 = t1 + |X-s1|/c
Gather four satellite signals and solve the non-linear system of equations.
Figure source: http://www.dependability.org/wg10.4/timedepend/03-Schmi.pdf
Propagation delay
10
Global Positioning System (GPS)Global Positioning System (GPS)
Single Hop Synchronization
+’s
Commercial receivers can achieve accuracy of better than 200ns.
-’s
Needs a clear sky view (not possible inside buildings, underwater etc.)
Receivers need long settling time
Receivers can be large, costly and high power consuming.
11
802.11 Synchronization802.11 Synchronization
Clients just adoptthe timestamp in the beacon packet
Send at T1Base station
Very simple, Provides ms accuracy.
Neglects packet delay and delay jitters
Same approach being used by NIST to synchronize electronic products such as wall clocks, clock radio, wrist watches etc. worldwide.
WWVB signals are being transmitted from colarado.
12
NTP: Internet SynchronizationNTP: Internet Synchronization
A
Send at T3Recv at T4
T4 = T3 + DELAY- OFFSET
Send at T1 Recv at T2
T2 = T1 + DELAY + OFFSET
B
OFFSET = {(T2-T1)-(T4-T3)}/2
DELAY = {(T2-T1)+(T4-T3)}/2
Client Peer
13
Network Time Protocol (NTP)Network Time Protocol (NTP)
The standard C/S Internet Synchronization Protocol
+’s
Scalable
Self configuration in multi hop networks (hierarchical)
Robustness to failures and sabotage (multiple servers)
-’s
High Cost
Pair-wise
Not energy efficient
S1 S1 S1 S1
S2* *
S1 S1
*S2 S2
Clients(c)
14
Time Synchronization in Sensor NetworksTime Synchronization in Sensor Networks
How is time synchronization in sensor networks different from the traditional networks?
1. Energy Utilization
2. Single hop vs. multi hop
3. Infrastructure-Supported vs. Ad-hoc
4. Static topology vs. Dynamic Topology
5. Connected vs. Disconnected
6. Dynamic time sync. requirements, depending on the application
M. Maroti, B. Kusy, G. Simon, A. Ledeczi
SenSys 2004
The Flooding Time Synchronization Protocol
The Flooding Time Synchronization Protocol
First Papers First Papers
16
FTSP Basic Idea: Deal with SkewFTSP Basic Idea: Deal with Skew
Receiver Time = Sender Time + Signaling Delay
Sender
Receiver
Signaling Delay
Challenging issue: estimate signaling Delay!!!
Sender side delay
Receiver side delay
Propagation delay
17
Let’s look at delays in detailLet’s look at delays in detail
software MAC propagationTX RX software
sender receiver
ALL DELAYS ARE VARIABLE !
Bottleneck
Use low level time stamping
18
Delays in transmitting and receiving a message
Delays in transmitting and receiving a message
interrupt handling
encoding
propagation
(byte alignment)
interrupt handling
decoding
send
erre
ceiv
ercpu:
radio:
antenna:
antenna:
radio:
radio:
cpu:
19
FTSP Basic Idea II.FTSP Basic Idea II.
Use periodic flooding to provide robustness
20
FTSP Idea III: Deal with DriftFTSP Idea III: Deal with Drift
Real Time
Ideal clock
Node B clock
Node A clock
t1
Local node time
45 degree
21
Basic Idea III: Deal with DriftBasic Idea III: Deal with Drift
Receiver gets the multiple time stamps (Ta,Tb)
Uses this to update the estimate on the clock drift.
Tim
e a
t N
od
e A
Time at Node B
Offset}
Slope = drift
22
Analysis of FTSPAnalysis of FTSP
+’s MAC layer delay are removed by low-level time-
stamping
Robust
Clock Drift through linear regression
Support multi-hop time synchronization
-’s Relatively high cost in flooding
Special timestamp message needed
Second Papers Second Papers
Jeremy Elson, Lewis Girod and Deborah EstrinOSDI 2002
Fine-Grained Network Time Synchronization using Reference
Broadcasts
Fine-Grained Network Time Synchronization using Reference
Broadcasts
24
RBS: Synchronize receivers RBS: Synchronize receivers
Based on CesiumSpray system by Verissimo and Rodrigues
Receiver-receiver synchronization
Figure source: Courtesy of Jeremy Elson
25
Sender
Receiver 1
Receiver 2
Critical Path
Sender
Receiver
Critical PathTime
Traditional critical path:From the time the sender
reads its clock, to when the receiver reads its clock
RBS: Only sensitive to the differences in receive time
and propagation delay
Magic behind RBS
Figure source: Courtesy of Jeremy Elson
26
Analysis of RBSAnalysis of RBS
+’s The biggest sources of non deterministic latency are removed.
Message does not need to have any time stamp neither the time when its sent is needed.
Multiple broadcasts allow tighter synchronization.
Outliers are handled gracefully because of the use of best fit line.
-’s Needs a network with physical broadcast channel (not possible in
networks with point to point links)
They have not explored the scaling issues like automatic and dynamic election of set of nodes to send out beacons
S. Ganeriwal, R. Kumar, M. B. Srivastava Sensys 2003
Timing-sync protocol for sensor networks
Timing-sync protocol for sensor networks
Third Papers Third Papers
28
Tree-based SynchronizationTree-based Synchronization
Pair-wise NTP over multi-hop
29
TPSN: Conventional sender-receiver synchronization
TPSN: Conventional sender-receiver synchronization
ASend at T3
Recv at T4
T4 = T3 + DELAY- OFFSET
Send at T1 Recv at T2
T2 = T1 + DELAY + OFFSET
B
OFFSET = {(T2-T1)-(T4-T3)}/2
DELAY = {(T2-T1)+(T4-T3)}/2
Based on NTP
Enemy is non-determinism!
Asymmetric delays and varying offset
30
Comparison of the time sync protocols.Comparison of the time sync protocols.
FTSP TPSN RBS
Send/Access Time TS at MAC TS at MAC Eliminated
Prop. time Not handled Acknowledgements Not handled
Byte Alignment Handled Acknowledgements Not handled
Average error single hop 1.48 us 16.9 us 29.1 us
Traffic/load Low High Low
Network hierarchy Not fixed Needed Not needed
31
Take Away MessagesTake Away Messages
Need to deal with uncertainty in MAC access delay
FTSP = Low Level Time-stamping + Flooding + Linear regression
RBS = Receiver-Receiver Synchronization
FTSP = Pairwise Multi-hop NTP