drift prediction is less than a clock tick for 1-minute period) and even better results on some nodes outdoors. Moreover, it needs only 3 previous drift samples for ...
On Efficient Clock Drift Prediction Means and Their Applicability to IEEE 802.15.4 Marcin Brzozowski, Hendrik Salomon and Peter Langendoerfer IHP Im Technologiepark 25 15236 Frankfurt (Oder), Germany {brzozowski, salomon, langendoerfer}@ihp-microelectronics.com
Abstract—Sensor nodes compensate clock drift with guard times (GT), which results in idle listening. By applying prediction methods nodes can limit drift uncertainty for upcoming frames and shorten GT. However, a common solution based on linear regression requires floating-point arithmetic, i.e. large computation and memory overhead. We present an approach for drift prediction based on moving average, which works well with basic mathematical operations. It achieves similar accuracy to linear regression in indoor environments (the standard deviation of the drift prediction is less than a clock tick for 1-minute period) and even better results on some nodes outdoors. Moreover, it needs only 3 previous drift samples for accurate drift estimations. Our two-week drift experiments revealed that in outdoor scenarios nodes received 99% of frames with GT 8x shorter than the worst case. We exploit the idea of deliberately giving up the reception of approx. 1% of frames in order to use very short GT and to reduce idle listening. After applying our drift prediction approach we shortened GT by 95%. It results in 10% lifetime gain for IEEE 802.15.4.
I. I NTRODUCTION In general, sensor nodes use crystal oscillators to derive the time. The oscillators frequency is a time variable, referred to as clock drift. Changes of temperature, air pressure or electric supply voltage cause short-term variations of the oscillator frequency. Long-term variations are caused by oscillator aging. Moreover, the same oscillator type may run with different frequencies on various nodes. Thus, clocks of sensor nodes run at different speeds. Due to clock drift a sensor node may wake up too soon or too late to receive a message in low duty cycle (LDC) protocols, e.g. it misses a beacon in IEEE 802.15.4 [8]. To counter this threat, sensor nodes wake up earlier by a guard time, and also stay awake longer. A common solution to guard times considers worst drift. However, as run-time drift is a few times smaller than the worst one, such a solution causes unnecessary long idle listening and wastes energy. During indoor and outdoor experiments we discovered that nodes can compensate drift of most messages (99%) within a small guard time window, i.e. 30x smaller than the worst-case guard time for indoors and 8x smaller for outdoors. Thus, if nodes deliberately use shorter guard times, they reduce idle listening significantly and miss only a few frames due to not compensated drift. Sensor nodes achieve further idle-listening reduction by applying drift prediction approaches. As clock drift is assumed
to be stable over a short time [10], [7], nodes may predict future drift to the neighbours, according to previous drift observations. Some time synchronization protocols predict future drift by adapting linear regression (LR) on previous drift samples, e.g. ordinary least squares (OLS). Moreover, using OLS nodes can estimate the probability that predicted drift is bounded within certain limits. It allows the calculation of guard times, which are shorter by approx. 95% than the worst case. However, LR has the following drawbacks when implemented on sensor nodes. Firstly, it requires floatingpoint arithmetic, which causes large computation overhead, e.g. LR may take 120ms on a sensor node [7]. Moreover, nodes need additional memory for the floating-point module and for large floating-point variables. Secondly, as LR requires several previous samples to accurately predict future drift, nodes must use the worst-case guard times for some frames to collect enough drift samples. Clearly, it results in additional idle listening and wastes the gain obtained from shorter guard times of LR. Thus, we extended LR so that nodes do not need to use worst-case guard times apart from the initialization phase. We adapted LR approach for IEEE 802.15.4 standard and use it for comparison purposes. To overcome the drawbacks of LR we present a new solution for drift prediction. We discovered that a moving average filter achieves very similar results to approaches based on LR, i.e. the standard deviation of the prediction is 1-2 clock ticks for a 1-minute sleep period (1 clock tick = 30.5 µs). Moreover, moving average achieved higher prediction accuracy on some nodes in the outdoor environment. However, moving average works well without floating-point operations and therefore fits better to sensor nodes than LR. The paper is organized as follows. Section 2 gives an overview about the scientific efforts related to LDC protocols and clock drift. Section 3 introduces IEEE 802.15.4. In next sections we present drift compensation approaches, OLS in section 4 and moving average in section 5. The results of our drift experiments are presented in section 6. We evaluate solutions to drift compensation in section 7 and conclude the paper thereafter. II. R ELATED WORK Although LDC protocols suffer from clock drift, the problem was often neglected (e.g. SMAC [15], WiseMAC [5],
2
DMAC [9]). To counter the clock drift problem, several approaches (e.g. Dozer [3], DLDC-MAC [1]) use guard times based on worst-case drift. However, the authors derive worstcase drift only from oscillator drift parameter neglecting other factors, e.g. the time of radio power up/down is not constant. Moreover, as run-time drift is smaller than the worst case, such solutions may waste energy due to unnecessary long idle listening. Ref. [12] addresses the problem of clock drift and LDC. The authors combine hardware and software solutions to achieve very accurate times. Their sensor nodes equipped with two oscillators derive a very precise local time, +/- 1.2 parts per million (ppm) frequency stability. However, the approach requires hardware modifications (2 oscillators) and the initial calibration of both oscillators. Moreover, the software part occupies 3kB memory (6% of available program memory on tmote sky [11] sensor node). The authors in [7] present Rate Adaptive Time Synchronization (RATS) and combine it with B-MAC in order to prolong the lifetime of LDC. RATS extends LR (linear regression) drift prediction by the empirical estimation of confidence intervals in indoor and outdoor scenarios. These intervals are a good basis for the guard time calculation, as they define the probability that future drift will be within certain limits. In general, B-MAC uses long preambles to compensate worst time uncertainty between a sender and a receiver. B-MAC combined with RATS lowers time uncertainty and in that way shortens preambles, resulting in the idle listening reduction. However, from time to time RATS sends time-synchronization frames with the worst case preamble to ensure proper working of OLS, causing unnecessary idle listening. Additionally, this solution decreases idle listening but for the cost of additional memory needed for a complex time synchronization protocol. Moreover, RATS with B-MAC is tailored for protocols where a sender is responsible for drift compensation, for example by sending longer preambles. As IEEE 802.15.4 does not permit longer preambles, receivers compensate drift. Hence, it is unclear how to adapt RATS to IEEE 802.15.4. Several time synchronization protocols address the drift prediction problem. Although they do not refer to LDC explicitly, their drift prediction methods can be used for lifetime prolongation of LDC protocols. Flooding Time Synchronization Protocol (FTSP) [10] introduces the drift prediction based on LR to increase synchronization accuracy. We already stated the main problems of LR applied to sensor nodes. Symmetric Clock Synchronization [14] estimates the relative drift to the reference clock with the weighted moving average filter. The authors use the drift estimation mainly to increase accuracy of the time synchronization protocol. It resembles slightly the approach we use for drift prediction based on the moving average. However, there are many open issues when adapting the approach [14] to LDC, mainly the calculation of prediction uncertainty required for the guard times estimation. Sensor nodes using Gradient Clock Synchronization [13] protocol repeatedly collect drift samples from their neighbours. Then, each node updates its logical clock according to the received drift samples. In that way, all nodes converge to a common clock and can predict future drift of this clock. However, this
Fig. 1.
Superframe structure of IEEE 802.15.4 in beacon mode
approach assumes that nodes receive repeatedly frames from neighbours, whereas in IEEE 802.15.4 (beacon mode) only the coordinator sends beacons. Moreover, energy consumption of additional neighbour frames cannot be neglected. Several research works provide empirical drift data of sensor nodes. An indoor 3-minute experiment of Berkeley Motes shows the drift distribution appears Gaussian [6]. Ref. [14] provides empirical data of clock drift of TinyNode [4] hardware platform in an indoor environment only. Ref. [7] evaluates empirically clock drift in indoor and outdoor scenarios. However, the longest outdoor scenario lasted 26 hours only and the temperature varies from 17 to 27 degree Celsius. As these experiments do not provide long-term drift data, we carried out 2-week experiments with constant and changing temperature, up to 50 °C. III. IEEE 802.15.4 A. Architecture In this paper we coupled drift compensation approaches with IEEE 802.15.4 MAC protocol. In general, IEEE 802.15.4 works in 2 modes: with and without beacons. We considered the beacon mode here. There are two device types in IEEE 802.15.4: full-function device (FFD) and reduced-function device (RFD). The latter ones does not provide some features, e.g. RFD cannot operate as a coordinator. A single IEEE 802.15.4 network, called personal area network (PAN), forms a star topology of a coordinator in the center and a few sensor nodes around. Typically the coordinator has larger energy resources than sensor nodes, as it periodically sends beacons. The coordinator defines in each beacon the following communication period, i.e. the contention period length and the time slot allocation. Upon the beacon reception nodes can access the channel, either in contention phase or in time slots, see Figure 1. Nodes can form more complex topologies, e.g. a tree, by connecting several PANs. In this case, some nodes serve as gateways between different PANs. B. Low duty cycle To keep the duty cycle at a low level, each node sleeps most of the time, the inactive phase in Figure 1, and wakes up at tnext to receive the next beacon and to send/receive data thereafter: tnext
=
tlast + Tbeacon
(1)
where tlast is the reception time of the last beacon and Tbeacon the beacon period (protocol parameter).
number of trials [%]
3
50
30
1
0 -20
10
number of trials [%] number of trials [%]
-10
0
1
10
0
10
-10 0 clock drift [ticks/minute]
20
1
10
0 -20
10
0
0
-10 0 clock drift [ticks/minute]
20
1
10
0
10 10
0
0
20
1
10
0
10 20
-30
20
0
-30 -20 -10
0
-30 -20 -10 clock drift [ticks/minute]
0
node E
2
30
-20 -10
-10
-10 0 10 clock drift [ticks/minute]
node D
2
30
-30 -20 -10
-20 -10 clock drift [ticks/minute]
0 0
Indoor scenario: drift distribution among all examined nodes; magnification in the right upper corners; 1 clock tick = 30.5 µs
30
node A
2
20 10
node B
2
0
30
0
node D
2
20
30
0
10
-20 -10
0
-20 -10 0 clock drift [ticks/minute]
30
1
0
10 10
0
-10
0
10 20
-10 0 10 clock drift [ticks/minute]
20
node E
2
20
1
node C
2
10 0
10 20 30
10 20 clock drift [ticks/minute]
30 20
1
10 0
1
10 0
0
30 20
1
0
number of trials [%]
20
node C
2
30
20
0
Fig. 3.
node B
2
30
40
0 -20
Fig. 2.
node A
2
0
0
0
10 20 30
10 20 clock drift [ticks/minute]
30
0
0
0
10 20 30
10 20 clock drift [ticks/minute]
30
Outdoor scenario: drift distribution among all examined nodes; magnification in the right upper corners
The standard mentions that MAC layer needs to deal with clock drift, but does not provide any solution. However, as coordinators (senders) must use fixed-size preambles and rigid beacon times, they cannot compensate drift. Therefore, sensor nodes (receivers) compensate drift by waking up earlier or later in order not to miss beacons. IV. OLS DRIFT
COMPENSATION
As clock drift is assumed to be stable over a short time [10], [7], nodes predict the reception time of the next beacon by applying linear regression, e.g. ordinary least squares (OLS) method, on previous drift observations. Thus, each node stores n previous samples < b, rx >; b is the beacon sequence
number (contained in the beacon) and rx the beacon reception time. According to OLS each node estimates the reception time of the next beacon as: (2)
tnext = β1 · b + β0 1
where b is the expected beacon sequence number and β1 , β0 OLS parameters: P P P n ni=1 bi rxi − ni=1 bi ni=1 rxi (3) β1 = P P 2 n ni=1 b2i − ( ni=1 bi ) (4) β0 = rx ¯ − β1¯b 1 As the sequence number is only 8-bit value, a special care must be taken when the value overlaps
4
where ¯b, rx ¯ are the average values of the beacon sequence numbers and the corresponding rx times of previous n observations. Clearly, the predicted next wake up time may not be accurate enough, causing the node to miss the beacon. Thus, ref. [7] introduces confidence bands (guard times) around tnext : tnext ± [∆ · SE(tnext )] (5) where SE(tnext ) is the standard error of the predicted value and ∆ the scaling factor obtained empirically, e.g. during an initialization phase, to compensate prediction and estimation errors. We extend the mentioned OLS approach and redefine ∆ as the factor needed to compensate drift of predefined amount of frames, referred to as rx rate. The rationale behind this is the fact that the majority of frames (approx. 99%) are compensated with short guard times, i.e. with small ∆. On the contrary, drift compensation of all frames requires very long guard times and increases idle listening. Therefore, nodes using OLS can deliberately give up the reception of 1% frames but use very short guard times and decrease idle listening. Our experiments revealed that ∆ does not vary among sensor nodes and can be either discovered during the initialization phase or estimated before deploying the nodes. For example, in the outdoor scenario ∆ of 99% rx rate varied from 2.7 to 3.1 among 5 evaluated nodes. In general, to achieve a high OLS accuracy nodes collect previous drift samples and must not miss any beacon. Thus, they use the worst-case guard times for some beacons, causing idle-listening. However, we found out that OLS still predicts future drift very accurately (i.e. the standard deviation of drift prediction was even 1 clock tick / minute indoors), if it uses short guard times and misses some beacons (1% in our experiment). Although the adapted OLS shortens guard times considerably, see evaluation results later, it causes several problems when implemented on sensor nodes. OLS requires an emulation of floating-point arithmetic on microcontrollers. When using single precision the truncation error can vary from +/17us to +/- 17.7 ms according to [7]. When using more accurate, i.e. double-precision operations, OLS may take even 120ms [7]. Moreover, floating-point module and operations need additional memory, which is very limited on sensor nodes. V.
MOVING AVERAGE DRIFT COMPENSATION
(MADC)
A. Drift compensation Similarly to OLS, nodes using MADC estimate future drift and its uncertainty in order to calculate guard times for the following beacon. Firstly, each node predicts future drift δavg to the coordinator by applying the moving average filter to the previous n beacon rx times rxi : Pn (rxi+1 − rxi ) (6) δavg = i=1 n · Tbeacon
where i denotes the sample index starting from the oldest one. On sensor nodes we approximate Eq. 6 using 16-bit integers only, which is accurate enough for MADC. Then, nodes estimate the next wake up time tnext to receive a beacon: tnext
= tlast + Tbeacon · δavg
(7)
As run-time drift may vary from the predicted value δavg , nodes compensate it by using guard times based on the drift jitter κ (expressed in ppm) as: tnext ± (m + 1) · κ · Tbeacon
(8)
where m is the number of consecutive missed beacons. According to Eq. 8 nodes use longer guard times upon missing a beacon. B. Initialization phase If the drift jitter κ does not vary among nodes, as in our experiment, nodes can use the value estimated before deploying. Otherwise nodes must discover empirically the jitter needed to receive predefined amount of frames, e.g. during the initialization phase. We introduce an algorithm for the jitter discovery that does not need storing previous drift samples. It consists of the following steps: 1) Γ-array contains rx counters for predefined jitter values from κmin to κmax ; each node fills the array with zeros at the beginning. 2) Nodes use the worst-case guard time to receive as many beacons as possible. Upon receiving a beacon nodes increment the counter for all jitters κ that compensated current drift according to Eq. 8., i.e. Γ[κ]++ 3) after receiving the predefined number of beacons Φ each node finds min(κ) : Γ[κ] Φ ≥ ψ, where ψ is the desired rx rate. VI. E XPERIMENT We examined relative drift between sensor nodes and a sink, which includes all factors affecting time uncertainty (e.g. the time needed to power up the transceiver that may be not completely constant; similar reasoning holds true for software execution). As clock drift depends on environmental conditions, e.g. temperature, pressure, we carried out two experiments: one with constant and one with changing temperature. We deployed 5 tmote sky [11] sensor nodes in our office environment, referred to as indoor experiment. After that, we started another experiment with 5 tmote sky sensor nodes exposed to sunlight and varying temperature. However, the sink temperature was constant throughout the experiment. In this way, we obtained drift measurements for various temperature differences between the sensor nodes and the sink. We refer to this experiment as outdoor. A. Description Each node sent a beacon incl. the current temperature every 60 seconds. We connected one node - the sink - to a logging computer. Upon receiving a beacon the sink recorded the
100
received messages [%]
received messages [%]
5
95 node A node B node C node D node E
90 85 80
Fig. 4.
0
5
10 drift window [ticks]
15
20
100 95 node A node B node C node D node E
90 85 80
0
5
10
15 20 25 drift window [ticks]
30
35
40
Amount of received frames in various drift windows, i.e. with guard times of various length; indoors (left) and outdoors (right)
reception time using its local hardware clock to obtain precise results. The sink forwarded the reception time together with the address of the beacon sender and the node temperature to the logging computer. The sink was constantly powered on and we deployed all nodes in a close vicinity of the sink (i.e. one-hop network). In this way the sink received beacons of all nodes. Since the sink forwarded all reception times to the computer, we did not have problems with limited storage capacity and recorded measurements for two weeks with a high frequency. The sink recorded drift samples with a frequency once a minute for each node, resulting in total of approx. 200,000 drift samples for both experiments. We use these drift samples to evaluate various drift compensation approaches in the next section.
case sink received 99% messages within a drift window of 40 ticks outdoors, i.e. 8x smaller that the worst case, see Figure 4. However, to receive the remaining frames (less than 1%) nodes needed much longer guard times, i.e. more than 300 ticks. VII. E VALUATION We based the evaluation on the relative drift samples collected during our indoor and outdoor experiments. In this way, we considered all factors that influence drift (e.g. latencies in transceiver power up/down, software execution, oscillator drift). A. MADC vs. OLS
B. Results Tmote sky uses a crystal oscillator of 32.768 kHz frequency with drift of +/- 20 ppm. Thus, theoretically nodes need a guard time of approx. 80 ticks (2.4 ms) to compensate worst drift of a 1-minute period. However, we discovered that some frames (less than 1%) were received with drift few times worse (more than 300 ticks) than the theoretical worst case. It shows that not only the inaccuracy of crystal oscillator affects relative drift, but also other factors (e.g. jitter in times needed to power up radio, software execution time, etc.). Our indoor experiment confirmed that the drift distribution appears Gaussian, see Figure 2. However, it does not hold true for outdoor environments, see Figure 3. The reason for that is the influence of the changing temperature on clock drift. In the indoor experiment the nodes temperature was constant, about 25 °C. However, in the outdoor experiment the temperature changed from about 20 °C (during nights) to more than 50 °C (during daytime). As the sink was not exposed to sunlight, its temperature was constant, about 25 °C. Due to temperature variation, drift among the nodes and the sink changed. Therefore, the drift distribution outdoors is not symmetric and wider than the distribution of the indoor environment, compare Figures 2 and 3. As already stated, the sink received all frames within a very large window, i.e. even 300 ticks/minute. However, the analysis of the drift distribution revealed that most messages were received within a very small drift window, i.e. less than 10 ticks in the indoor experiment (30x smaller than the worst case), see Figure 4. We discovered that this holds true also for outdoor environments with changing temperature. In that
To examine how accurate both approaches - MADC and OLS - predict future drift, we estimated the standard deviation σ of drift prediction, i.e. the difference from real drift to the predicted one. In the indoor environment we observed very small differences between MADC and OLS, see Figure 5. On nodes A, C and D both approaches achieved very similar results. OLS predicted drift more accurate on node E, whereas MADC was better on node C. However, these differences are negligible, i.e. σ difference was smaller than a clock tick. In general, for small sample windows MADC and OLS achieved similar results in the outdoor environment, see Figure 6. However, on 3 out of 5 nodes we noticed that accuracy of OLS prediction got worse with the increasing number of considered drift samples. For example, σ on node E with 7 previous samples was 2 ticks. Changing the number of previous samples to 20 resulted in almost 5 ticks σ! We explain it as follows. As clock drift is assumed to be stable over a short time [10], [7], nodes can predict it very precisely using linear regression. In other words, linear regression achieves precise results, if drift was stable in the past. However, as on some nodes (A, D, E) in the outdoor scenario drift was not stable over long periods (10 minutes and more), OLS did not predict drift precisely in these cases. On the contrary, the moving average filter does not suffer from this problem. Therefore, MADC achieved high prediction accuracy on all examined nodes indoors and outdoors. Moreover, on some nodes outdoors the prediction of MADC was more accurate that the OLS. For example, on node D σ of MADC was approx. a tick (more that 17 samples considered), whereas σ of OLS was 3 ticks and more, see Figure 6.
6
std deviation [ticks]
10 8
8
6
4
4
4
2
2
2
0
0
2
4
6
8 10 12 14 16 18 20 sample window
std deviation [ticks]
10
2
4
6
node C
8
6
8 10 12 14 16 18 20 sample window
0
2
4
6
8 10 12 14 16 18 20 sample window
10 node D
8
6
4
4
2
2 2
4
6
node E
8
6
8 10 12 14 16 18 20 sample window
0
2
4
6
8 10 12 14 16 18 20 sample window
The prediction accuracy of moving average (MADC) and ordinary least squares (OLS) in the indoor scenario
std deviation [ticks]
10
10 MADC OLS
node A
8
8 6
6
4
4
2
2
2
2
4
6
8 10 12 14 16 18 20 sample window
0
4
6
8 10 12 14 16 18 20 sample window
0
2
4
6
8 10 12 14 16 18 20 sample window
10 node D
8
6
4
4
2
2 2
4
6
node E
8
6
0
2
node C
8
4
10
std deviation [ticks]
10 node B
6
0
Fig. 6.
10 node B
6
0
Fig. 5.
10 MADC OLS
node A
8 10 12 14 16 18 20 sample window
0
2
4
6
8 10 12 14 16 18 20 sample window
The prediction accuracy of moving average (MADC) and ordinary least squares (OLS) in the outdoor scenario
TABLE I C OMPLEXITY OF A SINGLE DRIFT PREDICTION WITH n PREVIOUS DRIFT SAMPLES . MADC WORKS WITH INTEGER VALUES , WHEREAS OLS REQUIRES FLOATING - POINT (FP) OPERATION , I . E . IT TAKES LONGER , CONSUMES MORE ENERGY AND NEEDS FP ARITHMETIC MODULE .
MADC OLS
ADD n+1 7n-2
SUB n-1 3n+4
MUL 4 5n+5
DIV 1 4
SQRT 0 1
Although MADC achieves similar results to OLS indoors, and even better results on some nodes outdoors, it requires less resources than OLS (e.g. MADC works without a floatingpoint arithmetic module). In addition, it uses fewer operations
to predict the drift. Table I depicts the number of operations needed for a single drift prediction. MADC works well with integer values, whereas OLS needs floating-point arguments for mathematical operations, causing a longer computation. B. Impact of samples history Ref. [7] discovered that OLS achieves the most accurate drift prediction with the history window size of 8 previous samples (1-minute sampling period). However, our experiments did not confirm the statement. On the contrary, we discovered that there is no optimal history window in indoor environments, see Figure 5. In general, the more samples nodes consider, the more accurate the prediction is. For
4 3 2 1 0 -1 -2 -3
MADC OLS
0
5
10
15
20
25
30
35
40
idle listening per frame [ticks]
difference to optimal value [ticks]
7
45
4.5 indoor MADC 4 indoor OLS 3.5 3 outdoor MADC outdoor OLS 2.5 2 1.5 1 80 82 84 86
initialization phase length [hour]
Fig. 7. Time needed to estimate jitter windows/scaling factor; average among 5 examined nodes outdoors TABLE II J ITTER WINDOWS (MADC) AND SCALING FACTORS (OLS) NEEDED TO COMPENSATE DRIFT OF 99% MESSAGES
indoor MADC outdoor MADC indoor OLS outdoor OLS
1 2 5 1.7 3.1
2 2 6 1.4 3.0
node 3 4 4 1.8 3.0
4 3 4 1.1 2.9
5 4 4 2.2 2.7
example, on node B σ of OLS with 3 previous samples was 5 ticks. Doubling the number of previous samples decreased σ by a half. Only on some nodes in the outdoor scenario we discovered the optimal sample window. For example, node A achieved best results with 10 previous samples, but node E with 7 samples, see Figure 6. Thus, we claim that the statement of [7] about the the optimal samples window for drift prediction is too general and cannot be applied to sensor networks. In general, prediction accuracy is higher with the increasing number of past drift samples. However, there is a limit of prediction accuracy, i.e. any increase in the number does not improve the prediction. For example, in the indoor scenario node A predicted drift very accurate - σ of approx. 1 tick with only 6 previous samples, see Figure 5. Any increase in the samples history did not improve prediction accuracy.
88
90
92
94
96
98
100
received messages %
Fig. 8.
Average idle listening per frame vs. reception rate
when nodes prolong guard times, they increase idle listening. We examined the relation between rx rate and idle listening and present the average values of 5 nodes in Figure 8. Both approaches cause less than 1.5 tick (45us) idle listening per frame when supporting 80% rx rate and less. Nodes achieve higher rx rates when using longer guard times, causing only slightly longer idle listening. For example, MADC achieves 99% rx rate and causes only 3 ticks idle listening indoors. On the contrary, the approach based on the worstcase guard times causes on average 150 ticks idle listening / frame, but compensates drift of all frames. We discovered that OLS causes shorter idle listening than MADC. For instance, for 99% rx rate OLS causes 1.8 ticks idle listening indoors (MADC 3) and 3.6 ticks outdoors (MADC 4.3). Thus, although MADC may predict future drift more accurately than OLS, especially outdoors, it causes longer idle listening. The reason for that is the estimation of guard times. OLS uses guard times of various length according to the standard error of prediction, see Eq. 5. In other words, if nodes predicted drift accurately in the past, they use short guard times. On the contrary MADC uses guard times of fixedlength, even when the prediction was accurate. As a result it uses longer guard times than OLS for some frames and incurs longer idle listening. However, such small differences in idle listening have almost no impact on the lifetime, see next paragraph.
C. Initialization phase Table II presents the optimal values of jitter windows (MADC) and scaling factors (OLS) that compensate drift of 99% messages. These values were obtained by considering all drift samples. We examined the algorithm of the initialization phase, i.e. estimation accuracy of jitter windows/scaling factors. For OLS we used the same algorithm as for MADC, presented in section V-B. After 10 hours of initialization phase MADC and OLS discovered jitter windows/scaling factors very precisely, i.e. within +/- 1 tick margin, see Figure 7. However, after 20 hours the estimated jitter windows of MADC got worse. This sudden change is caused by large clock drift on some nodes in the time interval between 2025 hours. It shows that there is a risk of the jitter windows overestimation, which may lead to longer guard times. D. Rx rate vs. idle listening In general, the longer guard times nodes use, the less messages they miss due to not compensated drift. However,
E. Lifetime 1) Model: We applied our analytical model introduced in [2] to evaluate the lifetime gain of MADC and OLS. Moreover, ref. [2] defines also about 30 hardware and protocol parameters (e.g. current consumption, self-discharge of batteriers, beacon period) that we considered in this evaluation. As already mentioned, relative drift between nodes stems not only from the crystal oscillator inaccuracy, but also from other factors (e.g. time to power up the radio is not constant). Our experiments revealed that the sink received some frames with drift jitter 300 ticks / minute; corresponds to approx. 75 ppm. We use this drift value for the lifetime estimation of the approach based on worst-case drift. After evaluation of drift measurements outdoors we discovered that MADC and OLS cause on average (calculated among 5 examined nodes) 131us and 110us idle listening per frame due to guard times (beacon period of 1 minute, 99% reception rate, 6 samples history). It corresponds to relative
3.4 3.2 3 2.8 2.6 2.4 2.2 2
lifetime [years]
lifetime [years]
8
MADC OLS worst drift 0
20
40
60
80
100
120
140
160
180
beacon period [seconds]
(a) Receiving beacons from one node only Fig. 9.
3.4 3.2 3 2.8 2.6 2.4 2.2 2
MADC OLS worst drift 0
20
40
60
80
100
120
140
160
180
beacon period [seconds]
(b) Receiving beacons from two nodes
Lifetime of nodes with various drift compensation approaches
drift (between nodes and the sink) of 2.18 ppm and 1.83 ppm respectively. 2) Results: As OLS and MADC shorten the guard times for each received beacon, they minimize idle listening, reduce energy consumption and prolong the lifetime. For example, OLS and MADC achieve a 5% lifetime gain against the approach based on worst-case drift for a beacon period of 60 seconds, see Figure 9a. In that case nodes work 3.2 years with OLS or MADC and 3.05 years with the worst-case drift approach. IEEE 802.15.4 allows complex network topologies by combining several Personal Area Networks (PANs). Thus, some nodes serve as gateways between various PANs. Such gateways receive beacons from several PANs. We examined a gateway connecting two PANs, i.e. receiving beacons from two PAN coordinators. In this example, the gateway works 2.84 years when using the solution based on worst-case drift (1-minute beacon period), see Figure 9b. However, when the gateway replaces the worst-case solution with OLS or MADC, it prolongs the lifetime by 10%, i.e. it works 3.12 years. Our previous results revealed that OLS causes shorter idle listening (1.8 ticks / frame indoors) than MADC (3 ticks / frame). Obviously, MADC wastes more energy than OLS due to longer idle listening and thus shortens the lifetime. However, the lifetime difference of both approaches is negligible. For example, OLS achieves 3.203 years lifetime indoors for 1minute beacon period and MADC 3.202 years, see Figure 9a. Although nodes using OLS and MADC prolong the lifetime considerably against the solution based on worst-case drift, they miss approx. 1% frames due to not compensated drift. Nonetheless, we are convinced that in many sensor network applications the benefits of the lifetime gain (5% and more for MADC/OLS) are more significant than the loss of 1% frames. VIII. C ONCLUSION In this paper we presented the results of two-week drift experiments indoor and outdoor. Our key finding is that nodes compensate drift of most frames with very short guard times even when the temperature changes, i.e. 99% of frames compensated with guard times 8x smaller than the worst case. Thus, if nodes use such short guard times, they reduce idle listening and miss only a few frames. To achieve long lifetimes in low duty cycle protocols nodes need to shorten guard times by applying a drift prediction method, i.e. linear regression (LR). We presented an alternative approach based on moving average (MADC). Although
MADC is simpler than LR, it predicts drift as accurate as LR in the indoor environment. Moreover, MADC achieved more accurate drift predictions than LR on some nodes outdoors. However, MADC does not need floating-point arithmetic and therefore fits well to computation- and memory constrained sensor nodes. By applying MADC to IEEE 802.15.4 nodes extend the lifetime by 5% for 60-second beacon period. Moreover, if nodes receive beacons from two neighbours, they work approx. 3 months longer (10% lifetime gain) than the approach based on the worst-case guard times. Although we coupled MADC with IEEE 802.15.4 MAC, other protocols can also lower the duty cycle and prolong the lifetime by applying MADC. Moreover, any time synchronization protocol that uses LR methods, e.g. FTSP [10], can replace it with MADC and reduce the overhead in terms of computation and memory occupation. R EFERENCES [1] M. Brzozowski, H. Salomon, and P. Langendoerfer. Completely distributed low duty cycle communication for long-living sensor networks. In Proceedings EUC 2009. [2] M. Brzozowski, H. Salomon, and P. Langendoerfer. Limiting end-to-end delays in long-lasting sensor networks. In Proceedings MobiWac 2010. [3] N. Burri, P. von Rickenbach, and R. Wattenhofer. Dozer: ultra-low power data gathering in sensor networks. In Proceedings IPSN 2007. [4] H. Dubois-Ferrière, L. Fabre, R. Meier, and P. Metrailler. Tinynode: a comprehensive platform for wireless sensor network applications. In Proceedings IPSN 2006. [5] A. El-Hoiydi and J.-D. Decotignie. Wisemac: An ultra low power mac protocol for multi-hop wireless sensor networks. In Proceedings ALGOSENSORS 2004. [6] J. Elson, L. Girod, and D. Estrin. Fine-grained network time synchronization using reference broadcasts. ACM SIGOPS 2002, 36, 2002. [7] S. Ganeriwal, D. Ganesan, H. Shim, V. Tsiatsis, and M. B. Srivastava. Estimating clock uncertainty for efficient duty-cycling in sensor networks. In Proceedings SenSys 2005. [8] IEEE Standard for Information Technology. Specific requirements Part 15.4: Wireless MAC and PHY, 2006. [9] G. Lu, B. Krishnamachari, and C.S. Raghavendra. An adaptive energyefficient and low-latency MAC for tree-based data gathering in sensor networks. Wireless Communications and Mobile Computing, 7, 2007. [10] M. Maróti, B. Kusy, G. Simon, and Á. Lédeczi. The flooding time synchronization protocol. In Proceedings SenSys 2004. [11] Moteiv Corporation. Tmote Sky Ultra low power IEEE 802.15.4 compliant wireless sensor module http://www.sentilla.com, 2006. [12] T. Schmid, J. Friedman, Z. Charbiwala, Y.H. Cho, and M.B. Srivastava. Low-power high-accuracy timing systems for efficient duty cycling. In Proceeding ISLPED 2008. [13] P. Sommer and R. Wattenhofer. Gradient clock synchronization in wireless sensor networks. In Proceedings IPSN 2009. [14] P. Sommer and R. Wattenhofer. Symmetric clock synchronization in sensor networks. In Proceedings REALWSN 2008. [15] W. Ye, J. Heidemann, and D. Estrin. An energy-efficient mac protocol for wireless sensor networks. In Proceedings INFOCOMM 2002.