Time Synchronization
Outline
6.4. Summary
02/05/15
02/05/15
Sources of Inaccuracies
A local software clock of node i at time t Li(t) = i Hi(t) + i
Hi(t): hardware clock of node i at time t
02/05/15
02/05/15
Metrics:
Precision:
maximum synchronization error for deterministic algorithms,
mean error /stddev /quantiles for stochastic ones
Energy costs,
e.g. # of exchanged packets, computational costs
Memory requirements
Fault tolerance:
what happens when nodes die?
02/05/15
02/05/15
02/05/15
10
02/05/15
02/05/15
12
02/05/15
13
because the earliest time S puts t in message mt is min after p sent mr.
the latest time was min before mt arrived at p
the time by Ss clock when mt arrives is in the range [t + min, t + Tround
- min]
Tround is observed round-trip time
min is minimum delay between p and S
mr
mt
Time server S
02/05/15
14
No authentication mechanism
02/05/15
1
2
15
2
3
02/05/15
Synchronisation of servers
Modes of synchronization:
Multicast
Symmetric
16
A server within a high speed LAN multicasts time to others which set
clocks assuming some delay (not very accurate)
Procedure call
02/05/15
Recipient notes the time of receipt ( we have Ti-3, Ti-2, Ti-1, Ti)
In symmetric mode there can be a non-negligible delay between messages
Server B
Ti-2
Ti-1
Time
m
17
Server A
Ti-3
m'
Ti
Time
02/05/15
Accuracy of NTP
18
02/05/15
19
Overall goal:
20
02/05/15
Two components:
21
Pair-wise synchronization:
based on sender/receiver technique
Network wide synchronization:
Minimum-height spanning tree construction with reference
node as root
02/05/15
Trigger resynchronization
Format synch packet
Timestamp packet with
Hand over packet for transmission
Operating system,
channel access
Start packet transmission
Propagation delay
Packet transmission time
22
Timestamp with
02/05/15
Assumptions:
23
02/05/15
Trigger resynchronization
Format synch packet
Timestamp packet with
Hand over packet for transmission
Operating system,
channel access
Start packet transmission
Propagation delay
Packet transmission time
Li(t5)
Timestamp with
Format synch answer packet
Timestamp with
Hand over packet
for transmission
OS, Channel access
Start packet transmission
24
Timestamp with
02/05/15
Trigger resynchronization
Format synch packet
Timestamp packet with
Hand over packet for transmission
Operating system,
channel access
Start packet transmission
Propagation delay
Packet transmission time
Li(t5)
Timestamp with
Format synch answer packet
Timestamp with
Hand over packet
for transmission
25
Timestamp with
02/05/15
Trigger resynchronization
t5 <= t8- - tp
Operating system,
channel access
Propagation delay
Packet transmission time
Li(t5)
Timestamp with
Format synch answer packet
Timestamp with
Hand over packet
for transmission
OS, Channel access
Start packet transmission
26
Timestamp with
02/05/15
Propagation delay
Packet transmission time
Li(t5)
Timestamp with
Format synch answer packet
Timestamp with
Hand over packet
for transmission
OS, Channel access
Start packet transmission
27
Timestamp with
02/05/15
02/05/15
Sources of inaccuracies:
29
02/05/15
Trigger resynchronization
Format synch packet
Timestamp packet with
Hand over packet for transmission
Operating system,
channel access
Start packet transmission
Propagation delay
Packet transmission time
30
Timestamp with
02/05/15
Improvements:
31
02/05/15
02/05/15
33
02/05/15
Introduction
We present a Timing-sync Protocol for Sensor Networks
(TPSN) that works on the conventional approach of
sender-receiver synchronization
Pair-wise-protocol: time-stamping at node i happens
immediately before first bit appears on the medium, and
time-stamping at node j happens in interrupt routine
34
02/05/15
Network Model
35
02/05/15
Trivial
Synchronization Phase
36
02/05/15
37
02/05/15
Synchronization Phase
T2 = T1 + + d, where
is the clock offset
d is propagation delay
38
02/05/15
Synchronization Phase
A receive an Ack and get timestamp T4
B
replies
acknowledgement
T1:
TB
Areceive
is sender,
the starting
synchronization
synccontaining
by sending
_pulse packet and
T1,T2,T3
synchronization_pulse
ti2:mestamping immediately
packet to B with timestamp T1
T2
T1,T2,T3
T1
A
T4
39
At time t3
t1
t4
t2
02/05/15
40
02/05/15
41
02/05/15
42
02/05/15
Introduction
43
02/05/15
Network Model
44
TimeStamp
RootID
SeqNum
The node with the smallest ID will be only one root in the
whole network
02/05/15
Synchronization phase
45
02/05/15
46
02/05/15
Synchronization phase
47
02/05/15
rootID
Root
seqNum
Timestamp
rootID
seqNum
B
C
Synchronized
Node
48
Unsynchronized
node
02/05/15
49
02/05/15
50
02/05/15
51
02/05/15
The local clock time of a sensor device is provided by the quartz oscillator
inside itself
02/05/15
Sensor node
02/05/15
Sensor node
Each node can estimate the local time of reference node in the following
way:
(3)
: the local time of sensor node
:the corresponding local time of the reference node.
: the initial offset between reference node and sensor node.
54
02/05/15
the
55
(4)
02/05/15
(5)
56
02/05/15
Sensor node
(T13)
57
02/05/15
58
02/05/15
59
02/05/15
Introduction
60
02/05/15
61
Phase error
due to nodes clock that contains different times
Clock skew
due to nodes clock that run at different rates
62
02/05/15
RBS
Synchronizes a set of receivers with one another
Supports both single hop and multi-hop networks
Traditional
Senders synchronizes with receivers
mostly supports only single hop networks
63
02/05/15
64
02/05/15
65
Packet reception
interrupt
Receiver uncertainty
Timestamp with
Packet reception
interrupt
Timestamp with
Send
Send
66
67
02/05/15
68
02/05/15
Reference
Packet
A:Local
time
A
B:Local
time
B
Transmitter
Receiver
69
02/05/15
Communication costs:
70
02/05/15
Communication costs:
Be m the number of nodes in the broadcast domain
Third scheme:
each node transmits its observation individually to the other
members of the broadcast domain m (m-1) packets
Fourth scheme:
each node broadcasts its observation m packets, but
unreliable delivery
71
02/05/15
Conclusion
72
02/05/15
73
02/05/15
Goal :
Synchronize the vast majority of a WSN in a
lightweight manner
Idea
Combine the benefits of LTS and RBS
74
02/05/15
75
02/05/15
Record tt14
Record
n1
n2
Sync packet
Reply packet
Record t32
02/05/15
77
02/05/15
Benefit of RBS
78
02/05/15
79
02/05/15
Timeline:
Root node triggers time synchronization at t1 with timestamp
LR(t1)
Node i timestamps packet at time t2 with Li(t2) and node j
timestamps it at t2 with Lj(t2)
Node i formats a packet and timestamps it at time t3 with Li(t3)
the packet includes the values Li(t2) and Li(t3)
Root node R timestamps the answer packet at time t4 with LR(t4)
and computes its offset OR,i with node is clock
80
OR,i =Li(t2) - LR(t2) = Li(t2) (LR(t1) + LR(t4) (Li(t3)- Li(t2))/2 =[ (Li(t2) LR(t1)) (LR(t4)- Li(t3))]/2
The root node R can estimate the offset OR,i between its
own clock and the local clock i in a similar fashion as the
protocol LTS
OR ,i
81
02/05/15
82
02/05/15
83
02/05/15
84
02/05/15
Summary
Time synchronization is important for both WSN
applications and protocols
Using hardware like GPS receivers is typically not an
option, so extra protocols are needed
Post-facto synchronization allows for time
synchronization on demand, otherwise clock drifts
would require frequent resynchronization and thus a
constant energy drain
85
02/05/15
Summary
86
02/05/15
References
[1] Ed. Ivan Stojmenovic, Handbook of Sensor Networks Algorithms and
Architectures, 2005.
[2] F. Sivrikaya,and B.Yener, Time Synchronization in Sensor Networks: A
Survey,2004. (www.cs.rpi.edu/~yener/PAPERS/WINET/timesync04.pdf)
[2] J. Elson, L. Girod, and D. Estrin ,Fine-Grained Network Time Synchronization
using Reference Broadcasts. (In Proceedings of the Fifth Symposium on OSDI
2002)
[3] S. Ganeriwal, R. Kumar, and M. Srivastava, Timing-Sync Protocol for Sensor
Networks. (SenSys 03)
[5] D. L. Mills. Network Time Protocol (Version 3) Specification, Implementation and
Analysis. RFC 1305, 1992.
[6] D. L. Mills. Improved Algorithms for Synchronizing Computer Network Clocks.
IEEE/ACM Transactions on Networking, 3(3): 245254, 1995.
[7] D. L. Mills. Adaptive Hybrid Clock Discipline Algorithm for the Network Time
Protocol. IEEE/ACM Transactions on Networking, 6(5): 505514, 1998.
87
02/05/15
References
[8] S. Ganeriwal, R. Kumar, S. Adlakha, and M. Srivastava. Network-Wide Time
Synchronization in Sensor Networks. Technical Report NESL 01-01-2003, Networked
and Embedded Systems Lab (NESL), University of California, Los Angeles (UCLA),
2003.
[9] S. Ganeriwal, R. Kumar, and M. B. Srivastava. Timing-Sync Protocol for Sensor
Networks. In Proceedings of the 1st ACM International Conference on Embedded
Networked Sensor Systems (SenSys), pages 138149, Los Angeles, CA, November
2003.
[10] Mikls Marti , Branislav Kusy , Gyula Simon , kos Ldeczi, The Flooding Time
Synchronization Protocol, In Proceedings of the 2ed ACM International Conference on
Embedded Networked Sensor Systems (SenSys), pages 39 49, Baltimore, MD, USA,
2004 .
[11] J.-P. Sheu, W.-K. Hu, and J.-C. Lin, Ratio-Based Time Synchronization Protocol in
Wireless Sensor Networks, Telecommunication Systems, Vol. 39, No. 1, pp. 25-35,
Sep. 2008.
[12] J. Elson, L. Girod, and D. Estrin. Fine-Grained Network Time Synchronization using
Reference Broadcasts. In Proceedings of the Fifth Symposium on Operating Systems
Design and Implementation (OSDI 2002), Boston, MA, December 2002.
[13] H. Dai and R. Han. TSync: A Lightweight Bidirectional Time Synchronization Service
for Wireless Sensor Networks. ACM SIGMOBILE Mobile Computing and
88
02/05/15
Communications Review, 8(1): 125139, 2004.
Recommend Reading
89