I Introduction
Time synchronization for wireless sensor networks (WSNs) has been extensively studied in the last decades as the number of WSN deployments has been gradually increasing over the period [1, 2, 3].
Because many existing time synchronization schemes rely on sensor nodes’ broadcasting synchronization messages received from a root node (i.e., flooding) to achieve networklevel time synchronization (e.g., [4, 5]), additional computation and energy consumption are imposed on the resourceconstrained sensor nodes which are already loaded with tasks including medium access control (MAC) protocol, message scheduling and routing, and data measurement. The Flooding Time Synchronization Protocol (FTSP) [4]
, which is a benchmark among WSN time synchronization schemes, is a typical example of floodingbased time synchronization schemes, where the energy consumption caused by the layerbylayer broadcasting and the computational complexity of estimating the clock skew and offset could be high for batterypowered, lowcost sensor nodes.
To address the high computational complexity of estimating the clock skew and offset to achieve microsecondlevel accuracy in FTSP, the Ratiobased time Synchronization Protocol (RSP) has been proposed based on the periodical oneway synchronization message dissemination and a lightweight procedure for the estimation of clock parameters [6]. In RSP, additional thresholds and procedures are introduced to reduce the impact on the clock parameter estimation of the numerical errors by the limited floatingpoint precision (i.e., 32bit floatingpoint numbers) of the resourceconstrained sensor nodes. However, like FTSP, RSP also relies on the periodical broadcasting of the synchronization messages and, therefore, is not energy efficient in terms of message transmissions by sensor nodes. Another wellknown WSN time synchronization scheme is the Timingsync Protocol for Sensor Networks (TPSN) [7], which is based on the twoway message exchange requiring additional response message along with the beacon message. Considering that the schemes based on the twoway message exchange could achieve higher accuracy in principle by compensating for propagation delay, however, TPSN’s synchronization error of tens of microseconds is quite high even compared to that of the schemes based on oneway message dissemination. In case of the Reference Broadcast Synchronization (RBS) [8], because it requires not only additional reference nodes to broadcast the common clock time but also additional message exchanges between the sensor nodes to estimate their relative time differences, it is also not energyefficient and proper for resourceconstrained sensor nodes. Aiming at conserving the energy consumption through reducing message transmissions for the synchronization procedures, the authors of [9] proposed the EnergyEfficient and rapid Time Synchronization (EETS). Although EETS could reduce the message transmissions between neighboring levels in a hierarchical network, it still strongly relies on the broadcasting of the synchronization messages to achieve networklevel time synchronization. Also, because the energy efficiency of EETS is indirectly evaluated through the number of message transmissions using simulations, its actual energy consumption could be different on real sensor nodes.
The authors of [10] proposed a novel energyefficient time synchronization scheme based on the reverse twoway message exchange and demonstrated through simulation experiments that submicrosecondlevel synchronization accuracy could be achieved. Still, the computational precision required by their scheme (i.e., the precise division of the floatingpoint numbers) is beyond the capability of most resourceconstrained sensor nodes equipped with a lowcost MicroController Unit (MCU) providing only 32bit floatingpoint as discovered in [11]. The idea of the reverse twoway message exchange together with message bundling for synchronization and measurement data, however, could be applied for designing more advanced energyefficient time synchronization schemes targeting resourceconstrained sensor nodes because it can greatly reduce the number of message transmissions by sensor nodes.
In this paper, we present the reverse asymmetric time synchronization framework illustrated in Fig. 1 and propose the Beaconless Asymmetric energyefficient Time Synchronization (BATS) scheme specifically based on the reverse oneway message dissemination shown in Fig. 1 (a). In the proposed framework, all the synchronization procedures are moved from sensor nodes to the head^{1}^{1}1The head node and the monitoring station (i.e., a PC or a workstation for data processing) connected to it locally or remotely over the Internet are collectively called the head in this paper. as in [11], and application messages (e.g., for reporting measurement data to the head) carry synchronizationrelated data as well. In addition, BATS does not rely on the “Beacon/Request” messages as shown in Fig. 1 (a), thereby saving energy for their transmissions and receptions at sensor nodes, the latter of which often consume more energy [12]. The proposed scheme is designed to address the three major challenges in WSN time synchronization on resourceconstrained sensor nodes, i.e., achieving high synchronization accuracy, reducing energy consumption [13] and lowering computational complexity [14].
Based on the reverse asymmetric time synchronization framework and the oneway message dissemination, the proposed BATS scheme combines in a unique way the advantages of several existing WSN time synchronization schemes: Being based on the oneway message dissemination, BATS can take the advantage of simpler implementation compared to those based on the twoway message exchange. Unlike the conventional schemes based on the oneway message dissemination including FTSP, however, BATS is optimized for energy efficiency by reversing the flow of synchronization messages from “headsensor nodes” to “sensor nodeshead”, which is the key idea of the reverse asymmetric time synchronization framework. The reverse asymmetric time synchronization framework, on the other hand, is a generalization of the schemes we have proposed in [10] and [11] and belongs to a broader category of reactive time synchronization protocols [15], where sensor nodes’ local clocks, which are not synchronized to a common reference, are used to timestamp events; synchronization takes place after the event has been detected. However, BATS is also different from the existing reactive time synchronization protocols like Routing Integrated Time Synchronization protocol (RITS) [5] in its multihop extension, where, unlike RITS, there is no layerbylayer time translation at gateway nodes along a multihop path; instead, the said time translation is completely moved to the head to relieve the burden of the gateway nodes.
Note that the actual energy consumption and synchronization accuracy of the proposed scheme are evaluated and analyzed through experiments on a real WSN testbed in this paper. To the best of our knowledge, this is the first work that shows the actual performance of energyefficiency of the highprecision time synchronization schemes on resourceconstrained sensor nodes through real experiments.
The rest of the paper is organized as follows: In Section II, the related work including the time synchronization scheme proposed in [10] based on reverse twoway message exchange and the conventional time synchronization schemes based on oneway message dissemination is discussed. Section III presents the proposed BATS scheme based on the reverse oneway message dissemination. Section IV discusses the multihop extension of BATS scheme with a focus on the issue of communication overhead. The results of the performance evaluation of BATS scheme in terms of energy consumption and synchronization accuracy on a real testbed are presented in Section V. Section VI concludes our work in this paper and highlights the future work.
Ii Related Work
Iia Time Synchronization Based on Reverse TwoWay Message Exchange
Aiming at providing highprecision time synchronization for an asymmetric WSN with a head equipped with abundant computing and power resources and multiple resourceconstrained sensor nodes (e.g., powered by standalone batteries and equipped with lowcost MCUs), the authors of [10] proposed an energyefficient time synchronization scheme based on the asynchronous source clock frequency recovery (SCFR) and the reverse twoway message exchange shown in Fig. 1 (b), which we call it EEASCFR in short from now on. In EEASCFR, the estimation of the clock offset and frequency ratio is separated into the head and the sensor node to reduce the computational complexity of the latter where a logical clock is maintained based on the estimated clock frequency ratio. Although the broadcasting of the beacon messages is still required, the number of message transmissions at sensor nodes is reduced through bundling several measurement data together with synchronization data in a “Report/Response” message. Compared to BATS, parts of the time synchronization procedures—i.e., the estimation of the clock frequency ratio and the maintenance of the logical clock based on it—are still done at sensor nodes in EEASCFR.
Since the hardware clocks of sensor nodes based on lowcost crystal oscillators run independently at different clock frequencies and offsets with respect to those of the reference clock, which is the hardware clock of the head in [10], the hardware clock of a sensor node for a node WSN (i.e., ) can be described by the affine clock model as follows:
(1) 
where is the reference clock time, and and are the clock frequency ratio and the clock offset, respectively. The aforementioned logical clock maintained at the sensor node is described in terms of the hardware clock as follows [10]: For (),
(2) 
where is the reference time for the th synchronization, and and are the clock skew and offset of the sensor node estimated during the th synchronization. Note that, since the estimation of the offset and frequency ratio is separately done at the head node and the sensor node in EEASCFR, the is set to 0 in (2) for the logical clock at the sensor node, which means that the logical clock is synchronized to the reference clock in frequency but runs with a different offset.
As for the frequency ratio in (1), due to the use of the cumulative ratio (CR) estimator of the asynchronous SCFR scheme proposed in [16] and the reverse twoway message exchange, it is estimated as where and are the timestamps recorded during the initial beacon message transmission at the head and its reception at the sensor node, respectively, and and are the timestamps corresponding to the latest beacon message. The time points of recording the timestamps and are shown in Fig. 1 (b).
Of particular note is that the second term in (2)—i.e., —for the logical clock update requires the division by the frequency ratio, instead of multiplication, unlike the time synchronization schemes based on conventional twoway message exchange. Considering the microsecondlevel timestamps involved in the calculation, this division may cause significant numerical computation error due to the limited floatingpoint precision in the resourceconstrained sensor nodes embedded with lowcost MCU as discussed in [6] and [11].
IiB Time Synchronization Based on OneWay Message Dissemination
Compared to the time synchronization schemes based on the twoway message exchange, those based on the oneway message dissemination have simpler synchronization procedures as shown in Fig. 2 (a) (i.e., conventional one) and Fig. 1 (a) (i.e., reverse one). As a representative example of the time synchronization schemes based on the oneway message dissemination, here we discuss the details of FTSP, whose implementation is available as part of the standard TinyOS library [17], and identify issues in its implementation on resourceconstrained WSN sensor nodes.
In FTSP, the linear regression is used to estimate the clock frequency ratio and offset, i.e., the slope and the intercept of the regression line. However, due to the limited computing resources of the sensor node, FTSP limits the number of timestamp samples used for the least squares estimation of the slope and intercept: Specifically, past 8 timestamp values are employed for all different synchronization intervals (SIs) during the performance evaluation in
[4]. In addition to the linearleastsquaresbased clock frequency ratio and offset estimation, the timestamping procedure of FTSP records multiple timestamps—i.e., timestamps at each byte boundary after the SYNC bytes as shown in Fig. 3—in sending and receiving a synchronization message to reduce the jitter of the interrupt handling and encoding/decoding times, which is also quite demanding for resourceconstrained sensor nodes [4].The authors of [6] proposed RSP, which is also based on the flooding of synchronization messages but simplifies the estimation of the clock skew and offset. In case of the head and the sensor node shown in Fig. 2 (a), their hardware clock times (i.e., for the head and for the sensor node) modeled in (3) can be described as follows:
(3) 
where and are the clock frequency ratio and the clock offset of the reference clock with respect to the sensor node hardware clock, respectively. Let and () be the timestamps corresponding to the latest Beacon/Request message received at the sensor node. Then, the logical clock at the sensor node —i.e., the estimated reference time corresponding to the sensor node’s hardware clock—is obtained as follows [6]:
(4) 
where and
are the clock frequency ratio and the clock offset estimated based on the linear interpolation using four timestamps, i.e.,
(5)  
(6) 
IiC Impact of Limited Precision FloatingPoint Arithmetic on HighPrecision Time Synchronization
Even with the relatively simpler clock parameter estimation procedures, RSP suffers from numerical errors caused by the limited precision of the lowcost MCUs (i.e., 32bit singleprecision floatingpoint numbers) of the resourceconstrained sensor nodes: Specifically, the proposers of RSP suggest to use SI (i.e., or ) that is large enough to mitigate the impact of the numerical errors on the estimation of clock parameters in (5) and (6).
Likewise, the actual performance of EEASCFR on resourceconstrained sensor nodes turns out to be poorer than expected due to the precision loss resulting from the use of singleprecision floatingpoint numbers. In this regard, we have proposed an improved version of the scheme along with its multihop extension based on the reverse asymmetric framework and demonstrated satisfactory time synchronization accuracy on a real WSN testbed [11].
It is worth mentioning that the use of 32bit singleprecision floatingpoint format is common not only for the resourceconstrained sensor node platforms (e.g., TelosB [12] and MicaZ [18]) but also for the lightweight Arduino boards [19], which are frequently used as hardware platforms for Internet of Things (IoT) prototyping as discussed in [20].
Iii EnergyEfficient Time Synchronization Tailored for ResourceConstrained Sensor Nodes
When the propagation delay is not significant (e.g., submicrosecond delays for WSNs with a communication range of or less), time synchronization schemes based on the oneway message dissemination have a clear advantage over those based on the twoway message exchange in terms of the number of message transmissions at sensor nodes. Still, the schemes based on the oneway message dissemination have issues in their implementation on resourceconstrained sensor nodes as discussed in Sec. IIB. Here we introduce BATS—i.e., the energyefficient time synchronization scheme based on the reverse oneway message dissemination—which addresses the implementation issues of the onewaymessagedisseminationbased time synchronization schemes on resourceconstrained sensor nodes.
Iiia Impact of Precision Loss on the Performance of OneWayMessageDisseminationBased Time Synchronization Schemes
Taking RSP as an example, which was proposed to simplify the estimation of the clock skew and offset in FTSP, we first analyze the impact of the precision loss on the performance of the onewaymessagedisseminationbased time synchronization schemes.
The impact of the precision loss on the estimated reference clock of RSP in (4) can be analyzed in a similar way to that for EEASCFR [11]: Let and be the precision loss in the estimation of the clock frequency ratio and the clock offset, i.e.,
(7)  
(8) 
where and
are the value of the clock frequency ratio and the clock offset from the practical implementation that are affected by the limitedprecision floatingpoint arithmetic in (
5) and (6). The computational error in the estimated reference clock at the sensor node at time , therefore, can be derived as follows:(9) 
(9) shows that the computational error consists of two components, the first of which is proportional to the current time of the sensor node’s hardware clock (i.e., ).
According to the IEEE standard for floatingpoint arithmetic [21], a nonzero floatingpoint number can be represented in the binary format as follows:
(10) 
where is the sign taking the value of or , is the binary fraction whose value is within the range of , and is the integer exponent. Because the IEEE 32bit singleprecision floatingpoint format assigns 1 bit to , 8 bits to and 23 bits to , the machine epsilon [22] becomes . If the rounding arithmetic is chopping (i.e., rounding towards 0), the precision loss is within the range of , and the maximum absolute precision loss in this case is . This implies that the first component of (9) alone could result in about and computational errors for of and , respectively, in the worst case.
Note that the analysis of the computational error above is based on the worstcase scenario for simplicity. As discussed in [6], however, in reality the precision loss itself is inversely proportional to SI (i.e., the time difference between two consecutive beacon messages), which could more or less relax the dependency of the computational error on . In fact, setting an optimal value of SI is quite complicated because the value of SI not only affects the computational error but also determines the impact of the sensor node’s hardware clock drift due to the changes in the ambient temperature and the battery voltage.
IiiB Beaconless Asymmetric EnergyEfficient Time Synchronization
Now we introduce BATS and show how it can address the implementation issues on resourceconstrained sensor nodes discussed in Sec. IIIA and further increase energy efficiency by saving the energy for transmissions and receptions of the “Beacon/Request” messages at sensor nodes.
As illustrated in Fig. 4, the proposed BATS scheme based on the reverse oneway message dissemination does not rely on beacon messages but utilizes only measurement data messages to carry the reversed synchronization timestamp , which results in the movement of all time synchronization procedures to the head except timestamping of . As shown in Fig. 5, the timestamping of and is triggered by an interrupt generated by the radio chip immediately after the Start Frame Delimiter (SFD) byte has been sent and received by the MAC layer of the sender and the receiver, respectively, which is similar to that of the Recursive Time Synchronization Protocol (RTSP) [23]. This timestamping approach, which is based on a pair of timestamps generated during the transmission and reception of one message, is simpler and faster than that of FTSP [23] which reduces the jitter of interrupt handling through recording, normalizing and averaging multiple timestamps at both the sender and the receiver.
In the singlehop scenario shown in Fig. 4, the head’s direct offspring nodes employ their measurement data messages to transmit their timestamps during the th synchronization to the head for maintaining the time synchronization. Using the abundant computing and power resources including the 64bit floatingpoint precision at the head, the numerical computational errors mentioned in Section. II could be avoided in the proposed scheme.
Instead of using the relatively simpler clock parameter estimation procedures of [10] and [6], we employ the original linear regression like [4] and [8] to model the relationship of the timestamps of the hardware clocks of the sensor node and the head, however, without the limitation on the number of past samples, e.g., FTSP uses only the past 8 samples. The following linear least squares method is employed in BATS to model the linear relationship between the hardware clocks of the sensor node and the head: For
(11) 
where
where is the parameter set of clock skew and offset, and denotes the synchronization.
As we will see in Section V, employing the complex linear regression solution with no limitation on the sample size for solving the linear equation of the time synchronization, could improve the performance of time synchronization compared with the conventional simpler solutions described in Section II. Furthermore, applying relatively more complex solution with higher computational complexity is the natural advantage of our reverse asymmetric framework as we operate all the estimation procedures in the head with abundant computing capability instead of the resourceconstrained sensor node.
As exhibited in Fig. 4, the direction of the conventional oneway message dissemination is reversed, where the estimation of the hardware clocks between sensor node and the head is also reversed compared to the conventional one. On the one hand, when timestamps along with measurement data from sensor nodes are gathered in the head, the corresponding hardware clock timestamps of the sensor nodes should be translated based on the head’s reference clock to estimate the exact time for the measurement events. On the other hand, optionally, when the head issues commands to notify sensor nodes to perform collaborative operations (e.g., sleep and wakeup for energyefficient MAC protocols and application of coherent sampling), the timestamps carried in the commands have to be translated to the target sensor nodes’ hardware clock time. Using the estimated frequency ratio and offset between a sensor node and the head, in singlehop scenario, the translations between their hardware clock time are represented as:
(12) 
where the translation from sensor node’s clock time to head’s clock time involved the floatingpoint division, which is similar to the clock time translation in EEASCFR. As mentioned in [24], such calculation involved with floatingpoint division and microsecondlevel timestamp should be carefully handled in the resourceconstrained sensor nodes, but BATS is not bothered by such level of computational complexity.
Iv Extension of BATS to MultiHop WSNs
Independent of the network topologies which are typically established through routing protocols (e.g., Collection Tree Protocol (CTP) [25]), the proposed BATS scheme in principle could be extended to any existing multihop routing protocols with the addition of the required timestamps in the application messages. There are several issues to consider, however, in its extension to the multihop scenario.
In the multihop scenario, gateway sensor nodes located in intermediate layers process not only their own data as regular sensor nodes but also the data from their offspring sensor nodes. The presence of gateway nodes makes it complicated for the head to directly handle all timestamps required for time synchronization in multihop WSNs.
Iva MultiHop Extension of The Time Synchronization Based On Reverse OneWay Message Dissemination
As described in [10], two possible approaches for the multihop extension of WSN time synchronization schemes based on the reverse twoway message exchange (including EEASCFR) are those of timerelaying and timetranslation at the gateway nodes. Of the two approaches, the timerelaying one could introduce more random delays as the messages from the sensor nodes are being transmitted to the head through multiple gateway nodes unlike the timetranslation one. Moreover, the random queueing delays of the synchronization messages are also not properly compensated for. To maximize the advantage of MAClayer timestamping and avoid random queueing delays cumulated through multiple gateway nodes, therefore, we use perhop time synchronization for the multihop extension of BATS, which is similar to the aforementioned timetranslation approach in which the hardware clock time of a sensor node goes through layerbylayer translation in order to estimate its time with respect to the reference clock of the head. The fundamental difference of the perhop time synchronization compared to the timetranslation approach, however, is that all layerbylayer translations are again moved from the gateway nodes to the head to relieve the burden of the gateway nodes in the original timetranslation approach. The system architecture is illustrated in Fig. 6, where the “command” is optional and the “sensor nodes” refer to both gateway and leaf sensor nodes.
We first extend the hardware clock time translation equation of (12) for the singlehop case to the multihop case where we recursively translate the hardware clock time. Consider the hardware clock time of a sensor node located at layer of the sensor network with layers: For ,
(13) 
where is the hardware clock time of the head when is equal to . And the equation when represents the layerbylayer translation using the clock frequency ratio and offset of each layer.
To translate the hardware clock time of a sensor node at layer to that based on the hardware clock time of the head (i.e., ), we go through the following recursive procedure that is to run at the head:
(14) 
where the clock frequency ratio and clock offset of each layer are all known at the head.
Note that, in the proposed perhop time synchronization, timestamps required for the synchronization of a sensor node based on the reverse oneway message dissemination are recorded at the sensor node and its gateway node (working as a reference) as shown in Fig. 4. Unlike the time translation approach described in [10], however, the time translation operation is moved from the gateway to the head, and the gateway node just sends the pair of timestamps obtained from the reverse oneway message dissemination (i.e., and ) to the head. Based on these pairs of timestamps from all the gateway nodes, the head can establish the relationships between sensor nodes and their gateway nodes and eventually translate sensor nodes hardware clock times to those based on the reference clock at the head recursively based on (13) and (14).
Using the aforementioned perhop time synchronization, BATS could be extended to cover the multihop scenario as demonstrated in Fig. 8 (b), which is different from the conventional multihop scheme based on oneway message dissemination shown in Fig. 8 (a) where the synchronization timestamps are carried by standalone beacon messages and the measurement data are transported by the standalone measurement messages. The proposed BATS does not rely on broadcasting beacon messages and embeds the synchronization timestamps into the measurement messages as in [10]. In case of the conventional schemes, there are two separate flows of messages with different directions (i.e., one for synchronization and the other for measurement), we cannot embed synchronization timestamps into the measurement messages as in the extended BATS.
IvB Comparison to Other MultiHop WSN Time Synchronization Schemes
Having discussed the multihop extension of BATS, which does not rely on beacon messages but exploits the bundling of synchronization timestamps with the measurements, we compare the extended BATS to other multihop WSN time synchronization schemes.
Since the synchronization timestamps are bundled with measurement data in the same message, consequently the major cost of using the proposed scheme is the payload occupation of the synchronization timestamp—i.e., and —on the measurement message. As exhibited in Fig. 8 (b), for hop , timestamps—i.e., and —are required for the head to achieve networkwide time synchronization. Therefore, for a flat hop network, timestamps^{2}^{2}2Because is generated at the head, there is no need of transmission. are transmitted through the measurement messages to the head. Note that, those timestamps ( and ) are also needed in the conventional scheme based on oneway message dissemination such as FTSP, however, the cost—i.e., the transmissions of the standalone synchronization messages—is much higher. Even considering that the timestamp could be kept locally in the sensor node to perform the synchronization procedures, for a flat hop network, synchronization messages which carry the timestamp have to be broadcasted for achieving overall time synchronization. Using the selfdata and alldata bundling procedure illustrated in Fig. 7, for a flat hop network with generating measurements each hop, the numbers of message receptions and transmissions for conventional scheme () and proposed scheme () with bundling procedures could be quantified as follows:
(15) 
(16) 
where contains not only the synchronization message but also the measurement message. On the contrary, just involves the measurement message with synchronization timestamps inside. A flat hop network with generating measurements each hop is taken as an example with applying (15) and (16), the numbers of message transmissions and receptions for conventional scheme and proposed scheme with selfdata and alldata bundling procedures are , and . The proposed scheme with alldata bundling procedure conserves more than message transmissions and receptions compare to the conventional scheme.
Compared to the multihop extension of the time synchronization scheme based on reverse twoway message exchange proposed in [11], the multihop extension of BATS based on oneway message dissemination can greatly lower communication overheads by reducing the number of synchronization messages required for networkwide synchronization, which is a significant advantage when used for largescale WSNs. If the endtoend communication range of a multihop WSN is over a kilometer, however, the propagation delay cannot be ignored any longer, and the time synchronization schemes based on reverse twoway messages exchange would be a better solution in such a case.
V Experimental Results
The proposed BATS scheme is implemented on a real testbed for a flat hop WSN consisting of one head and six sensor nodes, all of which are based on TelosB motes running TinyOS [17]. Note that the timer resolution of TelosB motes running TinyOS is since the resolutions of its hardware clock running on a 32kHz crystal oscillator and software timer are and , respectively. The accuracy of time synchronization schemes tested on the testbed, therefore, is limited to a microsecond level.
Va Energy Efficiency
VA1 The Number of Message Transmissions/Receptions
Type of Synchronization Scheme  N^{1}  N  

Conventional Twoway  SI  136  36 
SI  460  360  
SI  3700  3600  
Conventional Oneway  SI  100  36 
SI  100  360  
SI  100  3600  
Reverse Twoway  SI  100  36 
SI  100  360  
SI  100  3600  
Reverse Oneway  SI  100  0 
SI  100  0  
SI  100  0 

Both synchronization and measurement messages are counted.
First, we count the numbers of message transmissions and receptions of the conventional and reverse asymmetric time synchronization schemes based on both oneway message dissemination and twoway message exchange to indirectly compare their energy consumptions. A singlehop scenario is considered, where the head and one sensor node are directly connected to each other. We assume that there are measurements in total at the sensor node over the period of , which are reported to the head through measurement messages without measurement bundling, and the SI is set to . The resulting number of messages—i.e., synchronization and measurement messages—transmitted (N) and received (N) by the sensor node are summarized in Table. I.
From the comparison, we observe that the reverse oneway scheme could save the energy consumed by both transmissions and receptions of the synchronization messages; this is because the reverse oneway scheme is free from transmissions and receptions of beacon messages and synchronization timestamps are embedded into measurement messages.
In the reverse twoway scheme, the “Request” synchronization message including timestamp can be embedded into beacon messages, but still sensor nodes consume energy to receive the beacon messages. On the other hand, the conventional twoway scheme requires the most message transmissions due to the sending the “Request” messages from the sensor node to the head. In addition, the conventional oneway scheme requires the same number of synchronization message receptions as in the reverse twoway scheme.
VA2 Direct Measurement of Energy Consumption
To measure the actual power consumption of a time synchronization scheme on the resourceconstrained sensor nodes, we employ a stabilized voltage supply and a digital storage oscilloscope (DSO) to power the sensor node which synchronizes with the head and log the actual power consumption as shown in Fig. 9. In the experiment setup, one resistor is connected in series between the power supply and the sensor node. The two pins of the resistor are connected to the inputs of the amplifying circuit^{3}^{3}3The amplifying circuit is based on the analog devices designer guidebook [26, chapter 4]. which used to enlarge the level current input value with 150 times. The outputs of the amplifying circuit are connected to the DSO for logging the power consumption. The power consumption logged in the DSO is illustrated in Fig.10. Because the voltage is stabilized in the measurement experiment which is constantly, so the actual power consumption could be compared through comparing the logged current value sets.
During the experiments, the measurement is generated every and the bundling procedure with bundling measurements is employed in both FTSP and BATS for fair comparison. FTSP broadcasts and receives the synchronization beacon messages per second (i.e., default setting) and reports the bundling messages every , BATS reports the bundling messages with the measurements and synchronization data every without broadcasting or receiving—i.e., radio listening deactivated—the synchronization beacons. The power and energy consumptions are computed as follows:
(17)  
(18) 
where , and are the instant power, voltage and current for the sensor node at time , respectively, and is the energy consumed by the sensor node over the time period of . Because the voltage is fixed to during the experiments, we only measure the current over the two different time intervals of and (i.e., in (18)) to obtain power and energy consumptions; Fig. 11 shows the power consumption for different time synchronization schemes over the period of . Since the broadcasting of beacon messages and the reporting of the (bundled) measurement message are periodic, so the two aforementioned example measurement intervals could represent the longterm experiments. As illustrated in Fig. 12, the average power consumption for BATS is the lowest, while the original FTSP—i.e., without using lowpower mode—consumes the most power. Specifically, the FTSP employing lowpower mode consumes less than onethird power of the original FTSP but more than BATS, which consumes less than and power of the original and the lowpower FTSP, respectively.
VB Time Synchronization Accuracy
VB1 SingleHop Scenario
We first evaluate the time synchronization accuracy of the proposed BATS scheme in comparison to that of FTSP with a singlehop scenario. For the experiments, we assume that the sensor node periodically sends measurement data to the head via measurement messages, where 5 measurements are bundled in each measurement message for both FTSP and BATS together with synchronization data in case of the latter. We run experiments for .
Note that BATS uses the measurement messages to carry both measurement and synchronization data, while conventional oneway time synchronization schemes like FTSP rely on beacon messages for synchronization data and use measurement messages only for measurement data. For a fair comparison between BATS and FTSP, therefore, we define SI as the interval between two consecutive measurement messages carrying synchronization data for BATS and the interval between two consecutive beacon messages for FTSP, respectively, and use the same SI value for both schemes for each experiment.
Synchronization Scheme  MAE^{1} [s]  MSE^{1}  N  N  

FTSP^{2}  SI  0.2892E03  0.3614E06  36  36 
SI  0.3164E03  0.3983E06  360  360  
SI  0.3173E03  0.4038E06  3600  3600  
BATS with the method 1  SI  2.4837E05  2.1194E09  36  0 
SI  3.2770E06  1.7492E11  360  0  
SI  2.4903E06  1.0120E11  3600  0  
BATS with the method 2  SI  8.1524E06  1.5805E10  36  0 
SI  2.1016E06  7.3933E12  360  0  
SI  1.8299E06  5.4018E12  3600  0 

Based on the measurement time estimation obtained from such that the actual performance in real deployment is represented.

The standard FTSP implementation provided in TinyOS library offers limited millisecondlevel time synchronization [27].
Before carrying out a comparative analysis with FTSP, we need to decide the values of BATS system parameters affecting time synchronization performance. During the preliminary experiments, we found that the time synchronization accuracy of BATS is affected by the sample size for the linear regression for clock frequency ratio estimation. Note that, for a reasonable comparison, to find the best value of the sample sizes for different SIs, we implemented the offline rerunning program in which the same raw data trace produced in the online experiment could be reused to run different offline experiments with different sample sizes. With this program, the possible sample sizes (e.g., 2, …, 10, …, 100, …, all) for different values of SI are evaluated. In particular, the performance of the experiment based on all samples does not outperform the one using the most recent timestamps with certain sample size value. This may result from, as time goes on, due to the aggravating clock drift, the very past sample data—i.e., very past timestamps—do not have positive contributions for the estimations of the timestamps in the most current synchronization interval. Instead, the most recent samples could provide relatively better contributions for the estimation of the most recent timestamps.
Fig. 13 shows the effect of sample size on the mean square error (MSE) and the mean absolute error (MAE) of measurement time estimation of BATS with different values of SI. From the results, we find that the MSE and MAE of measurement time estimation are minimal when the sample size is 19 and 5 for SI of and , respectively. As for the experiments with SI of , the size of total samples is quite limited (i.e., only 36 samples from the experiment over ), which means, it is quite difficult to apply large value for the aforementioned sample size. Anyhow, we still tuned the value of sample size in the range of 2–30, and the results showed that, 2 is the best sample size for the experiment with SI of .
With the best empirical values of the sample sizes for various values of SI, the performance of our proposed scheme embedding the linear regression method is demonstrated. The performance of the method of linear regression with the best parameter value outperformed the conventional methods such as the method based on the calculation of the cumulative frequency ratio proposed in [6] as shown in Fig. 14. In this figure, the measurement time estimation errors of our proposed time synchronization scheme based on both traditional ratiobased method and linear regression method are demonstrated, in which the linear regression method outperforms the ratiobased method in all three report intervals at different levels. In addition, Fig. 14 demonstrated that our proposed reverse asymmetric framework could be employed on different conventional time synchronization schemes with diverse estimation methods.
Table II summarizes the MAE and MSE of measurement time estimation from the experiments during the period of . In the singlehop scenario, one sensor node is synchronized to one head in the experiments. Note that, as the standard FTSP implementation provided in TinyOS library is employed in our experiments, so the synchronization accuracy of FTSP is limited to millisecondlevel[27]. The MAE of measurement time estimation of all three different SIs show that the proposed scheme with two proposed methods provides satisfactory precision with minimum of which is competitive with consideration to the results presented in other papers—e.g., conventional twoway scheme TPSN and oneway schemes FTSP and RSP—which are also evaluated through real testbeds, however, with drastically fewer message transmissions as shown in Table. II.
In addition, Fig. 14 and Table II illustrate that a relatively smaller SI results in better performance with smaller MSE, which means, the performance of the proposed scheme with both methods is related to the value of report intervals. This may result from the drifting of the lowcost crystal oscillator with up to tens of ppm of clock skew in the resourceconstrained sensor node, in which the drifting range is typically larger in a longer interval.
VB2 MultiHop Scenario
Hop Number  MAE ^{1}  MSE ^{1}  

Hop  4.2580E06  2.4586E11  
3.6149E06  1.8405E11  
3.1341E06  1.4519E11  
2.4847E06  9.4813E12  
1.9455E06  6.0164E12  
1.6764E06  4.4735E12 

Based on the measurement time estimation obtained from such that the actual performance in real deployment is represented.
Here we investigate the effect of the number of hops on time synchronization with a flat 6hop WSN with one head and six sensor nodes. We set the SI to and employ the optimal sample size of 19 for the experiment. Note that we apply the selfdata bundling only in order to mainly focus on the effect of the number of hops, rather than that of bundling, and thereby make the results more consistent with those of conventional schemes reported in the literature.
As shown in the Fig. 15, the level of fluctuations of the measurement time estimation errors are roughly proportional to the hop counts; for instance, the measurement time estimation errors of the node 6 hops away from the head show the highest fluctuations, while those of the node 1 hop away from the head show the least fluctuations. This is due to the perhop synchronization strategy employed in BATS, where the estimation of the hardware clock time of a sensor node with respect to the reference clock relies on those of its upperlayer sensor nodes.
Fig. 16 shows the effect of the number of hops on time synchronization in a clearer way through the cumulative distribution functions (CDFs) of absolute measurement time estimation errors. 90thpercentile absolute measurement time estimation errors for sensor nodes 1 to 6 hops away from the head are , , , , and , respectively. The MAEs and MSEs of measurement time estimation are also summarized in Table III. The results of Fig. 16 and Table III demonstrate that the proposed scheme can provide microsecondlevel time synchronization accuracy for all the sensor nodes in the 6hop WSN, even though the time synchronization error is cumulative over the hop count.
Vi Concluding Remarks
We have proposed BATS, i.e., an energyefficient time synchronization scheme based on the framework of reverse asymmetric time synchronization and the reverse oneway message dissemination; BATS can simultaneously address the major challenges in WSN time synchronization, i.e., lowering energy consumption and computational complexity while achieving high time synchronization accuracy.
The major contribution of our work in this paper is threefold: First, the reverse asymmetric time synchronization framework is presented. This framework reassigns the clock parameter estimation procedures from resourceconstrained sensor nodes to the head equipped with abundant computing and power resources, which leaves only timestamping procedure at the sensor nodes. This reassignment of time synchronization can not only reduce the computational errors caused by the limited precision floatingpoint arithmetic at the sensor nodes but also bring further potential to use more complex estimation methods at the head, e.g., those based on machine learning techniques such neural networks as demonstrated in
[28]; note that, the proposed framework could be employed by the conventional time synchronization schemes based on both oneway message dissemination and twoway message exchange, too.Second, based on the reverse asymmetric time synchronization framework, BATS is proposed and extended to multihop WSNs, which significantly reduces the energy consumption by eliminating the need of the extra synchronizationrelated message—i.e., beacon message and standalone synchronization message—transmissions.
Third, the actual energy consumption and time synchronization accuracy of BATS are evaluated through extensive experiments on the real WSN testbed. The results demonstrate that BATS conserves up to 95% of the energy consumption by FTSP and provides synchronization accuracy in the singlehop scenario. In case of the multihop scenario, the synchronization accuracy for 1hop and 6hop sensor nodes are and respectively, which results in perhop synchronization error in average.
As part of BATS, we have also outlined the message bundling procedure, the full investigation of which would require the consideration of its effect on the endtoend delay of the measurement data as well as the time synchronization performance. In the followup work, therefore, we will carry out a systematic investigation of the effects of the bundling procedure on both synchronization and delay performance in order to identify potential issues and address them through more advanced bundling procedures.
Note that the asymmetric time synchronization framework presented in this paper fits the asymmetric Internet of Things (IoT) deployment which typically consists of a powerful server and numerous resourceconstrained IoT devices [29].
Acknowledgment
This work was supported by Xi’an JiaotongLiverpool University Research Development Fund (RDF) under grant reference number RDF160239.
References
 [1] B. Sundararaman, U. Buy, and A. D. Kshemkalyani, “Clock synchronization for wireless sensor networks: A survey,” Ad Hoc Networks, vol. 3, no. 3, pp. 281–323, May 2005.
 [2] I.K. Rhee, J. Lee, J. Kim, E. Serpedin, and Y.C. Wu, “Clock synchronization in wireless sensor networks: An overview,” Sensors (Basel, Switzerland), vol. 9, no. 1, pp. 56–85, Jan. 2009.
 [3] Y. Wu, Q. Chaudhari, and E. Serpedin, “Clock synchronization of wireless sensor networks,” IEEE Signal Processing Magazine, vol. 28, no. 1, pp. 124–138, Jan. 2011.
 [4] M. Maróti, B. Kusy, G. Simon, and Ákos Lédeczi, “The flooding time synchronization protocol,” in Proc. 2nd Int. Conf. SenSys, Nov. 2004, pp. 39–49.
 [5] B. Kusý, P. Dutta, P. Levis, M. Maróti, Ákos Lédeczi, and D. Culler, “Elapsed time on arrival; a simple and versatile primitive for canonical time synchronisation services,” Int. J. Ad Hoc Ubiquitous Comput., vol. 1, no. 4, pp. 239–251, Jul. 2006.
 [6] J.P. Sheu, W.K. Hu, and J.C. Lin, “Ratiobased time synchronization protocol in wireless sensor networks,” Telecommunication Systems, vol. 39, no. 1, pp. 25–35, Sep. 2008.
 [7] S. Ganeriwal, R. Kumar, and M. B. Srivastava, “Timingsync protocol for sensor networks,” in Proc. SenSys’03, Nov. 2003, pp. 138–149.
 [8] J. Elson, L. Girod, and D. Estrin, “Finegrained network time synchronization using reference broadcasts,” in Proc. 5th Symp. Operating System Design and Implementation, Dec. 2002, pp. 147–163.
 [9] B. Kim, S. Hong, K. Hur, and D. Eom, “Energyefficient and rapid time synchronization for wireless sensor networks,” IEEE Transactions on Consumer Electronics, vol. 56, no. 4, pp. 2258–2266, Nov. 2010.
 [10] K. S. Kim, S. Lee, and E. G. Lim, “Energyefficient time synchronization based on asynchronous source clock frequency recovery and reverse twoway message exchanges in wireless sensor networks,” IEEE Transactions on Communications, vol. 65, no. 1, pp. 347–359, Jan. 2017.
 [11] X. Huan and K. S. Kim, “On the Practical Implementation of Propagation Delay and Clock Skew Compensated HighPrecision Time Synchronization Schemes with ResourceConstrained Sensor Nodes in MultiHop Wireless Sensor Networks,” arXiv eprints, p. arXiv:1905.00554, 2019.
 [12] “TelosB datasheet,” http://www.memsic.com/userfiles/files/Datasheets/WSN/telosb_datasheet.pdf, accessed: 07062019.
 [13] F. Gong and M. L. Sichitiu, “CESP: A lowpower highaccuracy time synchronization protocol,” IEEE Transactions on Vehicular Technology, vol. 65, no. 4, pp. 2387–2396, Apr. 2016.
 [14] S. el Khediri, N. Nasri, M. Samet, A. Wei, and A. Kachouri, “Analysis study of time synchronization protocols in wireless sensor networks,” arXiv eprints, pp. 1–15, Jun. 2012.
 [15] J. Sallai, B. Kusý, A. Lédeczi, and P. Dutta, “On the scalability of routing integrated time synchronization,” in Proceedings of the Third European Conference on Wireless Sensor Networks, ser. EWSN’06. Berlin, Heidelberg: SpringerVerlag, 2006, pp. 115–131.
 [16] K. S. Kim, “Asynchronous source clock frequency recovery through aperiodic packet streams,” IEEE Communications Letters, vol. 17, no. 7, pp. 1455–1458, Jul. 2013.
 [17] “TinyOS,” https://github.com/tinyos/tinyosmain, accessed: 07062019.
 [18] “MicaZ datasheet,” http://www.memsic.com/userfiles/files/Datasheets/WSN/micaz_datasheett.pdf, accessed: 07062019.
 [19] “Arduino platforms,” https://www.arduino.cc/, accessed: 07062019.
 [20] S. K. Mani, R. Durairajan, P. Barford, and J. Sommers, “An architecture for iot clock synchronization,” in Proceedings of the 8th International Conference on the Internet of Things, Oct. 2018, pp. 17:1–17:8.
 [21] IEEE Computer Society, IEEE Std 754™2008, IEEE Standard for floatingpoint arithmetic, Std., 2008.
 [22] D. Goldberg, “What every computer scientist should know about floatingpoint arithmetic,” ACM Computing Surveys, no. 1, pp. 5–48, Mar. 1991.
 [23] M. Akhlaq and T. R. Sheltami, “RTSP: An accurate and energyefficient protocol for clock synchronization in WSNs,” IEEE Transactions on Instrumentation and Measurement, vol. 62, no. 3, pp. 578–589, Mar. 2013.
 [24] D. Djenouri and M. Bagaa, “Implementation of high precision synchronization protocols in wireless sensor networks,” in Proc. WOCC 2014, May 2014, pp. 1–6.
 [25] O. Gnawali, R. Fonseca, K. Jamieson, M. Kazandjieva, D. Moss, and P. Levis, “CTP: An efficient, robust, and reliable collection tree protocol for wireless sensor networks,” ACM Trans. Sen. Netw., vol. 10, no. 1, pp. 16:1–16:49, Dec. 2013.
 [26] “A Designer’s Guide to Instrumentation Amplifiers, 3RD Edition, 2006,” https://www.analog.com/en/education/educationlibrary/dhdesignersguidetoinstrumentationamps.html, accessed: 07062019.
 [27] J. M. CastilloSecilla, J. M. Palomares, and J. Olivares, “Temperaturecompensated clock skew adjustment,” Sensors, vol. 13, no. 8, pp. 10 981–11 006, Aug. 2013.
 [28] G. Cena, S. Scanzio, and A. Valenzano, “A neural network clock discipline algorithm for the rbis clock synchronization protocol,” in Proc. 14th IEEE International Workshop on Factory Communication Systems, Jun. 2018, pp. 1–10.
 [29] B. Badihi, R. Jantti, Huseyin, and Yigitler, “Time synchronization for IoT deployments: Clock discipline algorithms and protocols,” https://www.researchgate.net/publication/328577639_Time_Synchronization_for_IoT_Deployments_Clock_Discipline_Algorithms_and_Protocols, 2018, accessed: 07062019.
Comments
There are no comments yet.