 Research
 Open Access
 Published:
Twohop time synchronization protocol for sensor networks
EURASIP Journal on Wireless Communications and Networking volume 2014, Article number: 39 (2014)
Abstract
One of the critical middleware services for sensor networks is the time synchronization, which provides supports to different applications. Synchronization protocols used for Internet and LANs are not appropriate in the sensor networks for the highdensity and limited energy resource. This paper describes twohop time synchronization (TTS) that aims at reducing the synchronization overhead and providing more accurate networkwide synchronization. The synchronization message exchanges are minimized by making full use of sensors’ broadcast domain and enlarging the common node synchronization range in multihop scenarios. By halving synchronization hops, the TTS achieves high multihop synchronization precision. The proposed protocol contains singlehop synchronization model, multihop synchronization algorithm, and a power control scheme. We prove that the extension of singlehop TTS to networkwide synchronization is NPcomplete. The complexity and convergence time of multihop TTS are analyzed in detail. We simulate TTS on MATLAB and show that it requires minimal overhead and convergence time compared with other protocols. We also implement TTS on common sensors and its multihop synchronization error is less than that of receiverreceiver synchronization (RRS).
1 Introduction
The technological advances in miniaturization, in digital circuits design, and in wireless communication are promoting the study of sensor networks with small and lowcost nodes. By interacting with the environment and communicating with each other, the sensors could provide future ubiquitous communications. When those sensor nodes are deployed over a wide geographical region, they form the wireless sensor networks (WSN). They are useful for providing applications varying from environment monitoring to equipment monitoring, from smart office to industrial automation [1].
Clock synchronization is one of the most important components in WSN. It is essential for transmission scheduling, power management, data fusion, and many other applications. For example, in power management, the duty cycling helps the sensors to maintain energy by consuming minimal power during the sleep mode. The performance of duty cycling is closely related to the accuracy of the whole network synchronization.
Although the time synchronization problem has been solved in common networks, it requires to be reconsidered in WSN. First, such networks are energy constraint, so the time synchronization protocol must be energy efficient. Second, nodes in sensor networks communicate with each other via multihop paths. The singlehop error accumulates along the synchronization hops, and the multihop error is inevitable. Sometimes, the multihop synchronization error even becomes a major consideration due to the large network scale.
1.1 Our contribution
We propose the singlehop TTS to solve the disadvantages of traditional synchronization models. The model has the same time accuracy with receiverreceiver synchronization (RRS), and its reference node can also be synchronized. Our main contribution is the multihop TTS protocol, which is the extension of singlehop TTS. We prove that this extension process is NPcomplete and present a new distributed algorithm to accomplish it. The fundamental property of multihop TTS is that it synchronizes nodes within two adjacent levels in one synchronization process. In our design, reference node and its parent node perform twoway timing message exchange to synchronize nodes lying within the reference node broadcast domain. The TTS minimizes the reference nodes needed to cover the entire network and has the largest common node synchronization range in multihop scenarios. So it could reduce multihop synchronization overhead significantly. Our approach decreases multihop synchronization error by halving the synchronization hops. We analyze the complexity and convergence time of multihop TTS, and the result shows that our work is simple and fast. Odd layer TTS, which uses odd layer nodes as the reference nodes, is another achievement of this paper. This scheme is used to balance the energy consumption of nodes in different levels.
2 Related work and challenges
The most important singlehop synchronization models are receiverreceiver synchronization, pairwise synchronization (PWS) and senderreceiver synchronization (SRS).
In RRS, different nodes that receive the same reference message can be synchronized with each other by exchanging the recorded reception time. References [2, 3] and [4] are based on reference broadcast synchronization (RBS) which is the most important prototype of RRS. RBS achieves higher time accuracy compared with other protocols by removing the nondeterminism of the sending end. However, in RBS, the reference node is left unsynchronized.
PWS uses pairwise message exchanges to achieve the synchronization of two adjacent nodes. Protocols that adopt this model are lightweight time synchronization (LTS) [5], tinysync and minisync [6], and timingsync protocol for sensor networks (TPSN) [7].
SRS synchronizes a receiver with a sender by broadcasting multiple time packets. The flooding time synchronization protocol (FTSP) [8] and delay measurement time synchronization (DMTS) [9] analyze the sources of uncertain delay in message exchange in detail. FTSP utilizes media access control (MAC) time stamping to minimize the clock offset. It also adopts linear regression to compensate the clock skew.
Recently, some new protocols have been proposed to solve the drawbacks of the above models. In pairwise broadcast synchronization (PBS) [10], a node gets synchronized by overhearing the exchanged messages from two neighbors. In vector Kalman filter using multiple parents (KFMP) [11], a node combines the messages from multiple parents and adopts vector Kalman filter to reduce the global clock error. The master synchronization [12] adopts physical layer feedback control to save power consumption. Recently, a new approach called Average TimeSynch (ATS) [13] is proposed to estimate the clock offset and skew by utilizing distributed lowpass filter. Although some multihop protocols have been proposed to fit the above models, the multihop clock synchronization is still challenging for several reasons. On one hand, the synchronization hops become a major consideration for better clock protocols design. This is because the multihop synchronization error accumulates along the hops. For example, RBS proves that the multihop error increases with the square root of the hops. In order to reduce the cumulative multihop error, most algorithms focus on designing more accurate singlehop model or adopting a statistical signal processing framework. However, we find that all the current multihop protocols virtually share the same synchronization hop: the least hop to the root node. So our work aims at reducing the synchronization hops and providing precise multihop synchronization.
Synchronization overhead is another challenge that multihop synchronization faces due to the limited power sources. Actually, the overhead (energy consumption) is the opposite of time accuracy. The three basic models focus on improving the synchronization accuracy, so their synchronization overheads are usually very large. In [14] and [15], some multihop extensions of PBS have been devised. The extensions aim to minimize the number of synchronization packets. However, their effects are unsatisfactory because the synchronization range of PBS is too small. Synchronization range is the key factor for the energyefficient protocol design. No protocol notices that, in multihop synchronization, the synchronization range of a common node is smaller than the singlehop synchronization range.
3 The singlehop model of TTS
The TTS is designed to achieve the synchronization of the whole network. In general, the communication radius of a sensor is assumed to be less than a few hundred meters. In this case, the propagation delay can be ignored. Since the energy consumption increases with the broadcast radius, this assumption is consistent with common sensor networks.
The singlehop TTS focuses on providing synchronization points (syncpoints), which can be used to estimate the node clock phase and skew, instead of the approach to calculate the offsets directly.
In Figure 1a, suppose that P is a parent node and A is a reference node. Common node B, which lies within the broadcast region of A, collects syncpoints by overhearing the information from A. The message exchange model is depicted in Figure 2.

1.
A broadcasts N reference packets and records the sending time ${T}_{i}^{\mathit{\text{AA}}}(1\le i\le N)$.

2.
Each receiver records the time stamp at reference message reception. The reception time of P and B are ${T}_{i}^{\mathit{\text{AP}}}$ and ${T}_{i}^{\mathit{\text{AB}}}$, respectively.

3.
P forwards a packet containing N recorded time stamps to A.

4.
A broadcasts the packet received from P.
From Figure 2, ${T}_{1}^{\mathit{\text{AP}}}$ and ${T}_{i}^{\mathit{\text{AP}}}$ can be expressed as
where ${\theta}_{\text{offset}}^{\mathit{\text{BP}}}$ and ${\theta}_{\text{skew}}^{\mathit{\text{BP}}}$ denote the clock offset and skew between B and P. The parameters c and ε_{ i } stand for the fixed portion and random portion of packet delay [2, 7, 8]. If the set of time stamp differences is denoted by $T={\left[{T}_{1}^{\mathit{\text{AP}}}{T}_{1}^{\mathit{\text{AB}}}\cdots {T}_{N}^{\mathit{\text{AP}}}{T}_{N}^{\mathit{\text{AB}}}\right]}^{\mathrm{T}}$, then it can be expressed as follows:
where $\Theta ={\left[{\theta}_{\text{offset}}^{\mathit{\text{BP}}}{\theta}_{\text{skew}}^{\mathit{\text{BP}}}\right]}^{\mathrm{T}}$, C=[c⋯c]^{T}, E=[ε_{1}⋯ε_{ N }]^{T}, and $H={\left[\begin{array}{cccc}1& 1& \cdots & 1\\ 0& {T}_{2}^{\mathit{\text{AB}}}{T}_{1}^{\mathit{\text{AB}}}& \cdots & {T}_{N}^{\mathit{\text{AB}}}{T}_{1}^{\mathit{\text{AB}}}\end{array}\right]}^{\mathrm{T}}$.
Consequently, using the Equation 3, B can be synchronized with P. In addition, Equations 1 to 3 can also be used to synchronize the reference node by substituting A for B. In order to improve the precision, TTS uses N+2 broadcast packets to provide N syncpoints and the node records time stamp at MAC layer to remove send, receive, and access time. It is worth mentioning that B utilizes reference broadcast scheme to eliminate the transmitterside nondeterminism, thus ${\epsilon}_{i}^{\mathit{\text{BP}}}\approx {\epsilon}_{i}^{\mathit{\text{AP}}}/2$.
4 The multihop algorithm of TTS
In practical WSN, a common node always gets information from the root node through a multihop path. Thus, the singlehop TTS is not enough to achieve the whole network synchronization. In these scenarios, the multihop TTS should be used to synchronize nodes beyond the communication range of the root node.
We utilize a simple demo illustration to show the difference between common protocol and multihop TTS. In Figure 3, suppose that only root node 1 has the global time. For common protocols, first, the root node synchronizes the four nodes connected with it. Then, nodes 3 and 4 are selected to synchronize nodes of level 3. However, TTS only selects two pairs of nodes to synchronize all common nodes. For example, nodes 3 and 1 perform pairwise message exchange to synchronize nodes 2, 3, 4, 6, 7, 8, and 9 because they all locate within the broadcast range of node 3. Similarly, nodes 4 and 1 exchange packets to synchronize nodes 2, 3, 4, 5, 8, 9, 10, and 11. Therefore, the TTS aims at finding all the synchronization pairs from the whole network.
4.1 Synchronization problem formulation
The procedure of searching synchronization pairs can be divided into some subproblems. Suppose that reference nodes of level 2i−2 have been found whereas reference nodes of level 2i are not found. This means that nodes of level 2i and 2i+1 are uncovered. We utilize an undirected graph G(V,E) to model the topology of nodes of level 2i and 2i+1. Let V=V_{ E }∪V_{ O } represent the set of nodes. V_{ E } is the set of level 2i nodes and V_{ O } is the set of level 2i+1 nodes. Edge set E stands for the set of communication link and node selfloop. The link (v,e)∈E if it satisfies: at least one of the two elements belongs to V_{ E }, v could communicate with e or v=e. Thus, the edges connecting nodes in V_{ O } only are not included. Then, the subproblem can be described as finding minimum number of reference nodes from V_{ E } to cover all nodes in V.
Theorem 1
The process of the subproblem is NPcomplete.
Claim 1
The subproblem is in NP.
Proof
The following verifier for the subproblem runs in polynomial time.
For 〈(V,E,K),R〉
If all the followings are all true then accept else reject:
R is a subset of V_{ E }
R≤K
∀v∈V∃e∈R[(v,e)∈E].
Claim 2.
Set covering problem (SCP) ≤_{ p } subproblem □
Proof.
Suppose a function with the input (V,S,K), which is a SCP instance, and output (V,E,K) which stands for the subproblem. Let S={S_{ e }:e∈V_{ E }} and S_{ e }={v∈V:(v,e)∈E}. There are V vertices and $\sum _{e=1}^{\leftS\right}\left{S}_{e}\right$ edges. We now show that the function is a polynomial time reduction of SCP to subproblem.
We assume that J is a Scover of V and let R={e∈V_{ E }:S_{ e }⊂J}. Suppose J=K, then R=K. We claim that R could cover all elements of V. Suppose v is a common node of V. So we have {v∈S_{ e }:S_{ e }⊂J}. According to the definition of S_{ e }, (v,e)∈E. The definition of R shows that e∈R. Thus, v could be covered by an elemente of R.
Then, we suppose R with size of K could cover all the elements of V. let J={S_{ e }:e∈R}, then J=K. We will show that J is a Scover of V. For a common node v∈V, we know that ∃e∈R [(v,e)∈E]. Thus, according to the definition of S_{ e }, v∈S_{ e }. The definition of J shows that S_{ e }∈J. We can see that v∈J and J is the cover of V.
4.2 Multihop process of TTS
There is no efficient way to solve the SCP. A famous suboptimal solution for SCP is the greedy algorithm. We propose the multihop TTS, which is a distributed greedy algorithm, to solve the subproblem. This algorithm only uses even layer node as reference node, so it is also named as even layer TTS.
Every node in the network is assigned a unique ID to identify the source of message. A node obtains its level through the level discovery phase [7]. The parameter syn_{ v } represents the cover state of node v, that is, syn_{ v }=1 when v itself is the reference node or v is located within the broadcast domain of a reference node, and syn_{ v }=0 otherwise. Let num_{ v } denote the number of v’s neighbors with parameter syn=0. The variable num can also be obtained initially from the level discovery phase. The distributed algorithm can be described as:

1.
Nodes in V _{ E } are divided into two types, reference nodes and common nodes. According to CSMA, common node e∈V _{ E } waits for some random time to avoid collision and to ensure that the wireless channel is free. Then, e broadcasts a packet containing num_{ e } and its own identity. Meanwhile, e also collects corresponding variables from the neighbors. Having received all such variables, e computes out and broadcasts the maximum value {max_{ e }=max(num_{ v }),v∈V _{ E },(v,e)∈E} to all the neighbors. In this step, the number of broadcasted messages is less than 2V _{ E }.

2.
Common node e∈V _{ E } judges whether it needs to be a reference node or remains a common node. Node e becomes a candidate of the reference node if num_{ e } is the largest variable among all the twohop neighbors of e. That is,
$${\text{num}}_{e}=max\left({\text{max}}_{v}\right),\forall v\in {V}_{E},(v,e)\in \mathrm{E.}$$(4)
If candidate e timeouts after some random time without receiving any reference message (refmsg), it becomes a reference node and broadcasts refmsg immediately. Otherwise, node e is still a common node.
Here, we present a simple example of this step. In Figure 3, suppose that all nodes of levels 2 and 3 are uncovered, that is, their parameters syn are all equal to zero. Now the subproblem is to find all the reference nodes of level 2. First, every node of level 2 exchanges num with the neighbors of the same level. From Figure 3, we can see that num_{2}=∣{2,3,4,6}∣= 4, num_{3}=∣{2,3,4,6,7,8,9}∣=7, num_{4}=∣{2,3,4,5,8,9,10,11}∣=8, num_{5}=∣{4,5,11}∣=3. Then, node 4 becomes a reference node because num_{4} is the largest among all the neighbors. The iterative process continues until nodes 6 and 7 are also covered.

3.
If node v∈V with parameter syn_{ v }=0 becomes a reference node or has received refmsg, it sets the parameter syn_{ v }=1 and broadcasts a cover state message (covstate). This broadcasting process also adopts CSMA scheme.

4.
Each common node e∈V _{ E } updates num_{ e } after receiving all covstates.
$$\begin{array}{c}{\text{num}}_{e}=\sum (1{\text{syn}}_{v}),\forall v\in V,(v,e)\in \mathrm{E.}\end{array}$$(5)
Steps 1 to 4 are repeated until all nodes in V are lying within the broadcast range of the reference nodes. Then, each reference node randomly selects a level 2i−1 neighbor to make a synchronization pair, and this subproblem is finished. When all these subproblems have been accomplished, the networkwide synchronization will be performed along the synchronization pairs.
4.3 The performance of multihop TTS
Theorem 2
The multihop TTS yields a set of size at most lnΔ+2 times the size of the optimal set.
Proof.
See Appendix.
In multihop TTS, more than one reference node is found in one iteration process and only a small number of nodes become reference nodes. Hence, the actual number of iterations is far less than V_{ E } and the maximum complexity of step 1 is O(V_{ E }^{2}). In steps 2 and 3, every node broadcasts the message covstate and some nodes broadcast the message refmsg, so the complexity is O(V). Therefore, the total complexity of the whole process is {O(V_{ E }^{2})+O(V)}. Note that the communication messages needed to determine the synchronization pairs are oneoff.
The TTS reduces the synchronization messages significantly because it makes full use of node’s broadcast characteristic. A node’s broadcast range can be divided into three parts: area that covers neighbors in the previous layer, area that covers neighbors in the same layer, and area that covers neighbors in the next layer. In common protocols, a synchronized node can only synchronize its neighbors in the next layer. However, the reference node of TTS is able to synchronize all neighbors in the same and next layer. Therefore, the broadcast domain utilization of TTS is higher than that of common protocols. As depicted in Figure 1a,b, TTS gives a roughly 2× larger maximum synchronization area compared with other protocols. Moreover, the distributed TTS chooses the most appropriate nodes as the reference nodes. By minimizing reference nodes, TTS significantly reduces the number of timing packets which are heavy overheads in terms of energy consumption.
The TTS halves the synchronization hops and effectively reduces the multihop synchronization error by synchronizing nodes of two adjacent levels. In Figure 1a,b, suppose that both P and P^{′} have been synchronized and the number of hops from a common node to the root node is H. The goal of traditional protocols is to ensure the shortest path, which means the least number of hops, to the root node. They use P^{′} of level i^{′} to synchronize the nodes of level i^{′}. Thus, the number of synchronization hops of traditional protocols is H. However, TTS selects P of level 2i−1 and A of level 2i as a synchronization pair to synchronize level 2i and 2i+1 nodes. The number of synchronization hops of TTS can be expressed as [(H+1)/2], which means the floor of (H+1)/2, i.e., the largest integer less than or equal to (H+1)/2. Since the synchronization error increases with the number of synchronization hops, the accuracy of TTS is higher compared with previously known protocols.
Fewer synchronization hops and less overhead mean lower convergence time that is needed to achieve networkwide synchronization. Let C be the channel capacity, ρ be the node density, and r be the node broadcast radius. Then, the node throughput equals k C/(π r^{2}ρ) where k is the channel utilization. Traditional protocols exchange N timing packets to accomplish synchronization, and reference [2] shows that the most suitable value of N is 30. The convergence time of traditional protocols can be expressed as:
where H_{max} is the maximum number of hops of a network and P is the size of synchronization packet. Our even layer TTS needs N+2 messages, and its synchronization hops are half of that of common protocols. The convergence time of TTS is given by:
Equations 6 and 7 show that the convergence time raises with the increasing of the value of ρ. As shown earlier, TTS requires less synchronization nodes to synchronize the whole network and thus ρ_{e TTS}<ρ_{ t }. So TTS has less convergence time when just considering about the parameter ρ. In addition, the parameter k decreases with the growth of ρ in basic CSMA which is a very important MAC layer protocol [16, 17]. Then, we assume ρ_{ t }=ρ_{e TTS} and compare N H_{max} with (N+2)[(H_{max}+1)/2]. We turn to MATLAB to verify TTS has less convergence time. In Figure 4a, the white dot denotes that N H_{max} is relative large. When the number of N is larger than 3, the TTS always has less convergence time compared with common protocols in multihop networks. Actually, in order to calculate the clock skew, N is usually very large. Figure 4b plots the calculated difference between N H_{max} and (N+2)[(H_{max}+1)/2]. The figure shows that the difference increases with the growths of both N and H_{max}. Therefore, TTS performs better in networks with large maximum number of hops.
4.4 Power control scheme
In WSN, nodes have to work as energyefficient as possible due to limited energy supply. In the protocol proposed above, only even layer nodes are chosen as reference nodes. Those selected nodes consume more power compared with odd layer nodes. Here, we present odd layer TTS to solve this problem.
The root node broadcasts N packets containing the sender’s time stamps which denote the global time. Each level 2 node obtains the corresponding local time at message reception. The node calculates the clock offset by working out the difference between the global and local time and then becomes synchronized. Nodes of level 2 are synchronized by SRS which has lower accuracy compared with RRS. After that, odd level nodes use the above distributed algorithm to achieve networkwide synchronization. Note that even layer TTS and odd layer TTS can be performed alternately in practical WSN protocols.
Figure 5 shows a possible way of achieving power control by utilizing two types of TTS. Each synchronization node with less power remaining sends a warning message containing its own identity and level to the root node. An application PowerControl is generated by the root node to collect the energy consumption state of the whole network. PowerControl analyzes the data and changes the synchronization mode when the powers of most current reference nodes are too low. Then, PowerControl starts a flooding process to notify all the nodes. Depending on the judgment of PowerControl, SynAPP initials the whole network synchronization.
5 Experiment results
5.1 Message overhead and convergence time comparison
The experiment scenario is a L∗L network with grid topology, in which each node communicates with the neighbors only. An example of the topology connection state is shown in Figure 6. The gray dot deployed in the upper right corner is the root node. The white dot denotes the reference node which connects with its parent node via dashed line. The reference node and parent node makes a synchronization pair, and all synchronization pairs are selected by even layer TTS. In the figure, only the most appropriate even layer nodes are chosen as reference nodes, and all nodes could be located within the broadcast domain of the synchronization pairs. The next experiment focuses on the overhead and convergence time required by different protocols.
We evaluate the message overhead required by TTS, TPSN, and FTSP. In TPSN, each node except the root node forms a synchronization pair with its parent and each synchronization pair demands 2N timing messages. Therefore, TPSN needs 2N(L^{2}−1) packets to achieve synchronization of the network mentioned before. If FTSP is adopted to synchronize the network, every node sends its time stamp to other nodes, so the number of required packets is N L^{2}. Notice that RBS demands O(L^{4}) packets in a singlehop network, which is too large compared with both TPSN and FTSP. The value of N is set to be 20. It can be seen from Figure 7a that TTS requires a much lower number of overheads compared with both TPSN and FTSP. The overhead gaps between TTS and other protocols become greater as L is increasing. This indicates that TTS performs better with regard to energy consumption versus TPSN and FTSP in largescale networks. Furthermore, the decrease of packets also means the reduction of network conflict and global time error.
Another experiment is carried out to show the convergence time differences between TTS and other classical protocols. Although RBS is one of the most important protocols, it does not have a clear multihop synchronization scheme. Also, there is no root node in RBS, so the common nodes can only get relative time. Therefore, we just simulated TPSN, FTSP, and TTS on MATLAB. In the simulation, the TPSN first established a tree hierarchy and each node synchronized with its parent through pairwise message exchange. The FTSP achieved networkwide synchronization byflooding. In all the three protocols, common nodes communicated with their neighbors through CSMA protocol. Figure 7b shows the convergence times of different protocols. Each point represents the average of 100 experiment results. The convergence times of the three protocols all increase with the network size because the number of nodes and maximum hops increase with the network scale. The convergence time of TTS is always less than the other two protocols and the gaps raise with L. This is consistent with Equations 6 and 7. The reason lies in two aspects: TTS has less message overhead; TTS halves the synchronization hops. Therefore, TTS converges fast and performs significantly better in largescale WSN.
5.2 The synchronization accuracy of TTS
We use the implementation of TTS on common sensors to carry out the advantages of TTS described above. The hardware of the sensor consists of processor board, radio, and battery. We base our design on the microcontroller TI MSP430F5438 and on the radio chip TI CC1100E. The processor adopts 16 MHz external crystal oscillator, so its timer maintains a local clock with the resolution of about 0.0625 µs. The central frequency of the radio chip is 470 MHz, and its data rate is set to be 100 kBaud. We utilize the 4.5V lithium rechargeable battery as the power of the sensor. The sensor also provides lots of external interfaces (e.g., RS232 serial port, JTAG emulator interface, LED lights). Figure 8 shows a prototype of this hardware design.
Figure 9 shows the experiment scenario and the network connection state. The experiment involves a super node and nine common nodes. The topology of the ten nodes is enforced in software in order to facilitate the realization. The topology structure shows that all common nodes could be covered by the broadcast domain of the super node S. S queries and collects the clock time from P_{ i } once per 7.9 s. It sends the time readings to PC through 115,200baud serial link. Then, S broadcasts a start message, so that all nodes begin to resynchronize. The synchronization process is started by the root node P_{1} which maintains the global time. Other common nodes communicate with the neighbors and exchange synchronization messages according to the adopted protocols demonstrated below.

TTS: P_{ i } and A_{ i } exchange messages, and P_{i+1} synchronizes with P_{ i } by overhearing the broadcasts from A_{ i }. After that, P_{i+1} starts to exchange messages with A_{i+1}. This process continues until P_{5} is synchronized.

RRS: At first, S broadcasts a reference message. P_{1} and A_{1} records the reception time; then, P_{1} sends the recorded time to A_{1}. A_{1} synchronizes with P_{1} by computing out the time difference. This process continues until P_{5} is also synchronized with A_{4}.
Each scenario consists of 500 trials. We compute out the synchronization error between P_{1} and P_{ i }. The distributions of clock error are shown in Figure 10, and the variances are summarized in Table 1. As shown in Figure 10a,b, the synchronization error increases with hop distance. This means that, both in TTS and RRS, nodes with lower hops perform better than those with higher hops. The thresholds at confidence of 90% in two, four, six, and eight hops of TTS are about 0.36, 0.43, 0.52, and 0.60 µs, respectively. The values of TTS are better than that of the RRS (0.48, 0.59, 0.75, and 0.84 µs). From Table 1, the fourhop variance of TTS is smaller than the twohop variance of RRS. Although the eighthop variance of TTS is larger than the fourhop variance of RRS, they are in the same order of magnitude and the former is smaller than the sixhop variance of RRS. In summary, TTS dramatically reduces the variance of global synchronization error. The reason is that TTS halves the synchronization hops.
6 Conclusions
In this paper, we have introduced the twohop time synchronization for sensor networks. We show that TTS requires less message exchanges to achieve networkwide synchronization. The efficacy of this claim is verified via simulations on MATLAB. The convergence time of TTS is also very low. We argue that TTS is more accurate in largescale networks because it halves synchronization hops. We verify this claim by implementing TTS and RRS on common sensors. The results show that TTS performs better than RRS in multihop synchronization.
The singlehop TTS can be used as the substitute of RRS. In TTS, the reference node records the time stamps when broadcasting reference messages. The reference node and its children nodes can be synchronized with a selected parent node. We utilize a distributed algorithm to extend the singlehop TTS to multihop synchronization. The algorithm minimizes the number of reference nodes and halves the synchronization hops compared with other protocols. Thus TTS is a distributed, scalable, energyefficient, and accurate solution to the problem of sensor network clock synchronization.
Our future work will focus on several aspects. First, TTS is sensitive to the dynamic topology change, so we would like to make it more robust. Then, we plan to verify the performance of TTS in a realworld application. The most attractive scenarios are those with great range of hardware platforms, timevarying network topology, and multiuser applications.
Appendix
Theorem 3
The multihop TTS yields a set of size at most lnΔ+2 times the size of the optimal set.
Proof.
Suppose that OPT ⊂V_{ E } is the optimal set. A node in V either belongs to OPT or has a neighbor in OPT. The set of nodes covered by i^{∗}∈ OPT is called ${S}_{{i}^{\ast}}$. If a node is covered by more than one neighbors in OPT, we arbitrary assign it to one of such sets.
We use the charging scheme to prove the efficacy of TTS. The total cost of an optimal set ${S}_{{i}^{\ast}}$ is 1 and each node of the set is charged $1/\left{S}_{{i}^{\ast}}\right$. In the following, we prove that the total cost of TTS is at most lnΔ+2 for each set ${S}_{{i}^{\ast}}$.
Each time we select a reference node, we charge the new nodes that become covered in this step. A node is charged only once because it gets covered only once. Suppose the number of nodes covered by a new reference node i is N_{ i }. Then, if node v in the set of ${S}_{{i}^{\ast}}$ is covered by i, it gets charged 1/N_{ i }. According to step 1 of multihop TTS, N_{ i } is the largest among all the twohop neighbors and therefore ${N}_{i}>{N}_{{i}^{\ast}}$. So node v gets charged at most $1/{N}_{{i}^{\ast}}$. Let ${d}_{{i}^{\ast}}$ represent the number of neighbors of node i^{∗}. Therefore, the first node in the set of ${S}_{{i}^{\ast}}$ gets charged at most $1/({d}_{{i}^{\ast}}+1)$ and the j th node gets charged at most $1/({d}_{{i}^{\ast}}j+2)$. Adding up all the charges of nodes in ${S}_{{i}^{\ast}}$, we get
where Δ is the maximum degree of V.
Abbreviations
 ATS:

Average TimeSynch
 CAS:

Chinese Academy of Sciences
 DMTS:

Delay measurement time synchronization
 FTSP:

Flooding time synchronization protocol
 KFMP:

Vector Kalman filter using multiple parents
 LTS:

Lightweight time synchronization
 MAC:

Media access control
 PBS:

Pairwise broadcast synchronization
 PWS:

Pairwise synchronization
 RBS:

Reference broadcast synchronization
 RRS:

Receiverreceiver synchronization
 SCP:

Set covering problem
 SRS:

Senderreceiver synchronization
 SSTC:

Shanghai Science and Technology Commission
 TPSN:

Timingsync protocol for sensor networks
 TTS:

Twohop time synchronization
 WSN:

Wireless sensor networks.
References
 1.
Wang F, Zeng P, Yu H, Xiao Y: Random time source protocol in wireless sensor networks and synchronization in industrial environments. Wireless Commun. Mobile Comput 2013, 13(8):798808. 10.1002/wcm.1144
 2.
Elson J, Girod L, Estrin D: Finegrained network time synchronization using reference broadcasts. SIGOPS Oper. Syst. Rev 2002, 36(SI):147163. 10.1145/844128.844143
 3.
PalChaudhuri S, Saha AK, Johnson DB: Adaptive clock synchronization in sensor networks. In Proceedings of the 3rd international symposium on Information processing in sensor networks. ACM IPSN ’04, New York, NY, USA; 2004:340348.
 4.
Marco A, Casas R, Ramos J, Coarasa V, Asensio A, Obaidat M: Synchronization of multihop wireless sensor networks at the application layer. Wireless Commun. IEEE 2011, 18: 8288.
 5.
van Greunen J, Rabaey J: Lightweight time synchronization for sensor networks. In Proceedings of the 2nd ACM international conference on Wireless sensor networks and applications. ACM WSNA ’03, New York, NY, USA; 2003:1119.
 6.
Sichitiu ML, Veerarittiphan C: Simple, accurate time synchronization for wireless sensor networks. In Wireless Communications and Networking Conference. IEEE WCNC ’03, New York, NY, USA; 2003:12661273 vol. 2.
 7.
Ganeriwal S, Kumar R, Srivastava MB: Timingsync protocol for sensor networks. In Proceedings of the 1st international conference on Embedded networked sensor systems. ACM SenSys ’03, New York, NY, USA; 2003:138149.
 8.
Maróti M, Kusy B, Simon G, Lédeczi A: The flooding time synchronization protocol. In Proceedings of the 2nd international conference on Embedded networked sensor systems. ACM SenSys ’04, New York, NY, USA; 2004:3949.
 9.
Ping S: Delay measurement time synchronization for wireless sensor networks. Intel Research Berkeley Lab, IRBTR03013, CA, USA; 2003.
 10.
lae Noh K, Serpedin E, Qaraqe K: A new approach for time synchronization in wireless sensor networks: Pairwise broadcast synchronization. Wireless Commun. IEEE Trans 2008, 7(9):33183322.
 11.
Zeng Y, Hu B, Liu S: Vector Kalman filter using multiple parents for time synchronization in multihop sensor networks. In 5th Annual IEEE Communications Society Conference on Sensor, Mesh and Ad Hoc Communications and Networks. Inst. of Elec. and Elec. Eng. Computer Society Secon’08, NJ, USA; 413421.
 12.
Zheng L, Ge W, Qiu H: Master synchronization in physicallayer communications of wireless sensor networks. EURASIP J. Wirel. Commun. Netw 2010, 2010: 108:1108:9.
 13.
Schenato L, Fiorentin F: Average TimeSynch: A consensusbased protocol for clock synchronization in wireless sensor networks. Automatica 2011, 47(9):18781886. 10.1016/j.automatica.2011.06.012
 14.
Cheng KY, Lui KS, Wu YC, Tam V: A distributed multihop time synchronization protocol for wireless sensor networks using Pairwise Broadcast Synchronization. Wireless Commun. IEEE Trans 2009, 8(4):17641772.
 15.
Noh KL, Wu YC, Qaraqe K, Suter B: Extension of pairwise broadcast clock synchronization for Multicluster sensor networks. EURASIP J. Adv. Signal Process 2008, 2008: 286168. 10.1155/2008/286168
 16.
Bianchi G, Fratta L, Oliveri M: Performance evaluation and enhancement of the CSMA/CA MAC protocol for 802.11 wireless LANs. 1996.
 17.
Ziouva E, Antonakopoulos T: CSMA/CA performance under high traffic conditions: throughput and delay analysis. Comput. Commun 2002, 25(3):313321. 10.1016/S01403664(01)003693
Acknowledgements
This work is supported in part by the ‘Strategic Priority Research Program’ of the Chinese Academy of Sciences (CAS) under Grant No. XDA06020301 and Shanghai Science and Technology Commission (SSTC) research projects under Grant No. 12DZ2293200.
Author information
Additional information
Competing interests
The authors declare that they have no competing interests.
Authors’ original submitted files for images
Below are the links to the authors’ original submitted files for images.
Rights and permissions
Open Access This article is distributed under the terms of the Creative Commons Attribution 2.0 International License (https://creativecommons.org/licenses/by/2.0), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.
About this article
Cite this article
Wang, J., Zhang, S., Gao, D. et al. Twohop time synchronization protocol for sensor networks. J Wireless Com Network 2014, 39 (2014). https://doi.org/10.1186/16871499201439
Received:
Accepted:
Published:
Keywords
 Sensor networks
 Time synchronization
 Synchronization hops
 Synchronization range
 Multihop