SLTP: Scalable Lightweight Time Synchronization Protocol for Wireless Sensor Network

Similar documents
Chapter 6 Ti T me m s ynchronization

Chapter 6 Time synchronization

Reliable Time Synchronization Protocol for Wireless Sensor Networks

Time Synchronization in Wireless Sensor Networks: CCTS

Enhanced Timing-Sync Protocol for Sensor Networks

"Comparative study of: Different Time synchronization Techniques in WSN."

Synchronization in Sensor Networks

Symmetric Clock Synchronization in Sensor Networks

Mobile Agent Driven Time Synchronized Energy Efficient WSN

Study on Wireless Sensor Networks Challenges and Routing Protocols

HRTS: a Hierarchical Reactive Time Synchronization protocol for wireless sensor networks

MTSF: A Timing Synchronization Protocol to Support Synchronous Operations in Multihop Wireless Networks

Geographical Routing Algorithms In Asynchronous Wireless Sensor Network

Time Synchronization in Wireless Networks

State-Based Synchronization Protocol in Sensor Networks

Ad hoc and Sensor Networks Time Synchronization

Comparison of Two Synchronization Protocol in Wireless Sensor Network

Wireless Sensor Networks: Clustering, Routing, Localization, Time Synchronization

Robust Multi-Hop Time Synchronization in Sensor Networks

INTRODUCTION TO WIRELESS SENSOR NETWORKS. CHAPTER 7: TIME SYNCHRONIZATION Anna Förster

ROAL: A Randomly Ordered Activation and Layering Protocol for Ensuring K-Coverage in Wireless Sensor Networks

Time Synchronization of Cognitive Radio Networks

A Survey of Time Synchronization Protocols for Wireless Sensor Networks

Tri-Message: A Lightweight Time Synchronization Protocol for High Latency and Resource-Constrained Networks

Intra and Inter Cluster Synchronization Scheme for Cluster Based Sensor Network

UAMAC: Unidirectional-Link Aware MAC Protocol for Heterogeneous Ad Hoc Networks

ViTAMin: A Virtual Backbone Tree Algorithm for Minimal Energy Consumption in Wireless Sensor Network Routing

Ratio-based time synchronization protocol in wireless sensor networks

Analysis of Cluster-Based Energy-Dynamic Routing Protocols in WSN

The Flooding Time Synchronization Protocol

Nodes Energy Conserving Algorithms to prevent Partitioning in Wireless Sensor Networks

CHAPTER 2 WIRELESS SENSOR NETWORKS AND NEED OF TOPOLOGY CONTROL

AN EFFICIENT MAC PROTOCOL FOR SUPPORTING QOS IN WIRELESS SENSOR NETWORKS

An Energy Consumption Analytic Model for A Wireless Sensor MAC Protocol

6367(Print), ISSN (Online) Volume 4, Issue 2, March April (2013), IAEME & TECHNOLOGY (IJCET)

Novel Cluster Based Routing Protocol in Wireless Sensor Networks

Connected Point Coverage in Wireless Sensor Networks using Robust Spanning Trees

An Energy-efficient Distributed Self-organized Clustering Based Splitting and Merging in Wireless Sensor Networks

IRI-MAC: An Improved Receiver Initiated MAC Protocol for Wireless Sensor Network

Enhanced Precision Time Synchronization for Wireless Sensor Networks

Research Article MFT-MAC: A Duty-Cycle MAC Protocol Using Multiframe Transmission for Wireless Sensor Networks

Modified Low Energy Adaptive Clustering Hierarchy for Heterogeneous Wireless Sensor Network

IMPACT OF LOW ENERGY TIME SYNCHRONI- ZATION METHODS IN WIRELESS SENSOR NETWORKS Kamlesh Kumar Gautam, Surendra Kumar Gautam, Dr. P.C.

Fig. 2: Architecture of sensor node

Rumor Routing Algorithm

1 Multipath Node-Disjoint Routing with Backup List Based on the AODV Protocol

Delay Analysis of ML-MAC Algorithm For Wireless Sensor Networks

Figure 1. Clustering in MANET.

Abstract. 1. Introduction. 2. Theory DOSA Motivation and Overview

CFMTL: Clustering Wireless Sensor Network Using Fuzzy Logic and Mobile Sink In Three-Level

A COMPARISON OF REACTIVE ROUTING PROTOCOLS DSR, AODV AND TORA IN MANET

PERFORMANCE ANALYSIS OF AODV ROUTING PROTOCOL IN MANETS

Wireless Communication Bluetooth, Timing

A Logical Group Formation and Management Mechanism Using RSSI for Wireless Sensor Networks *

ANewRoutingProtocolinAdHocNetworks with Unidirectional Links

Node Heterogeneity for Energy Efficient Synchronization for Wireless Sensor Network

Routing protocols in WSN

Energy-Efficient Communication Protocol for Wireless Micro-sensor Networks

WSN Routing Protocols

SENSOR-MAC CASE STUDY

Blackhole Attack Detection in Wireless Sensor Networks Using Support Vector Machine

Evaluation of Cartesian-based Routing Metrics for Wireless Sensor Networks

RT-Link: A global time-synchronized link protocol for sensor networks Anthony Rowe, Rahul Mangharam, Raj Rajkumar

Sabareesan M, Srinivasan S*,John Deva Prasanna D S

Energy Efficient Time Synchronization in WSN for Critical Infrastructure Monitoring

Delay Measurement Time Synchronization for Wireless Sensor Networks

A Fault-recovery Routing Approach for Loop-based Clustering WSN

Integrated Routing and Query Processing in Wireless Sensor Networks

Hierarchical Addressing and Routing Mechanisms for Distributed Applications over Heterogeneous Networks

MultiHop Routing for Delay Minimization in WSN

End-To-End Delay Optimization in Wireless Sensor Network (WSN)

Efficient Cluster Based Data Collection Using Mobile Data Collector for Wireless Sensor Network

Dalimir Orfanus (IFI UiO + ABB CRC), , Cyber Physical Systems Clustering in Wireless Sensor Networks 2 nd part : Examples

Connectivity, Energy and Mobility Driven Clustering Algorithm for Mobile Ad Hoc Networks

Impact of IEEE MAC Packet Size on Performance of Wireless Sensor Networks

A Cluster-Based Energy Balancing Scheme in Heterogeneous Wireless Sensor Networks

Implementation of a Network-wide Time Synchronization Strategy for WirelessHART Sheng Zhang, Zhongsheng Xiang, Jie Chen

A Novel Hierarchical Routing Protocol for Wireless Sensor Networks

A Genetic Algorithm-Based Approach for Energy- Efficient Clustering of Wireless Sensor Networks

Maximizing the Lifetime of Clustered Wireless Sensor Network VIA Cooperative Communication

A REVIEW ON LEACH-BASED HIERARCHICAL ROUTING PROTOCOLS IN WIRELESS SENSOR NETWORK

Prianka.P 1, Thenral 2

Defending Against Resource Depletion Attacks in Wireless Sensor Networks

Part I. Wireless Communication

Routing Protocols in MANETs

Time Synchronization Strategies in Wireless Sensor Network: A Review

SECURE AND EFFICIENT HYBRID APPROACH FOR DATA TRANSMISSION IN ZIGBEE NETWORK

Analysis of Cluster based Routing Algorithms in Wireless Sensor Networks using NS2 simulator

Effects of Sensor Nodes Mobility on Routing Energy Consumption Level and Performance of Wireless Sensor Networks

An Energy Efficient Data Dissemination Algorithm for Wireless Sensor Networks

CSMA based Medium Access Control for Wireless Sensor Network

An Adaptive Self-Organization Protocol for Wireless Sensor Networks

Distributed Data Aggregation Scheduling in Wireless Sensor Networks

INTEGRATION OF AD HOC WIRELESS SENSOR NETWORKS IN A VIRTUAL INSTRUMENTATION CONFIGURATION

Maintenance of Time Synchronization in Wireless Adhoc Networks in Case of Node Destruction

Multichannel MAC for Energy Efficient Home Area Networks

Global ID Assignment in Wireless Sensor Network by Using Huffman Algorithm

Dynamic Cooperative Routing (DCR) in Wireless Sensor Networks

The Recursive Time Synchronization Protocol for Wireless Sensor Networks

A Gateway Selections Using Signal Strength among Clusters in Ad Hoc Networks

Transcription:

SLTP: Scalable Lightweight Time Synchronization Protocol for Wireless Sensor Network Sepideh Nazemi Gelyan, Arash Nasiri Eghbali 2, Laleh Roustapoor 2, Seyed Amir Yahyavi Firouz Abadi 3, and Mehdi Dehghan 2 Dept. Of Computer Engineering, Islamic Azad University, Firouzkooh Branch 2 Computer Engineering Department, Amirkabir University of Technology 3 Electrical & Computer Engineering Department, University of Tehran s.nazemi@iaufb.ac.ir, {eghbali, roustapoor, dehghan}@aut.ac.ir, a.yahyavi@ut.ac.ir Abstract. In wireless sensor networks, time synchronization is a critical problem. In this paper, we propose SLTP, a Scalable Lightweight Time-synchronization Protocol for wireless sensor networks. By using passive clustering and linear regression SLTP can reduce the energy consumption of network nodes and also decrease the overhead of creating and maintaining the clusters. Moreover SLTP uses linear regression to compute the time. Therefore, it can calculate the clock skew and offset between each node and its cluster head in order to estimate the local time of remote nodes in the future or the past. Simulation results show that by this we can gain considerable improvements in power consumption, accuracy and scalability in comparison to similar algorithms. Introduction Recently a new kind of wireless networks has emerged, one that has cheaper and smaller nodes []. These nodes are sensors which gather and process information from the physical and real world. They are used for geophysical monitoring and observing the special environments such as war zones, wild life, etc. Special and strategic applications of these networks in inaccessible and dangerous environments can cause some restrictions for network managers. For instance, the managers are unable to access nodes for recharging, reconfiguring and reprogramming. So when the nodes are damaged or their batteries are discharged, they are neither recyclable nor reprogrammable [8]. In sensor networks, the main reason for nodes failure is the discharge of batteries. Energy efficiency is a critical issue in wireless sensor networks [2]; therefore, using energy efficient programs and algorithms on these nodes is of great significance [2]. One of the most important problems in computer networks, including wireless sensor networks, is time synchronization among nodes. In view of the fact that wireless sensor networks are used for monitoring strategic environments, the accuracy of the information gathered is crucial. Information accuracy highly depends on time [8]; as a result, time synchronization plays an important role. Traditional time synchronization H. Zhang et al. (Eds.): MSN 2007, LNCS 4864, pp. 536 547, 2007. Springer-Verlag Berlin Heidelberg 2007

SLTP: Scalable Lightweight Time Synchronization Protocol for WSN 537 protocols are not suitable for sensor networks [2, 8]. For example NTP consumes too much energy in order to exchange the required messages and requires using GPS which is costly for sensor nodes [8]. Over the past few years, many time synchronization algorithms have been suggested. The main goals of these algorithms were to increase the time synchronization accuracy and to decrease the power consumption. RBS [] is one of the most cited protocols in this field. It synchronizes a set of receivers by using linear regression; in other words, RBS presents a way that enables nodes to calculate local time of remote nodes in proportion to their local times. This protocol is not scalable and in case of increase in the number of nodes its efficiency decreases significantly. Although RBS presents a solution for increasing the accuracy, it extremely suffers the network collisions. Some algorithms such as TPSN and LTS [3, 2] use tree construction. In general, in these algorithms, increase in the depth of the tree results in higher error rates. Also the creation and maintenance of the tree causes high overhead. In addition, tree-scanning algorithms require having some global information about the network which is inconsistent with distribution concept; indeed, wireless sensor networks are distributed systems that do not have access to such information [2, 2]. Some algorithms like PCHTS [6] and PCTS [5] use clustering techniques. PCHTS suffers high overhead due to costly creation and maintenance of the clusters. PCTS uses the passive clustering concept, which results in efficient energy consumption; on the other hand, it frequently has to set the node s clock to calculated values which leads to high-energy consumption by CPU. These values are calculated using the averaging technique. By using passive clustering, our proposed protocol not only decreases the nodes energy consumption but also reduces the overhead of creation and maintenance of the clusters. Moreover, we use linear regression for computing skew and offset for clock of each node in proportion to its cluster head. This helps nodes to estimate the local time of remote nodes in the future or the past. We used NS2 for simulating and evaluating our model. The organization of this paper is as follows: We first review related works in Section 2. In Section 3, first we discuss passive clustering (3.) as a basis for our method; afterwards we will describe our protocol in detail. In section 3.4, we demonstrate the theoretical analysis of our method. Error analysis is discussed in section 3.5. Section 4 presents our simulations setup and results. Protocol overhead is discussed in section 4.3.2. Finally, we offer our conclusions and describe our plans for future work in section 5. 2 Related Works RBS [] synchronizes a set of receivers by using the available broadcasting channel in the network physical layer. The reference node broadcasts a predefined number of synchronization packets to its neighbors and these packets are received approximately at the same time. At this time receivers record their local times. After that, they exchange the received times with their neighbors. Next, they use linear regression for computing clock offset and skew corresponding to their neighbors. RBS does not readjust the clock. Also it does not consider the nondeterministic errors such as send time delay and access time delay, since broadcasting creates the same

538 S.N. Gelyan et al. amount of these errors for all nodes. The most important disadvantage of RBS is that it is not scalable. In other words, by increasing the number of nodes, synchronization accuracy falls and the number of exchanged messages for synchronization increases. LTS [2] creates a low-depth spanning tree composed of the nodes in the network, and uses a pair-wise synchronization algorithm for each one of the two nodes on the same edge of the tree [2, 3]. Reference node starts time synchronization and it continues until all leaves are synchronized. LTS uses Breadth-first-search algorithm which has higher communication overhead compared to other tree-construction algorithms. Also executing BFS in distributed systems is difficult. TPSN [3] has two phases. At the first phase, level discovery phase, a tree is created. At the second phase, the synchronization phase, each node in i th level synchronies itself with the node in (i-) th level by using a pair-wise synchronization algorithm. TSYNC [4] uses Multi channel nodes. This attribute results in lower collision rates. Each node has two channels, control and clock channel. All nodes use the same control channel but clock channel is unique for each node. Algorithm has two protocols. One of them is HRTS which is used for synchronizing the whole network and the other one is ITR which lets each node to synchronize itself on-demand. Each node that wants to be synchronized sends an ITR request message to its parent and this is repeated until the request message reaches the base station. The base station returns its clock though the clock channel to the requesting node. TSYNC uses broadcasting like RBS, but it has less overhead than RBS. Disadvantage of this algorithm is that we made an assumption about having multi channel sensor nodes which is not always the case. CHTS [6] uses clustering technique and nodes are able to change their radio ranges. Network is not homogenous, some nodes are high performance, and some are low performance. Cluster heads are selected from high performance nodes. CHTS has three sub algorithms; cluster head tree construction, cluster member tree construction, and the synchronization algorithm. CHTS makes too many assumptions in order to select cluster heads and cluster members. Moreover, algorithm extremely suffers from collisions, if the number of nodes increases. PCTS [5] uses passive clustering and overhearing in time synchronization phase. It has two phases. At first cluster heads collect clock information from members of their clusters. Next, they calculate the average value and send the calculated clock to members of their clusters. Some nodes that are members of more than one cluster have to calculate the average clock of all of their cluster heads and send the calculated clock to them. This algorithm has to set clock continuously which results in more power consumption and in order to do this it has to send lots of time synchronization packets which in turn causes a lot of collisions, during the time synchronization phase. 3 Protocol Description 3. Review on Passive Clustering Passive clustering is a method for creating clusters with less overhead than other methods [4]. Its setup time is very short and clustering the network is fast. The most eager node to become cluster head starts this procedure [5]. In our implementation this node broadcasts a special packet with a flag. Flag s value can be either ø or and

SLTP: Scalable Lightweight Time Synchronization Protocol for WSN 539 the initial value is ø. The nodes that receive this packet will become cluster members and change the flag to, and then rebroadcast it. Adjacent nodes that receive it in turn will become cluster head and change the flag to ø and then broadcast too. This procedure is repeated until the whole network is scanned. During this procedure, some nodes receive packets from two or more cluster heads. These nodes change their status to gateway [5, 5]. We will discuss passive clustering in more detail in section 3.3.. 3.2 Assumptions Time synchronization is done between cluster members and their cluster heads based on the assumption that cluster members do not need to exchange messages with each other, because analyzing data and query processing is done by cluster heads. However, time synchronization among cluster members of the same cluster or different clusters is possible. The nodes have the same abilities such as power level, radio range, etc. Nodes are able to change their status to cluster head, cluster member or gateway. Our algorithm does not require nodes to readjust their clocks. The use of linear regression for calculating drift between nodes clocks enables them to estimate the time of one another. This method has two advantages [2]:. Clock oscillators all tick at different rates resulting in different clock disciplines. We let each clock to work with its discipline. 2. Clocks do not require continuous readjustments by CPU which is important for efficient energy consumption. We do not employ a global time in our algorithm since having only local times is sufficient and more suitable for sensor networks applications [, 3]. However, using a global time like UTC is also possible. 3.3 Scalable Lightweight Time Synchronization Protocol Our Algorithm has two phases: configuration phase and synchronization phase. We will describe them below. 3.3. Configuration Phase The intent of this phase is to determine the cluster heads. The procedure for selecting cluster heads influences on network's lifetime [0]. There are many ways to select cluster heads []. We use a method close to passive clustering with a little modification so that it fits our needs. Configuration phase is divided into two parts based on network being static or dynamic. Static mode: The most eager node to become cluster head changes its status to cluster head and broadcasts a packet with a Boolean flag. Flag s value is set to ø. Every node that receives this packet changes its status to cluster member and sets the packet s flag to and rebroadcasts it. Nodes that have received this packet change their status to cluster head. They set the packet's flag to ø and broadcast it again. This is repeated until the whole network is covered. Each node stores its cluster head address. Nodes that receive this packet from 2 or more cluster heads will become

540 S.N. Gelyan et al. gateway. Gateways must send an ACK message to introduce themselves to their cluster heads. This ACK message contains the list of their cluster heads. Sending an ACK message enables cluster head to select one gateway between clusters. Having one gateway simplifies the routing. We used the following four rules in our implementation of passive clustering:. If a cluster member receives the packet from another cluster member, it must not rebroadcast the packet. 2. If a cluster head receives the packet from another cluster head, it must change its status to cluster member and rebroadcast the message with flag value. 3. If a cluster member receives the packet from another cluster s head or vice versa, it will not rebroadcast the packet. 4. If a node does not receive any packets for a specified amount of time, it must set its status to cluster head and broadcasts a message with flag value ø. Dynamic mode: In dynamic mode, only the selection of the cluster heads is done. Cluster members and gateways are determined in synchronization phase. Because of the network dynamics, a node that was a gateway in the past may not be one now and a node that belonged to cluster i may now belong to cluster j. We believe, our algorithm performs relatively well in dynamic networks. In case of applications that the rate of change in network structure is faster than configuration phase s speed, our algorithm may not work well. In dynamic networks configuration procedure must be executed before doing time synchronization. This procedure helps in uniform distribution of cluster heads. 3.3.2 Synchronization Phase After configuration phase is finished and cluster heads are selected, synchronization phase starts. During a defined time period which we call setup time cluster heads start broadcasting some packets in random intervals. These packets contain local times of cluster heads. When one of these packets is received by a cluster member, the cluster member records its own local time. In dynamic mode by receiving a packet, cluster members can figure out which cluster they belong to. By using linear regression method each cluster member can calculate its clock offset and clock skew in proportion to its cluster head. In dynamic mode, if a node receives packets from two or more cluster heads, it will become gateway. In general, gateway s task is to convert local time of cluster heads to each other. In static mode, time synchronization is repeatedly done in specific time intervals. If a node needs to synchronize itself with another node during this period, it can broadcast an independent time synchronization request message. The first cluster head that receives this message starts synchronization procedure and broadcasts synchronization packets. In dynamic mode as mentioned before, we have to execute configuration phase before each synchronization phase, in order to have a uniform distribution of cluster heads. If during synchronization phase a node does not receive any packets, node changes its status to cluster head and starts broadcasting synchronization packets with its local time. If the network's distribution is uniform, we may hope that this node will be able to connect through one gateway to the network.

SLTP: Scalable Lightweight Time Synchronization Protocol for WSN 54 Below is the pseudo-code of our algorithm: CH: Cluster Header; CM: Cluster Member G: Gateway; h i: local time of node i Program timesync (output); Begin Configuration (base station); {in this part CHs and CMs are selected by our Passive Clustering algorithm} For each n i in CH set do broadcast (ID, h i ); For each n i in CM set do Begin Receive (ID, h i ); Store (ID, h i ); Compute regression (h i, h j ); Co=clock offset (h i, h j ); Cs=clock skew (h i, h j ) End; If (n k is in the CM set) and (n k has received from more than one CH) Then Begin n k.status:= G; {add n k to gateways set} For each i that has sent packet to same n k do Compute regression (h i, h k ) {i is the member of CH that has sent a packet to the same n k } End; If there is n m that does not receive any packet from CH then Broadcast (ID, h m ); End. 3.4 Analysis by Example To describe our analysis clearly we use some examples. After execution of our algorithm, each node except for the cluster heads calculates the following equation: h chi = αh cmi + β. () Which α is the clock skew and β is the clock offset between cluster head and cluster member. Assume that CM at its local time h cml sees an object in location (X, Y ). It calculates the local time of its cluster head, in proportion to its own local time of the object s observation. CM sends this time and the location of the object to its cluster head. This procedure is repeated by CM 2. CM 2 sees the object in its local time h cm2 in (X 2, Y 2 ). Therefore cluster head can calculate the speed and direction of the moving object (figure -a). Fig.. CH receives the observation time of the object from CM and CM2, (b) CM and CM2 are synchronizing their clocks

542 S.N. Gelyan et al. If two nodes in the same cluster want to exchange information, calculating their own α and β is sufficient. By the following equation, they can calculate time of each other (figure -b). () CM : h (2) h CM CM 2 : h α = α 2 CH CH h = α h = α h CM2 CM 2 CM2 + β + β 2 β2 β + α In general we can formulate the relation between local time of two nodes as follows. CM 2 can convert its local time to CM s local time by using equation 2 (figure 2). In spite of the fact that this calculations have error, if α and β are calculated accurately in each hop, they would remove each other s effect (Equation 3). As result, we will have fairly constant error amount in multi-hop time synchronization algorithm. In our Implementation it is not necessary for CM to have all of parameters (α and β) along the path from CM to CM2. The calculation is done in each node in the path until the packet reaches its destination. (2) Fig. 2. Two nodes from different clusters are synchronizing their clocks α2i i= h CM = h n α 0 Π = j= n i= 2i CM2 + n / 2 β2i β α i= 2i 2i i j= i j= α α 2 j 2 j (3) 3.5 Error Analysis n: Number of nodes in the path between source & destination By broadcasting we can ignore some sources of error in time synchronization [] such as send time and access time delay. These errors depend on parameters that we cannot control; for instance, the load on the sender's CPU or network s load. By broadcasting, these delays become similar for the whole network and as a result we can ignore them [8, ]. In addition, the speed of electro-magnetic signal in air is almost C (Light speed) [] and propagation delay is calculated by this equation: T= x/v, v =c.

SLTP: Scalable Lightweight Time Synchronization Protocol for WSN 543 As a result, since sensors have limited range, propagation delay is very small and can be neglected. The remaining error is received time delay, according to [6] we can receive and process the packet in an interrupt. Calculating α and β in each hop has computational error as was mentioned in section 3.4. Therefore, as the path between source and destination node increases the error grows higher. 4 Performance Evaluation For performance evaluation we used NS 2.3. We selected PC_Avg [5] and RBS [] for performance comparison and created the same test conditions for all of them during the simulation time. We compare SLTP to PC_Avg in terms of accuracy and scalability. Also, we compare it to RBS for overhead and scalability. 4. Simulation Setup Simulation and evaluation of different algorithms that require different clock configurations on one system are very difficult. To create different clock behavior for each node, we use a different clock drift and offset. The values are selected randomly and each node's clock works according to these parameters. As mentioned in [], typically two nodes clock will drift -00µsecond per second. Also we assume that maximum clock offset is second. This pessimistic offset should cover for the propagation delay. All nodes have a range of 00 meters and are located in 000*000 square meters area. Network topology is grid. Default number of nodes is 40 and default simulation time is 0450s. We run the synchronization algorithm every 000 seconds. Each cluster head sends 0 initial synchronization packets (which contain its local time) with a second delay between each transmission. 4.2 Time Routing When a node wants to be synchronized with another one, it has to broadcast a request message. If this node is a cluster member or a gateway, it must send this request to its cluster head(s). The cluster head broadcasts this message to its cluster and saves the address of requesting node as the last hop of this message. Each gateway in this cluster, after receiving this packet, sends it to its entire cluster heads except the one that sent this packet in the first place. Cluster heads that receive this packet will save the gateway s address as the last hop of this message. This procedure is repeated until the packet reaches the destination node. A path is made between requesting node and destination node. In the reverse path in each hop the clock of destination node is converted until it reaches requesting node. 4.3 Simulation Results Since in each run, different paths between source and destination are selected we decided to run the algorithm 0 times for each different situation and calculate the average of error for each run. If gateways with small clock drifts and skew are chosen along the path, average of error will be smaller.

544 S.N. Gelyan et al. 4.3. Time Synchronization Results Figure 3 shows the average of error versus simulation time. It is clear that as time passes, error of SLTP increases gradually, while in case of PC_Avg this increase is dramatic. Since clock of each node works with a different drift and offset, and the difference among clusters clock can be significant, PC_Avg algorithm will not be able to appropriately synchronize different clusters. Because SLTP uses linear regression, it is able to manage this problem. Figure 4, shows the influence of number of hops increase on the error. As indicated, SLTP's error in all situations was significantly less than PC_Avg's. Besides, as the number of hops increases, error ratio of PC_Avg goes up dramatically but in case of SLTP this increase is gradual. Average of error in SLTP in one hop is 0.3± 0.06s. Increasing the number of hops has a little effect on SLTP s error. The reason for this is mentioned in section 3.4. Figure 5 compares the scalability of SLTP versus PC_Avg. We can observe that error of SLTP is almost stable and SLTP s error seems independent of the number of nodes. Figure 6 shows the two algorithms' tolerance under different drifts. Fig. 3. Comparison of SLTP s and PC_Avg s error versus simulation time Fig. 4. Comparison of SLTP s and PC_Avg s error versus number of hops

SLTP: Scalable Lightweight Time Synchronization Protocol for WSN 545 Fig. 5. Comparison of SLTP and PC_Avg in scalability Fig. 6. Comparison of SLTP s and PC_Avg s tolerance under different drift 4.3.2 Overhead By using passive clustering and linear regression we decreased the number of exchanged messages in SLTP. Table shows the number of messages used to synchronize the whole network for SLTP and two similar algorithms. Table. Number of transmitted messages for the following algorithms Number of messages C * m C*(2 + K) N 2 * m Algorithm SLTP PC_Avg RBS C: Number of Cluster Heads K: Number of Cluster Members N: Number of Nodes m: Number of Synchronization Packets C<<K<<N

546 S.N. Gelyan et al. Note that although the number of cluster members in PC_Avg is usually less than the number of synchronization packets, since all of the cluster members send their clocks to their cluster heads at the same time the possibility of collision and packet loss increases. 5 Conclusion We introduced the SLTP for time synchronization in wireless sensor network. By using passive clustering and linear regression, not only the accuracy of time synchronization in comparison to similar algorithms is improved but also we were able to reduce the consumption of energy in each node by decreasing the number of exchanged messages. Because of the fact that by expanding the network error doesn't increase, SLTP is scalable. By using linear regression SLTP can tolerate the changes in drift under various situations. SLTP is the best fit for the following situations: When the lifetime of the network is very important, when we need a large network to monitor a wide area, or when our application requires medium time accuracy. From our point of view SLTP will work in dynamic networks as well as in static networks. In this paper we evaluated SLTP only on static networks. This protocol should be tested on dynamic networks as well. References. Elson, J., Girod, L., Estrin, D.: Fine-Grained Network Time Synchronization Using Reference Broadcasts. In: 5th Symposium on Operating Systems Design and Implementation, vol. 36, pp. 47 63. ACM Press, USA (2002) 2. van Greunen Jan Rabaey, J.: Lightweight Time Synchronization for Sensor Networks. In: WSNA. 2nd ACM International Workshop on Wireless Sensor Networks and Applications, pp. 9 (2003) 3. Ganeriwal, S., Kumar, R., Srivastava, M.B.: Timing-sync Protocol for Sensor Networks. In: st International Conference on Embedded Networked Sensor Systems, pp. 38 49 (2003) 4. Dai, H., Han, R.: TSync: A Lightweight Bidirectional Time Synchronization Service for Wireless Sensor Networks. In: ACM SIGMOBILE Mobile Computing and Communications Review archive, vol. 8, pp. 25 39. ACM Press, USA (2004) 5. Mamun-Or-Rashid, Md., Hong, C.S., Chi-Hyung: Passive Cluster Based Clock Synchronization in Sensor Network. In: Advanced Industrial Conference on Telecommunications AICT/SAPIR/ELETE 2005, pp. 340 345 (2005) 6. Kim, H., Kim, D., Yoo, S.-e.: Cluster-based Hierarchical Time Synchronization for Multihop Wireless Sensor Networks. In: 20th International Conference on Advanced Information Networking and Applications, pp. 38 322 (2006) 7. Sundararaman, B., Buy, U., Kshemkalyani, A.D.: Clock Synchronization for Wireless Sensor Networks: A Survey. Ad Hoc Networks 3(3), 28 323 (2005) 8. Römer, K.: Time Synchronization and Localization in Sensor Networks PhD thesis. No. 606, ETH Zurich, Switzerland (June 2005) 9. Blum, P., Meier, L., Thiele, L.: Improved Interval-Based Clock Synchronization in Sensor Networks. In: IPSN 2004. 3th International Symposium on Information Processing in Sensor Networks, pp. 349 358 (2004)

SLTP: Scalable Lightweight Time Synchronization Protocol for WSN 547 0. Younis, O., Fahmy, S.: Distributed Clustering in Ad-hoc Sensor Network: a Hybrid, Energy-Efficient Approach. In: 23th Annual Joint Conference of the IEEE Computer and Communications Societies, vol., pp. 629 640 (2004). Bush, S.F.: Low-Energy Sensor Network Time Synchronization as an Emergent Property. In: ICCN 2005. 4th International Conference on Computer Communications and Networks, pp. 93 98 (2005) 2. Elson, J., Römer, K.: A New Regime for Time Synchronization. ACM Computer Communication Review (CCR) 33(), 49 54 (2003) 3. Bandyopadhyay, S., Coyle, E.J.: An Energy Efficient Hierarchical Clustering Algorithm for Wireless Sensor Network. In: IEEE INFOCOM, pp. 73 723 (2003) 4. Ha c, A.: Wireless Sensor Network Designs. John Wiley & Sons, USA (2003) 5. Handziski, V., Kopke, A., Karl, H., Drytkiewicz, C.F.W.: Improving the Energy Efficiency of Directed Diffusion Using Passive Clustering. In: European workshop on wireless sensor network. EWSN 2004, pp. 72 87 (2004)