Simple, Accurate Time Synchronization For Wireless Sensor Networks

Download as pdf or txt
Download as pdf or txt
You are on page 1of 8

Simple, Accurate Time Synchronization for

Wireless Sensor Networks


Mihail L. Sichitiu and Chanchai Veerarittiphan
Electrical and Computer Engineering Department
North Carolina State University
Raleigh, NC 27695-7911
Email: {mlsichit,cveerar}@eos.ncsu.edu

Abstract— Time synchronization is important for any can refine it by estimating the speed and the direction
distributed system. In particular, wireless sensor networks of the sensed vehicle. For this application (and most
make extensive use of synchronized time in many contexts other applications), synchronized timestamps (together
(e.g. for data fusion, TDMA schedules, synchronized sleep
periods, etc.). Existing time synchronization methods were with position information) are essential.
not designed with wireless sensor networks in mind, and Sensor networks are expected to have very small form
need to be extended or redesigned. Our solution centers factors and be cheap such that they can be deployed
around the development of a deterministic time synchro- in very large numbers. This precludes spending a large
nization method relevant for wireless sensor networks. The amount of resources on a large, expensive power source
proposed solution features minimal complexity in network
bandwidth, storage and processing and can achieve good for each node. Once deployed, the sensor networks are
accuracy. Highly relevant for sensor networks, it also usually unattended, so battery replacement is out of the
provides tight, deterministic bounds on both the offsets question – the life of the sensor network is equal to the
and clock drifts. A method to synchronize the entire life of its batteries. Finally, such a network is typically
network in preparation for data fusion is presented. A real expected to work for extended periods of time (weeks,
implementation of a wireless ad-hoc network is used to
evaluate the performance of the proposed approach. months, and in some cases, years). There is no better way
Keywords: synchronization, wireless sensor networks, to conserve energy but to put the nodes to sleep (using
model based, clock drift bound. low power components only goes so far). However, to
perform its function the network should wake up at
I. I NTRODUCTION periodic intervals. It is essential that all the nodes are
The availability of small, cheap microsensors and low able to wake up at the same time to be able to exchange
power wireless communications nowadays enables the information.
deployment of large arrays of wireless sensor networks In addition, various time division multiple access
allowing us to monitor and, eventually, control many as- (TDMA) schemes proposed in literature for ad hoc
pects of the physical world. Applications include tagging networks assume clock synchronization of the nodes [1].
small animals unobtrusively, environmental monitoring, Nodes could be equipped with a global positioning
tagging small objects in a hospital or factory warehouse. system (GPS) [2] to synchronize them, but currently
In tactical environments, it can be used to track the this is a costly (in size, cost and power consumption)
movements of troops or targets. solution.
The sensed data is of limited usage if it is not There is a considerable amount of work available in
accompanied by the coordinates of the sensor - position the field synchronization for distributed systems [3]–
and time stamp. This is perhaps the primary reason for [14]. However most of the existing methods do not
clock synchronization in wireless sensor networks. But take into account the limited resources available for
there are also other vital functions which depend on sensor networks and require either error free operation,
clock synchronization. significant storage for the data samples, or processing
A basic function of a wireless sensor network is data power not plentiful in a sensor network.
fusion, i.e. combining data from multiple sensors into Elson and Estrin presented an interesting technique
high level data. For example, a vehicle going through a called post-facto synchronization [15] which is also
sensor network equipped with acoustic sensors can be based on unsynchronized local clocks but limits synchro-
detected by different sensor nodes at different moments nization to the transmission range of the mobile comput-
(corresponding to the moments when the vehicle entered ing nodes. The precision achieved by their approach is
the detection range of those nodes). A fusion node very good, but lacks a deterministic bound on the clock
receiving the raw information from the sensor nodes drift.

0-7803-7700-1/03/$17.00 (C) 2003 IEEE 1266


Recently, other approaches suitable for wireless sensor ited to wireless sensor networks. They can synchronize
networks synchronization were published [16] or are the nodes on any communication network which allows
under review [17]. However, those approaches are still bi-directional data transmission. However, the algorithms
comparatively computation intensive, and do not provide provide very good precision (micro-second if crafted
firm bounds on the achieved precision. carefully) and bounds on the precision while using very
This paper presents a synchronization algorithm for little resources and thus being especially well suited for
drifting clocks similar to that found in [4], [18] but wireless sensor networks.
processes the collected data in a different manner. The
II. DATA C OLLECTION A LGORITHMS
proposed algorithm preserves the fault-tolerance proper-
ties of the methods in [4], [18]. In this Section a simple data collection algorithm and
Due to unpredictability and imperfect measurability possible enhancements are presented.
of message delays in a networked environment, physi- A. A simple data collection algorithm
cal clock synchronization is always imperfect. We will We will use a classical data collection algorithm [4],
present two closely related algorithms suitable for syn- [8], [11], [16]. We will however process the data stream
chronizing two wireless nodes. We will also present a differently. Consider two wireless nodes 1 and 2, with
scheme building on these algorithms capable to synchro- their hardware clocks t1 (t) and t2 (t) respectively, where
nize the clocks of an entire sensor field. t is the Coordinated Universal Time (UTC).
To avoid confusion between the two algorithms we In general the hardware clock of node i is a monoton-
will name them mini-sync and tiny-sync as they use ically non-decreasing function of t. In practice, a quartz
limited resources and very limited resources respectively. oscillator is used to generate the real time clock. The os-
The two algorithms feature: cillator’s frequency depends on the ambient conditions,
• Drift awareness: the algorithm not only takes the but for relatively extended periods of time (minutes -
drift of the clock into account, but also finds tight hours) can be approximated with good accuracy by an
bounds on the drift which allows for corrections. oscillator with fixed frequency:
• Tight bounds on the precision: Most other algo-
rithms provide best estimates for the offset and the ti (t) = ai t + bi , (1)
drift of the clocks, and possibly probabilistic bounds where ai and bi are the drift and the offset of node i’s
on these estimates. Our approach deliverers tight, clock. In general ai and bi will be different for each
deterministic bounds on these estimates, such that node and approximately constant for an extended period
absolute information can be deduced about ordering of time.
and simultaneous events. From (1) it follows that t1 and t2 are linearly related:
• Accuracy: given small uncertainty bounds on the
delays the exchanged messages undergo, the preci- t1 (t) = a12 t2 (t) + b12 (2)
sion of the synchronization can be arbitrarily good.
The parameters a12 and b12 represent the relative
• Low computation and storage complexity: wire-
drift and the relative offset between the two clocks
less sensor nodes typically feature low computa-
respectively. If the two clocks are perfectly synchronized,
tional power microcontrollers with small amounts
the relative drift is equal to one and the relative offset is
of RAM. Both algorithms have low computational
equal to zero.
and storage complexity.
Assume that node 1 would like to be able to determine
• Insensitivity to communication errors: wireless
the relationship between t1 and t2 . Node 1 sends a probe
communications are notoriously error prone, and
message to node 2. The probe message is timestamped
thus one cannot rely on receiving correctly all
right before it is sent with to . Upon receipt, node 2
messages. The presented approach works correctly
timestamps the probe tb and returns it immediately (we
even if a large percentage of the messages are lost.
will shortly relax this requirement) to node 1 which
The main contribution of the paper is the development timestamps it upon receipt tr . Fig. 1 depicts such an
of a simple algorithm which delivers accurate offset exchange.
and drift information together with tight, deterministic The three time-stamps (to , tb , tr ) form a data-point
bounds on them. This is a highly desirable property which effectively limits the possible values of parameters
for wireless sensor networks. Assume that two nodes, a a12 and b12 in (2). Indeed, since to happened before
transmitter and a receiver are in sleep mode. To ensure tb and tb happened before tr the following inequalities
that the receiver wakes up before the transmitter, the should hold:
offset error and the drift error between their clocks have
to be known. to (t) < a12 tb (t) + b12 , (3)
The two algorithms presented in this paper are not lim- tr (t) > a12 tb (t) + b12 . (4)

1267
tb t2 (6). The true parameters a12 and b12 can be estimated
as:
∆a12
a12 = a 12 ± , (7)
2
∆b12
b12 = b 12 ± , (8)
to tr t1 2
where
Fig. 1. A probe message from node 1 is immediately returned by a12 + a12
node 2 and timestamped at each send/receive point resulting in the a
12 = , (9)
data-point (to , tb , tr ). 2
∆a12 = a12 − a12 , (10)
b12 + b12
The measurement described above will be repeated b
12 = , (11)
2
several times and each probe which returns will provide
∆b12 = b12 − b12 . (12)
a new data point and thus new constraints on the admis-
sible values of a12 and b12 . Once a12 and b12 are estimated, node 1 can always
correct the reading of the local clock (using (2)) to have
t1 it match the readings of the clock at node 2.
data
point 3 To decrease the overhead of this data-gathering al-
data gorithm the probes can be piggybacked on data mes-
point 2
sages. Since most MAC protocols in wireless networks
employ an acknowledgment (ACK) scheme, the probes
data
point 1 can be piggybacked on the data and the responses on
the ACKs. Elaborate schemes with optional headers can
tr be devised to reduce the length of the header when
1
probes do not need to be sent. This way, synchronization
t o1
a 12 can be achieved almost “for free” (i.e. with very little
b 12
overhead in terms of communication bandwidth, which is
a12 perhaps the most important constraint in wireless sensor
b12
networks).
a 12
b 12
tb
B. Relaxing the immediate reply assumption on node 2
1 t2
In Fig. 1 we assumed that node 2 replies immediately
Fig. 2. The linear dependence (2) and the constraints imposed on to node 1. The correctness of the presented approach
a12 and b12 by three data-points. is not affected in any way if node 2 does not respond
immediately. Node 2 can delay the reply as long as it
The linear dependence between t1 and t2 and the wants, the relations (3) and (4) and thus the rest of the
constraints imposed by the data points can be represented analysis will still hold.
graphically as shown in Fig. 2. Each data-point can However, as the delay between to and tr increases,
be represented by two constraints in the system of the precision of the estimates will decrease. In practice
coordinates given by the local clocks of the two nodes node 2 may have to delay the reply due to any number
t2 and t1 . One constraint is (tb , to ) and the other one is of reasons (e.g. it has something more important to send,
(tb , tr ). it cannot access the wireless channel, etc.).
Inequalities (3) and (4) graphically require that the line
representing the relationship (2) is positioned between tbt t2
tbr
the two constraints of each data-point. The exact values
of a12 and b12 cannot be exactly determined using this
approach (or any other approach) as long as the message
delays are unknown. But a12 and b12 can be bounded:
a12 ≤ a12 ≤ a12 , (5) to tr t1
b12 ≤ b12 ≤ b12 . (6)
Fig. 3. A probe message from node 1 may be returned by node 2
Not all combinations of a12 and b12 satisfying (5) and and timestamped at both the send and receive points resulting in two
(6) are valid, but all valid combinations satisfy (5) and data-points: (to , tbr , tr ) and (to , tbt , tr ).

1268
To counteract the possible loss in precision, node 2 can wireless sensor nodes. In this paper we will pursue
time-stamp the probe message both upon receipt (tbr ) another avenue.
and when it resends it (tbt ) (as depicted in Fig. 3). In The two proposed algorithms spring from the obser-
this case each of the triplets (to , tbr , tr ) and (to , tbt , tr ) vation that not all data-points are useful. In Fig. 2 the
represent a data point satisfying (3) and (4). Thus we bounds on the position estimates [a12 , a12 ] and [b12 , b12 ]
obtain two data-points using only one probe. They will are constrained only by the data points 1 and 3. Therefore
be treated as two independent data-points and in this we do not need data point 2, and we can discard it, as
paper no further distinction will be made between the data point 3 produces better estimates than data point 2.
two methods of collecting data points. It seems that we should be able to keep only four
constraints (the ones which define the best bounds on the
C. Increasing the accuracy by considering the minimum position estimates) at any time. Upon the arrival of a new
delay data point the two new constraints are compared with the
If no information about the delays encountered by the existing four constraints and two of the six discarded (i.e.
probe messages is available, nothing else can be done to the four constraints which result in the best estimates are
increase the accuracy. However, if the minimum delay a kept). The comparison operation to decide which four
probe encounters between the nodes is known, the data- constraints to keep is very simple computationally (only
points can be adjusted for a boost in the precision of the 8 additions, 4 divisions and 4 comparisons). At any one
results. time only the information for the best four constraints (8
To determine the minimum delay, one can take into timestamps = 4 constraints × 2 timestamps/constraint)
account the minimum length of such a probe and the time needs to be stored. We will name the algorithm described
it takes to transmit such a probe (at the transmission rate in this paragraph “tiny-sync”. The four constraints that
of the sensor node), and eventually other operations that are stored at any one time instant may very well belong
have to be completed before the probe is sent or upon to two, three or four different data points.
receiving such a probe (e.g. encryption/decryption, CRC
calculation, etc.). t1
Assume that we are able to determine the minimum
delay δ12 the probe encounters between the moment to
is stamped at node 1 and the moment tb (tbr ) is stamped B4
at node 2. Also denote with δ21 the minimum delay B3
between the moment tb (tbt ) is stamped and the moment
B2
tr is stamped. Then (to + δ12 , tb , tr − δ21 ) should be A4

used as a data-point as this will offer increased accuracy B1


over the data-point (to , tb , tr ). A3
If for two probes both minimums δ12 and δ21 are A2

reached the method presented in this paper can achieve


A1
perfect synchronization (i.e. both for the relative offset
and the relative drift: ∆a12 = ∆b12 = 0).

III. T INY- SYNC AND M INI - SYNC - P ROCESSING THE


DATA t2

After acquiring a few (at least two) data-points, the Fig. 4. Tiny-sync will miss the optimum solution in this situation, as it
offset and the drift can be estimated using inequalities will discard the constraint A2 upon the receipt of data-point (A3 −B3 ).
(3) and (4). An existing solution for finding the optimal
bounds on the drift and offset involves solving two linear Unfortunately while tiny-sync is very efficient it does
programming problems with twice as many inequalities not always produce the optimal solution. Consider the
as data points [4]. situation depicted in Fig. 4. For clarity we labeled each
The disadvantage of this approach is that as more and constraint individually. After the first two data-points
more data samples are collected, the computational and (A1 -B1 ) and (A2 -B2 ) are received, the first estimates
storage requirements increase (potentially unbounded). for the drift and offset may be computed. After the third
Also, one should not limit the number of collected data-point (A3 -B3 ) is received the estimates improve, so
samples to a fixed window as the best drift estimates are the constraints A1 ,B1 ,A3 and B3 are stored, while A2
obtained when a large number of samples are available. and B2 are discarded. The next data point (A4 -B4 ) could
The approach in [4] is clearly not suitable for systems have used constraint A2 to construct a better estimate.
with limited memory and computing resources such as Unfortunately A2 was already discarded at this point,

1269
and thus a less than ideal estimate for b12 will now be
imposed by A1 and A4 . Thus tiny-sync while producing s u v
correct results, might miss the optimum result. We will Fig. 5. Synchronization transitivity: if s is synchronized with u and
compare the performance of tiny-sync with the optimal u is synchronized with v, then s is synchronized with v.
solution in the experimental Section V.
In Fig. 4 the constraint A2 was discarded by tiny-sync
because it was not immediately useful, but rather only and node u is able to determine the bounds
potentially useful in the future. This does not mean that auv ≤ auv ≤ auv , (17)
all the constraints are potentially useful. In fact, only the
constraints Aj (e.g. A2 ) that satisfy the condition buv ≤ buv ≤ buv . (18)

m(Ai , Aj ) > m(Aj , Ak ) (13) If node u sends its bounds, auv , auv , buv and buv to
node s, then s can compute the bounds
for some integers 1 ≤ i < j < k are potentially useful
in the future (by m(X, Y ) we denote the slope of the asv ≤ asv ≤ asv , (19)
line going through the points X and Y ). bsv ≤ bsv ≤ bsv , (20)
Theorem 1 Any constraint Aj (e.g. A3 ) which satisfies
where
m(Ai , Aj ) ≤ m(Aj , Ak ) (14)
asv = asu auv , (21)
for any integers 1 ≤ i < j < k can be safely discarded
as it will never be useful. asv = asu auv , (22)
 
The proof is presented in the Appendix. Similar con- bsv = min asu buv + bsu , asu buv + bsu , (23)
ditions for discarding upper-bound constraints (Bi ) exist.  
bsv = max asu buv + bsu , asu buv + bsu . (24)
The resulting algorithm (called “mini-sync”) upon
the receipt of a new data point will check if the new This approach effectively synchronizes nodes s and v
constraints can eliminate any of the old constraints. Po- without exchanging any messages between them.
tentially many old constraints can be eliminated with one A wireless sensor network is logically organized as
new data-point. Since we only eliminate the constraints a hierarchy (see Fig. 6) with sensor nodes in the lowest
(conditions) that are irrelevant we still obtain the optimal layer, one (or more) root node(s) (also called sink(s)) and
solution with only a few points (solving the set of all possibly several layers of intermediate nodes. The sensor
inequalities is shown to result in the optimal solution nodes send the data at the intermediate node where the
[4]). data is fused and further sent to the upper layers.
Storing only four points like in tiny-sync does not
layer 1 (root node)
produce the optimal solution. How many points do we
actually need to store to produce the optimal solution?
layer 2 (intermediate nodes)
Theoretically a potentially large number. If the delay .
between node 1 and node 2 is monotonically increasing, .
.
(13) can hold for all the constraints Aj . In practice, the layer n−1 (intermediate nodes)
delays do not increase monotonically forever. Therefore,
only a few constraints need to be stored to obtain the
optimal result. In practice, our experiments showed that layer n (sensor nodes)

no more than 40 points have to be stored at any one


Fig. 6. Hierarchical wireless sensor network.
time which is quite reasonable even for wireless sensor
nodes. Since data is fused at the intermediate nodes, there
IV. S YNCHRONIZING AN E NTIRE N ETWORK is no point in synchronizing the entire network to one
In the previous Sections we presented two algorithms unique clock (e.g. the clock of the root node). Indeed,
to synchronize two wireless sensor nodes. In this Section all the sensors reporting to the same intermediate node
we will explore the possibility to extend the synchroniza- should synchronize with the fusion point and use the
tion from two nodes to any number of nodes. synchronized time to time-stamp all the data they send
Consider the situation depicted in Fig. 5. Node s (eventually the lower and upper bounds on t20 and t20
synchronizes with node u and node u synchronizes with are sent as time-stamps if so required by the application).
node v. Therefore node s is able to determine the bounds In turn, the nodes in the intermediate layer i should
synchronize to the nodes in layer i − 1, and so on.
asu ≤ asu ≤ asu , (15) Synchronizing the nodes in layer i to the nodes in
bsu ≤ bsu ≤ bsu , (16) layer i − 1 for all i = 2, . . . , n is not equivalent with

1270
TABLE I
synchronizing all the nodes with the root node. If all
S TATISTICS OF THE DATA - POINTS COLLECTED FOR THE ONE HOP
nodes are synchronized with the root node, the precision
AND THE FIVE HOPS EXPERIMENTS .
of the synchronization degrades linearly with number of
layers, the sensor nodes in layer n having the lowest Min [ms] Max [ms] Avg [ms] Std Dev [ms]
precision. Instead, sensor nodes should synchronize only one hop 3.040 24.217 3.366 1.112
five hops 16.073 177.744 31.540 12.874
with the fusion nodes in the layer immediately above.
Thus the precision can be kept relatively high (clearly TABLE II
better than if all nodes are synchronized with the root U PPER BOUNDS OF THE RELATIVE ERROR BETWEEN MINI - SYNC
layer). AND TINY- SYNC
As suggested in Fig. 6, some sensors may report to
more than one intermediate node. In this case the sensor Relative errors for
nodes will synchronize with all intermediate nodes that a12 a12 b12 b12
one hop 0.14% 0.19% 0.19% 0.14%
receive data from it. How is it possible to synchronize five hops 1.8% 1.7% 1.7% 1.8%
with two intermediate nodes which are not themselves
synchronized? This is indeed possible, because in the
presented approach we do not modify the local clock. We in practice, only a limited number of data points (four
just estimate the parameters aij and bij used to “correct” for tiny-sync) have to be stored. In this section we
the local clock and estimate the time at the receiver of worked with 5000 data points to observe the processing
the data. To send data to two (or more) receivers, we’ll capabilities of the two algorithms.
just keep track of two (or more) sets of aij and bij and Fig. 7 a) and 8 a) depict the evolution of the bounds
use each set for its corresponding receiver. on a12 and b12 respectively. Fig. 7 b) and 8 b) depict the
The logical organization of the wireless sensor net- improvement in precision of the estimate ∆a12 and ∆b12
work might not be mirrored by the physical layout of (see (7) and (8)) respectively. The values correspond
the nodes. For example, the sensors may send the data to the five hops data points processed with mini-sync.
to the intermediate nodes through a multi-hop path which The corresponding figures for one hop are similar. As
may go through other sensors, or even the root. In this expected, the bounds converge. It can be shown that
case, the synchronization can be either done through precision of the drift is expected to be bounded by
transitivity (hop-by-hop) or the synchronization probes 2RT T /(sample number) where RTT is the round trip
may be relayed on the same path that data will travel time of the samples, and sample number is the number
once the nodes are synchronized. of samples collected. Also the precision of the offset is
expected to be on the order of RT T . The justification
V. E XPERIMENTAL R ESULTS
for both expected bounds is omitted due to the lack of
To evaluate the performance of the proposed algo- space. The expectations match closely the experimental
rithms we implemented and tested them on two sets of results in Fig. 7 (b) and Fig. 8 (b). The precision of
data points. Since a wireless sensor network was not the offset estimate increases significantly during the
available, we used an 802.11b multi-hop ad-hoc network. first samples, and then improves only marginally. In
It is expected that wireless sensor networks will exhibit contrast the precision of the drift continues to improve
similar delay patterns as the ones encountered in this ad- significantly for as long as data samples are collected.
hoc network. To mimic the data traffic in the wireless In theory tiny-sync, while simple, is sub-optimal. To
sensor network, we used a background traffic in the ad- evaluate the loss in precision for tiny-sync we computed
hoc network as well. For the first set of data points the the upper bound of the relative error between mini-
two computers to be synchronized were neighbors (i.e. sync (the optimal solution) and tiny-sync after each
one hop away). For the second data set, the computers new sample was processed. The results are presented in
were five hops away. For both experiments a message Table II. It can be seen that the difference is practically
probe was sent once a second for about 83 minutes thus insignificant - smaller than 2% in all cases (and actually
resulting in almost 5000 data-point samples for each smaller than 0.1% after the first few samples have been
experiment. Each experiment was repeated several times processed). The direct implication is that in practice
to increase the confidence in the results. The statistics of usually one does not need the precision provided by
the collected data-points are presented in Table I. mini-sync. The results from tiny-sync are very close to
The same two sets of 5000 data points were used the ones from mini-sync with far less complexity.
to compare the performance of the two algorithms. In We can improve the results if we take into account
practice far fewer messages have to be exchanged for the minimum delays that 802.11b introduces for each
precisions similar to the ones given by these 5000 data hop. We used 256 bytes UDP packets in both direc-
points, by taking the samples at the “right” times Also, tions (to mimic the piggybacking of the time-stamps

1271
−1
10
10
0.0004 ∆a
12
2 RTT/(sample number)

0.0003
10
−2
10

0.0002
10
12
Lower and upper bound on a

0.0001 −3
10 10

12
0

∆a
10

−4
−0.0001 10
10

−0.0002
10
−5
10
−0.0003
10

−0.0004
10
−6
10
500 1000 1500 2000 2500 3000 3500 4000 4500 0 500 1000 1500 2000 2500 3000 3500 4000 4500 5000
samples samples

(a) (b)
Fig. 7. a) Evolution of the bounds on a12 (a) and of ∆a12 (b) as more samples are collected

4
x 10
7
x 10 ∆ b12
−1.7755 min(RTT)
3.2

−1.776
3

−1.7765 2.8
12
Lower and upper bound on b

−1.777 2.6
∆ b12 (µ s)

2.4
−1.7775

2.2
−1.778

2
−1.7785
1.8

−1.779
1.6

−1.7795
0 500 1000 1500 2000 2500 3000 3500 4000 4500 5000 500 1000 1500 2000 2500 3000 3500 4000 4500
samples samples

(a) (b)
Fig. 8. a) Evolution of the bounds on b12 (a) and of ∆b12 (b) as more samples are collected

TABLE III
on sensed data and control information) and we used
R ESULTS FOR TINY- SYNC WITH AND WITHOUT DATA
the CSMA/CA high rate (11 Mbps) mode of 802.11b.
PRE - PROCESSING
A careful examination of all delays involved (DIFS,
preamble, MAC, LLC/SNAP header, IP and UDP head- Raw data Pre-processed data
ers) results in a minimum transmission delay for each ∆a12 ∆b12 ∆a12 ∆b12
2 2
(ms) 2 2
(ms)
probe of 1089 µs. For the five hop case, neglecting one hop 7.133e-07 2.0941 2.768e-07 0.9457
the processing in each intermediate node, we consider five hops 5.013e-06 17.08 1.167e-06 3.239
the minimum one way delay equal to five minimum
transmission times.
To evaluate the usefulness in adjusting the results for
further increased especially for wireless sensor network
the minimum delay, in Table III the results of tiny-sync
nodes where many of the uncertainties present in the ad-
are shown after processing both streams of data samples.
hoc network used as testbed can be eliminated. In the
The results for mini-sync are similar.
one hop case we were able, in a little over an hour, to
The improvement obtained by eliminating known de- bound the offset by ±945µs and the drift by ±2.7 10−7
lays is significant (up to five times better), and it can be corresponding to a drift of 23.3 ms in a day.

1272
VI. C ONCLUSION [14] A. Duda, G. Harrus, Y. Haddad, and G. Bernard, “Estimating
global time in distributed systems,” in Proc. of the 7th IEEE
A light-weight synchronization algorithm is presented. International Conference on Distributed Computing Systems
(ICDCS’87), Berlin, Germany, Sept. 1987.
The proposed algorithm is able to produce tight, de- [15] J. Elson and D. Estrin, “Time synchronization for wireless
terministic synchronization with only few message ex- sensor networks,” in Proc. of the 2001 International Parallel
changes. While the algorithm is suitable for any type and Distributed Processing Symposium (IPDPS), Workshop on
Parallel and Distributed Computing Issues in Wireless Networks
of network, it is especially useful in wireless sensor and Mobile Computing, San Francisco, CA, Apr. 2001.
networks which are typically extremely constrained on [16] K. Römer, “Time synchronization in ad hoc networks,” in Proc.
the available computational power and bandwidth and of ACM Mobihoc, Long Beach, CA, 2001.
[17] J. Elson, L. Girod, and D. Estrin, “Fine-grained network
have some of the most exotic needs for high precision time synchronization using reference broadcasts,” in UCLA
synchronization. The performs of the presented algo- Technical Report 020008, Feb. 2002. [Online]. Available:
rithms is verified with an experimental testbed. The citeseer.nj.nec.com/elson02finegrained.html
[18] D. Dolev, J. Halpern, B. Simmons, and H. Strong, “Dy-
experimental results match closely the theoretical expec- namic fault-tolerant clock synchronization,” Journal of the ACM,
tations. A method to extend the synchronization to the vol. 42, no. 1, pp. 1–36, 1988.
entire sensor network, as needed for data fusion is also
A PPENDIX
presented. Two varieties of the algorithm are presented
and their performance is compared using real delay Proof of Theorem 1
traces collected from a wireless ad-hoc network. The We can provide a strictly mathematical proof for
experimental results show that the simplest of the two Theorem 1. However, there is little intuition behind the
algorithms, called tiny-sync, produces results very close mathematical proof. Instead, we will provide a graphic
to the optimum (within 0.1%) and thus is preferable. argument.
t1

R EFERENCES
Bx2

[1] G. Asada, M. Dong, T. Lin, F. Newberg, G. Pottie, W. Kaiser,


and H.O.Marcy, “Wireless integrated network sensors: low power
systems on a chip,” in Proc. of the 24th European Solid-State Bx1

Circuits Conference, The Hague, Netherlands, Sept. 1998.


Ak
[2] B. Hofmann-Wellenhof, H. Lichtenegger, and J. Collins, Global
Positioning System: Theory and Practice, 4th ed. Springer- b12 ( Ak,Bx1)
Aj
Ai
Verlag, 1997.
[3] L. Lamport, “Time, clocks, and the ordering of events in a b12 ( A i,Bx2 )
b12 ( Aj ,Bx1)
distributed system,” Communications of the ACM, vol. 21, no. 7,
pp. 558–565, 1978. b12 ( Aj ,Bx2)
t2

[4] M. Lemmon, J. Ganguly, and L. Xia, “Model-based clock


synchronization in networks with drifting clocks,” in Proc. of
the 2000 Pacific Rim International Symposium on Dependable Fig. 9. Aj can be safely discarded as Ai or Ak will result in better
Computing, Los Angeles, CA, Dec. 2000, pp. 177–185. estimates in all cases.
[5] R. Ostrovsky and B. Patt-Shamir, “Optimal and efficient clock
synchronization under drifting clocks,” in Proceedings of the Consider the situation depicted in Fig. 9. The points
18th ACM Symposium on Principles of Distributed Comput- Ai , Aj and Ak satisfy condition (14). Consider a point
ing(PODC99), 1999.
[6] J. Lundelius and N. Lyunch, “A new fault-tolerant algorithm for
Bx of coordinates (t2x , t1x ) such that t1x > t1k and
clock synchronization,” Information and Computation, vol. 77, t2x > t2k . Constraint Bx and any of the constraints
no. 1, pp. 1–36, 1988. Ai , Aj or Ak may determine a lower bound on b12
[7] L. Lamport and P. J. Melliar-Smith, “Synchronizing clocks in
the presence of faults,” Journal of the ACM, vol. 32, no. 1, pp.
(or alternatively an upper bound on a12 ). Denote with
52–78, 1985. b12 (Ay , Bx ) the lower bound on b12 determined by the
[8] F. Cristian, “Probabilistic clock synchronization,” Distributed constraints Ay and Bx . We can distinguish two cases:
Computing, vol. 3, no. 3, pp. 146–158, 1989.
[9] R. Gussell and S. Zatti, “The accuracy of clock synchronization
1. If Bx is below the line determined by Ai and Ak
achieved by TEMPO in Berkeley UNIX 4.3 BSD,” IEEE Trans- (position Bx1 in Fig. 9). In this case b12 (Aj , Bx1 ) <
actions on Software Engineering, vol. 15, pp. 847–853, 1989. b12 (Ak , Bx1 ) and the constraint Aj can be safely
[10] T. K. Srikanth and S. Toueg, “Optimal clock synchronization,”
J-ACM, vol. 34, no. 3, pp. 625–645, 1987.
discarded.
[11] D. L. Mills, “Internet time synchronization: the network time 2. If Bx is above the line determined by Ai and Ak
protocol,” IEEE Trans. Communications, vol. 39, no. 10, pp. (position Bx1 in Fig. 9). In this case b12 (Aj , Bx2 ) <
1482–1493, Oct. 1991. b12 (Ai , Bx2 ) and the constraint Aj can be safely
[12] ——, “Improved algorithms for synchronizing computer network
clocks,” in Proc. of ACM Conference on Communication Archi- discarded as well.
tectures (ACM SIGCOMM’94), London, UK, Aug. 1994. Thus in both cases, the constraint Aj can be discarded
[13] P. Ashton, “Algorithms for off-line clock synchronization,” in
Technical Report TR COSC 12/95, Department of Computer
as it will never be useful (i.e. it will never constrain a12
Science, University of Canterbury, Dec. 1995. or b12 more than than Ai and Ak do).

1273

You might also like