[acm press the international workshop - san francisco, california (2012.06.03-2012.06.03)]...

8
Improving Broadcast Efficiency in Wireless Sensor Network Time Synchronization Protocols Wenxun Huang Department of Electrical and Computer Engineering University of Illinois at Urbana-Champaign Urbana, IL 61801 [email protected] Yujuan Quan Computer Center of Ji Nan University Guangzhou, 510632 China [email protected] Deming Chen Department of Electrical and Computer Engineering University of Illinois at Urbana-Champaign Urbana, IL 61801 [email protected] ABSTRACT In this work we proposed an algorithm to allow nodes in a wireless sensor network to interconnect in a way such that time stamp information can be efficiently distributed for net- work wide synchronization. The algorithm works by first es- tablishing a level hierarchy in the network, and then solves set cover problems between adjacent levels through local in- teractions of the nodes. A proof is included to demonstrate the correctness of the distributed set cover method used in the algorithm. The algorithm features low overhead since it does not require any neighboring node list to be sent, making it ideal for networks with high connectivity. The efficiency and operation of the algorithm is studied through simulations. Categories and Subject Descriptors C.2 [Computer-Communication Networks]: Network Architecture and Design General Terms Algorithm, Design, Experimentation, Performance Keywords Sensor networks, Time Synchronization, Broadcast optimiza- tion 1. INTRODUCTION Wireless sensor networks (WSN) have a wide range of appli- cations. Environment monitoring, the military, and health care are some areas where sensor networks can be applied. On the hardware side, a sensor node typically consists of a radio module, a microprocessor, a few I/O connections and sensors. Berkeley Mica2 mote is a popular choice for con- structing such sensor networks. It runs the TinyOS operat- ing system, which accompanies a sensor network simulation platform called TOSSIM. In addition to a hardware platform, suitable protocols must be developed. Time synchronization is one of the essential services required by a number of applications. For example, in acoustic ranging applications, if 1 meter spatial resolution is desired, the clock error between sensor nodes should not exceed 1 340 2.9 ms. Certain applications such as beam- forming require precise coordination of nodes in the future, which also implies the need for synchronization. Sometimes the requirement of time synchronization is not explicit in applications. For instance, in order to reduce power con- sumption or to communicate in a covert manner, it is de- sirable to form a schedule for communications. A radio can be turned off while it’s not needed. This kind of process is called wakeup scheduling [1]. If the relative error of clocks between sensor nodes is kept small, the scheduling will be very efficient because the nodes will wake up at about the same time and start data transfer immediately instead of having to wait for others due to unsynchronized clocks. In order to synchronize the entire network, a typical multi- hop synchronization protocol needs to broadcast time stamps that originate from a root node across the entire network. In order for the entire network to receive time stamps, every node needs to rebroadcast the message. This creates un- necessarily large communication overhead on the network, especially when the network is well connected. For appli- cations with low communication needs (e.g. monitoring), full network synchronization can be a major source of power consumption. Therefore it is very important to keep the power consumption of the synchronization protocol as low as possible in those scenarios. In this work we explored a reliable method and managed to reduce this communication overhead by a factor of 3 to 8, as discussed in the following sections. 2. BACKGROUND 2.1 Clock Drift Typical clock skew results from absolute frequency error and post-manufacturing frequency variation of a quartz crystal. The absolute frequency error of a crystal from manufacturer is at the order of 10 ppm [13], which is equivalent to 10 microseconds per second. The frequency stability of quartz crystal is affected by several environment conditions such as temperature, acceleration, magnetic field and aging. Among all of these factors, temperature is the most significant one [3]. For tuning fork based oscillators, the coefficient of fre- quency variation is about 0.038 ppm/( C) 2 [13]. Note that the frequency varies as the square of the temperature vari- ation about a center temperature Tm, which is about 25 C for the oscillator cited. Due to this temperature depen- dence, synchronization needs to be performed repeatedly. In reality, it is usually the case that the external environment does not change very fast so that an oscillator has a well defined operation frequency within a period that is not too

Upload: deming

Post on 14-Dec-2016

213 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: [ACM Press the International Workshop - San Francisco, California (2012.06.03-2012.06.03)] Proceedings of the International Workshop on System Level Interconnect Prediction - SLIP

Improving Broadcast Efficiency in Wireless SensorNetwork Time Synchronization Protocols

Wenxun HuangDepartment of Electrical and

Computer EngineeringUniversity of Illinois atUrbana-ChampaignUrbana, IL 61801

[email protected]

Yujuan QuanComputer Center of Ji Nan

UniversityGuangzhou, 510632

[email protected]

Deming ChenDepartment of Electrical and

Computer EngineeringUniversity of Illinois atUrbana-ChampaignUrbana, IL 61801

[email protected]

ABSTRACTIn this work we proposed an algorithm to allow nodes in awireless sensor network to interconnect in a way such thattime stamp information can be efficiently distributed for net-work wide synchronization. The algorithm works by first es-tablishing a level hierarchy in the network, and then solvesset cover problems between adjacent levels through local in-teractions of the nodes. A proof is included to demonstratethe correctness of the distributed set cover method used inthe algorithm. The algorithm features low overhead sinceit does not require any neighboring node list to be sent,making it ideal for networks with high connectivity. Theefficiency and operation of the algorithm is studied throughsimulations.

Categories and Subject DescriptorsC.2 [Computer-Communication Networks]: NetworkArchitecture and Design

General TermsAlgorithm, Design, Experimentation, Performance

KeywordsSensor networks, Time Synchronization, Broadcast optimiza-tion

1. INTRODUCTIONWireless sensor networks (WSN) have a wide range of appli-cations. Environment monitoring, the military, and healthcare are some areas where sensor networks can be applied.On the hardware side, a sensor node typically consists of aradio module, a microprocessor, a few I/O connections andsensors. Berkeley Mica2 mote is a popular choice for con-structing such sensor networks. It runs the TinyOS operat-ing system, which accompanies a sensor network simulationplatform called TOSSIM.

In addition to a hardware platform, suitable protocols mustbe developed. Time synchronization is one of the essentialservices required by a number of applications. For example,in acoustic ranging applications, if 1 meter spatial resolutionis desired, the clock error between sensor nodes should notexceed 1

340≈ 2.9 ms. Certain applications such as beam-

forming require precise coordination of nodes in the future,which also implies the need for synchronization. Sometimes

the requirement of time synchronization is not explicit inapplications. For instance, in order to reduce power con-sumption or to communicate in a covert manner, it is de-sirable to form a schedule for communications. A radio canbe turned off while it’s not needed. This kind of process iscalled wakeup scheduling [1]. If the relative error of clocksbetween sensor nodes is kept small, the scheduling will bevery efficient because the nodes will wake up at about thesame time and start data transfer immediately instead ofhaving to wait for others due to unsynchronized clocks.

In order to synchronize the entire network, a typical multi-hop synchronization protocol needs to broadcast time stampsthat originate from a root node across the entire network.In order for the entire network to receive time stamps, everynode needs to rebroadcast the message. This creates un-necessarily large communication overhead on the network,especially when the network is well connected. For appli-cations with low communication needs (e.g. monitoring),full network synchronization can be a major source of powerconsumption. Therefore it is very important to keep thepower consumption of the synchronization protocol as lowas possible in those scenarios. In this work we explored areliable method and managed to reduce this communicationoverhead by a factor of 3 to 8, as discussed in the followingsections.

2. BACKGROUND2.1 Clock DriftTypical clock skew results from absolute frequency error andpost-manufacturing frequency variation of a quartz crystal.The absolute frequency error of a crystal from manufactureris at the order of 10 ppm [13], which is equivalent to 10microseconds per second. The frequency stability of quartzcrystal is affected by several environment conditions such astemperature, acceleration, magnetic field and aging. Amongall of these factors, temperature is the most significant one[3]. For tuning fork based oscillators, the coefficient of fre-quency variation is about 0.038 ppm/(◦C)2 [13]. Note thatthe frequency varies as the square of the temperature vari-ation about a center temperature Tm, which is about 25◦C for the oscillator cited. Due to this temperature depen-dence, synchronization needs to be performed repeatedly. Inreality, it is usually the case that the external environmentdoes not change very fast so that an oscillator has a welldefined operation frequency within a period that is not too

Page 2: [ACM Press the International Workshop - San Francisco, California (2012.06.03-2012.06.03)] Proceedings of the International Workshop on System Level Interconnect Prediction - SLIP

long. Therefore if a synchronization algorithm can make anaccurate estimate of frequency difference between nodes, thesynchronization period can be prolonged to preserve energy.

2.2 Synchronization AlgorithmsThere has been a lot of research effort devoted to synchro-nization methods that are accurate and low power. Typi-cally, power consumption of a sensor node is dominated byits radio module. Therefore, it is critical to reduce the num-ber of messages exchanged for synchronization, especiallywhen the network is large where a lot of nodes need to besynchronized. We’ll review three classic algorithms, RBS,TPSN, and FTSP [4, 10, 2]. They represent three maincategories of synchronization algorithms – receiver-receiver,two-way sender-receiver, and one-way sender receiver.

Reference-broadcast synchronization (RBS) relies on a schemecalled receiver-receiver synchronization, where the receiversof timestamps synchronize with each other. First, a ref-erence node (beacon) broadcasts a message without timestamp. All nodes record their local time upon receiving themessage. Later, the nodes exchange their messages witheach other to analyze clock delays. This kind of algorithmis commonly referred to as receiver-receiver synchronization,where receivers of synchronization message synchronize witheach other rather than with the sender. The advantage ofusing receiver-receiver sync is the exclusion of time-stampinguncertainty on the sender side. However, this algorithm doesnot scale well with the number of nodes. If each node needsto exchange time stamp with all other nodes, the total num-ber of messages sent is proportional to the square of thenumber of nodes. The collision caused by the large numberof messages makes synchronization impossible at some point[11]. Also, the requirement of a beacon that can reach allother sensor nodes is unrealistic when the network is large.Such specialized node can also become the single point offailure of the algorithm.

Timing-sync protocol for sensor networks (TPSN) synchro-nizes all nodes in a sensor network to one reference nodethrough pairwise synchronizations. The first phase of thealgorithm is level discovery, through which a spanning treestructure is generated. Then two-way sender-receiver syn-chronizations are performed along the edges of the tree tosynchronize the parent and its children. Upon the comple-tion of synchronization stage, all nodes should be synchro-nized to the root of the tree. By time stamping messages atthe MAC layer directly, TPSN reduces uncertainty of mes-sage delay at the sender side, which improves performance.It is shown by a sender-receiver synchronization experimentthat TPSN achieves average clock error of 16.9 μs, a re-duction of more than 40% compared to 29.13 μs achievedby RBS [4]. However, TPSN does not estimate the rate ofclock drift, which limits the achievable accuracy.

Flooding time synchronization protocol (FTSP) has the small-est average clock error among the three algorithms, thanksto its better time stamping and drift management [10]. FTSPalso takes advantage of the broadcast nature of sensor net-works to reduce the amount of messages overhead from pair-wise synchronization. In fact, FTSP introduces the smallestamount of traffic among the three.

The operation of FTSP is relatively simple. Each node in thenetwork periodically broadcast messages that contain thenode’s own estimate for global time. When a node receivesa new message, it records the local time when the messagearrives, which, together with the time stamp contained inthe message, form an entry in a regression table. Linearregression is then performed to calculate the relative clockrate and offset. A root election scheme is used to create aroot as the time reference of the network.

FTSP has outstanding robustness. In the experiment per-formed in [10], the researchers turned off the root node,switched off half of the network and later turned them backon without significant impacts on the operation of the al-gorithm. This is partly because FTSP does not require tomaintain any explicit topological structure. The only localstate kept by each sensor node is the root ID.

Among the three algorithms discussed FTSP is the promis-ing method to achieve synchronization across an Ad HocWSN. However, one particular problem of FTSP is the un-conditional broadcast by all the sensor nodes. In a wellconnected network, it is likely that the entire network canbe covered by a small fraction of the nodes. For the rest ofthe nodes, broadcasting timestamps is a waste of not onlyenergy, but also the shared channel resources. Therefore, itwill be desirable to have an algorithm that maintains thesame level of precision of FTSP, while reducing the overallbroadcast activities in situations like this.

3. DESIGNING THE ALGORITHM3.1 Model and AssumptionsIn the analysis following, the network is modeled as a graphwhere vertices represent sensor nodes, and edges representbidirectional links between nodes. Each node has a uniqueidentifier. Each node also has the necessary computationalpower and storage capacity to carry out steps in the algo-rithm.

3.2 AnalysisThe synchronization message must originate from some des-ignated node, which in FTSP is called synchronization root.The problem is then to distribute the information from theroot over the entire network, with as few active nodes aspossible. Adopting the graph representation of a sensor net-work, it is not hard to realize that this problem is essentiallyfinding the maximum leaf spanning tree (MLST) of the net-work’s graph representation because the more leafy the treeis, the less number of nodes are depended upon for passingthe synchronization packet. A simple example is shown inFigure 1, where it is possible to reduce the broadcast activ-ity by 60% compared to simple flooding. However, findingthe MLST of a graph is a proven NP-complete problem [5],which implies polynomial time solution is quite unlikely tobe found. Therefore, for practical sensor networks with hun-dreds or even thousands of nodes, it is very hard to find theoptimal solution, especially for sensor nodes which have verylimited computing capabilities.

There have been some study on polynomial time approxi-mation algorithms [6, 7]. However, even if the hardness ofthe problem is reduced to within polynomial time complex-ity, the proposed algorithm is still not suitable for use in

Page 3: [ACM Press the International Workshop - San Francisco, California (2012.06.03-2012.06.03)] Proceedings of the International Workshop on System Level Interconnect Prediction - SLIP

Figure 1: MLST solution to a simple network. Ei-ther of the solid nodes can be the root. In the con-text of our problem, solid nodes are active and re-quired to broadcast. Dashed edge represents a linkthat exists but unnecessary for the purpose of broad-casting sync message when R is chosen as the root.

WSN because they are centralized algorithms. Sensor net-work is a highly distributed system where in general noneof the nodes has the information about the entire network’stopology. In order to run a centralized algorithm on the net-work, topological information first needs to be aggregated atone designated node, where the computation is carried out.Then, the result needs to be distributed over the network.Obviously this involves a lot of communication overhead.The computational requirement for the designated node isalso very high, if not unsurmountable. What makes thingseven worse is that a sensor network is dynamic, where nodescan go missing or be added at any moment. A centralizedalgorithm needs to be rerun periodically to keep up withthe changes. All these shortcomings prevent the use of cen-tralized algorithms in sensor networks that need to be self-organized.

This paper’s approach to the problem can be logically di-vided into three steps (even though they actually happenconcurrently). A demo of the process is shown in Figure 2.The first step is root election. This step is the same as theone adopted by FTSP. The node with the smallest ID num-ber will be selected as the root of the network. The nextstep is level discovery, during which the nodes will recordtheir distances from the root as their level numbers. We candefine the level number of root to be 0. In future discus-sions, a node is said to be in upper level if it is closer tothe root; a node is in lower level if it is farther away fromthe root. Note that a node in lower level actually has largerlevel number.

The last step is the key to reducing broadcast activities.Each node on level l needs to decide whether it can stopbroadcasting while still keeping all the nodes in level l + 1covered. This is a set cover problem, where given a set andsome of its subsets, one needs to find the smallest numberof subsets to cover the original set. Set cover can be ex-pressed as an integer linear programming (ILP) problem, aclassical NP-complete problem. Interestingly, a very obviousapproach to this problem, the greedy algorithm, is the bestpossible approximation in polynomial time [9]. In the greedyalgorithm, the subset that contains the most number of un-covered elements is chosen iteratively until all elements arecovered. Here we propose a distributed algorithm that cangive the same solution as the centralized greedy algorithm.For completeness of the work, the proof of correctness is

Figure 2: Demonstration of the three phases of theproposed approach. a. The original network; b.After root election; c. After level discovery; d. Aftersolving set cover problem between levels.

included in the section 5.

4. DISTRIBUTED SET COVER ALGORITHM4.1 General ideaThe basic idea of this algorithm is to optimize through localinteractions between nodes on adjacent levels. We can thinkof a broadcasting node on an upper level as the provider fora service which costs some fix amount G. The subscribers,located in the lower level, are required to pay the providersfor running the service. The service charge should be splitevenly by the nodes subscribing to a shared provider. Thereis no limit on how much each individual subscriber is willingto pay but naturally it will attempt to find the best ‘deal’and subscribe to the provider that offers the lowest price. Inthe end, the upper level nodes that cover the most number oflower level nodes should be able to attract subscribers withtheir low prices. Upper level nodes with smaller coveragewill lose the competition and may eventually decide to stopbroadcasting upon realizing that they have no subscribers.

The key challenge of designing the algorithm is to figure outa way for the provider to price properly. Merely consideringcurrent subscribers when calculating the price is not enoughbecause the unnecessarily high price due to a temporary lackof subscribers can cause the solution to be stuck at localextrema. Therefore it is important for a provider to alsoconsider its potential subscribers — its children that are notbut should be its subscribers.

In order for a provider to be able to figure out its potentialsubscribers, each node must include the price it’s currentlypaying in the announcement message. This way, a providerwill be able to estimate the number of subscribers it canpotentially have by examining the prices they are currentlypaying.

It is also necessary to include the ID of the subscriber in theannouncement because it is possible that multiple providerscan provide the service at the same lowest price level. Ifwe let the node randomly pick one of them, the behaviorof subscribers will be unpredictable. As a result, it will beimpossible for a provider to estimate its potential subscribers

Page 4: [ACM Press the International Workshop - San Francisco, California (2012.06.03-2012.06.03)] Proceedings of the International Workshop on System Level Interconnect Prediction - SLIP

accurately. Hence this additional rule: In case of a price tie,a subscriber should always choose the provider with lowest IDnumber.

4.2 Dealing with topological changesSo far we have not considered the topological changes thatcan take place in the network. What will happen whena node is removed? We can assume the network remainsconnected after the change.

Based on the previous discussions there are three types ofroles in the network, the root, providers, and subscribers.Each node can take on one or two of the roles. We need todiscuss each situation separately.

If the root is removed, the impact on the algorithm will besignificant. After not receiving new timestamps for certainnumber of synchronization cycles, all nodes should time outand start over from the root election phase. All topologicalinformation should be discarded. To deal with this case eachnode needs a counter for root time out.

If a provider node is removed, although its children are stillconnected to the network, they may not be able to remain onthe same level. In an attempt to stay on the same level, theorphans will reset their paying price and current providerID to some large values and announce the changes so thatupper level nodes will pick up them as subscribers, becausethey are currently paying more than the upper level nodescharge. If the orphans still cannot get response from anyupper level node by doing this, it should reset its level tosome large number and broadcast the changes. As long asit has other neighbors connected to the network, it will beassigned a new level through messages from other nodes andbecome part of the network again. Two constants related tothis are PROVIDER TIMEOUT and LEVEL TIMEOUT.Both time out events can share a single counter, which isreset upon receiving time stamp from the node’s provider.

When a child is removed, it is hard for its provider to tellif the node is gone or simply inactive. If an inactive nodeis allowed to stay silent indefinitely, there is virtually noway to tell the difference by overhearing its communications.Therefore, all nodes should be required to communicate pe-riodically. This period is specified by LEAF TIMEOUT,which can be set to a large value in practice when it is rarefor nodes to go missing. This feature also has the bene-fit of periodically clearing out phantom entries that mighthave been added by mistake due to bad estimate of the levelnumber.

4.3 Implementation DetailsThe implementation can be divided into two parts. The firstpart, also the easier part, is implementing the core algorithmdescribed in section 5. The rest of the implementation basi-cally needs to maintain the data structures required by thecore algorithm, mainly the children list, and also to handlemessage exchanges, so that the data structures at each nodeare up to date. As one particular implementation of the al-gorithm, we used two types of messages to achieve the func-tionalities described above. One is called MSG TS and theother is MSG ANN, denoting time stamp-like message andannouncement-like message, respectively. The data fields

Table 1: Fields in MSG TSField name Explanation

rootID Node that the sender synchronizes tolevel Level of the sender

seqNum Sequence number of the time stampglobalTime Sender’s estimate of the time

Table 2: Fields in MSG ANNField name Explanation

rootID Node that the sender synchronizes tolevel Level of the senderpaying The price that sender paysprovider ID of the sender’s providerprice The price that sender charges

contained in each type of messages are listed and explainedin Tables 1 and 2.

The two types of messages are intended for different pur-poses. MSG TS is mainly used for root election, level dis-covery and sending time stamps. It is always initiated by theroot node, and forwarded by the provider nodes determinedby the algorithm. The frequency at which this message isgenerated depends on the chosen resynchronization period.MSG ANN is used for transactions related to the distributedset cover algorithm. It can be initiated by any node whenthere is an update to the fields inside MSG ANN, for ex-ample, when a price change occurs. Note that even thoughMSG ANN can be initiated by any node, nodes are only al-lowed to send MSG ANN once every certain amount of timeso that more changes can be merged in a single message, im-proving the efficiency of this process.

At the beginning of the operation, there is no root in thenetwork. Since root is the only node that will initiate timestamp broadcast, all nodes will soon time out after not re-ceiving any time stamp update and declare themselves asthe root. MSG TS will be sent across the network andeventually one node with lowest ID will win the election.At the same time, every node will identify its distance tothe root. In this process, nodes discover their neighborsas potential providers and subscribers. Since each node bydefault pays and charges the maximum price, every nodeexcept root will be considered as a subscriber by its upperlevel nodes, changing the price of the providers and mak-ing it necessary for them to announce price changes throughanother MSG ANN. Nodes with more children will chargea lower price, attracting even more children and vice versa.After several rounds of transactions, the network reachesstable state, without any need to send further MSG ANNmessages. The details of the find price function for deter-mining the number of subscribers can be found in section5.

5. CORE ALGORITHM AND PROOF OF COR-RECTNESS

5.1 Centralized greedy algorithmThe set cover problem (often referred to as the problem later)is typically defined as follows: Given a finite set X, and a

Page 5: [ACM Press the International Workshop - San Francisco, California (2012.06.03-2012.06.03)] Proceedings of the International Workshop on System Level Interconnect Prediction - SLIP

collection F of subsets of X, where every element in X isincluded by at least one element in F , that is:

X =⋃

S∈F

S

The objective is to find a C ⊆ F with minimum |C| suchthat

X =⋃

S∈C

S

There exist many flavors of greedy algorithms to approxi-mate the optimal set cover problem. For the convenience ofproof and consistency with the proposed distributed algo-rithm, the version used in our discussion is stated below:

Algorithm 1 GreedySetCover(X,F )

Require: F = {(ai, Si) : ai ∈ N; ai �= aj ∨ i = j;Si ⊆X;X =

⋃∀i Si}

1: C ← ∅2: while X �= ∅ do3: select (ai, Si) ∈ F such that Si has the most number

of elements or the smallest ai among all sets that havethe same most number of elements.

4: X ← X − Si

5: F ← {(ak, Sk − Si) : (ak, Sk) ∈ F, ak �= ai}6: C ← C + {(ai, Si)}7: end while8: return C

The algorithm’s assumption on F differs slightly from theproblem definition in that the algorithm assumes each sub-set Si in F has a unique label ai according to which thesubsets can be ordered. For each iteration, the subset withthe largest number of elements is chosen. If there are multi-ple subsets with the same number of elements, the one withthe smallest ai is chosen. The original problem is then re-placed by a new, but smaller problem (X ′, F ′), by excludingthe elements in Si from X and from all Sj , j �= i and exclud-ing chosen cover (ai, Si) from F . In the end the algorithmreturns a sequence {c1, . . . , cm}, where c1 is the cover cho-sen in the first iteration, c2 the second, . . . , assuming thenumber of iterations is m. Note that, ci does not necessarilybelong to F because Si can be a result of modifications byline 5 in some previous iterations. We denote Pn = (Xn, Fn)as the problem after the nth iteration completes execution.In particular, P0 = (X,F ), which is the original specifica-tion of the problem; Pm = (∅, {(ai, ∅), ai /∈ C}), the emptyproblem and GreedySetCover(Pm) = ∅.

5.2 Distributed greedy algorithmHere we describe the distributed algorithm that allows upperlevel nodes to determine the price for its subscribers, whichis the key to the transaction that will reduce the numberof active nodes. Children = {x1, . . . , xn} is a sorted list oftuples xi = (IDi, pricei, provideri), where ID is the child’sunique number, Price is the price the child is currently pay-ing, and Provider is the upper level node which the childis currently subscribing to. The order of the sequence isspecified in the requirement section in the algorithm. Aninformal description of the order is as follows: first the chil-dren are sorted in descending order of price; in case of a tie

in price, the children are sorted in descending order of theirprovider IDs. This sequence is updated by a function rou-tine upon receiving a message that indicates a change in thechild’s provider or price. The total cost of the providers isset to some number G, which will be split evenly among itssubscribers. In actual implementations, G should not be toosmall to avoid rounding errors when divided by the numberof subscribers. A return value of −1 indicates the node willnot have any subscribers and thus will not broadcast.

Algorithm 2 FindPrice(Children)

Require: ∀xi, xj ∈ Children, i < j → pricei > pricej or(pricei = pricej and provideri > providerj)

1: n ← 02: for i = 1 to |Children| do3: if pricei >

Gior (pricei =

Giand provideri ≥ myID)

then4: n ← i5: end if6: end for7: if n = 0 then8: return −1 {Price is infinite}9: else10: return G

n{Cost is split evenly}

11: end if

We have assumed in the algorithm that the actual imple-mentation guarantees up-to-date and consistent informationon both the providers’ and subscribers’ sides through otherroutines not shown here. For example, if there is a change inthe price level after the execution of FindPrice, the node willsend a broadcast message to keep its children up to date.

The algorithm that determines which upper level node tosubscribe to is trivial. The node simply chooses to subscribeto the provider with lowest price. In case of a tie in price,the node will choose to subscribe to the provider with lowestID number.

5.3 Equivalence of the twoFirst we need to define the problem specification (X,F ) inthe context of a sensor network.

Definition 1. The problem specification (X,F ), whereX ={ID1, . . . , IDn}, F = {(ai, Si) : ai ∈ N;Si ⊆ X;X =

⋃∀i Si},

in a hierarchical sensor network implies that:

• There are n nodes on level l, with unique IDs {ID1, . . . , IDn}• There are |F | nodes on level l − 1, with unique IDs

specified by ai

• Nodes in Si are the children of node ai, ∀(ai, Si) ∈ F

Definition 2. A cover ci is in solution set C of the dis-tributed algorithm, if and only if FindPrice(Childreni) �=−1 for an arbitrarily long time.

Theorem 1. Given specification (X,F ) of the problem,the solution set given by centralized greedy algorithm isCc = {c1, . . . , cm}, the solution set given by proposed dis-tributed algorithm is Cd. Cc = Cd.

Page 6: [ACM Press the International Workshop - San Francisco, California (2012.06.03-2012.06.03)] Proceedings of the International Workshop on System Level Interconnect Prediction - SLIP

Proof. We first look at the cover c1 = (a1, S1), whichis the first set chosen by the centralized algorithm. c1 thensatisfies that S1 has the most number of elements or amongthose sets that have the same number of elements, a1 issmallest. By looking at the last iteration of FindPrice, wecan see that, under this condition, FindPrice(Children1) =G

|S1| �= −1. By definition 2, c1 is in Cd.

Before we move to pick the next cover, we consider trans-forming the network into some equivalent form to simplifythe problem.

Let (ak, Sk), k �= 1 be a cover that shares at least one childwith c1, that is, Sk ∩ S1 = D �= ∅. Assume |Sk − S1| = m,|D| = p. Then |Sk| = m+p. Recalling the ordering rules, theChildren list for node ak will be made up of some m entries(which we do not care), followed by p entries of (·, G

|S1| , a1),

where the first neglected element is the child’s ID.

We next prove that those p entries can be removed withoutaffecting the return value of FindPrice(Childrenk).

If the return value of FindPrice(Childreni) were to be af-fected, the final n value in algorithm 2 needs to be fromm+ 1 to m+ p. We only need to prove this is impossible.

For iterations m+1 ≤ i ≤ m+ p− 1 the condition “pricei >Gi” in line 3 is not met because pricei =

G|S1| ≤ G

m+p< G

i.

Therefore, n cannot be m+ 1 . . .m+ p− 1.

For the iteration i = m+ p:

As mentioned previously, since c1 is chosen by the central-ized algorithm, one of the following must be true:

1. m+ p < |S1|2. m+ p = |S1| ∧ a1 < ak

When the first condition is true, the condition “pricei >Gi”

in algorithm line 3 is not met.

When the second condition is true, the condition“ provideri ≥myID” in algorithm line 3 is not met. Therefore, n cannotbe m+ p either.

Therefore, for the purpose of analyzing the rest of the stepsof the distributed algorithm, we can assume the coverednodes are removed from the network because they can nolonger affect the operation of the algorithm. We can substi-tute the network with a new one where the elements in S1

are excluded from X and from all Sj , j �= 1 and excludingchosen cover (a1, S1) from F . This is the same way the cen-tralized algorithm transfers the original problem (X,F ) tothe next problem (X ′, F ′).

Since both algorithms choose the same cover in the initialstep for a problem P , and turn the problem into the samenext problem P ′, Cc = Cd.

6. EXPERIMENTSThe proposed algorithm is implemented and tested on Castalia,a WSN simulation package based on the OMNeT++ simu-lation platform. Several experiments have been designed totest the algorithm’s performance and stability.

6.1 AccuracyIn sender-receiver synchronization protocols, error will buildup between each level of nodes due to uncertainty in takingthe time stamps. The accuracy of the algorithm is comparedagainst FTSP on a 20-node linear network. A zero-averageuniform distribution of 20 μs error is added to each timestamp. The result is shown in Figure 3. It can be seen fromthe graph that FTSP suffers from an exponential increasein error as distance from root increases. This significantimprovement from FTSP comes from fast propagation ofsynchronization messages in this implementation, which isstudied in detail in [8].

Figure 3: Synchronization error at different dis-tances from root. Error bar indicates 95% confi-dence interval.

6.2 PerformanceIn this section, we examine the algorithm in terms of itsability to reduce active nodes in the network. For the firstexperiment, the sensor nodes are placed on a rectangulargrid with node 1 at the center.

The topology configuration reached equilibrium starting fromthe 3rd synchronization cycle. The stabilized configurationis shown in Figure 4.

The number of active nodes in the network is equal to thenumber of non-leaf nodes in the generated tree. In this case,9 out of the 35 nodes need to broadcast to cover the entirenetwork. If we define the gain as total number of nodesdivided by the number of required active node, in this casethe gain is about 3.89.

Later in the simulation, node 1, the root of the network, isswitched off to simulate a root failure. The network againreached equilibrium near the end of the experiment, when

Page 7: [ACM Press the International Workshop - San Francisco, California (2012.06.03-2012.06.03)] Proceedings of the International Workshop on System Level Interconnect Prediction - SLIP

9

2

10

3 4

12

5 6

13

7

8

1

11 14

15 16 17

18

19

26

20 21

2322 24 25 27 28

29 30 31 32 33 34 35

Figure 4: The network topology resulting from theproposed algorithm.

all nodes synchronized to node 2, the node with smallest IDafter node 1. The organization of the network at the end isshown in Figure 5. There are 11 active nodes in total, out ofthe remaining 34 nodes. This shows that the proposed algo-rithm is capable of adapting to significant topology changes.

2

9

3 4 5

12

6

13

7

8 10

17

11 14

15 16

18

25

19 20 21

22 23 24 26 27 28

29 30 31 32 33 34 35

Figure 5: The stabilized network topology afternode 1 is switched off.

A plot with the number of transmitted messages through outthe experiment is shown in Figure 6. Note the activity ofthe proposed algorithm at the beginning and the middle ofthe simulation. The high activity is due to frequent updateswith announcement type messages. Despite the relativelyhigh cost during topology changes in network, it can be seenfrom the plot that it won’t take long before the benefitsoutweigh the one-time cost.

10 20 30 40Synchronization cycle (30s)

0

50

100

150

200

250

Num

ber

of

TX

message

Set cover reduce

FTSP

Figure 6: Radio transmit events in the experiment.

In order to study the efficiency of the algorithm in differentnetwork sizes, experiments with randomly generated net-work are performed and results shown in Figure 7 and 8.For each of the experiment, the communication range of thenode is increased gradually. As a result, the average degreeincreases because more nodes can now communicate witheach other. The improved connectivity allows the networkto be covered with a smaller number of nodes, reflected bya higher gain, which is defined as the ratio of network sizeand the number of active nodes. The transmission activ-ity of the network is reduced by a factor of 3 to 8 by theproposed algorithm.

40 50 60 70 80 90 100Communication range (m)

0

5

10

15

20

25Number of nodes: 50 Field size: 200

Average degree

Number of active nodes

Gain

Figure 7: Gain, average degree and number of activenodes is shown for a random distribution of 50 nodesin a 200x200 m field

The way network activity translates to power saving largelydepends on the MAC protocol used in the network. For anon duty-cycled CSMA protocol, reducing the traffic loadhas little impact on the overall energy consumption whenthe traffic load is already light because most of the energy

Page 8: [ACM Press the International Workshop - San Francisco, California (2012.06.03-2012.06.03)] Proceedings of the International Workshop on System Level Interconnect Prediction - SLIP

60 70 80 90 100 110 120Communication range (m)

0

5

10

15

20

25

30

35

40Number of nodes: 100 Field size: 400

Average degree

Number of active nodes

Gain

Figure 8: Gain, average degree and number of ac-tive nodes is shown for a random distribution of 100nodes in a 400x400 m field

is wasted on idle listening. Even with a duty cycled MACprotocol such as S-MAC [14], the energy saving by reducingthe network activity is very small because the time a nodespends on idle listening with a 10% duty cycle is still muchlonger than the duration of active communication.

This reduced broadcast activity provided by this algorithmis expected to be mostly useful for low traffic network thatemploys asynchronous low power listening (LPL) protocolssuch as B-MAC [12]. When LPL is used, a node periodicallywakes up very briefly to assess the status of the channel. Ifthere is no activity the node goes to sleep immediately; oth-erwise, it stays awake for data transmission. In this schemeit can be costly for a sender to initiate a transmission be-cause a preamble at least as long as the check period must beused to guarantee the target node is awake by the time ac-tual data transmission starts. Transmissions are also costlyfor other non-communicating nodes because all neighboringnodes will be waken up, even though they may not be thetarget of the transmission. Therefore, the number of trans-missions is directly proportional to the number of transmit-ted messages, which dominates the energy consumption.

7. CONCLUSIONS AND FUTURE WORKWe have demonstrated a reliable, efficient and low overheadalgorithm for interconnecting sensor network nodes to re-duce the broadcast activity required for full network syn-chronization. The messages used for algorithm transactionsare small because no neighborhood information needs to beattached. In the experiments performed, the network activ-ity can be reduced by a factor of 3 to 8. The algorithm isalso shown to adapt to significant topology changes quickly.

In future work, we can consider varying the price of eachbroadcast node. For example, if the battery is running low,the node can increase its price to drive away its subscribersto save energy; when a node needs frequent communicationfor some other reasons, the node can reduce its subscriptioncost because time stamps can potentially be appended to

packets it sends with a negligible overhead. It is also verydesirable, to have actual power usage analyzed and life timeof the network estimated.

8. REFERENCES[1] Abtin Keshavarzian and Huang Lee and Lakshmi

Venkatraman. Wakeup Scheduling in Wireless SensorNetworks. MobiHoc, May 2006.

[2] J. Elson, L. Girod, and D. Estrin. Fine-GrainedNetwork Time Synchronization using ReferenceBroadcasts. Proceedings of the Fifth Symposium onOperating Systems Design and Implementation (OSDI2002), December 2002.

[3] J.-J. Gagnepain. Sensitivity of Quartz Oscillators tothe Environment: Characterization Methods andPitfalls. IEEE Transactions on Ultrasonics,Ferroelectrics, and Frequency Control, 37(5),September 1990.

[4] S. Ganeriwal, R. K. Mani, and B. Srivastava.Timing-sync Protocol for Sensor Networks. SenSys,November 2003.

[5] M. R. Garey and D. S. Johnson. Computers andIntractability; A Guide to the Theory ofNP-Completeness. W. H. Freeman & Co., New York,NY, USA, 1990.

[6] H. i Lu and R. Ravi. The power of local optimization:Approximation algorithms for maximum-leaf spanningtree. In In Proceedings, Thirtieth Annual AllertonConference on Communication, Control andComputing, pages 533–542, 1996.

[7] H. i Lu and R. Ravi. Approximating maximum leafspanning trees in almost linear time. Journal ofAlgorithms, 29:132–141, 1998.

[8] C. Lenzen, P. Sommer, and R. Wattenhofer. Optimalclock synchronization in networks. In Proceedings ofthe 7th ACM Conference on Embedded NetworkedSensor Systems, SenSys ’09, pages 225–238, NewYork, NY, USA, 2009. ACM.

[9] C. Lund and M. Yannakakis. On the hardness ofapproximating minimization problems. J. ACM,41:960–981, September 1994.

[10] Mikllos Marloti and Branislav Kusy and Gyula Simon

and lckos Ll ↪edeczi. The Flooding TimeSynchronization Protocol. SenSys, November 2004.

[11] O. Mirabella, M. Brischetto, and A. Raucea.Evaluation of Clock Synchronization Protocols forWireless Sensor Networks. Wireless Days (WD), 20092nd IFIP, December 2009.

[12] J. Polastre, J. Hill, and D. Culler. Versatile low powermedia access for wireless sensor networks. InProceedings of the 2nd international conference onEmbedded networked sensor systems, SenSys ’04, pages95–107, New York, NY, USA, 2004. ACM.

[13] TGS (USA), INC. Product Information, CCMC series,October 2009. http://www.tgsinc.us/productFiles/CCMC\_serie.pdf.

[14] W. Ye, J. Heidemann, and D. Estrin. Anenergy-efficient mac protocol for wireless sensornetworks. In INFOCOM 2002. Twenty-First AnnualJoint Conference of the IEEE Computer andCommunications Societies. Proceedings. IEEE,volume 3, pages 1567 – 1576 vol.3, 2002.