69
EDOARDO D ELIA ANALYSIS OF CLOCKS SYNCHRONIZATION ALGORITHMS IN WIRELESS SENSOR NETWORKS TESI DI LAUREA MAGISTRALE Relatore: Chiar.mo Prof. Sandro Zampieri Co-relatore: Chiar.mo Dr. Ruggero Carli Università degli Studi di Padova Facoltà di Ingegneria Dipartimento di Ignegneria dell’Informazione Marzo 2011

Analysis of Clocks Synchronization Algorithms in Wireless ...tesi.cab.unipd.it/28288/1/thesis.pdf · ANALYSIS OF CLOCKS SYNCHRONIZATION ALGORITHMS IN WIRELESS SENSOR NETWORKS TESI

  • Upload
    others

  • View
    4

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Analysis of Clocks Synchronization Algorithms in Wireless ...tesi.cab.unipd.it/28288/1/thesis.pdf · ANALYSIS OF CLOCKS SYNCHRONIZATION ALGORITHMS IN WIRELESS SENSOR NETWORKS TESI

E D OA R D O D ’E L I A

A N A LYS I S O F C LO C K S

S Y N C H RO N I Z AT I O N

A LG O R I T H M S I N W I R E L E S S

S E N S O R N E T WO R K S

T E S I D I L AU R E A M AG I S T R A L E

Relatore: Chiar.mo Prof. Sandro ZampieriCo-relatore: Chiar.mo Dr. Ruggero Carli

Università degli Studi di PadovaFacoltà di IngegneriaDipartimento di Ignegneria dell’InformazioneMarzo 2011

Page 2: Analysis of Clocks Synchronization Algorithms in Wireless ...tesi.cab.unipd.it/28288/1/thesis.pdf · ANALYSIS OF CLOCKS SYNCHRONIZATION ALGORITHMS IN WIRELESS SENSOR NETWORKS TESI

Edoardo D’Elia: Analysis of Clocks Synchronization Algorithms inWireless Sensor Networks, Tesi di laurea magistrale, © marzo 2011.

Page 3: Analysis of Clocks Synchronization Algorithms in Wireless ...tesi.cab.unipd.it/28288/1/thesis.pdf · ANALYSIS OF CLOCKS SYNCHRONIZATION ALGORITHMS IN WIRELESS SENSOR NETWORKS TESI

L’uomo vede meglio le cose quando ne indaga accuratamentel’origine, che è la parte più importante di esse. Quando ne

conosce la spiegazione, esse appaiono più belle.

— Gilbert K. Chesterton

Dedicato a tutti i miei fantastici Amici

Page 4: Analysis of Clocks Synchronization Algorithms in Wireless ...tesi.cab.unipd.it/28288/1/thesis.pdf · ANALYSIS OF CLOCKS SYNCHRONIZATION ALGORITHMS IN WIRELESS SENSOR NETWORKS TESI
Page 5: Analysis of Clocks Synchronization Algorithms in Wireless ...tesi.cab.unipd.it/28288/1/thesis.pdf · ANALYSIS OF CLOCKS SYNCHRONIZATION ALGORITHMS IN WIRELESS SENSOR NETWORKS TESI

A B S T R AC T

In this work we analyze a novel distributed clock synchroniza-tion protocol. The algorithm compensates for both initial off-sets and differences in internal clock speeds and is based on aProportional-Integral (PI) controller that treats the different clockspeeds as unknown constant disturbances and the different clockoffsets as different initial conditions for the system dynamics.

The clocks are assumed to exchange information through ei-ther a symmetric-gossip or an asymmetric-gossip communica-tion protocols.

Convergence of the algorithm is proved and analyzed with re-spect to the controller parameter. An intensive simulation studyis provided to compare our algorithm with other distributedstrategies presented in literature.

S O M M A R I O

In questo lavoro analizziamo un nuovo protocollo distribuito perla sincronizzazione di orologi. L’algoritmo compensa sia gli off-set iniziali che le velocità interne degli orologi e si basa su uncontrollore Proporzionale-Integrativo (PI) che tratta le diversevelocità come incogniti disturbi costanti e i differenti offset comedistinte condizioni iniziali.

Assumeremo che gli orologi possano scambiarsi informazioniattraverso protocolli di comunicazione di tipo gossip simmetricoo asimmetrico.

Verrà fornita una prova della convergenza dell’algoritmo edanalizzata con riferimento ad i parametri di controllo. Inoltre,sarà presentato un intensivo studio simulativo per confronta-re il nostro algoritmo con altre strategie distribuite presenti inletteratura.

v

Page 6: Analysis of Clocks Synchronization Algorithms in Wireless ...tesi.cab.unipd.it/28288/1/thesis.pdf · ANALYSIS OF CLOCKS SYNCHRONIZATION ALGORITHMS IN WIRELESS SENSOR NETWORKS TESI
Page 7: Analysis of Clocks Synchronization Algorithms in Wireless ...tesi.cab.unipd.it/28288/1/thesis.pdf · ANALYSIS OF CLOCKS SYNCHRONIZATION ALGORITHMS IN WIRELESS SENSOR NETWORKS TESI

Philosophy is the basis for Logic,which is exactly 33.3% of Math.

(And because you are just dying to know:the other 66.6% is evenly divided

between Set Theory and Number Theory,the remaining per mil is magic).

— Anonymous Coward from science.slashdot.org

AC K N OW L E D G E M E N T S

First and foremost, I would like to thank my assistant supervisorDr. Ruggero Carli. In these months Ruggero introduced me intothe wonderful world of research and he taught me the relevanceto proceed step by step and always in a rigorous fashion. I amalso thankful to him for his constant willingness and for his helpwith my raw English.

Second I would express my gratitude to my supervisor Prof.Sandro Zampieri who gave me the opportunity to face up to aninteresting problem.

I also wish express my gratitude to my fellow students whomade these years at the University much more easier.

Of course, I cannot forget my friends for all the great momentsspent together: thanks a million guys!

Worthy of mention are my aunt Semira and my grandmother“Mimina” for having always encouraged me.

Last but not least my thought goes to my parents and myyounger brother Massimo for belive in me with no ifs, ands, orbuts.

Padova, marzo 2011 E. D.

vii

Page 8: Analysis of Clocks Synchronization Algorithms in Wireless ...tesi.cab.unipd.it/28288/1/thesis.pdf · ANALYSIS OF CLOCKS SYNCHRONIZATION ALGORITHMS IN WIRELESS SENSOR NETWORKS TESI
Page 9: Analysis of Clocks Synchronization Algorithms in Wireless ...tesi.cab.unipd.it/28288/1/thesis.pdf · ANALYSIS OF CLOCKS SYNCHRONIZATION ALGORITHMS IN WIRELESS SENSOR NETWORKS TESI

CO N T E N T S

1 I N T RO D U C T I O N 1

2 T H E S Y N C H RO N I Z AT I O N P RO B L E M 5

2.1 Mathematical modeling of a clock 5

2.2 Clock synchronization 7

3 T H E P I P ROTO CO L 9

3.1 Symmetric Gossip 9

3.2 Asymmetric Gossip 26

3.3 Some Simulations 38

4 A LG O R I T H M S CO M PA R I S O N 43

4.1 The Average TimeSynch Protocol 43

4.2 Some Simulations 45

5 CO N C LU S I O N S A N D F U T U R E WO R K 49

B I B L I O G R A P H Y 51

ix

Page 10: Analysis of Clocks Synchronization Algorithms in Wireless ...tesi.cab.unipd.it/28288/1/thesis.pdf · ANALYSIS OF CLOCKS SYNCHRONIZATION ALGORITHMS IN WIRELESS SENSOR NETWORKS TESI

L I S T O F F I G U R E S

Figure 1 The graphs of of s(t) resulting from the im-pulse shaped version of f(t) given in (2.1)(continuous line) and from the regularizedversion of f(t) given in (2.2) (dashed line). 6

Figure 2 Behavior of r2(α) for N = 15 and λ = 0.05(solid line) and the evaluation r2(α) (dashedline) 20

Figure 3 Behavior of r2(α) for N = 22 and λ = 0.05(solid line) and the evaluation r2(α) (dashedline) 21

Figure 4 Structure of the matrix S for N = 4 (left)and N = 5 (right). 25

Figure 5 Spectrum of the operator G forN = 50, ν =4, and α = λ/2. 26

Figure 6 Behavior of r2(α) for N = 10 and λ = 0.01(solid line) and the evaluation r2(α) (dashedline). 33

Figure 7 Behavior of r2(α) for N = 15 and λ = 0.01(solid line) and the evaluation r2(α) (dashedline). 34

Figure 8 Behavior of r3(α) forN = 4 and λ = 0.01. 35

Figure 9 Random geometric graph withN = 50 agents.The minimum, maximum and average de-gree of nodes are respectively of 1, 10 and5.4. 39

Figure 10 Behavior of the algorithm for the completegraph topology as α changes: λ/4 (solidline), λ/8 (dashed line), and λ/16 (dottedline). 40

Figure 11 Behavior of the algorithm for the circulantgraph topology as α changes: λ/4 (solidline), λ/8 (dashed line), and λ/16 (dottedline). 40

Figure 12 Behavior of the algorithm for the randomgeometric graph topology as α changes: λ/10(solid line), λ/10 (dashed line), and λ/1000(dotted line). 41

Figure 13 Behavior of the algorithm for the completegraph topology as ε changes: 10−7 (solidline) and 0.1 (dashed line). 41

x

Page 11: Analysis of Clocks Synchronization Algorithms in Wireless ...tesi.cab.unipd.it/28288/1/thesis.pdf · ANALYSIS OF CLOCKS SYNCHRONIZATION ALGORITHMS IN WIRELESS SENSOR NETWORKS TESI

Figure 14 Behavior of the algorithm for the circulantgraph topology as ε changes: 10−7 (solidline) and 0.1 (dashed line). 42

Figure 15 Behavior of the algorithm for the randomgeometric graph topology as ε changes: 10−7

(solid line) and 0.1 (dashed line). 42

Figure 16 Comparison between the pi protocol andthe ats algorithm for a complete graph topol-ogy in a noiseless scenario. 45

Figure 17 Comparison between the pi protocol andthe ats algorithm for a circulant graph topol-ogy in a noiseless scenario. 46

Figure 18 Comparison between the pi protocol andthe ats algorithm for a random geometricgraph topology in a noiseless scenario. 46

Figure 19 Comparison between the pi protocol andthe ats algorithm for a complete graph topol-ogy and a noisy communication channel 47

Figure 20 Comparison between the pi protocol andthe ats algorithm for a circulant graph topol-ogy and a noisy communication channel 48

Figure 21 Comparison between the pi protocol andthe ats algorithm for a random geomet-ric graph topology and a noisy communi-cation channel 48

AC RO N Y M S

WSN Wireless Sensor Network

Consists of spatially distributed autonomous sensors to cooper-atively monitor physical or environmental conditions, such astemperature, sound, vibration, pressure, motion or pollutants.

ATS Average Time-Sync

A protocol for synchronizing a wireless sensor network usingan averaging consensus approach. This algorithm is based ona class of popular distributed algorithms known as consensus,agreement, gossip or rendezvous whose main idea is averaginglocal information.

xi

Page 12: Analysis of Clocks Synchronization Algorithms in Wireless ...tesi.cab.unipd.it/28288/1/thesis.pdf · ANALYSIS OF CLOCKS SYNCHRONIZATION ALGORITHMS IN WIRELESS SENSOR NETWORKS TESI

xii List of Figures

DTSP Distributed Time-Sync ProtocolA fully distributed and asynchronous algorithm that achievetime synchronization in a multi-hop wireless sensor networkand exploit some global constraints to improve the performance.

FTSP Flooding Time Synchronization ProtocolA time synchronization protocol that uses low communicationbandwidth and it is robust against node and link failures. Thealgorithm achieves its robustness by utilizing periodic floodingof synchronization messages, and implicit dynamic topologyupdate.

A decentralized synchronicity algorithm based on a mathemati-cal model that describes how fireflies and neurons spontaneouslysynchronize.

TDMA Time Division Multiple AccessIs a channel access method for shared medium networks. Itallows several users to share the same frequency channel bydividing the signal into different time slots. The users transmitin rapid succession, one after the other, each using his own timeslot.

TPSN Timing-sync synchronization Protocol for Sensor NetworksA synchronization algorithm that works in two steps. In thefirst step, a hierarchical structure is established in the networkand then a pair wise synchronization is performed along theedges of this structure to establish a global timescale through-out the network. Eventually all nodes in the network synchro-nize their clocks to a reference node.

Page 13: Analysis of Clocks Synchronization Algorithms in Wireless ...tesi.cab.unipd.it/28288/1/thesis.pdf · ANALYSIS OF CLOCKS SYNCHRONIZATION ALGORITHMS IN WIRELESS SENSOR NETWORKS TESI

N OTAT I O N

N the natural number setR the real number fieldC the complex number fieldCm×n the set of m×n matrices whose elements

are in C

1 the (coloumn) vector whose entries are allequals to 1

In identity matrix of order ndiag(x) diagonal matrix having the components

of x as diagonal elements or, equivalently,diag(x1, . . . , xn)

dg(A) diagonal matrix with the same diagonalelements of A

coli(A) the i-th column of Arowi(A) the i-th row of AAT transpose of AA conjugate of AA∗ conjugate transpose of AA⊗B direct (Kronecker) product of A and BAB Hadamard (element by element) product

of A and BA† Moore-Penrose generalized inverse of Ar(A) rank of A‖A‖ Euclidean norm of A‖A‖∞ supremum norm of A‖A‖F Frobenius norm of A

If A is square,

det(A) determinant of Atr(A) trace of AΛ(A) the set of eigenvalues of AA−1 inverse of Aρ(A) spectral radius of A

xiii

Page 14: Analysis of Clocks Synchronization Algorithms in Wireless ...tesi.cab.unipd.it/28288/1/thesis.pdf · ANALYSIS OF CLOCKS SYNCHRONIZATION ALGORITHMS IN WIRELESS SENSOR NETWORKS TESI
Page 15: Analysis of Clocks Synchronization Algorithms in Wireless ...tesi.cab.unipd.it/28288/1/thesis.pdf · ANALYSIS OF CLOCKS SYNCHRONIZATION ALGORITHMS IN WIRELESS SENSOR NETWORKS TESI

1 I N T RO D U C T I O N

The recent technological advances in Wireless Sensor Networks(WSNs) and the decreasing in cost and size of electronic deviceshave promoted the appearance of large inexpensive intercon-nected systems, each with computational and sensing capabil-ities. These complex networks of agents are used in a largenumber of applications covering a wide range of fields, such as,surveillance, targeting systems, controls, power scheduling andTime Division Multiple Access (TDMA) communications, moni-toring areas, intrusion detection, vehicle tracking and mapping.One key problem in many of these applications is clock synchro-nization. Indeed, very often, it is essential that the agents act ina coordinated and synchronized fashion requiring global clocksynchronization, that is, all the agents of the network need torefer to a common notion of time.

A wide variety of clock synchronization protocols have beenproposed recently in the literature. Depending upon the archi-tectures adopted, these protocols can be divided into three cat-egories: tree-structure-based, cluster-structure-based, and fully-distributed.

Tree-structure-based protocols such as the Timing-sync syn-chronization Protocol for Sensor Networks (TPSN) by Ganeriwalet al. [2003] and the Flooding Time Synchronization Protocol(FTSP) by Maróti et al. [2004] consist in electing a reference nodeand creating a spanning tree rooted at this reference node, whereeach children synchronizes itself with respect to its parent. Incluster-structure-based protocols such as in Elson et al. [2002],the network is divided into distinct clusters, each with an electedcluster-head. All nodes within the same cluster synchronizethemselves with the corresponding cluster-head, and each cluster-head synchronizes itself with an another cluster-head. Althoughthese two strategies have been experimentally tested showingremarkable performance, they suffer from robustness and scala-bility issues. For instance, if a node dies or a new node is added,then it is necessary to rebuild the tree or the clusters, at the priceof additional implementation overhead and possibly long peri-ods in which the network or part of it is poorly synchronized.

Fully distributed algorithms for clocks synchronization haveappeared in Werner-Allen et al. [2005], Simeone and Spagno-

1

Page 16: Analysis of Clocks Synchronization Algorithms in Wireless ...tesi.cab.unipd.it/28288/1/thesis.pdf · ANALYSIS OF CLOCKS SYNCHRONIZATION ALGORITHMS IN WIRELESS SENSOR NETWORKS TESI

2 I N T RO D U C T I O N

lini [2007], Solis et al. [2006] and Schenato and Fiorentin [2009].Werner-Allen et al. [2005] introduced a protocol inspired by thefireflies integrate-and-fire synchronization mechanism, able tocompensate for different clock offsets but not for different clockskews. On the opposite, the algorithm proposed by Simeoneand Spagnolini [2007] adopting a P-controller, compensates forthe clock skews but not for the offsets. Distributed protocolsthat can compensate for both clock skews and offsets have beenproposed by Solis et al. [2006] with the Distributed Time-SyncProtocol (DTSP) and by Schenato and Fiorentin [2009] with theAverage Time-Sync (ATS). The first one is based on the cascadeof two distributed least-squared algorithms, while the secondone is based on the cascade of two first order consensus algo-rithms. Of note is the fact that both these strategies are highlynon-linear and do not lead to a simple characterization of theeffects of noise on the steady-state performance.

Differently, Carli et al. [2008] and Carli and Zampieri [2010]proposed a synchronization algorithm that can be formally ana-lyzed not only in the noiseless scenario in terms of rate of con-vergence, but also in a noisy setting in terms of the steady-statesynchronization error. This algorithm compensates for both ini-tial offsets and differences in internal clock speeds and is basedon a Proportional-Integral (PI) controller that treats the differ-ent clock speeds as unknown constant disturbances and the dif-ferent clock offsets as different initial conditions for the systemdynamics. Both convergence guarantees as well optimal designusing standard optimization tools when the underlying commu-nication graph is known, can be provided as shown by Carli et al.[2011]. It is important to remark that the time-synchronizationalgorithm proposed by Carli and Zampieri [2010] requires eachnode to perform all the operations related to the k-th iteration ofthe algorithm, including transmitting messages, receiving mes-sages and updating estimates, within a short time window. Thispseudo-synchronous implementation might be very sensitive topacket losses, node and link failure.

In this dissertation we developed and analyzed a far morepractical version of the PI synchronization algorithm, assumingthat clocks can exchange information through either a symmetric-gossip or an asymmetric-gossip communication protocols. Thisapplies very well to real sensor networks, and drastically re-duces the network requirements in terms of reliability, band-width, and synchronization. Theoretical results are providedwhen the underlying communication topology is given by thecomplete graph, while more general families of graphs are con-sidered by means of simulations.

Page 17: Analysis of Clocks Synchronization Algorithms in Wireless ...tesi.cab.unipd.it/28288/1/thesis.pdf · ANALYSIS OF CLOCKS SYNCHRONIZATION ALGORITHMS IN WIRELESS SENSOR NETWORKS TESI

I N T RO D U C T I O N 3

The presentation of the work is structured as follows:

I N T H E S E C O N D C H A P T E R we propose a mathematical modelof each local clock, then we introduce the reader to thesynchronization problem we want to solve, namely the factthat the time is an unknown variable, which has to be esti-mated.

I N T H E T H I R D C H A P T E R we propose a Proportional-Integral (PI)consensus controller based on the gossip communication model.We first describe a symmetric implementation of the algo-rithm, where at each iteration two neighboring units estab-lish a communication link and exchange their time stampto each others. Then we report the asymmetric version ofthe protocol, where the communication link is directional,reducing the network requirements in terms of reliabilityand bandwidth.

I N T H E F O U R T H C H A P T E R we provide a numerical comparisonof our protocol with ATS, another asynchronous and fullydistributed algorithm, focusing our attention to performanceand accuracy.

I N T H E L A S T C H A P T E R we briefly summarize the work done,the results achieved, and the possible directions of investi-gation.

Page 18: Analysis of Clocks Synchronization Algorithms in Wireless ...tesi.cab.unipd.it/28288/1/thesis.pdf · ANALYSIS OF CLOCKS SYNCHRONIZATION ALGORITHMS IN WIRELESS SENSOR NETWORKS TESI
Page 19: Analysis of Clocks Synchronization Algorithms in Wireless ...tesi.cab.unipd.it/28288/1/thesis.pdf · ANALYSIS OF CLOCKS SYNCHRONIZATION ALGORITHMS IN WIRELESS SENSOR NETWORKS TESI

2 T H E S Y N C H RO N I Z AT I O NP RO B L E M

We start by proposing a model of each local clock which is sim-ple enough but which captures the main difficulty of the prob-lem we want to solve, namely the fact that the time is an un-known variable, which has to be estimated.

2.1 M AT H E M AT I C A L M O D E L I N G O F A C LO C K

Assume that each unit has a clock, which is an oscillator capableto produce an event at time t(k), k = 0, 1, 2, . . . The clock hasto use these clicks in order to estimate the time. The followingcumulative function well describes the time evolution of the tickcounter that can be implemented in the clock

s(t) =

∫t−∞ f(σ)dσ,

where

f(t) =

∞∑k=0

δ(t− t(k)). (2.1)

In this way the counter output is a step shaped function. In casethe clock period is small, in order to simplify the analysis, itis convenient to approximate step shaped function s(t) with acontinuous one by approximating the delta shaped function f(t)with a regularized version. One way is to take

f(t) :=1

t(k+ 1) − t(k)for all t ∈ [t(k), t(k+ 1)[ (2.2)

The graphs of the stepwise and of the regularized version of s(t)is shown in Figure 1.

Notice that f(t) can be interpreted as the oscillator frequencyat time t. Typically an estimate f of f(t) is available and it isknown that f(t) ∈ [fmin fmax]. From the counter one can build atime estimate t(t) by letting

t(t) = t(t0)+ ∆(t)[s(t)− s(t0)] = t(t0)+ ∆(t)

∫tt0

f(σ)dσ (2.3)

5

Page 20: Analysis of Clocks Synchronization Algorithms in Wireless ...tesi.cab.unipd.it/28288/1/thesis.pdf · ANALYSIS OF CLOCKS SYNCHRONIZATION ALGORITHMS IN WIRELESS SENSOR NETWORKS TESI

6 T H E S Y N C H RO N I Z AT I O N P RO B L E M

0

2

4

6

8

10

t(0) t(1) t(2) t(k) t(k+ 1)

tick

coun

ter

s(t)

time t

Figure 1: The graphs of of s(t) resulting from the impulse shaped ver-sion of f(t) given in (2.1) (continuous line) and from the reg-ularized version of f(t) given in (2.2) (dashed line).

where ∆(t) is an estimate of the oscillation period 1/f(t). It isreasonable to initialize ∆(t) to 1/f.

Both t(t) and ∆(t) can be modified when the unit obtains infor-mation allowing it to improve its time and oscillator frequencyestimates. Assume that these corrections are applied at time in-stants Tup(h), where h = 0, 1, . . . , called updating time instants.In this case we have 1

t(T+up(h)) = t(T−up(h)) + u

′(h)

∆(T+up(h)) = ∆(T−up(h)) + u

′′(h)

where u ′ and u ′′ denote the control inputs applied to t and ∆,respectively.

For t ∈ [T+up(h) T−up(h+ 1)] the estimates evolve according to

t(t) = t(T+up(h)) + ∆(T+up(h))

(s(t) − s(Tup(h))

)∆(t) = ∆(T+up(h))

(2.4)

or according tot(t) = t(T+up(h)) + ∆(T

−up(h))

(s(t) − s(Tup(h))

)∆(t) = ∆(T+up(h))

(2.5)

Intuitively the updating rule (2.4) should perform better thanthe updating rule (2.5). However, for the sake of simplicity — aswe will see later — in this dissertation we assume that the unitsadopt the updating rule (2.5).

1 Given the time t, with the symbols t+ and t− we mean, respectively, the timeinstant just after t and time instant just before t.

Page 21: Analysis of Clocks Synchronization Algorithms in Wireless ...tesi.cab.unipd.it/28288/1/thesis.pdf · ANALYSIS OF CLOCKS SYNCHRONIZATION ALGORITHMS IN WIRELESS SENSOR NETWORKS TESI

2.2 C LO C K S Y N C H RO N I Z AT I O N 7

2.2 C LO C K S Y N C H RO N I Z AT I O N

Assume now that we have a network composed by N clocks.For i ∈ 1, . . . ,N , let fi(t) be the evolution of the oscillatorfrequency of the clock i. Moreover, for i ∈ 1, . . . ,N , let xi(t) =[x ′i(t) x

′′i (t)]

∗ = [ti(t) ∆i(t)]∗

denote the local state of the clock i.The objective is to synchronize the variables x ′i(t), i ∈ 1, . . . ,N ,namely, to find a law which allows the clocks to obtain the sametime estimate.

Assume that the clocks can exchange their local state accord-ing to a graph G = (V ,E), where V = 1, . . . ,N and where(i, j) ∈ E whenever the clock i can send its state xi to the clock j.

Specifically, each clock i, i ∈ 1, . . . ,N , transmits its statexi(t) at some time instants Ttx,i(h), h = 0, 1, . . . , and can use anyinformation it receives from the neighboring nodes to perform acontrol at the time instants Tup,i(h), h = 0, 1, . . .

More precisely

xi(T+up,i(h)) = xi(T

−up,i(h)) + ui(h), (2.6)

where ui(h) = [u ′i(h) u′′i (h)]

∗ is the control action applied attime Tup,i(h). Moreover for t ∈ [T+up,i(h) T

−up,i(h+ 1)] we assume

that the state xi is updated according to (2.5).For simplicity in this dissertation we assume the following

properties.

Assumption 2.2.1. The oscillator frequencies fi are constant butunknown, i.e., for i ∈ 1, . . . ,N , fi(t) = fi for all t > 0.

Assumption 2.2.2. The transmission delays are negligible, namely,if clock i perform its h-th transmission to clock j, then clock j re-ceives the information xi(Ttx,i(h)) exactly at time Ttx,i(h)

2.

From Assumption 2.2.1 and from (2.3), it follows that (2.5), forthe i-th clock, can be equivalently rewritten as

x ′i(t) = x′i(T

+up(h)) + x

′′i (T

−up(h)) fi (t− Tup(h))

x ′′i (t) = x′′i (T

+up(h))

(2.7)

The objective is to find a control strategy yielding the clocksynchronization, namely such that there exist constants a ∈ R>0and b ∈ R such that synchronization errors

ei(t) := x′i(t) − (at+ b), i = 1, . . . ,N (2.8)

converge to zero or remain small.

2 In general, the information xi(Ttx,i(h)) is received by clock j ∈ Ni at a delayedtime Trx,i,j(h) > Ttx,i(h) where Trx,i,j(h) = Ttx,i(h) + γi,j(h) being γi,j(h) anonnegative real number representing the deliver delay between i and j.

Page 22: Analysis of Clocks Synchronization Algorithms in Wireless ...tesi.cab.unipd.it/28288/1/thesis.pdf · ANALYSIS OF CLOCKS SYNCHRONIZATION ALGORITHMS IN WIRELESS SENSOR NETWORKS TESI
Page 23: Analysis of Clocks Synchronization Algorithms in Wireless ...tesi.cab.unipd.it/28288/1/thesis.pdf · ANALYSIS OF CLOCKS SYNCHRONIZATION ALGORITHMS IN WIRELESS SENSOR NETWORKS TESI

3 T H E P I P ROTO CO L

In this chapter, following the work of Carli et al. [2008], wepropose and analyze a Proportional-Integral (PI) consensus con-troller based on more practical communication schemes. In-deed, as emphasize by Carli and Zampieri [2010], a relevantlimitation in their protocol is that the nodes data transmissionand algorithm updating steps cannot occur exactly at the sametime. To avoid this problem the authors introduced a pseudo-synchronous implementation which require each node to per-form all the computing burden in a short time window. How-ever, this strategy might be very sensitive to packet drop, nodeand link failure. To reduce the communication requirementswe consider a different protocol, more precisely the gossip com-munication model, i. e. a model in which only a pair of clockscan exchange their information at any time. We first describe asymmetric implementation of the algorithm, where at each iter-ation two neighboring units establish a communication link andexchange their time stamp to each others. Then we report theasymmetric version of the protocol, where the communicationlink is directional, reducing the network requirements in termsof reliability and bandwidth.

3.1 S Y M M E T R I C G O S S I P

In this section we assume the clocks exchange information witheach other through a symmetric gossip communication protocolover an undirected connected graph G = (V ,E).

Informally, we assume that, for i ∈ 1, . . . ,N , clock i wakesup at the sample times of a Poisson process of a certain inten-sity λ > 0 and establishes a bidirectional link with one of itsneighbors randomly selected.

Specifically let ti,k,k ∈N denote the time instants in whichclock i wakes up. Then at time ti,k,

• clock i randomly chooses with probability 1/di a clock jwithin the set of its neighbors Ni = j ∈ V : (i, j) ∈ E, j 6= i ,where di denote the cardinality of Ni;

9

Page 24: Analysis of Clocks Synchronization Algorithms in Wireless ...tesi.cab.unipd.it/28288/1/thesis.pdf · ANALYSIS OF CLOCKS SYNCHRONIZATION ALGORITHMS IN WIRELESS SENSOR NETWORKS TESI

10 T H E P I P ROTO CO L

• clock i sends to clock j only the information related to thefirst component of its state, i. e. x ′i(ti,k);

• clock j instantaneously responds back to node i sending theinformation related to the first component of its state, i. e.x ′j(ti,k).

Notice that for some h,h ′ ∈N we have that

ti,k = Ttx,i(h) = Ttx,j(h′) = Tup,i(h) = Ttx,j(h

′).

Based on the information received clock i and clock j appliesto their current states xi and xj the following correction

ui =

[u ′iu ′′i

]=1

2

[1

α

] (x ′j(ti,k) − x

′i(ti,k)

),

uj =

[u ′ju ′′j

]=1

2

[1

α

] (x ′i(ti,k) − x

′j(ti,k)

),

where α is a control parameter such that α > 0. From (2.6), itfollows

x ′i(t+i,k) =

1

2

(x ′i(ti,k) + x

′j(ti,k)

), (3.1a)

x ′j(t+i,k) =

1

2

(x ′i(ti,k) + x

′j(ti,k)

)(3.1b)

and

x ′′i (t+i,k) = x

′′i (ti,k) +

α

2

(x ′j(ti,k) − x

′i(ti,k)

), (3.2a)

x ′′j (t+i,k) = x

′′j (ti,k) +

α

2

(x ′i(ti,k) − x

′j(ti,k)

). (3.2b)

Remark 3.1.1. The control above introduced can be seen as aPI controller where u ′i = x ′j(tk) − x

′i(tk) and u ′′i = α(x ′j(tk) −

x ′i(tk)) represent, respectively, the proportional and the integralaction on node i.

Now let tk,k ∈N be the set of all the transmitting/updat-ing time instants of the clocks’ network, i. e.

tk,k ∈N =

N⋃i=1

ti,k,k ∈N .

We assume the N Poisson processes generating the transmissionin which the clocks wake up are independent from one another,the updating time instants tk,k ∈N can be seen as the sampletimes of a Poisson process of intensity Nλ.

Page 25: Analysis of Clocks Synchronization Algorithms in Wireless ...tesi.cab.unipd.it/28288/1/thesis.pdf · ANALYSIS OF CLOCKS SYNCHRONIZATION ALGORITHMS IN WIRELESS SENSOR NETWORKS TESI

3.1 S Y M M E T R I C G O S S I P 11

Next we provide a convenient vector-form description of theevolution of the clocks’ network. To do so, we need some auxil-iary definitions. First, let us introduce the following vectors

x ′ := [x ′1 . . . x′N]∗ ∈ RN,

x ′′ := [x ′′1 . . . x′′N]∗ ∈ RN,

x = [x ′1 . . . x′N x

′′1 . . . x

′′N]∗ ∈ R2N.

Second, for i, j ∈ 1, . . . ,N let the matrix Ei↔j ∈ RN×N bedefined as

Ei↔j := (ei − ej)(ei − ej)∗,

and let the matrix D ∈ RN×N be defined as

D = diagf1, . . . , fN.

Finally let δtk := tk+1 − tk. Then, combining (2.7) with (3.1)and (3.2), we can write

x(t−k+1) =

[I− 1

2Ei↔j δtkD

−α2Ei↔j I

]x(t−k ).

To simplify the notation we define x(k) := x(t−k ), hence the abovesystem becomes

x(k+ 1) =

[I− 1

2E(k) δtkD

−α2E(k) I

]x(k), (3.3)

where E(k) = Ei↔j if, during the k-th iteration communicationbetween node i and node j take place.

We extensively simulated algorithm in (3.3), for several com-munication graphs G and for different values ofD, λ and α. Nextwe summarize some of the numerical evidences we extrapolatedfrom the simulations we run:

1. Typically, for α > λ, the algorithm does not reach the syn-chronization, independently from the values of fi.

2. For α 6 λ the synchronization is achieved depending onhow spread the values

fi, i = 1, . . . ,N

are. More pre-

cisely suppose that, for i ∈ 1, . . . ,N , fi ∈ [1 − ε 1 + ε]where 0 6 ε < 1. Then the smaller the value of α is, thegreater the value of ε is while still reaching the synchro-nization. In particular, if α ≈ λ then the synchronization isattained only if ε << 1, while if α ≈ 0 then ε can be alsovery close to 1.

Page 26: Analysis of Clocks Synchronization Algorithms in Wireless ...tesi.cab.unipd.it/28288/1/thesis.pdf · ANALYSIS OF CLOCKS SYNCHRONIZATION ALGORITHMS IN WIRELESS SENSOR NETWORKS TESI

12 T H E P I P ROTO CO L

3. When the synchronization is achieved, then

limk→∞ x ′′(k) = β1,

where β is in general close to 1N

∑Ni=1 fi. This value β

represents the oscillator frequency of the “virtual clock” towhich all the clocks synchronize.

Providing a theoretical analysis of the above evidences is quitechallenging in general. In the next section we restrict to completeand circulant graphs. In these cases we will be able to providesome theoretical insights on the convergence properties of algo-rithm (3.3).

3.1.1 Mean-Square Analysis

To our aims it is convenient to consider the synchronization error

y(k) = Ωx ′(k) =

(I−

1

N11∗)x ′(k)

and the new variable

z(k) = ΩDx ′′(k) =

(I−

1

N11∗)Dx ′′(k).

Since for any i, j ∈ 1, . . . ,N , i 6= j, Ei↔jΩ = Ei↔jΩ = Ei↔j,system (3.3) can be rewritten as[

y(k+ 1)z(k+ 1)

]=

[I− 1

2E(k) δtk−α2ΩDE(k) I

] [y(k)z(k)

](3.4)

Clearly x ′ reaches the asymptotic synchronization if and only iflimk→∞ y(k) = 0.

Now observe that, according to the data transmission andcommunication model described above, system (3.4) evolves asa random process such that

• for any k ∈N, the matrix E(k) is randomly selected withinthe set

S =Ei↔j : (i, j) ∈ E

and

P[E(k) = Ei↔j] =1

N

(1

di+1

dj

);

• the selection of the matrix E(k) is independent from theselection of E(k ′), k ′ 6= k;

Page 27: Analysis of Clocks Synchronization Algorithms in Wireless ...tesi.cab.unipd.it/28288/1/thesis.pdf · ANALYSIS OF CLOCKS SYNCHRONIZATION ALGORITHMS IN WIRELESS SENSOR NETWORKS TESI

3.1 S Y M M E T R I C G O S S I P 13

• δtk : k ∈N are the interarrival times of a Poisson pro-cess of intensity Nλ.

It is useful to introduce the following N×Nmatrix as the matrixhaving W(i,j) as element in the ith row and jth column and in thejth row and ith column, namely

Wij =Wji :=W(i,j). (3.5)

Note that, since i 3 Ni, we have that Wii = 0.

The goal is to perform a mean-square analysis of (3.4). To doso, we introduce the matrix

Σ(k) := E

[[y(k)z(k)

] [y∗(k) z∗(k)

]]=

[Σyy(k) Σyz(k)Σ∗yz(k) Σzz(k)

],

where

Σyy(k) := E[y(k)y∗(k)],Σyz(k) := E[y(k)z∗(k)],Σzz(k) := E[z(k)z∗(k)].

The objective is to study the evolution of

Σ(k+ 1) = E[Γ(k)Σ(k)Γ∗(k)] (3.6)

where

Γ(k) :=

[I− 1

2E(k) δtk−α2ΩDE(k) I

].

In what follows, we perform our analysis by assuming that Dis a small perturbation of the matrix I. Accordingly, we will de-sign the parameter α only for D = I. From the fact that theeigenvalues of the expectation operator in (3.6) depend continu-ously on the matrix D, it will follow that this choice of α yieldsthe stability also for a small enough perturbation of D.

Page 28: Analysis of Clocks Synchronization Algorithms in Wireless ...tesi.cab.unipd.it/28288/1/thesis.pdf · ANALYSIS OF CLOCKS SYNCHRONIZATION ALGORITHMS IN WIRELESS SENSOR NETWORKS TESI

14 T H E P I P ROTO CO L

Assuming that D = I, from (3.6) we obtain the following re-cursive equations1

Σ+yy = Σyy −

1

2

E[Ei↔j]Σyy + ΣyyE[Ei↔j]

+1

4E[Ei↔jΣyyEi↔j] +

1

Σyz + Σ

∗yz

1

2Nλ

E[Ei↔j]Σyz + Σ

∗yzE[Ei↔j]

+

2

N2λ2Σzz,

(3.7a)

Σ+yz = −

α

2ΣyyE[Ei↔j] +

α

4E[Ei↔jΣyyEi↔j] + Σyz

−1

2E[Ei↔j]Σyz −

α

2NλΣ∗yzE[Ei↔j] +

1

NλΣzz, and

(3.7b)

Σ+zz =

α2

4E[Ei↔jΣyyEi↔j]

−α

2

E[Ei↔j]Σyz + Σ

∗yzE[Ei↔j]

+ Σzz, (3.7c)

where we used the fact that

E[δtk] =1

Nλand E[δtk

2] =2

N2λ2.

The covariance matrix Σ then updates according to a linear trans-formation

Σ(k+ 1) = F[Σ(k)] (3.8)

defined by the recursive equations that we just computed, andwhose initial conditions can be obtained once we state the fol-lowing assumption on x ′(0) and x ′′(0).

Assumption 3.1.1. The initial condition x ′(0) is a random vectorsuch that E[x ′(0)] = 0, E[x ′(0)x ′(0)∗] = σ2xI. The vector x ′′(0) issuch that x ′′(0) = 1.

It then follows that

Σ(0) =

[σ2xΩ 0

0 0

]. (3.9)

The analysis of the previous recursive equations is a challeng-ing problem when G is an arbitrary communication graph. Inthe next section we provide a detailed theoretical analysis for thecomplete graph. Later we consider the more general family of

1 For the sake of notational simplicity, time dependence has been omitted here;the notation Σ+ij stand for Σij(k+ 1).

Page 29: Analysis of Clocks Synchronization Algorithms in Wireless ...tesi.cab.unipd.it/28288/1/thesis.pdf · ANALYSIS OF CLOCKS SYNCHRONIZATION ALGORITHMS IN WIRELESS SENSOR NETWORKS TESI

3.1 S Y M M E T R I C G O S S I P 15

circulant graphs, then we also yield an analysis for the randomgeometric graphs by meaning of numerical simulations. Beforethat let us introduce now a useful technical Lemma from Carli[2008].

Lemma 3.1.1. Let G = (V ,E) be a given graph without any self-loopsand let W be the matrix defined as in (3.5). Let Q any symmetricmatrix. Then

E[Ei↔j] = diag(W1) −W (3.10)

and

E[Ei↔jQEi↔j] = diag(W1)dg(Q) + 2W Q+ diag(W dg(Q)1) − dg(Q)W +W dg(Q)

− 2dg(A(W Q)),(3.11)

where the matrix A represent the adjacency matrix of the graph G,namely

Aij = Aji =

1, if (i, j) ∈ E

0, otherwise.

P RO O F We have that

E[Ei↔j] =∑

(i,j)∈E

Wij(ei − ej)(ei − ej)∗

=∑

(i,j)∈E

Wij(eie∗i + eje

∗j )

−∑

(i,j)∈E

Wij(eie∗j + eje

∗i ) = diag(W1) −W.

Then we have that

E[Ei↔jQEi↔j] =

=∑

(i,j)∈E

Wij(ei − ej)(ei − ej)∗Q(ei − ej)(ei − ej)

=∑

(i,j)∈E

Wij(eie∗i + eje

∗j )Q(eie

∗i + eje

∗j )

−∑

(i,j)∈E

Wij(eie∗j + eje

∗i )Q(eie

∗i + eje

∗j )

−∑

(i,j)∈E

Wij(eie∗i + eje

∗j )Q(eie

∗j + eje

∗i )

+∑

(i,j)∈E

Wij(eie∗j + eje

∗i )Q(eie

∗j + eje

∗i ).

Page 30: Analysis of Clocks Synchronization Algorithms in Wireless ...tesi.cab.unipd.it/28288/1/thesis.pdf · ANALYSIS OF CLOCKS SYNCHRONIZATION ALGORITHMS IN WIRELESS SENSOR NETWORKS TESI

16 T H E P I P ROTO CO L

Consider now the first term of the last equality. It follows that∑(i,j)∈E

Wij(eie∗i + eje

∗j )Q(eie

∗i + eje

∗j ) =

=∑

(i,j)∈E

Wij(eie∗iQeie

∗i + eje

∗jQeje

∗j )

+∑

(i,j)∈E

Wij(eje∗jQeie

∗i + eie

∗iQeje

∗j ) =

=∑

(i,j)∈E

(WijQiieie∗i +WijQjjeje

∗j )

+∑

(i,j)∈E

(WjiQjieje∗i +WijQijeie

∗j ) =

= diag(W1)dg(Q) +W Q.

In a similar way it can be shown that∑(i,j)∈E

Wij(eie∗j + eje

∗i )Q(eie

∗i + eje

∗j )

+∑

(i,j)∈E

Wij(eie∗i + eje

∗j )Q(eie

∗j + eje

∗i ) =

= dg(Q)W +W dg(Q) + 2dg(A(W Q))

and that∑(i,j)∈E

Wij(eie∗j + eje

∗i )Q(eie

∗j + eje

∗i ) =

=W Q+ dg(W diag(Q)1).

Plugging together all the contributions we obtain (3.11).

Complete Graph

Assume that the graph G describing the feasible communicationbetween nodes is the complete graph. Moreover, assume thateach edge has the same probability of being selected. Hence

W =2

N(N− 1)(11∗ − I). (3.12)

We have the following

Proposition 3.1.2. In the case of complete graph it holds

E[Ei↔j] =2

N− 1Ω,

and

E[Ei↔jΩEi↔j] =4

N− 1Ω.

Page 31: Analysis of Clocks Synchronization Algorithms in Wireless ...tesi.cab.unipd.it/28288/1/thesis.pdf · ANALYSIS OF CLOCKS SYNCHRONIZATION ALGORITHMS IN WIRELESS SENSOR NETWORKS TESI

3.1 S Y M M E T R I C G O S S I P 17

P RO O F From the technical Lemma 3.1.1 we have that

E[Ei↔j] = diag(W1) −W

=2

NI−

2

N(N− 1)(11∗ − I) =

2

N− 1Ω

and, observing that

Ei↔jΩEi↔j = E2i↔j = (ei − ej)(ei − ej)

∗(ei − ej)(ei − ej)∗

= 2(ei − ej)(ei − ej)∗ = 2Ei↔j,

we obtain

E[Ei↔jΩEi↔j] =4

N− 1Ω.

We can now state the following

Proposition 3.1.3. In the case of complete graph, the set

J =

Σ : Σ =

[a b

b c

]⊗Ω

is invariant under the transformation in (3.8).

P RO O F Let Σ(k) = Σ with Σ ∈ J. Then, applying Proposi-tion 3.1.2 to (3.8), one can obtain

Σ+yy =

N− 2

N− 1aΩ+

2(N− 2)

Nλ(N− 1)bΩ+

2

N2λ2cΩ

Σ+yz =

Nλ(N− 2) −α

Nλ(N− 1)bΩ+

1

NλcΩ

Σ+zz =

α2

N− 1aΩ−

N− 1bΩ+ cΩ

therefore Σ(k+ 1) ∈ J.

Corollary. In the case of a complete graph and under Assumption 3.1.1,we have

Σyy(k) = ξyy(k)Ω,Σyz(k) = ξyz(k)Ω,Σzz(k) = ξzz(k)Ω,

where

ξ+ =

ξ+yyξ+yzξ+zz

=

N−2N−1

2(N−2)Nλ(N−1)

2N2λ2

0Nλ(N−2)−αNλ(N−1)

1Nλ

α2

N−1 − 2αN−1 1

ξyyξyzξzz

= Φsξ

Page 32: Analysis of Clocks Synchronization Algorithms in Wireless ...tesi.cab.unipd.it/28288/1/thesis.pdf · ANALYSIS OF CLOCKS SYNCHRONIZATION ALGORITHMS IN WIRELESS SENSOR NETWORKS TESI

18 T H E P I P ROTO CO L

P RO O F The result just follows form the fact that the initialcondition Σ(0) in (3.9) is in J and, therefore we can parametrizedthe trajectories of the system as

Σ(k) =

[ξyy(k) ξyz(k)ξyz(k) ξzz(k)

]⊗Ω

because of the invariance stated in proposition above. The proofof the same proposition gives also the update equations for thethree parameters of the covariance matrix.

Theorem 3.1.4. Consider the network of clocks described before witha symmetric gossip communication protocol over a complete graph andan edge selection probability matrix as in (3.12). Then the covarianceΣ of the synchronization error converges exponentially to zero if andonly if

α <Nλ

2

√N2 − 2N+ 5−N+ 1

=: α(N)

P RO O F The stability of the update equation can be studied byeigenvalue analysis of the matrix Φs. The characteristic polyno-mial is

ψ(z) = det(zI−Φs) =q3z

3 + q2z2 + q1z+ q0

N3λ3(N− 1)2,

where

q3 = N3λ3(N− 1)2;

q2 = N2λ2(N− 1)[α−Nλ(3N− 5)];

q1 = Nλ[−2(N− 1)α2 +Nλα+N2λ2(N− 2)(3N− 4)];

q0 = −2α3 −N2λ2(N− 2)α−N3λ3(N− 2)2.

An efficient way to study the stability of ψ(z) is to apply theRouth criterion to the numerator of the continuous time versionobtained by the Möbius transformation z = (1+ s)/(1− s)

ψc(s) =r3s

3 + r2s2 + r1s+ r0

N3λ3(N− 1)2(s− 1)3,

where

r3 = α3 −Nλ(N− 1)α2 +N3λ3(2N− 3)2;

r2 = −3α3 +Nλ(N− 1)α2 −N2λ2(2N− 3)α

+ 2N3λ3(2N− 3);

r1 = 3α3 +Nλ(N− 1)α2 + 2N2λ2(N− 2)α+N3λ3;

r0 = −α3 −Nλ(N− 1)α2 +N2λ2α.

Page 33: Analysis of Clocks Synchronization Algorithms in Wireless ...tesi.cab.unipd.it/28288/1/thesis.pdf · ANALYSIS OF CLOCKS SYNCHRONIZATION ALGORITHMS IN WIRELESS SENSOR NETWORKS TESI

3.1 S Y M M E T R I C G O S S I P 19

To have stability all the four terms ri must have the same sign.We will now show that, under the technical assumptions N > 2

(which is a necessary condition to have a properly randomizedalgorithm) and λ > 0 (a necessary condition to have a properlyPoisson process) all terms are positive under the condition α <α.

Observe that the term r1 is always positive then we have totest the positivity of the remaining terms.

S I G N O F T H E T E R M r0 : It is clear that r0 is positive if and onlyif

α2 +Nλ(N− 1)α−N2λ2 < 0

which turns out to be true for

α <Nλ

2

√N2 − 2N+ 5−N+ 1

= α.

Our goal now is to proof that r2, r3 > 0 if α < α.

S I G N O F T H E T E R M r2 : Observing that

N− 1 < ζ < N,

where

ζ :=√N2 − 2N+ 5,

we have

r2(0) = N3λ3(4N− 6),

r2(α) >3

8N3λ3(8N− 13),

both greater than zero for all N > 2.

To show that r2 is positive in the entire interval (0, α) westudy the derivative of r2, that is

r ′2(α) = −9α2 + 2Nλ(N− 1)α−N2λ2(2N− 3).

We have that r ′2(α) = 0 for

α1,2 =Nλ

9

N− 1∓

√N2 − 20N+ 28

.

For N 6 18, α1,2 are complex conjugate and hence r2 ismonotonically decreasing for α ∈ R (see Figure 2). Other-wise, if N > 18, then r2 has a local minimum in α1 and a

Page 34: Analysis of Clocks Synchronization Algorithms in Wireless ...tesi.cab.unipd.it/28288/1/thesis.pdf · ANALYSIS OF CLOCKS SYNCHRONIZATION ALGORITHMS IN WIRELESS SENSOR NETWORKS TESI

20 T H E P I P ROTO CO L

-10

-5

0

5

10

15

20

25

0 0.5 1 1.5 2 2.5 3

ψc

coef

ficie

ntr 2(α

)

control parameter α

r2(α)

Figure 2: Behavior of r2(α) for N = 15 and λ = 0.05 (solid line) and theevaluation r2(α) (dashed line)

local maximum in α2 (as reported in Figure 3). However,in this case we have that α < α1 if and only if

9ζ+ 2γ < 11(N− 1), γ :=√N2 − 20N+ 28

or, equivalently, if and only if

γζ < N2 − 11,

which, in turn, conduct to

22N3 − 95N2 + 156N− 19 > 0, ∀N > 0,

which implies that r2 restricted to the interval [0 α] is stillmonotonically decreasing.

S I G N O F T H E T E R M r3 : Similarly to r2 we have that

r3(0) = N3λ3(2N − 3)2 > 0 ,

r3(α) > N3λ3(2N − 3)2 > 0 .

One can see that r3 is a concave function for α ∈ [0 α].Indeed we have that

r ′′3 (α) = 6α − 2Nλ(N − 1) ,

where r ′′3 < 0 if and only if

α <1

3Nλ(N − 1) =: ρ

and it holds true that α < ρ for all N > 2.

Page 35: Analysis of Clocks Synchronization Algorithms in Wireless ...tesi.cab.unipd.it/28288/1/thesis.pdf · ANALYSIS OF CLOCKS SYNCHRONIZATION ALGORITHMS IN WIRELESS SENSOR NETWORKS TESI

3.1 S Y M M E T R I C G O S S I P 21

60

65

70

75

80

85

90

95

100

105

110

0 1 2 3 4 5

ψc

coef

ficie

ntr 2(α

)

control parameter α

r2(α1)

r2(α2)

r2(α)

Figure 3: Behavior of r2(α) for N = 22 and λ = 0.05 (solid line) and theevaluation r2(α) (dashed line)

Corollary. Under the same hypothesis of Theorem 3.1.4, a sufficientcondition on α for the covariance Σ of the synchronization error to goto zero is that

0 < α 6 λ

P RO O F It is not difficult to see that λ < α(N), indeed

2

1 − N +

√N2 − 2N + 5

> λ

if and only if

N√N2 − 2N + 5 > 2 + N(N − 1) ,

or, equivalently, 4(N − 1) > 0 clearly true for all N > 1. Fur-thermore results that the bound is tight if the number of agentsis unknown. This is equivalent to assert that

2

1 − N +

√N2 − 2N + 5

→ λ , N → +∞

that is

limN→+∞ 2

1 + 1N +

√1 − 2

N + 5N2

λ = λ .

Page 36: Analysis of Clocks Synchronization Algorithms in Wireless ...tesi.cab.unipd.it/28288/1/thesis.pdf · ANALYSIS OF CLOCKS SYNCHRONIZATION ALGORITHMS IN WIRELESS SENSOR NETWORKS TESI

22 T H E P I P ROTO CO L

Remark 3.1.2. Instead of (2.5), we might consider the updatingrule in (2.4). The algorithm resulting in this case satisfies thesame properties of (3.4). In particular, for the complete graph,it is possible to see that there still exists a function α(N), suchthat α(N) > λ for all N, limN→∞ α(N) = λ and such thatthe synchronization is attained if and only if α < α. Howeverthe analysis in this case is much more involved; for this reason,in this dissertation, we decide to analyze the algorithm adopt-ing (2.5).

Circulant Graphs

Assume that the graph G describing the feasible communicationbetween nodes is a circulant graph, i. e. its adjacency matrix A isa circulant (symmetric) matrix. Moreover assume that each edge(i , j) ∈ E has the same probability of being selected. Hence

W =2

νNA ,

where ν is the degree of the graph, i. e. the number of link ofeach node. We have the following

Proposition 3.1.5. In the case of circulant graph with degree ν itholds

E[Ei↔j ] =2

νN(νI − A) , (3.13)

and

E[Ei↔jQEi↔j ] =4

νN[ν dg(Q) + A Q]

−4

νN(A dg(Q) + dg(AQ)) ,

(3.14)

for every symmetric circulant matrix Q.

P RO O F From the technical Lemma 3.1.1 we have that

E[Ei↔j ] = diag(W1) −W

=2

νNdiag(A1) −

2

νNA =

2

N

(I −

1

νA

).

Then we have the following

• diag(W dg(Q)1) = 2N dg(Q);

• dg(Q)W = W dg(Q) = 2νNA dg(Q);

• dg(A(W Q)) = 2νN dg(AQ),

Page 37: Analysis of Clocks Synchronization Algorithms in Wireless ...tesi.cab.unipd.it/28288/1/thesis.pdf · ANALYSIS OF CLOCKS SYNCHRONIZATION ALGORITHMS IN WIRELESS SENSOR NETWORKS TESI

3.1 S Y M M E T R I C G O S S I P 23

where we used the facts that if M is circulant, then dg(M) =M11I. Finally, substituting the above equations in (3.11) we ob-tain (3.14).

Thus we have that the covariances update (3.7) become

Σ+yy = Σyy − ZΣyy + ΣyyZ +

1

4X +

1

Σyz + Σ

∗yz

1

ZΣyz + Σ

∗yzZ+

2

N2λ2Σzz , (3.15a)

Σ+yz = −αΣyyZ +

α

4X + Σyz − ZΣyz

−α

NλΣ∗yzZ +

1

NλΣzz , and (3.15b)

Σ+zz =

α2

4X − α

ZΣyz + Σ

∗yzZ+ Σzz , (3.15c)

where

Z :=1

2E[Ei↔j ] =

1

νN(νI − A) ,

and

X := E[Ei↔jQEi↔j ]

=4

νN[ν dg(Q) + A Q − (A dg(Q) + dg(AQ))] .

Notice that from Assumption 3.1.1 results that Σyy, Σyz andΣzz are circulant matrix for all t > 0.

Observe now that a circulant matrix is completely determinedby the values of one of its row or column. Let πM be the gen-erator of the circulant matrix M (e. g. πM = col1(M)), and letdefine

πyy := πΣyy , πyz := πΣyz , and πzz := πΣzz .

In order to find useful recursive equations for πyy, πyz and πzz,we introduce the N × N matrices as follows

B := diag(Ae1) , C := e1e∗1 , and

D := e1e∗1A + Ae1e

∗1 .

(3.16)

We can now state the following

Proposition 3.1.6. In the case of a circulant graph with degree ν andan edge selection probability W = 2

νNA, results that

π+ =

π+yy

π+yz

π+zz

=

F11 F12 F13F21 F22 F23F31 F32 F33

πyyπyzπzz

= Fπ , (3.17)

Page 38: Analysis of Clocks Synchronization Algorithms in Wireless ...tesi.cab.unipd.it/28288/1/thesis.pdf · ANALYSIS OF CLOCKS SYNCHRONIZATION ALGORITHMS IN WIRELESS SENSOR NETWORKS TESI

24 T H E P I P ROTO CO L

where

F11 =1

νN[(N − 2)νI + 2A + B + νC − D] ;

F12 =2

νN2λ[(N − 1)νI + A] ;

F13 =2

N2λ2I ;

F21 =α

νN(−νI + A + B + νC − D) ;

F22 =1

νN2λ[(N2λ − Nλ − α)νI + (Nλ + α)A] ;

F23 =1

NλI ;

F31 =α2

νN(B + νC − D) ;

F32 = −2α

νN(νI − A) ;

F33 = I .

P RO O F From the definition of A, B, C, and D we have that

πAΣyy = Aπyy , πAΣyz = Aπyz , πAΣzz = Aπzz ,

πAΣyy = Bπyy , πAΣyz = Bπyz , πAΣzz = Bπzz ,

πdg(Σyy) = Cπyy , πdg(Σyz) = Cπyz , πdg(Σzz) = Cπzz ,

and

πA dg(Σyy)+dg(AΣyy) = Dπyy ,

πA dg(Σyz)+dg(AΣyz) = Dπyz ,

πA dg(Σzz)+dg(AΣzz) = Dπzz .

Hence, substituting the above equations in (3.15), and bearing inmind that if the matrices K and T are circulant, then KT = T K,we obtain (3.17).

From directly computation, one can see that the 3N-dimensionalvectors

v(1) =

100

, v(2) =

1

Nλ2 1

0

, and v(3) =N2λ2

2

001

,

belong to the same Jordan chain relative to the eigenvalue 1 ofthe operator matrix F, namely

(F− I)v(1) = 0 , (F− I)v(2) = v(1) , and (F− I)v(3) = v(2) .

Page 39: Analysis of Clocks Synchronization Algorithms in Wireless ...tesi.cab.unipd.it/28288/1/thesis.pdf · ANALYSIS OF CLOCKS SYNCHRONIZATION ALGORITHMS IN WIRELESS SENSOR NETWORKS TESI

3.1 S Y M M E T R I C G O S S I P 25

1

1

1

1

ith

row

jth column

1

2

3

4

1 2 3

jth column

1 2 3

1

2

3

4

5

1

1

1

1

1

Figure 4: Structure of the matrix S for N = 4 (left) and N = 5 (right).

We persuade ourselves that these (generalized) eigenvectors arethe only ones related to the eigenvalue 1, and that the remain-ing eigenvalues are inside the unit disc. In support of our guesswe will provide some numerical insights. To do that, in orderto further simplify the problem, we perform a system reduc-tion exploiting the fact that the covariances are symmetric ma-trices. Indeed, only part of the generators is essential. Moreprecisely, only the first r := dN+1

2 e elements2 of the generatorsπyy, πyz, and πzz are strictly necessary, because the other onesare a merely repetition. Consequently the system (3.17) could berewritten as

γ+ =

γ+yyγ+yzγ+zz

=

G11 G12 G13G21 G22 G23G31 G32 G33

γyyγyzγzz

= Gγ,

where G = (I3 ⊗ R)F(I3 ⊗ S), R = S†, and S is an N× r matrixsuch that

Sij =

1, if i = j,1, if i = r+ k, j = r− k+ 1, k = 1, . . . , r− 1, and N odd,1, if i = r+ k, j = r− k, k = 1, . . . , r− 2, and N even,0, otherwise.

An illustration of the matrix S is shown in Figure 4.So the 3r-dimensional G operator just computed encode the

information that the covariances Σyy, Σyz, and Σzz are both cir-culant and symmetric matrices. Let Λ(G) the spectrum of G

2 with dxe we denote the smallest integer not less than x.

Page 40: Analysis of Clocks Synchronization Algorithms in Wireless ...tesi.cab.unipd.it/28288/1/thesis.pdf · ANALYSIS OF CLOCKS SYNCHRONIZATION ALGORITHMS IN WIRELESS SENSOR NETWORKS TESI

26 T H E P I P ROTO CO L

0.965

0.97

0.975

0.98

0.985

0.99

0.995

1

1.005

0 10 20 30 40 50 60 70 80

Abs

olut

eva

lue

ofλi

Index i

Figure 5: Spectrum of the operator G for N = 50, ν = 4, and α = λ/2.

and let sort the eigenvalues by their absolute value (descendingorder), namely

Λ(G) = λ1, λ2, . . . , λ3r , |λ1| > |λ2| > · · · > |λ3r|.

We report an example of this set in Figure 5. From numericalsimulation we notice that the absolute values of λi, i = 1, . . . , 3rcluster around 1 as N growth and, although is not supported bytheoretical results, seems that all the eigenvalues belong to theunit disc.

3.2 A S Y M M E T R I C G O S S I P

In this case we suppose that for i ∈ 1, . . . ,N and for k ∈ N,the information x ′i(Ttx,i(k)) is sent by node i to only one of itsneighbors, which is randomly selected within the set Ni.

Now, without loss of generality, assume that the node i trans-mits, at time Ttx,i(k), the information x ′i(Ttx,i(k)) to node j. Basedon the information received, the node j instantaneously applies toits current state xj(Ttx,i(k)) the following correction

u =

[u ′

u ′′

]=1

2

[1

α

] (x ′i(Ttx,i(k)) − x

′j(Ttx,i(k))

),

Page 41: Analysis of Clocks Synchronization Algorithms in Wireless ...tesi.cab.unipd.it/28288/1/thesis.pdf · ANALYSIS OF CLOCKS SYNCHRONIZATION ALGORITHMS IN WIRELESS SENSOR NETWORKS TESI

3.2 A S Y M M E T R I C G O S S I P 27

where α, as before, is a control parameter such that α > 0.From (2.6), it follows that

x ′j(T+tx,i(k)) =

1

2

(x ′j(Ttx,i(k)) + x

′i(Ttx,i(k))

), (3.18a)

x ′′j (T+tx,i(k)) = x

′′j (Ttx,i(k))

2

(x ′i(Ttx,i(k)) − x

′j(Ttx,i(k))

). (3.18b)

Observe we have that Ttx,i(k) represents an update time instantfor node j, i. e. Ttx,i(k) = Tup,j(k

′) for some k ′ ∈N.From now on, all the deductive reasonings follow the same

operating principles outlined in the symmetric case. Let us startby providing a convenient vector-form description of the evolu-tion of the clocks’ network. Combining (2.7) with (3.18), we canwrite

x(k+ 1) =

[I− 1

2Ei→j δtkD

−α2Ei→j I

]x(k), (3.19)

where

Ei→j := eje∗j − eje

∗i , tk := T−up(k),

δtk = tk+1 − tk, x(k) := x(t−k ).

In next sections, as done for the symmetric protocol, we pro-vide a mean square analysis focusing our attention on the com-plete and the circulant graph topologies.

3.2.1 Mean-Square Analysis

Since for any i, j ∈ 1, . . . ,N , i 6= j, Ei→jΩ = Ei→j, system (3.19)can be rewritten as[

y(k+ 1)z(k+ 1)

]=

[I− 1

2ΩE(k) δtk−α2ΩDE(k) I

] [y(k)z(k)

], (3.20)

where y(k) and z(k) are defined as in Section 3.1.1, and whereE(k) = Ei→j if, during the k-th iteration node i and node j are,respectively, the transmitting and the receiving nodes. Clearlyx ′ reaches the asymptotic synchronization if and only if

limk→∞y(k) = 0.

The goal is to perform a mean-square analysis of (3.20). Theobjective is to study the evolution of

Σ(k+ 1) = E[A(k)Σ(k)A∗(k)] (3.21)

Page 42: Analysis of Clocks Synchronization Algorithms in Wireless ...tesi.cab.unipd.it/28288/1/thesis.pdf · ANALYSIS OF CLOCKS SYNCHRONIZATION ALGORITHMS IN WIRELESS SENSOR NETWORKS TESI

28 T H E P I P ROTO CO L

where

A(k) :=

[I− 1

2ΩE(k) δtk−α2ΩDE(k) I

].

Also in this case we perform our analysis assuming D = I.From the above recursive equation we obtain the following

Σ+yy = Σyy −

1

2

ΩE[Ei→j]Σyy + ΣyyE[E∗i→j]Ω

+1

4ΩE[Ei→jΣyyE

∗i→j]Ω+

1

Σyz + Σ

∗yz

1

2Nλ

ΩE[Ei→j]Σyz + Σ

∗yzE[E∗i→j]Ω

+

2

N2λ2Σzz,

(3.22a)

Σ+yz = −

α

2ΣyyE[E∗i→j]Ω+

α

4ΩE[Ei→jΣyyE

∗i→j]Ω+ Σyz

−1

2ΩE[Ei→j]Σyz −

α

2NλΣ∗yzE[E∗i→j]Ω+

1

NλΣzz,

(3.22b)

Σ+zz =

α2

4ΩE[Ei→jΣyyE

∗i→j]Ω

−α

2

ΩE[Ei→j]Σyz + Σ

∗yzE[E∗i→j]Ω

+ Σzz, (3.22c)

therefore, as for the symmetric algorithm, the covariance matrixΣ updates according to a linear transformation

Σ(k+ 1) = F[Σ(k)]. (3.23)

Let us introduce the following technical result.

Lemma 3.2.1. Let G = (V ,E) be a given graph without any self-loopand let W be the matrix defined as in (3.5). Let Q any symmetricmatrix. Then

E[Ei→j] = diag(W1) −W (3.24)

and

E[Ei→jQE∗i→j] = diag(W1)dg(Q)

+ diag(dg(Q)W1) − 2diag((W Q)1).(3.25)

P RO O F We have that

E[Ei→j] =∑

(i,j)∈E

Wij(eje∗j − eje

∗i ) = diag(W1) −W,

Page 43: Analysis of Clocks Synchronization Algorithms in Wireless ...tesi.cab.unipd.it/28288/1/thesis.pdf · ANALYSIS OF CLOCKS SYNCHRONIZATION ALGORITHMS IN WIRELESS SENSOR NETWORKS TESI

3.2 A S Y M M E T R I C G O S S I P 29

and also that

E[Ei→jQE∗i→j] =

∑(i,j)∈E

Wij(eje∗j − eje

∗i )Q(eje

∗j − eie

∗j )

=∑

(i,j)∈E

Wij(Qjj −Qij −Qji +Qii)eje∗j ,

or, equivalently

E[Ei→jQE∗i→j] = diag(W1)dg(Q)

− 2diag((W Q)1) + diag(dg(Q)W1).

Notice that a relevant difference with the symmetric versionof the protocol is the probability edge selection. Indeed, due tothe one-way link pattern, results that each edge (i, j) ∈ E hashalf probability of being selected, namely

W =1

N(N− 1)(11∗ − I), (3.26)

for the complete graph, and

W =1

νNA, (3.27)

for a circulant graph of degree ν.

Complete Graph

We can now state the following

Proposition 3.2.2. In the case of complete graph it holds

E[Ei→j] =1

N− 1Ω,

and

E[Ei→jΩE∗i→j] =

2

NI.

P RO O F From the technical Lemma 3.2.1 we have that

E[Ei→j] = diag(W1) −W

=1

NI−

1

N(N− 1)(11∗ − I) =

1

N− 1Ω

Page 44: Analysis of Clocks Synchronization Algorithms in Wireless ...tesi.cab.unipd.it/28288/1/thesis.pdf · ANALYSIS OF CLOCKS SYNCHRONIZATION ALGORITHMS IN WIRELESS SENSOR NETWORKS TESI

30 T H E P I P ROTO CO L

and

E[Ei→jQE∗i→j] = diag(W1)dg(Q)

− 2diag((W Q)1) + diag(dg(Q)W1)

=N− 1

N2I+

N− 1

N2I+

2

N2I =

2

NI.

Furthermore we have that

Proposition 3.2.3. In the case of complete graph, the set

J =

Σ : Σ =

[a b

b c

]⊗Ω

is invariant under the transformation in (3.23).

P RO O F Let Σ(k) = Σ with Σ ∈ J. Then, applying Proposi-tion 3.2.2 to (3.23), one can obtain

Σ+yy =

2N2 − 3N− 1

2N(N− 1)aΩ+

2N− 3

Nλ(N− 1)bΩ+

2

N2λ2cΩ

Σ+yz = −

α

2N(N− 1)aΩ+

2N2λ− 3Nλ−α

2Nλ(N− 1)bΩ+

1

NλcΩ

Σ+zz =

α2

2NaΩ−

α

N− 1bΩ+ cΩ

therefore Σ(k+ 1) ∈ J.

Corollary. In the case of a complete graph and under Assumption 3.1.1,we have

Σyy(k) = ξyy(k)Ω,Σyz(k) = ξyz(k)Ω,Σzz(k) = ξzz(k)Ω,

where

ξ+ =

ξ+yyξ+yzξ+zz

=

2N2−3N−12N(N−1)

2N−3Nλ(N−1)

2N2λ2

− α2N(N−1)

2N2λ−3Nλ−α2Nλ(N−1)

1Nλ

α2

2N − αN−1 1

ξyyξyzξzz

= Φaξ

P RO O F The result just follows form the fact that the initialcondition Σ(0) in (3.9) is in J and, therefore we can parametrizedthe trajectories of the system as

Σ(k) =

[ξyy(k) ξyz(k)ξyz(k) ξzz(k)

]⊗Ω

Page 45: Analysis of Clocks Synchronization Algorithms in Wireless ...tesi.cab.unipd.it/28288/1/thesis.pdf · ANALYSIS OF CLOCKS SYNCHRONIZATION ALGORITHMS IN WIRELESS SENSOR NETWORKS TESI

3.2 A S Y M M E T R I C G O S S I P 31

because of the invariance stated in proposition above. The proofof the same proposition gives also the update equations for thethree parameters of the covariance matrix.

Theorem 3.2.4. Consider the network of clocks described before withan asymmetric gossip communication protocol over a complete graphand an edge selection probability matrix as in (3.26). Then the covari-ance Σ of the synchronization error converges exponentially to zero ifand only if

α <Nλ

N− 1

√N4 − 4N3 + 9N2 − 8N+ 3−N2 + 2N− 2

=: α(N)

P RO O F The stability of the update equation can be studied byeigenvalue analysis of the matrix Φa. The characteristic polyno-mial is

ψ(z) = det(zI−Φa) =q3z

3 + q2z2 + q1z+ q0

4N4λ3(N− 1)2,

where

q3 = 4N4λ3(N− 1)2;

q2 = −2N3λ2(N− 1)(6N2λ− 8Nλ− λ−α);

q1 = −Nλ[4(N− 1)2α2 − 5Nλ(N− 1)α

−N2λ2(4N2 − 4N− 1)(3N− 5)];

q0 = −2(N− 1)α3 − 4Nλα2

−N2λ2(2N2 +N− 7)α

−N3λ3(4N3 − 12N2 + 7N+ 3).

An efficient way to study the stability of ψ(z) is to apply theRouth criterion to the numerator of the continuous time versionobtained by the Möbius transformation z = (1+ s)/(1− s)

ψc(s) =r3s

3 + r2s2 + r1s+ r0

2N4λ3(N− 1)2(s− 1)3,

where

r3 = −(N− 1)α3 + 2N2λ(N− 2)α2 − 2N2λ2(2N− 3)α

−N3λ3(4N2 − 5N− 1)(4N− 5);

r2 = 3(N− 1)α3 − 2Nλ(N2 − 2N− 2)α2

+N2λ2(4N2 + 3N− 13)α− 2N3λ3(4N2 − 3N− 3);

r1 = −3(N− 1)α3 − 2Nλ(N2 − 2N+ 4)α2

− 2N2λ2(2N2 −N− 4)α−N3λ3(N+ 1);

r0 = (N− 1)α3 + 2Nλ(N2 − 2N+ 2)α2 −N2λ2(N+ 1)α.

Page 46: Analysis of Clocks Synchronization Algorithms in Wireless ...tesi.cab.unipd.it/28288/1/thesis.pdf · ANALYSIS OF CLOCKS SYNCHRONIZATION ALGORITHMS IN WIRELESS SENSOR NETWORKS TESI

32 T H E P I P ROTO CO L

To have stability all the four terms ri must have the same sign.We will now show that, under the technical assumptions N > 2

(which is a necessary condition to have a properly randomizedalgorithm) and λ > 0 (a necessary condition to have a properlyPoisson process) all terms are negative under the condition α <α.

Observe that the term r1 is always negative then we have totest the negativity of the remaining terms.

S I G N O F T H E T E R M r0 : It is clear that r0 is negative if and onlyif

(N− 1)α2 + 2Nλ(N2 − 2N+ 2)α−N2λ2(N+ 1) < 0

which turns out to be true for

α <Nλ

N− 1

√N4 − 4N3 + 9N2 − 8N+ 3−N2 + 2N− 2

= α.

Our goal now is to proof that r2, r3 < 0 if α < α.

S I G N O F T H E T E R M r2 : We have that

r2(0) = −2N3λ3(4N2 − 3N− 3),

r2(α) = 2N3λ38N2(ζ−N2) + 2N(15N2 − 7ζ)

+ 21ζ− 73N2 − 35

,

where

ζ :=√N4 − 4N3 + 9N2 − 8N+ 3.

One can easily see that r2(0) < 0 for all N > 0 whereasr2(α) < 0 if and only if

(8N2 − 14N+ 21)ζ < 8N4 − 30N3 + 73N2 + 35,

or, equivalently, if and only if

ζ < N2 − 2N+ 3︸ ︷︷ ︸q(N)

+

r(N)︷ ︸︸ ︷84N− 28

8N2 − 14N+ 21,

where q(N) and r(N) denote respectively the quotient andthe remainder of the polynomial long division

d(N) =8N4 − 30N3 + 73N2 + 35

8N2 − 14N+ 21.

Page 47: Analysis of Clocks Synchronization Algorithms in Wireless ...tesi.cab.unipd.it/28288/1/thesis.pdf · ANALYSIS OF CLOCKS SYNCHRONIZATION ALGORITHMS IN WIRELESS SENSOR NETWORKS TESI

3.2 A S Y M M E T R I C G O S S I P 33

-0.8

-0.4

0

0.4

0.8

0 1 2 3 4 5

ψc

coef

ficie

ntr 2(α

)

control parameter α

r2(α)

Figure 6: Behavior of r2(α) for N = 10 and λ = 0.01 (solid line) and theevaluation r2(α) (dashed line).

It is not difficult to see that ζ < q(N) and this prove thenegativity of r2(α). Sure enough we have

ζ2 < q2(N) if and only if N2 − 4N+ 6 > 0,

clearly true for all N ∈N.

To show that r2 is negative in the entire interval (0, α) westudy the derivative of r2, that is

r ′2(α) = 9(N− 1)α2 − 4Nλ(N2 − 2N− 2)α

+N2λ2(4N2 + 3N− 13).

We have that r ′2(α) = 0 for

α1,2 =Nλ

9(N− 1)

2(N2 − 2N− 2)

∓√4N4 − 52N3 + 9N2 + 176N− 101

.

For N 6 12, α1,2 are complex conjugate and hence r2 ismonotonically increasing for α ∈ R (see Figure 6). Other-wise, if N > 12, then r2 has a local maximum in α1 and alocal minimum in α2 (as reported in Figure 7). However,in this case, we have that α < α1 if and only if A < B,where

A = 9ζ+ γ, γ :=√4N4 − 52N3 + 9N2 − 176N− 101;

B = 11N2 − 22N+ 14,

Page 48: Analysis of Clocks Synchronization Algorithms in Wireless ...tesi.cab.unipd.it/28288/1/thesis.pdf · ANALYSIS OF CLOCKS SYNCHRONIZATION ALGORITHMS IN WIRELESS SENSOR NETWORKS TESI

34 T H E P I P ROTO CO L

-6

-5

-4

-3

-2

-1

0

0 0.2 0.4 0.6 0.8 1

ψc

coef

ficie

ntr 2(α

)

control parameter α

r2(α1)

r2(α2)

r2(α)

Figure 7: Behavior of r2(α) for N = 15 and λ = 0.01 (solid line) and theevaluation r2(α) (dashed line).

or, equivalently, A2 < B2 that leads to

γζ < 2N4 − 6N3 + 3N2 − 8N+ 3,

which, in turn, conduct to

44N7 − 205N6 + 292N5 + 413N4

− 1844N3 + 2372N2 − 1384N+ 312 > 0, ∀N > 2,

which implies that r2 restricted into the interval [0 α] isstill monotonically increasing.

S I G N O F T H E T E R M r3 : Similarly to r2 , observing that

(N − 1)2 < ζ < N2 ,

we have

r3(0) = −N3λ3(4N − 5)(4N2 − 5N − 1) < 0 ,

r3(α) < −N3λ3(4N − 5)(4N2 − 5N + 3) < 0 .

One can see that, if N > 5, then r3 is a convex function forα ∈ [0 α]. Indeed we have that

r ′′3 (α) = −6(N − 1)α + 4N2λ(N − 2) ,

where r ′′3 > 0 if and only if

α <2

3

N − 2

N − 1N2λ =: ρ

and, for N > 5, it holds true that α < ρ.

Finally for N = 2 , 3 , 4 we obtain respectively:

Page 49: Analysis of Clocks Synchronization Algorithms in Wireless ...tesi.cab.unipd.it/28288/1/thesis.pdf · ANALYSIS OF CLOCKS SYNCHRONIZATION ALGORITHMS IN WIRELESS SENSOR NETWORKS TESI

3.2 A S Y M M E T R I C G O S S I P 35

-0.032

-0.0315

-0.031

-0.0305

-0.03

-0.0295

-0.029

-0.0285

-0.028

0 0.05 0.1 0.15 0.2

ψc

coef

ficie

ntr3(α

)

control parameter α

r2(αm)

r2(αM)

Figure 8: Behavior of r3(α) for N = 4 and λ = 0.01.

• r ′3(α) = −3α2 − 8λ < 0 ∀α;

• r ′3(α) = −6(α − 3λ)2 6 0 ∀α;

• r ′3(α) = −9α2 + 128λα + 160λ2 > 0 if and only if

αm := 1 .38λ < α < 12 .84λ =: αM ,

so αM is a local maximum and r3(αM) < 0 (as illus-trated in Figure 8).

Corollary. Under the same hypothesis of Theorem 3.2.4, a sufficientcondition on α for the covariance Σ of the synchronization error to goto zero is that

0 < α 6λ

2

P RO O F It is not difficult to see that λ/2 < α(N) for all N > 2,indeed

N− 1

√N4 − 4N3 + 9N2 − 8N+ 3−N2 + 2N− 2

2,

if and only if

12N3 − 21N2 + 10N− 1 > 0,

clearly true for all N > 1. Furthermore results that the bound istight if the number of agents is unknown. This is equivalent toassert that

limN→∞ Nλ

N− 1

√N4 − 4N3 + 9N2 − 8N+ 3−N2 + 2N− 2

→ λ

2,

Page 50: Analysis of Clocks Synchronization Algorithms in Wireless ...tesi.cab.unipd.it/28288/1/thesis.pdf · ANALYSIS OF CLOCKS SYNCHRONIZATION ALGORITHMS IN WIRELESS SENSOR NETWORKS TESI

36 T H E P I P ROTO CO L

that is

limN→+∞

1+ 1N√

1− 4N + 9

N2− 8N3

+ 3N4

+ 1− 2N + 2

N2

λ =λ

2.

Circulant Graphs

As highlighted in the previous section, the edge selection proba-bility matrix W is as in (3.27), therefore we have the following

Proposition 3.2.5. In the case of circulant graph with degree ν it holds

E[Ei→j] =1

νN(νI−A), (3.28)

and

E[Ei→jQE∗i→j] =

2

νN[νdg(Q) − dg(AQ))], (3.29)

for every symmetric circulant matrix Q.

P RO O F From the technical Lemma 3.2.1 we have that

E[Ei→j] = diag(W1) −W

=1

νNdiag(A1) −

1

νNA =

1

N

(I−

1

νA

).

Then we have the following

• diag(dg(Q)W1) = 1N dg(Q);

• dg((W Q)1) = 1νN dg(AQ),

where we used the facts that, if M is circulant, then dg(M) =M11I. Finally, substituting the above equations in (3.25) we ob-tain (3.29).

Thus we have that the covariances update (3.22) become

Σ+yy = Σyy − ΩZΣyy + ΣyyZΩ+

1

4ΩXΩ

+1

Σyz + Σ

∗yz

−1

ΩZΣyz + Σ

∗yzZΩ

+

2

N2λ2Σzz, (3.30a)

Σ+yz = −αΣyyZΩ+

α

4ΩXΩ+ Σyz −ΩZΣyz

−α

NλΣ∗yzZΩ+

1

NλΣzz, and (3.30b)

Σ+zz =

α2

4ΩXΩ−α

ΩZΣyz + Σ

∗yzZΩ

+ Σzz, (3.30c)

Page 51: Analysis of Clocks Synchronization Algorithms in Wireless ...tesi.cab.unipd.it/28288/1/thesis.pdf · ANALYSIS OF CLOCKS SYNCHRONIZATION ALGORITHMS IN WIRELESS SENSOR NETWORKS TESI

3.2 A S Y M M E T R I C G O S S I P 37

where

Z :=1

2E[Ei↔j] =

1

2νN(νI−A),

and

X := E[Ei↔jQEi↔j] =2

νN[νdg(Q) − dg(AQ))].

Notice that from Assumption 3.1.1 results that Σyy, Σyz and Σzzare circulant matrix for all t > 0.

As done in the symmetric case, we want to find useful recur-sive equations for the generators πyy, πyz, and πzz of the covari-ances just mentioned. In order to simplify the notation, let usintroduce the following N×N matrices

Θ := e1e∗1A, L := 1e∗1, and M := 1e∗1A. (3.31)

We can now state the following

Proposition 3.2.6. In the case of a circulant graph with degree ν andan edge selection probability W = 1

νNA, results that

π+ =

π+yyπ+yzπ+zz

=

F11 F12 F13F21 F22 F23F31 F32 F33

πyyπyzπzz

= Fπ, (3.32)

where

F11 =1

2νN2[2(N− 1)NνI+ 2NA+ νNC−NΘ− νL+M];

F12 =1

νN2λ[(2N− 1)νI+A];

F13 =2

N2λ2I;

F21 =α

2νN2(−νNI+NA+ νNC−NΘ− νL+M);

F22 =1

2νN2λ[(2N2λ−Nλ−α)νI+ (Nλ+α)A];

F23 =1

NλI;

F31 =α2

2νN2(νNC−NΘ− νL+M);

F32 = −α

νN(νI−A);

F33 = I.

Page 52: Analysis of Clocks Synchronization Algorithms in Wireless ...tesi.cab.unipd.it/28288/1/thesis.pdf · ANALYSIS OF CLOCKS SYNCHRONIZATION ALGORITHMS IN WIRELESS SENSOR NETWORKS TESI

38 T H E P I P ROTO CO L

P RO O F Observe that we are interested in the generators

πΩZQ, Q = Σyy,Σyz and πΩXΩ.

Moreover, notice that

πΩZQ = πZQ and πΩXΩ = πX −1

NπX11∗ .

Now, from Proposition 3.1.6 we have that

πAΣyy = Aπyy, πAΣyz = Aπyz, πAΣzz = Aπzz,

πdg(Σyy) = Cπyy, πdg(Σyz) = Cπyz, πdg(Σzz) = Cπzz,

and, from the definition of Θ, L, and M in (3.31) result

πdg(AΣyy) = Θπyy, πdg(Σyy)11∗ = Lπyy,

πdg(AΣyz) = Θπyz, πdg(Σyz)11∗ = Lπyz,

πdg(AΣzz) = Θπzz, πdg(Σzz)11∗ = Lπzz,

and

πdg(AΣyy)11∗ =Mπyy,

πdg(AΣyy)11∗ =Mπyy,

πdg(AΣyy)11∗ =Mπyy.

Hence, substituting the above equations in (3.30), and bearing inmind that if the matrices K and T are circulant, then KT = TK,we obtain (3.32).

3.3 S O M E S I M U L AT I O N S

In this section we provide some numerical results illustrating theasymmetric synchronization algorithm we propose in this thesis.We run our simulations over three different topologies of net-work, namely, the complete graph, the circulant graph, and therandom geometric graph. In all the simulations we considereda network of N = 50 clocks, and we assumed that the transmis-sions’ time instants were generated by N independent Poissonprocesses of the same intensity λ = 0.1. For circulant graphwe assumed that ν = 4, i. e. every clock can exchange informa-tion to only four neighboring clocks. All the random geometricgraphs were connected graphs and were generated by choosingthe N = 50 points uniformly distributed in the unit square andby connecting with an edge each pair of points at distance less

Page 53: Analysis of Clocks Synchronization Algorithms in Wireless ...tesi.cab.unipd.it/28288/1/thesis.pdf · ANALYSIS OF CLOCKS SYNCHRONIZATION ALGORITHMS IN WIRELESS SENSOR NETWORKS TESI

3.3 S O M E S I M U L AT I O N S 39

0

0.10.20.30.40.50.60.70.80.9

1

0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

Figure 9: Random geometric graph withN = 50 agents. The minimum,maximum and average degree of nodes are respectively of 1,10 and 5.4.

than 0.15. An example of a geometric graph is illustrated in Fig-ure 9.

We report our results in Figures 10–15. In all the plots we de-pict the behavior of log ‖y(k)‖ obtained by averaging over 100Monte Carlo runs, randomized with respect to the initial con-ditions and, as far as the geometric topology is concerned, alsowith the respect to the graph. In particular, for i ∈ 1, . . . ,N ,x ′(0) has been randomly chosen within the interval [−1, 1] whilefi has been randomly chosen within the interval [1 − ε, 1 + ε],where 0 6 ε 6 1 (the values of ε used will be specified in thecaptions of the figures).

In Figures 10, 11, and 12, we analyzed the behavior of log ‖y(k)‖for different values of α while keeping fixed the value of ε to thevalue 10−4. One can see that the value of α heavily influencesthe speed of convergence to the synchronization. In particular,small values of α drastically slower down the algorithm.

In Figures 13, 14, and 15 we analyzed the behavior of log ‖y(k)‖for different values of ε, while keeping fixed the value of α tothe value of λ/8, λ/50, and λ/100 for the complete, circulant,and random geometric graph respectively. It is remarkable that,for all topologies, the algorithm asymptotically achieves the syn-chronization, even though the drifts fi, i ∈ 1, . . . ,N , are signif-icantly spread, i.e., ε = 0.1. However, as expected, it turns outthat the smaller the value of ε is, the better the performance ofthe algorithm are.

Page 54: Analysis of Clocks Synchronization Algorithms in Wireless ...tesi.cab.unipd.it/28288/1/thesis.pdf · ANALYSIS OF CLOCKS SYNCHRONIZATION ALGORITHMS IN WIRELESS SENSOR NETWORKS TESI

40 T H E P I P ROTO CO L

1e-25

1e-20

1e-15

1e-10

1e-05

1

0 500 1000 1500 2000 2500 3000 3500 4000

Stea

dy-s

tate

erro

rlo

g(y(k))

Absolute time t

α = λ/4α = λ/8α = λ/16

Figure 10: Behavior of the algorithm for the complete graph topologyas α changes: λ/4 (solid line), λ/8 (dashed line), and λ/16(dotted line).

1e-25

1e-20

1e-15

1e-10

1e-05

1

100000

0 10000 20000 30000 40000 50000 60000

Stea

dy-s

tate

erro

rlo

g(y(k))

Absolute time t

α = λ/10α = λ/50α = λ/500

Figure 11: Behavior of the algorithm for the circulant graph topologyas α changes: λ/4 (solid line), λ/8 (dashed line), and λ/16(dotted line).

Page 55: Analysis of Clocks Synchronization Algorithms in Wireless ...tesi.cab.unipd.it/28288/1/thesis.pdf · ANALYSIS OF CLOCKS SYNCHRONIZATION ALGORITHMS IN WIRELESS SENSOR NETWORKS TESI

3.3 S O M E S I M U L AT I O N S 41

1e-25

1e-20

1e-15

1e-10

1e-05

1

0 5000 10000 15000 20000 25000 30000 35000 40000

Stea

dy-s

tate

erro

rlo

g(y(k))

Absolute time t

α = λ/10α = λ/100α = λ/1000

Figure 12: Behavior of the algorithm for the random geometric graphtopology as α changes: λ/10 (solid line), λ/10 (dashed line),and λ/1000 (dotted line).

1e-25

1e-20

1e-15

1e-10

1e-05

1

100000

0 500 1000 1500 2000 2500

Stea

dy-s

tate

erro

rlo

g(y(k))

Absolute time t

ε = 1e-07

ε = 1e-01

Figure 13: Behavior of the algorithm for the complete graph topologyas ε changes: 10−7 (solid line) and 0.1 (dashed line).

Page 56: Analysis of Clocks Synchronization Algorithms in Wireless ...tesi.cab.unipd.it/28288/1/thesis.pdf · ANALYSIS OF CLOCKS SYNCHRONIZATION ALGORITHMS IN WIRELESS SENSOR NETWORKS TESI

42 T H E P I P ROTO CO L

1e-25

1e-20

1e-15

1e-10

1e-05

1

100000

0 10000 20000 30000 40000 50000 60000 70000

Stea

dy-s

tate

erro

rlo

g(y(k))

Absolute time t

ε = 1e-7ε = 1e-1

Figure 14: Behavior of the algorithm for the circulant graph topologyas ε changes: 10−7 (solid line) and 0.1 (dashed line).

1e-25

1e-20

1e-15

1e-10

1e-05

1

100000

0 5000 10000150002000025000300003500040000

Stea

dy-s

tate

erro

rlo

g(y(k))

Absolute time t

ε = 1e-07

ε = 1e-01

Figure 15: Behavior of the algorithm for the random geometric graphtopology as ε changes: 10−7 (solid line) and 0.1 (dashedline).

Page 57: Analysis of Clocks Synchronization Algorithms in Wireless ...tesi.cab.unipd.it/28288/1/thesis.pdf · ANALYSIS OF CLOCKS SYNCHRONIZATION ALGORITHMS IN WIRELESS SENSOR NETWORKS TESI

4 A LG O R I T H M S CO M PA R I S O N

In this chapter we provide a numerical comparison of our proto-col with Average Time-Sync the algorithm introduced by Schen-ato and Fiorentin [2009]. We focus our attention to performanceand accuracy. More precisely, we start considering the idealnoiseless scenario and evaluating the speed of convergence ofboth algorithms, then we look at the noisy communication chan-nel and we compare the steady-state synchronization error.

4.1 T H E AV E R AG E T I M E S Y N C H P ROTO CO L

First of all let us summarize the ATS protocol. The algorithm isdivided into three main steps: the relative skew estimation, theskew compensation, and the offset compensation.

4.1.1 Relative Skew Estimation

This step of the protocol is concerned with deriving an algorithmto estimate for each clock i the relative skew, i. e. the oscillatorperiod, with respect to its neighbors j. Namely, every node itries to estimate the relative skew fij := fj/fi with respect to itsneighbor nodes j. This is accomplished by transmitting the cur-rent local time x ′j(Ttx,j(k)) to node jwhich instantaneously recordsits own local time x ′i(Ttx,j(k)). Therefore, node j records in itsmemory the pair (x ′i(Ttx,j(k)), x ′j(Ttx,j(k))). When a new packetfrom node j arrives to node i, the same procedure is applied toget the new pair (x ′i(Ttx,j(k

′)), x ′j(Ttx,j(k′))) and the estimate of

the relative skew fij is performed as follows

η+ij = ρηηij + (1− ρη)x ′j(k

′) − x ′j(k)

x ′i(k′) − x ′i(k)

, (4.1)

where, for the sake of notational simplicity we define

x ′l(h) := x′l(Ttx,j(h)),

and ρη ∈ (0, 1) is a tuning parameter. The authors prove that, ifthere is no measurement error and the oscillator frequencies areconstant as stated in Assumption 2.2.1, then the variable ηij con-verges to fij. They also highlight that (4.1) acts a low pass filter

43

Page 58: Analysis of Clocks Synchronization Algorithms in Wireless ...tesi.cab.unipd.it/28288/1/thesis.pdf · ANALYSIS OF CLOCKS SYNCHRONIZATION ALGORITHMS IN WIRELESS SENSOR NETWORKS TESI

44 A LG O R I T H M S CO M PA R I S O N

where the parameter ρη is used to tune the trade-off between thespeed of convergence (ρη close to zero) and noise immunity (ρηclose to unity).

4.1.2 Skew Compensation

This step is the core of the protocol, as it forces all clocks toconverge to a common virtual clock rate, a, as defined in (2.8).Basically is a distributed consensus algorithm where any nodekeeps its own estimate of the global variable a, and it updatesits value by averaging it relative to the estimate of its neighbors,i. e.

a+i = ρaai + (1− ρa)ηijaj, (4.2)

where aj is the virtual clock skew estimate of j ∈ Ni.The authors prove that if ai(0) = 1, ρa ∈ (0, 1), and assuming

that ηij = fij for all i, j and the underlying communication graphis strongly connected, then

limt→∞ ai(k)fi = a, ∀i

exponentially fast.

4.1.3 Offset Compensation

At this point it is only necessary to compensate for possible off-set errors. Once again, the protocol adopt a consensus algorithmto update the virtual clock offset as follows

oi = oi + (1− ρo)(τj − τi), (4.3)

where

τi = aix′i + oi, and

τj = ajx′j + oj,

are the virtual time estimates of clock i and j respectively andare computed at the same time instant. In their work the authors,as done for the skew compensation, prove that

limk→∞ τi(k) = τj(k) ∀(i, j)

exponentially fast.Remark 4.1.1. The algorithm requires extra memory to record thevirtual reference estimate τi, the relative skew estimates ηij andthe last clock pairs (x ′i(k), x

′j(k)) for every node i. Moreover, at

every transmission instant Ttx,i(k), node i must send the threevariables x ′i, ai, and τi to its neighbor j.

Page 59: Analysis of Clocks Synchronization Algorithms in Wireless ...tesi.cab.unipd.it/28288/1/thesis.pdf · ANALYSIS OF CLOCKS SYNCHRONIZATION ALGORITHMS IN WIRELESS SENSOR NETWORKS TESI

4.2 S O M E S I M U L AT I O N S 45

1e-25

1e-20

1e-15

1e-10

1e-05

1

0 5000 10000 15000 20000 25000 30000 35000 40000

Stea

dy-s

tate

erro

rlo

g(y(k))

Absolute time t

pi

ats

Figure 16: Comparison between the pi protocol and the ats algorithmfor a complete graph topology in a noiseless scenario.

4.2 S O M E S I M U L AT I O N S

In this section we provide a numerical comparison between theasymmetric synchronization algorithm we propose in this disser-tation and the ATS protocol. As done in the previous chapter, werun our simulation over three different topologies of network,namely, the complete graph, the circulant graph, and the ran-dom geometric graph. In all the simulations we considered anetwork ofN = 50 units, and we assumed that the transmissions’time instant were generated by N independent Poisson processof the same intensity λ = 0.1. For circulant graph we assumedthat ν = 4, i. e. every clock can exchange information to onlyfour neighboring clocks. All the random geometric graphs wereconnected graphs and were generated by choosing the N = 50

points uniformly distributed in the unit square and by connect-ing with an edge each pair of points at distance less than 0.15.

We report our results in Figures 16–21. In all the plots we de-pict the behavior of log ‖y(k)‖ obtained by averaging over 100Monte Carlo runs, randomized with respect to the initial con-ditions and, as far as the geometric topology is concerned, alsowith the respect to the graph. In particular, for i ∈ 1, . . . ,N ,x ′(0) has been randomly chosen within the interval [−1, 1] whilefi has been randomly chosen within the interval [1 − ε, 1 + ε],where ε = 10−5.

Page 60: Analysis of Clocks Synchronization Algorithms in Wireless ...tesi.cab.unipd.it/28288/1/thesis.pdf · ANALYSIS OF CLOCKS SYNCHRONIZATION ALGORITHMS IN WIRELESS SENSOR NETWORKS TESI

46 A LG O R I T H M S CO M PA R I S O N

1e-18

1e-16

1e-14

1e-12

1e-10

1e-08

1e-06

0.0001

0.01

1

0 5000 10000150002000025000300003500040000

Stea

dy-s

tate

erro

rlo

g(y(k))

Absolute time t

pi

ats

Figure 17: Comparison between the pi protocol and the ats algorithmfor a circulant graph topology in a noiseless scenario.

1e-25

1e-20

1e-15

1e-10

1e-05

1

0 5000 10000 15000 20000 25000 30000 35000 40000

Stea

dy-s

tate

erro

rlo

g(y(k))

Absolute time t

pi

ats

Figure 18: Comparison between the pi protocol and the ats algorithmfor a random geometric graph topology in a noiseless sce-nario.

Page 61: Analysis of Clocks Synchronization Algorithms in Wireless ...tesi.cab.unipd.it/28288/1/thesis.pdf · ANALYSIS OF CLOCKS SYNCHRONIZATION ALGORITHMS IN WIRELESS SENSOR NETWORKS TESI

4.2 S O M E S I M U L AT I O N S 47

1e-14

1e-12

1e-10

1e-08

1e-06

0.0001

0.01

1

0 5000 10000150002000025000300003500040000

Stea

dy-s

tate

erro

rlo

g(y(k))

Absolute time t

pi

ats

Figure 19: Comparison between the pi protocol and the ats algorithmfor a complete graph topology and a noisy communicationchannel

In Figures 16, 17, and 18, we compared the behavior of log ‖y(k)‖in the noiseless scenario. The tuning parameters for the ATS pro-tocol were

ρη = 0, ρa = 0.5, and ρo = 0.5,

while the control parameter α for the asynchronous PI algorithmwere

α = λ/8, α = λ/50, and α = λ/100,

for the complete, circulant, and complete graph respectively. Onecan see, except for the complete graph topology, that the ATS pro-tocol is faster than the PI algorithm.

In Figures 19, 20, and 21 we compared the behavior of log ‖y(k)‖in a noisy communication channel. We assumed the noise addi-tive and bounded by the maximum magnitude of 10−6. Specif-ically, at every transmission instant Ttx,i(k) a number uniformlydistributed in the interval [0, 10−6] was added to any transmit-ted variable, i. e. x ′i (for both algorithms), ai, and τi (only forthe ATS protocol). It is remarkable that, for all the topologies, thesteady-state of the PI algorithm is decidedly better than the ATSprotocol.

Page 62: Analysis of Clocks Synchronization Algorithms in Wireless ...tesi.cab.unipd.it/28288/1/thesis.pdf · ANALYSIS OF CLOCKS SYNCHRONIZATION ALGORITHMS IN WIRELESS SENSOR NETWORKS TESI

48 A LG O R I T H M S CO M PA R I S O N

1e-12

1e-10

1e-08

1e-06

0.0001

0.01

1

0 5000 10000150002000025000300003500040000

Stea

dy-s

tate

erro

rlo

g(y(k))

Absolute time t

pi

ats

Figure 20: Comparison between the pi protocol and the ats algorithmfor a circulant graph topology and a noisy communicationchannel

1e-14

1e-12

1e-10

1e-08

1e-06

0.0001

0.01

1

0 5000 10000150002000025000300003500040000

Stea

dy-s

tate

erro

rlo

g(y(k))

Absolute time t

pi

ats

Figure 21: Comparison between the pi protocol and the ats algorithmfor a random geometric graph topology and a noisy com-munication channel

Page 63: Analysis of Clocks Synchronization Algorithms in Wireless ...tesi.cab.unipd.it/28288/1/thesis.pdf · ANALYSIS OF CLOCKS SYNCHRONIZATION ALGORITHMS IN WIRELESS SENSOR NETWORKS TESI

5 CO N C LU S I O N S A N D F U T U R EWO R K

We developed a version of the PI algorithm that relies eitheron a symmetric gossip or on an asymmetric gossip communica-tion scheme to achieve synchronization of a network of clocks.We provided a theoretical stability analysis of the protocol, withrespect to the control parameter α, if the underlying graph isthe complete graph. In particular we proved that, if the con-trol parameter is under the value of λ (symmetric case) or λ/2(asymmetric version), where λ represent the Poisson processes’intensity, then the algorithm scales with the number of nodes.This makes the strategy independent of the network size and eas-ier to implement in a completely distributed fashion. Moreover,we provide some interesting insights if the underlying graphis circulant. Indeed, even thought not supported by theoreti-cal results, we numerically showed that all the eigenvalues re-sponsible for the dynamics of the synchronization error are in-side the unit disc. Finally we compared our algorithm to an-other fully distributed protocol presented in literature showingstrength and weaknesses of both strategies.

Future direction of investigation include different communi-cation graphs and protocols (e.g. multicast communication), ro-bustness stability and performance analysis, and modeling someof the most common non-idealities like packet drops, time deliv-ery delays and time-varying speed of the oscillators.

49

Page 64: Analysis of Clocks Synchronization Algorithms in Wireless ...tesi.cab.unipd.it/28288/1/thesis.pdf · ANALYSIS OF CLOCKS SYNCHRONIZATION ALGORITHMS IN WIRELESS SENSOR NETWORKS TESI
Page 65: Analysis of Clocks Synchronization Algorithms in Wireless ...tesi.cab.unipd.it/28288/1/thesis.pdf · ANALYSIS OF CLOCKS SYNCHRONIZATION ALGORITHMS IN WIRELESS SENSOR NETWORKS TESI

B I B L I O G R A P H Y

Bolognani, S., Carli, R. and Zampieri, S. (2009), «A PI consen-sus controller with gossip communication for clock synchro-nization in wireless sensors networks», in «Proceedings of the1

st IFAC Workshop on Distributed Estimation and Control inNetworked Systems (NecSys’09)», Venice, Italy.

Boyd, S., Ghosh, A., Prabhakar, B. and Shah, D. (2006), «Ran-domized gossip algorithms», IEEE/ACM Transactions on Net-working, vol. 14, pp. 2508–2530.

Carli, R. (2008), Topics on the Avarage Consensus Problem, PhDThesis, Università degli Studi di Padova, Padua, Italy. (Citedon page 15.)

Carli, R. and Zampieri, S. (2010), «Networked clock synchro-nization based on second order linear consensus algorithms»,in «Procedings of the 49

th IEEE Conference on Decision andControl», pp. 7259–7264, Atlanta, Georgia, USA. (Cited onpages 2 and 9.)

Carli, R., Chiuso, A., Schenato, L. and Zampieri, S. (2008),«A PI Consensus Controller for Networked Clocks Synchro-nization», in «Proceedings of the 17

th IFAC World Congress»,Seoul, South Korea. (Cited on pages 2 and 9.)

Carli, R., Chiuso, A., Schenato, L. and Zampieri, S. (2011),«Optimal synchronization for networks of noisy double inte-grators», To appear in IEEE Transactions on Automatic Con-trol. (Cited on page 2.)

Elson, J., Girod, L. and Estrin, D. (2002), «Fine-Grained Net-work Time Synchronization Using Reference Broadcasts», in«Proceedings of the 5

th Symposium on Operating SystemsDesign and Implementation (OSDI’02)», pp. 147–163, Boston,Massachusetts, USA. (Cited on page 1.)

Ganeriwal, S., Kumar, R. and Srivastava, M. B. (2003),«Timing-sync Protocol for Sensor Networks», in «Proceedingsof the 1

st International Conference on Embedded NetworkedSensor Systems (SenSys’03)», Los Angeles, California, USA.(Cited on page 1.)

51

Page 66: Analysis of Clocks Synchronization Algorithms in Wireless ...tesi.cab.unipd.it/28288/1/thesis.pdf · ANALYSIS OF CLOCKS SYNCHRONIZATION ALGORITHMS IN WIRELESS SENSOR NETWORKS TESI

52 B I B L I O G R A P H Y

Maróti, M., Kusy, B., Simon, G. and Lédeczi, A. (2004), «TheFlooding Time Synchronization Protocol», in «Proceedings ofthe 2

nd International Conference on Embedded NetworkedSensor Systems (SenSys’04)», pp. 39–49, Baltimore, Maryland,USA. (Cited on page 1.)

Olfati-Saber, R., Fax, J. A. and Murray, R. M. (2007), «Con-sensus and Cooperation in Multi-Agent Networked Systems»,Proceedings of IEEE, vol. 95 (1), pp. 215–233.

Schenato, L. and Fiorentin, F. (2009), «Average TimeSync: AConsensus-Based Protocol for Time Synchronization in Wire-less Sensor Networks», in «Proceedings of the 1

st IFAC Work-shop on Distributed Estimation and Control in NetworkedSystems (NecSys’09)», Venice, Italy. (Cited on pages 2 and 43.)

Simeone, O. and Spagnolini, U. (2007), «Distributed timesynchronization in wireless sensor networks with coupleddiscrete-time oscillators», EURASIP Journal on Wireless Commu-nication and Networking, vol. 2007. (Cited on pages 1 and 2.)

Solis, R., Borkar, V. S. and Kumar, P. R. (2006), «A New Dis-tributed Time Synchronization Protocol for Multihop WirelessNetworks», in «Proceedings of the 45

th IEEE Conference onDecision and Control (CDC’06)», pp. 2734–2739, San Diego,California, USA. (Cited on page 2.)

Werner-Allen, G., Tewari, G., Patel, A., Welsh, M. and Nag-pal, R. (2005), «Firefly-Inspired Sensor Network Synchronicitywith Realistic Radio Effects», in «ACM Conference on Embed-ded Networked Sensor Systems (SenSys’05)», San Diego, Cal-ifornia, USA. (Cited on pages 1 and 2.)

Page 67: Analysis of Clocks Synchronization Algorithms in Wireless ...tesi.cab.unipd.it/28288/1/thesis.pdf · ANALYSIS OF CLOCKS SYNCHRONIZATION ALGORITHMS IN WIRELESS SENSOR NETWORKS TESI

CO LO P H O N

This thesis was typeset with LATEX 2ε on a GNU/Linux systemusing a different view of the ClassicThesis package by AndréMiede. The typographic style was inspired by Robert Bringhurstas presented in The Elements of Typographic Style. The look edi-tion of this dissertation is due to the excellent work of LorenzoPantieri in his ArsClassica package.

N OT E : The text font belong to the Hermann Zapf’s Palatinotype face family (Type 1 PostScript fonts URW Palladio L). Themathematical equation was typeset with the AMS Euler font byHermann Zapf and Donald E. Knuth. The sans serif type facesare the Classico (a Zapf’s Optima typeface clone) by Bob Tennet(Type 1 PostScript fonts URW Classico).

Final version: April 2, 2011.

Page 68: Analysis of Clocks Synchronization Algorithms in Wireless ...tesi.cab.unipd.it/28288/1/thesis.pdf · ANALYSIS OF CLOCKS SYNCHRONIZATION ALGORITHMS IN WIRELESS SENSOR NETWORKS TESI
Page 69: Analysis of Clocks Synchronization Algorithms in Wireless ...tesi.cab.unipd.it/28288/1/thesis.pdf · ANALYSIS OF CLOCKS SYNCHRONIZATION ALGORITHMS IN WIRELESS SENSOR NETWORKS TESI

D E C L A R AT I O N

I declare this work research is mine with the exception of whatexplicitly mentioned in the text.

I also declare the material within the dissertation could bepublished, wholly or partially, by my supervisor Prof. SandroZampieri and/or my assistant supervisor Dr. Ruggero Carli.

Padova, marzo 2011

Edoardo D’Elia