CRIT: A Hierarchical Chained-Ripple Time Synchronization in Wireless Sensor Networks Kee-Young Shin, Kang Yong Lee, and Kwangyong Lee Abstract—Time synchronization in Wireless Sensor Networks (WSN) is important for accurate time stamping of events and fine-tuned coordination of duty cycles to minimize power consumption. This paper presents a novel ChainedRIpple Time Synchronization (CRIT) protocol that is fast, flexible, and high-precise in WSN. CRIT adopts hierarchical and multi-hop time synchronization architecture with supporting energy-saving problem in WSN. The algorithm works in two phases. In the first phase, a horizontal structure between Missionary Nodes (MN) is established in the network by Piggy-Back Neighbor Time Synchronization (PBNT) algorithm. In the second phase, a vertical structure between a MN and Sensor Nodes (SN) is set up in each sensor group (SG) by Distributed Depth First Search (DDFS) algorithm. By applying these two phases repeatedly, all nodes in WSN efficiently synchronize to each other. For the purpose of performance evaluation, we first study the error sources of CRIT. In addition, we simulate CRIT in terms of synchronization errors of two phases and clock offset using network simulator (NS-2). The simulation results show that CRIT provides very accurate time synchronization and it can be easily expanded to real WSN.
estimating the tank’s speed, direction and location. And then the gateway sensor node sends the data results to the sink node. In this environment, synchronized timestamps between sensor nodes are essential.
Index TermsHierarchical, Multi-hop, Synchronization, Wireless Sensor Network
In this paper, we proposed a flexible Chained-Ripple Time Synchronization (CRIT) protocol. Our protocol uses a hierarchical and multi-hop architecture suitable for WSN. The remainder of this paper is organized as follows: Section 2 introduces basic concepts and some assumptions used in this paper. Section 3 elaborates the details of our CRIT. In section 4, we study the error sources of CRIT with numerical analysis. The performance evaluation is discussed in section 5. Finally, section 6 concludes this paper and introduces some suggestions for further improvement of our protocol as future works.
I.
Time synchronization problem has been researched thoroughly in traditional Internet and wireless LAN. Several mechanisms such as GPS using a satellite have been used to support global time synchronization. Nevertheless, most of these existing time synchronization methods [1][9] do not consider the limited resource and energy available for long time operation of sensor nodes. Generally, WSN is composed of a large number of tiny sensor nodes. To operate well on such large network densities, we need the time synchronization protocol to be scalable with a diversity of sensor nodes and considerable energy efficiency problem due to the limited battery capacity. Moreover, existing schemes will need to be extended and combined in innovate ways in order to provide services that meet the needs of applications with the minimum possible energy consumption.
Time
INTRODUCTION
In recent years, the availability of cheap and tiny microsensors and low power wireless communication enabled the large scaled deployment of sensor nodes in Wireless Sensor Networks (WSN). WSN allows us to detect, monitor, and eventually control a wide aspect of real-world problems. For instances, there are such applications as follows: monitoring health condition of elder living at their home [6][7], tagging small animals like birds for monitoring, tracking threatened species across large remote habitats [8], and estimating pollution level in the open river and ocean, et al. An elementary operation of WSN is data aggregation. In other words, aggregating raw data information sensed from multiple sensors is so important. As an example, in battle field, vehicles like the enemy’s tanks passing through a sensor network area can be detected by sensor nodes preinstalled at the moments. A gateway sensor node having data fusion function collects the raw data information from the sensor nodes and rearranges the sensed information for Kee-Young Shin is with Embedded Software Research Division, Electronics and Telecommunications Research Institute, Daejeon, South Korea (e-mail:
[email protected]) Kang Yong Lee is with University of Science and Technology (UST), and ETRI, Daejeon, South Korea (e-mail:
[email protected]) Kwangyong Lee is with Electronics and Telecommunication Research Institute, Daejeon, South Korea (e-mail:
[email protected])
1-4244-0065-1/06/$20.00 ©2006 IEEE
Figure 1. The hierarchical CRIT architecture in WSN
II.
OUR NETWORK ARCHITECTURE AND ASSUMPTIONS
797
Authorized licensed use limited to: UNIVERSITY OF DELAWARE LIBRARY. Downloaded on January 20, 2009 at 19:45 from IEEE Xplore. Restrictions apply.
Phase mechanism (5) and broadcasts a MRP for assigning other MNs same as the BS’s operations (6).
Fig. 1 shows the overall architecture of CRIT. We use the architecture presented in [13] with some modifications. We denote the sink node as “Base Station (BS)” that is an original time resource node in our topology. The BS has stronger radio transmission capability than MNs and normal “Sensor Nodes (SN)”. Nodes are organized into different interconnected domains, called as “Sensor Group (SG)”. There is a “Missionary Node (MN)” that is also a time resource node to synchronize with normal SNs in each SG. A MN is selected by the BS or another MN of neighboring group by PBNT algorithm explained later. When a SN becomes a MN having own SG, it is supposed to have stronger radio transmission power than other normal SNs. MNs can manage the state information of all normal SNs in own SG, such as time information, computing resources, and locations.
B. Piggy-Back
Time
Synchronization
The following section describes a basic scheme of Piggy-Back Neighbor Time Synchronization (PBNT) algorithm between the BS and MNs or MNs. PBNT algorithm uses the classical approaches of sender-receiver synchronization [11] with some modifications. In Figure 3, there are two nodes which are called A and B. A is the BS or a MN in level 1 and B is a normal SN in level 2 that will become a MN having own SG by taking a MAP. T2, T3, and T6 are the time measured according to node B’s local clock; T1, T4, and T5 are the time measured according to node A’s local clock.
In addition, we assume that SNs locates in intersect area of SGs only formulate a communication with a MN. Based on the characteristics of these nodes, we categorized them into two-levels. The level-1 node is the BS and MNs and the level-2 nodes are normal SNs. III.
Neighbor
(PBNT)
CHAINED-RIPPLE TIME SYNCHRONIZATION (CRIT)
By applying a hierarchical and multi-hop architecture in WSN, the proposed algorithm is divided into the two phases: Horizontal Missionary Node Discovery Phase (Chained Phase) and Vertical Sensor Node Synchronization Phase (Ripple Phase). Figure 3. PBNT algorithm of CRIT
At T1, node A broadcasts a MRP (M1). Node B receives this MRP at T2. Node B waits for some random time (T3 – T2) before it initiates the two-way message exchange with node A. Here, the randomized waiting prevents collisions caused by the contention in media access. At time T3, node B sends ACK packet in response to the MRP with own piggybacked clock information (M2) to node A, and node A receives this ACK packet at time T4, where T4 is equal to T3 + o + d. Here, o and d represent the clock offset between the two nodes and propagation delay respectively. At T5, node A sends back a MAP with own piggybacked clock information (M3) to node B. This packet contains a MAPSET-BIT for assigning a MN and time values of T3, T4, and T5. Eventually, node A receives the packet at T6.
Figure 2. Step transitions in CRIT
A. Horizontal Missionary Node Discovery Phase
(Chained Phase)
Through the time values of T3, T4, T5, and T6, node B can calculate clock offset and propagation delay as follows:
In Figure 2, when the BS has been setup for time synchronization in WSN, Chained Phase starts. The BS initially broadcasts MN-REQUEST packet (MRP) through the network for assigning a MN (1). When a normal SN that wants to be a MN receives the MRP, it sends acknowledgement (ACK) packet with own piggybacked clock information to the BS (2). The BS receives this ACK packet and resends MISSIONARY-ASSIGN packet (MAP) with own piggybacked clock information to the SN (3).
o= d =
(T 4 − T 3) − (T 6 − T 5) 2
(T 4 − T 3) + (T 6 − T 5) 2
(1) (2)
The node B can correct its time information and synchronize with node A by referencing results from equation (1) and (2).
Eventually, the SN receiving this MAP becomes a MN in WSN and adjusts own clock information by Piggy-Back Neighbor Time Synchronization (PBNT) algorithm (4). And then, the MN constructs a SG with neighbor SNs by Ripple 798
Authorized licensed use limited to: UNIVERSITY OF DELAWARE LIBRARY. Downloaded on January 20, 2009 at 19:45 from IEEE Xplore. Restrictions apply.
networks communication, where it includes the switching and queuing delay, et al. • Accept time: The time consumed in receiving the data bits and passing them to the MAC layer. The range of fluctuation in acceptance delay would be smaller if the tiny sensor nodes operate on a hardware-based smart RF transceiver such as CC1000 and CC2420 [4]. • Receive time: The time spent by receiver that constructs the data bits into a packet structure and then pass this packet on the upper layer such as network layer and application layer. The variation of receive time is dependent on the variable delay sources produced by the operating system [10][14].
C. Vertical Sensor Node Synchronization Phase
(Ripple Phase) Ripple Phase indicates the step 5 and 10 in Figure 2. In this phase, all SNs in each SG efficiently synchronize to each other with a MN by Distributed Depth-first-Search (DDFS) [2] algorithm. At time T6 in Figure 3, the node B, which is a MN built up by a MAP, formulates a DDFS communication link with neighbor SNs and sends its clock information packet. Through this clock information packet, each SN can efficiently tune up own clock information. Here, having a communication and time complexities of O(|N|), where N is the number of node, DDFS algorithm maximized time synchronization accuracy. Specially, we used a DDFS algorithm different from the previous DDFS algorithms. In previous DDFS algorithm [12], an ACK packet is sent from each notification about sending packet and the sender node holds its information until all notifications are acknowledged. However, in CRIT, no ACKs are used for reducing packet communication overhead and energy consumption, so no time is spent on waiting for them (NO-ACK mechanism). Therefore, packets in this phase are forwarded immediately to the next node. Through these schemes, DDFS algorithm of CRIT can support fast and energy-efficient time synchronization in WSN. IV.
Figure 4. The sources of time synchronization error
B. Error Analysis of CRIT
ERROR ANALYSIS OF CRIT
Generally, because the hardware clock of node x is a usually non-decreasing function of time t, the equation (3) is easily deduced. Practically, an oscillator is used to generate the real time clock and the oscillator’s frequency depends on the surrounding’s conditions. However, it can be approximated with fine-tuned accuracy for relatively extended periods of time by estimating the error sources of time synchronization:
A. Sources of Time Synchronization Error Fig. 4 briefly appears the sources generating packet delay when two tiny sensor nodes (sender-receiver) communicate in WSN. Although a similar analysis has also been presented in [3], we expand a variety of delay factors from a systems perspective for using them in CRIT protocol. We utilize layered architecture concepts introduced in traditional communication network area.
t x (t ) = ax t + ox
• Send time: The time needed by the sender node in order to build the sending packet. This time includes the delay triggered by the packet to arrive the MAC layer from the application layer, system kernel processing, and variable delay elements generated by the operating system [10][14], e.g. context switching and interrupt service overhead, et al. • Access time: The time triggered by delaying for accessing the transmit channel in sender node. The packet waits until it can access the transmission channel after it is arrived the MAC layer. This delay time is specific to wireless networks resulting from the property of common medium for packet transmission. • Propagation time: The time used for the packet transmission from sender nodes to receiver nodes. When the sender and receiver node share access to the same physical media property, this time is very small. If not, propagation time causes the large delay in wide-area
(3)
Here, ax and ox are drift and offset of node x’s clock. In general ax and ox will be different for each node and approximately constant for an extended period of time. From (3), it can derive that ax and ox are linearly related:
t1 (t ) = a ABt + oAB
(4)
The parameters aAB and oAB represent the relative clock drift and offset between the two node’s clocks. If the two node’s clocks are perfectly synchronized, the relative clock drift is equal to one and the relative clock offset is equal to zero. We can expand this equation (4) to our CRIT by showing the expression of relation between node A and B in Figure 3. After node A and B are synchronized by PBNT 799
Authorized licensed use limited to: UNIVERSITY OF DELAWARE LIBRARY. Downloaded on January 20, 2009 at 19:45 from IEEE Xplore. Restrictions apply.
algorithm, the two nodes’ relation expression can be derived as follows:
t1 (t ) = a ABt + oAB + d AB
T6 = aTA5→BT5 + OTA5→B + (S A + ASA + PA→B + ACB + RB )
(9)
After subtracting the equation (9) from (8), we can obtain the following equations easily:
(5)
The parameters d AB represent the relative propagation delay between two nodes after synchronized to each other.
T4 −T6 = {aTB→AT3 + OTB→A + (SB + ASB + PB→A + ACA + RA )} 3
3
{
}
− aTA→BT5 + OTA→B + (SA + ASA + PA→B + ACB + RB ) 5
5
B→A 3 T3
= (a
D
T ) + (O
A→B T5
−O
)
(10)
+ ( ACA − ACB ) + (RA − RB )
Here, for simplifying the equation (10), we present the following equation like this and substitute it into the upper equation:
raT3 →T5 3
T −a
B→A T3
+ (SB − SA ) + ( ASB − ASA ) + (PB→A − PA→B )
roT3 →T5
aTB → A
A→B 5 T5
aTA5→ B
a TA5 → B = a TB3 → A + ra T3 → T5 O TA5 → B = O TB3 → A + roT3 → T5 SB − SA = SD
(11)
AS B − AS A = A S D Figure 5. The time error sources among the local node time
PB → A − PA → B = PD AC A − AC B = A C D
To be better analysis, we introduce the concept of real time measured by an ideal clock as shown in Figure 5. We present the real time measured by local node clocks, such as T3, as the uppercase letter and the ideal time measured by ideal clock, such as t3, as the lowercase letters. We apply this mechanism to PBNT algorithm in Figure 3. Node B sends a packet with own clock information at T3 and node A receives it at T4. Note that T3 and T4 are times measured by node’s local clock of A and B respectively. The following set of equations can be easily derived:
t4 = 1⋅ t3 + 0 + (SB + ASB + PB→A + ACA + RA )
(6)
= t3 + ( S B + AS B + PB→ A + AC A + RA )
(7)
T4 = aTB3→AT3 + OTB3→A + (SB + ASB + PB→A + ACA + RA )
(8)
R A − RB = RD
S D + AS D + PD + A C D + R D = D Consequently, we can obtain the following equation easily:
T4 −T6 = aTB→AT3 − (aTB3→A + raT3 →T5 )T5 + OTB→A − (OTB3→A + roT3 →T5 ) + SU + D 3
(12)
3
Here, raT3 →T5 and roT3 →T5 represent relative clock drift and offset between T3 and T5 respectively. D is the total transmission delay between T3 and T5 . These relations are graphically appeared in Figure 5. Eventually, we knows from equation (12) that ra , ro , and D are critical elements that impact the synchronization error rate of CRIT. Furthermore, we can obtain the normalized equation of average time synchronization error of Chained Phase in n-hop network as follows:
Here, S B and AS B present the time taken to send packet: send time and access time at node B respectively in Figure 4. PB → A refer to the propagation time between node B and A. AC A and RA represent the time taken to receive packet: accept time and receive time at node A respectively in Figure 4. Therefore, equation (8) presents the relationship with local clock mechanism between node A and B after node A sends an ACK packet with own clock information at time T3 and node B receives the packet.
Chained Phase Error =
1 n ∑{rai + roi + Di } n i =1
(13)
Note that, because time synchronization of Ripple Phase using DDFS algorithm is dependent on node’s counts in each SG, we regard its time synchronization error rate
In addition, if we apply this relation to node B at time T6, the next equation is drawn: 800
Authorized licensed use limited to: UNIVERSITY OF DELAWARE LIBRARY. Downloaded on January 20, 2009 at 19:45 from IEEE Xplore. Restrictions apply.
three hundred times after 1000s of simulation for accurate evaluation and calculated the average of them.
as O ( n) , n is the number of nodes. As a result, we can derive the total average synchronization error of the CRIT as follows:
B. Simulation Results
CRIT Error =
n
1 ∑{rai + roi + Di } + O(n) n i=1
(14)
Fig. 6 shows the time synchronization error of Chained Phase with minimum (MIN), average (AVG), and maximum (MAX) values in accordance with MN’s hop distances from BS. We evaluate the performance with 5-hop distances by using 1 Base Station and 5 Missionary Nodes. Here, each MIN, AVG, and MAX respectively appears an average time synchronization errors obtained by 1000 simulation runs in each hop distance. As expected, we find that the synchronization errors experienced by PBNT algorithm increase gradually according to increasing hop distances. However, the increasing amount is very slight because the PBNT algorithm used the piggybacked time information mechanism for reducing communication overhead. Therefore, the mechanism of Chained Phase achieves a finetuned time synchronization betweens the BS and MNs or MNs.
Eventually, we can also appear a synchronization error equation of CRIT with maximum and minimum rate as follows:
CRITError ≤
1 n ∑{rai + roi + Di} + O(n) ≤ CRITError n i=1
(15)
In the next section, we significantly evaluated the time synchronization error of Chained Phase with the upperbound and lower-bound. And then, we obtained the time synchronization error of Ripple Phase for reflecting results of equation (15). PERFORMANCE E VALUATION
Synchr o ni zati o n er r o r (m s )
V.
In order to evaluate the performance of CRIT, we simulated it using an extended version of discrete event network simulator NS-2, implemented by the Monarch project [5]. A simple random topology is used, where the BS is preset in the center of our network grid. Five nodes for MNs are automatically selected by Chained Phase when CRIT starts from the BS. According to the number of MNs, five SGs are formulated and each group has one hundred of normal SNs. We placed SNs on a predefined square geographical coverage area with dimension 3000x3000 meters in a uniformly random fashion. Moreover, in order to reflect Ripple Phase mechanism of our CRIT, we implemented the DDFS algorithm in NS-2 and used the IEEE 802.11b MAC protocol with some modifications. The data rate periodically sent from the BS is set to 2Mb/s and we simulated for 3000s.
0.016 0.014 0.012 0.01 0.008 0.006 0.004 0.002 0
MI N AV G MA X
1
2
3
4
5
Ho p d i s t a n c e s Figure 6. Synchronization error of Chained Phase
In Figure 7, we reported an average time synchronization error of Ripple Phase with respect to the number of nodes. Every data point represents an average of 1000 simulation runs. Since DDFS algorithm has the communication and time complexity with O ( n) , where n is the number of node, it is certain that synchronization error increases according to the number of nodes. However, because the increasing time synchronization error rate of this phase is very low by using NO-ACK mechanism for reducing the communication overhead, it is considerable less sensitive in dense WSN. Hence, we can easily notice that Ripple Phase mechanism of CRIT supports accurate time synchronization between a MN and a variety of SNs in WSN.
A. Evaluation Metrics In order to evaluate the performance of Chained Phase and Ripple Phase of CRIT, the following metrics are investigated. 1) Synchronization error of Chained Phase: The time synchronization error including upper-bound and lowerbound of Chained Phase based on PBNT algorithm according to hop distances.
Finally, Fig. 8 presents the clock offset values. We evaluated the average clock offset of all nodes in each SG compared with the BS’s local time. As shown in Figure 8, the clock offset values keep near constant zero according to the number of reading after 1000s of simulation. Thus, we proved that CRIT supports efficient and flexible clock offset tuning mechanism because of elaborate co-operating between Chained Phase and Ripple Phase of CRIT.
2) Synchronization error of Ripple Phase: The time synchronization error of Ripple Phase using DDFS algorithm according to the number of SNs in each SG. 3) Clock offset: An average of all nodes’ clock offsets compared with the BS’s local time in each SG, here five SGs. We read the clock offset value of each SN in each SG 801
Authorized licensed use limited to: UNIVERSITY OF DELAWARE LIBRARY. Downloaded on January 20, 2009 at 19:45 from IEEE Xplore. Restrictions apply.
0.0008 DDFS-TIME-SYNC
Synchronization error (s)
0.0007 0.0006
0.0005 0.0004
Figure 9. Nano-Qplus Platform 0.0003
VII. REFERENCES
0.0002 0
20
40 60 The number of nodes
80
100
[1]
Figure 7. Synchronization error of Ripple Phase [2] Sensor Sensor Sensor Sensor Sensor
0.003
Clock offset (ms)
0.002
Group Gourp Gourp Gourp Gourp
1 2 3 4 5
[3]
0.001
[4]
0
[5] [6]
-0.001 -0.002
[7] -0.003
[8] 0
50
100 150 200 The number of readings
250
300
Figure 8. Clock offset value of CRIT
VI.
[9]
CONCLUSION AND FUTURE WORKS
[10]
In this paper, we introduced a fast, flexible, and highprecise time synchronization mechanism with considering the energy-efficient problem in WSN, which is CRIT (Chained- RIpple Time Synchronization). CRIT contributes in the accurate hierarchical and multi-hop time synchronization with low error-rate and efficient clock offset tuning in WSN. The simulation results satisfied these goals with respect to synchronization errors of Chained Phase and Ripple Phase and clock offset. Furthermore, because of these characteristics, our CRIT can be efficiently expanded to real WSN products and used for time critical applications in real world.
[11]
[12] [13]
[14]
In the future, we plan to integrate CRIT with our sensor network protocol stack, Nano-Qplus platform [10] in Figure 9, and also evaluate its performances on real testbed.
L. Lamport, “Time, clocks, and the ordering of events in a distributed system,” Communications of the ACM, vol. 21, no. 7, pp. 558-565, 1978. I.Cidon, Yet another distributed depth-first-search-algorithm, Inform. Process. Lett, 26, (6), pp. 301-305, Jan 1988. Jeremy Elson, Lewis Girod and Deborah Estrin, “Fine-Grained Network Time Synchronization using Reference Broadcasts,” In the proceedings of the fifth symposium on Operating System Design and Implementation (OSDI 2002), December 2002. Chipcon CC2420 Radio Datasheet, http://www.chipcon.com/files/CC2420_Data_Sheet_2_1.pdf The NS-2 simulator, http://www.isi.edu/nsnam/ns B.G celler et al., An instrumentation system for the remote monitoring of changes in functional health status of the elderly, Iinternational Conference IEEE-EMBS, New York, pp. 908-909, 1994. G. Coyle et al., Home telecare for the elderly, Journal of Telemedicine and Telecare, 1, pp183-184, 1995. A. Cerpa, J. Elson, M. Hamilton, J. Zhao, Habitat monitoring: application driver for wireless commmunication technology, ACM SIGCOMM’2000, Costa Rica, April 2001. A. Duda, G. Harrus, Y. Haddad, and G. Bernard, “Estimating global time in distributed systems,” in Proc. Of the 7th IEEE International Conference on Distributed Computing Systems (ICDCS’87), Berlin, Germany, Sept. 1987. Y. S. Shin, et al., “A Design and Implementation of a Multi-hop Wireless Sensor Network based on Nano-Qplus Platform,” In the 20th International Technical Conference on Circuits/Systems, Computers and Communication (ITC-CSCC 2005), July, 2005. D. L. Mills, “Internet time synchronization: The Network Time Protocol” In Z. Yang andT.A. Marsland, editors, Global States and Time in Distributed Systems. IEEE Computer Society Press, 1944. B. Awerbuch, A new distributed depth-first-search algorithm, Inform. Process. Lett. 20 (3), pp147-150, 1985. Kang-Yong Lee, Jin-Bum Hwang, and Jeong-dong Ryoo, “EndtoEnd Qos Routing in Physically Hierarchial Wirelss Ad-Hoc Networks”, in Proc. Of the IEEE VTC 2005 Spring, June. 2005. LEVIS, P., MADDEN, S., G AY, D., POLASTRE, J., SZEWCZYK, R., WOO, A., BREWER, E., AND CULLER, D. The emergence of networking abstractions and techniques in tinyos. In Proceedings of the First Symposium on Networked Systems Design and Implementation (2004), USENIX Association, pp. 1.14.
802
Authorized licensed use limited to: UNIVERSITY OF DELAWARE LIBRARY. Downloaded on January 20, 2009 at 19:45 from IEEE Xplore. Restrictions apply.