UCLA Papers. Title. Permalink. Authors. Publication Date. Timing-sync Protocol for Sensor Networks. https://escholarship.org/uc/item/5mh7m01j

Similar documents
Lab 3 Acceleration. What You Need To Know: Physics 211 Lab

P. Bruschi: Project guidelines PSM Project guidelines.

B-MAC Tunable MAC protocol for wireless networks

Multiple Load-Source Integration in a Multilevel Modular Capacitor Clamped DC-DC Converter Featuring Fault Tolerant Capability

Memorandum on Impulse Winding Tester

Variation Aware Cross-Talk Aggressor Alignment by Mixed Integer Linear Programming

Communications II Lecture 7: Performance of digital modulation

Receiver-Initiated vs. Short-Preamble Burst MAC Approaches for Multi-channel Wireless Sensor Networks

Lecture #7: Discrete-time Signals and Sampling

ECE-517 Reinforcement Learning in Artificial Intelligence

Examination Mobile & Wireless Networking ( ) April 12,

EXPERIMENT #9 FIBER OPTIC COMMUNICATIONS LINK

Lecture 11. Digital Transmission Fundamentals

ISSCC 2007 / SESSION 29 / ANALOG AND POWER MANAGEMENT TECHNIQUES / 29.8

AN303 APPLICATION NOTE

Mobile Communications Chapter 3 : Media Access

EE 330 Lecture 24. Amplification with Transistor Circuits Small Signal Modelling

A WIDEBAND RADIO CHANNEL MODEL FOR SIMULATION OF CHAOTIC COMMUNICATION SYSTEMS

Negative frequency communication

DAGSTUHL SEMINAR EPIDEMIC ALGORITHMS AND PROCESSES: FROM THEORY TO APPLICATIONS

Notes on the Fourier Transform

Chapter 2 Introduction: From Phase-Locked Loop to Costas Loop

f t 2cos 2 Modulator Figure 21: DSB-SC modulation.

Chapter 14: Bandpass Digital Transmission. A. Bruce Carlson Paul B. Crilly 2010 The McGraw-Hill Companies

EE 40 Final Project Basic Circuit

Lecture 4. EITN Chapter 12, 13 Modulation and diversity. Antenna noise is usually given as a noise temperature!

Table of Contents. 3.0 SMPS Topologies. For Further Research. 3.1 Basic Components. 3.2 Buck (Step Down) 3.3 Boost (Step Up) 3.4 Inverter (Buck/Boost)

Spring Localization I. Roland Siegwart, Margarita Chli, Martin Rufli. ASL Autonomous Systems Lab. Autonomous Mobile Robots

Collaborative communication protocols for wireless sensor networks

A-LEVEL Electronics. ELEC4 Programmable Control Systems Mark scheme June Version: 1.0 Final

ECMA st Edition / June Near Field Communication Wired Interface (NFC-WI)

Design of an active radio frequency powered multihop wireless sensor network

Clock Synchronization

EXPERIMENT #4 AM MODULATOR AND POWER AMPLIFIER

DURING last decade, many communication technologies

An off-line multiprocessor real-time scheduling algorithm to reduce static energy consumption

Investigation and Simulation Model Results of High Density Wireless Power Harvesting and Transfer Method

TELE4652 Mobile and Satellite Communications

Signal Characteristics

Development of Temporary Ground Wire Detection Device

Pointwise Image Operations

4.5 Biasing in BJT Amplifier Circuits

ECMA-373. Near Field Communication Wired Interface (NFC-WI) 2 nd Edition / June Reference number ECMA-123:2009

Wrap Up. Fourier Transform Sampling, Modulation, Filtering Noise and the Digital Abstraction Binary signaling model and Shannon Capacity

Installing remote sites using TCP/IP

Efficient burst assembly algorithm with traffic prediction

Jitter Analysis of Current-Mode Logic Frequency Dividers

On the Scalability of Ad Hoc Routing Protocols

Social-aware Dynamic Router Node Placement in Wireless Mesh Networks

Optical fibres. Optical fibres made from high-density glass can carry light signals long distances without losing any light through their sides.

(This lesson plan assumes the students are using an air-powered rocket as described in the Materials section.)

OpenStax-CNX module: m Elemental Signals. Don Johnson. Perhaps the most common real-valued signal is the sinusoid.

Performance Study of Positioning Structures for Underwater Sensor Networks

Answer Key for Week 3 Homework = 100 = 140 = 138

THE OSCILLOSCOPE AND NOISE. Objectives:

5 Spatial Relations on Lines

TR-MAC: An Energy-E cient MAC Protocol for Wireless Sensor Networks exploiting Noise-based Transmitted Reference Modulation

4 20mA Interface-IC AM462 for industrial µ-processor applications

UNIT IV DIGITAL MODULATION SCHEME

PRM and VTM Parallel Array Operation

Key Issue. 3. Media Access. Hidden and Exposed Terminals. Near and Far Terminals. FDD/FDMA General Scheme, Example GSM. Access Methods SDMA/FDMA/TDMA

Direct Analysis of Wave Digital Network of Microstrip Structure with Step Discontinuities

MAP-AIDED POSITIONING SYSTEM

FROM ANALOG TO DIGITAL

Lecture September 6, 2011

Experimental Validation of Build-Up Factor Predictions of Numerical Simulation Codes

Revision: June 11, E Main Suite D Pullman, WA (509) Voice and Fax

10. The Series Resistor and Inductor Circuit

Volume Author/Editor: Simon Kuznets, assisted by Elizabeth Jenks. Volume URL:

A Harmonic Circulation Current Reduction Method for Parallel Operation of UPS with a Three-Phase PWM Inverter

Communication Systems. Department of Electronics and Electrical Engineering

Performance Evaluation of a MAC Protocol for Radio over Fiber Wireless LAN operating in the 60-GHz band

Evaluation of Instantaneous Reliability Measures for a Gradual Deteriorating System

Explanation of Maximum Ratings and Characteristics for Thyristors

MX629. DELTA MODULATION CODEC meets Mil-Std DATA BULLETIN. Military Communications Multiplexers, Switches, & Phones

Industrial, High Repetition Rate Picosecond Laser

Architectures for Resource Reservation Modules for Optical Burst Switching Core Nodes *

ECE3204 Microelectronics II Bitar / McNeill. ECE 3204 / Term D-2017 Problem Set 7

Pulse Train Controlled PCCM Buck-Boost Converter Ming Qina, Fangfang Lib

Review Wireless Communications

Communication Systems. Communication Systems

Location Tracking in Mobile Ad Hoc Networks using Particle Filter

The Relationship Between Creation and Innovation

Experiment 6: Transmission Line Pulse Response

The student will create simulations of vertical components of circular and harmonic motion on GX.

Foreign Fiber Image Segmentation Based on Maximum Entropy and Genetic Algorithm

Evaluation of the Digital images of Penaeid Prawns Species Using Canny Edge Detection and Otsu Thresholding Segmentation

Chapter 2. The Physical Layer

PREVENTIVE MAINTENANCE WITH IMPERFECT REPAIRS OF VEHICLES

Using Box-Jenkins Models to Forecast Mobile Cellular Subscription

Mobile Robot Localization Using Fusion of Object Recognition and Range Information

Errata and Updates for ASM Exam MLC (Fourteenth Edition) Sorted by Page

Anti-Jamming Schedules for Wireless Data Broadcast Systems

Cycles of Technology, Natural Resources and Economic Growth

Performance Analysis of High-Rate Full-Diversity Space Time Frequency/Space Frequency Codes for Multiuser MIMO-OFDM

The Design and Evaluation of a Wireless Sensor Network for Mine Safety Monitoring

Modeling and Prediction of the Wireless Vector Channel Encountered by Smart Antenna Systems

Multiuser Interference in TH-UWB

HIGH THROUGHPUT EVALUATION OF SHA-1 IMPLEMENTATION USING UNFOLDING TRANSFORMATION

Integrated Scheduling of Multimedia and Hard Real-Time Tasks

Transcription:

L Papers Tile Timing-sync Proocol for Sensor Neworks Permalink hps://escholarship.org/uc/iem/5mh7m0j uhors Ganeriwal, Saurabh Kumar, Ram Srivasava, Mani. Publicaion Dae 2003--05 Peer reviewed escholarship.org Powered by he California Digial Library Universiy of California

Timing-sync Proocol for Sensor Neworks Saurabh Ganeriwal Ram Kumar Mani. Srivasava Neworked and Embedded Sysems Lab (NESL), Universiy of California Los ngeles 56-25 Eng. IV, L EE Dep., Los ngeles, C 90095 {saurabh, ram, mbs}@ee.ucla.edu STRCT Wireless ad-hoc sensor neworks have emerged as an ineresing and imporan research area in he las few years. The applicaions envisioned for such neworks require collaboraive execuion of a disribued ask amongs a large se of sensor nodes. This is realized by exchanging messages ha are imesamped using he local clocks on he nodes. Therefore, ime synchronizaion becomes an indispensable piece of infrasrucure in such sysems. For years, proocols such as NTP have kep he clocks of neworked sysems in perfec synchrony. However, his new class of neworks has a large densiy of nodes and very limied energy resource a every node; his leads o scalabiliy requiremens while limiing he resources ha can be used o achieve hem. new approach o ime synchronizaion is needed for sensor neworks. In his paper, we presen Timing-sync Proocol for Sensor Neworks (TPSN) ha aims a providing nework-wide ime synchronizaion in a sensor nework. The algorihm works in wo seps. In he firs sep, a hierarchical srucure is esablished in he nework and hen a pair wise synchronizaion is performed along he edges of his srucure o esablish a global imescale hroughou he nework. Evenually all nodes in he nework synchronize heir clocks o a reference node. We implemen our algorihm on erkeley moes and show ha i can synchronize a pair of neighboring moes o an average accuracy of less han 20µs. We argue ha TPSN roughly gives a 2x beer performance as compared o Reference roadcas Synchronizaion (RS) and verify his by implemening RS on moes. We also show he performance of TPSN over small mulihop neworks of moes and use simulaions o verify is accuracy over large-scale neworks. We show ha he synchronizaion accuracy does no degrade significanly wih he increase in number of nodes being deployed, making TPSN compleely scalable. Caegories and Subjec Descripors C.2.2 [Compuer Sysems Organizaion]: Compuer Communicaion Neworks Nework Proocols. General Terms Permission o make digial or hard copies of all or par of his work for personal or classroom use is graned wihou fee provided ha copies are no made or disribued for profi or commercial advanage and ha copies bear his noice and he full ciaion on he firs page. To copy oherwise, or republish, o pos on servers or o redisribue o liss, requires prior specific permission and/or a fee. SenSys 03, November 5-7, 2003, Los ngeles, California, US. Copyrigh 2003 CM -583-707-9/03/00 $5.00. lgorihms, Experimenaion, Performance, Verificaion. Keywords Sensor Neworks, Time Synchronizaion, Packe Delay, Clock Drif, Medium ccess Conrol.. INTRODTION dvances in microelecronics fabricaion have allowed he inegraion of sensing, processing and wireless communicaion capabiliies ino low-cos and small form-facor embedded sysems called sensor nodes [], [2]. The need for unobrusive and remoe monioring is he main moivaion for deploying a sensing and communicaion nework (sensor nework) consising of a large number of hese baery-powered nodes. The applicaions envisioned for sensor neworks vary from monioring inhospiable habias and disaser areas o operaing indoors for inrusion deecion and equipmen monioring. Mos of hese applicaions require sensor nodes o mainain local clocks in order o deermine he iming of he evens. In general, sensor nodes gaher sensor readings, and use several signal processing echniques o ge meaningful resuls from his raw daa. For example, he arge racking applicaions use Kalman filer o esimae he arge posiion [3]. Such signal-processing echniques require relaive synchronizaion among sensor node clocks, so ha a righ chronology of evens can be deeced. On he oher hand, for sensor nework applicaions such as deecing brushfires, gas leaks ec.; he ime of occurrence of an even is iself a criical parameer. For such class of applicaions, he synchronizaion of he complee nework wih every node mainaining a unique global ime scale becomes paramoun. Time synchronizaion is also indispensable in he implemenaion of he commonly used medium access conrol (MC) proocols such as TDM []. Time synchronizaion problem has been invesigaed horoughly in Inerne and LNs. Several echnologies such as GPS, radio ranging ec have been used o provide global synchronizaion in neworks. Complex proocols such as NTP [5] have been developed ha have kep he Inerne s clocks icking in phase. However, he ime synchronizaion requiremens differ drasically in he conex of sensor neworks. In general such neworks are dense, consising of a large number of sensor nodes. To operae in such large nework densiies, we need he ime synchronizaion algorihm o be scalable wih he number of nodes being deployed. lso, energy efficiency is a major concern in hese neworks due o he limied baery capaciy of he sensor nodes. This eliminaes he use of exernal energy-hungry equipmens, such as GPS. Moreover, ime synchronizaion requiremens are much more sringen, ofen requiring synchronizaion of he order of microseconds among nodes involved in a ask such as racking a arge.

. Conribuions We presen a Timing-sync Proocol for Sensor Neworks (TPSN) ha works on he convenional approach of senderreceiver synchronizaion. We argue ha for sensor neworks, he classical approach of doing a handshake beween a pair of nodes is a beer approach han synchronizing a se of receivers [6]. This observaion comes as resul of ime samping he packes a he momen when hey are sen i.e., a MC layer, which is indeed feasible for hese neworks. To prove our claim, we compare he performance of TPSN wih Reference roadcas Synchronizaion (RS) [7], a iming synchronizaion algorihm for sensor neworks based on receiver-receiver synchronizaion. We will show ha TPSN gives roughly a 2x beer performance han RS via implemenaion on moes. We will show ha TPSN can synchronize a pair of moes o an average accuracy of less han 20µs and a wors-case accuracy of around 50µs. In sensor neworks, clock synchronizaion migh no be needed all he imes. For such scenarios, TPSN can be combined wih he approach of pos-faco synchronizaion proposed in [8] o provide ime synchronizaion among a subse of nodes. Posfaco synchronizaion is used o synchronize wo nodes by exrapolaing backwards o esimae he phase shif a a previous ime. We provide an implemenaion on moes ha inegraes TPSN wih pos-faco synchronizaion and gauge is performance on a mulihop nework of moes. On he oher hand, o faciliae deploymen of MC proocols such as TDM, here migh be a need of mainaining a unique and global imescale hroughou he nework. In his case, we creae a self-configuring sysem, suiable for sensor neworks, where a hierarchical srucure is esablished in he nework. In our algorihm, NTP-like daemons self-organize o ac as servers o some nodes while acing as clien o anoher server. In his paper, we specially consider such scenarios and provide an inegraed algorihm ha firs esablishes he hierarchical srucure and hen aims a providing a unique global imescale hroughou he nework. We will show ha TPSN provides a simple, scalable and efficien soluion o he problem of iming synchronizaion in sensor neworks. Moreover, TPSN is compleely flexible and can be easily uned o mee he desired levels of accuracy as well as algorihmic overhead. TPSN also comes wih an auxiliary benefi of improving he accuracy of oher basic services in sensor neworks such as localizaion, arge racking, aggregaion. 2. RELTED WORK lhough ime synchronizaion has been he opic of research for he pas many years in a wide specrum of applicaions [5], [6], [9], wih regard o sensor neworks, a final soluion is ye o be found. In his secion we will discuss some of he algorihms ha deal wih iming issues in sensor neworks. In [8], [0], researchers emphasize on a compleely differen regime for ime synchronizaion in sensor neworks. They have poined ou noable differences beween iming synchronizaion requiremens in sensor neworks as compared o radiional neworks. In general, he problem of ime synchronizaion can be sudied in conex of hree differen models. The firs and perhaps he simples ype of model concenrae on jus mainaining he relaive noion of ime beween nodes. Thus he aim here is no synchronize he sensor node clocks bu o generae a righ chronology of evens. scheme for sensor neworks based on his model was proposed in []. The algorihm proposed in [] is only iniiaed when evens ake place in he nework. Therefore, such a scheme is no exendible o scenarios where a noion of sensor node clock is required. For example, a scenario where he acual ime of occurrence of an even is imporan or where sensor node clock is used o successfully run MC proocols. more complex model is of mainaining relaive clocks. In his model, hough every node mainains an individual clock, hese clocks are no synchronized wih respec o each oher. Insead, every node sores informaion abou he relaive drif beween is clock and he clock of any oher node in he nework (or wih only hose nodes wih which i desires o mainain a relaive clock). scheme based on his model is Reference- roadcas Synchronizaion (RS) [7]. In RS, sensor nodes periodically send beacon messages o heir neighbors using he nework s physical layer broadcas. Recipiens use he message s arrival ime as poin of reference for comparing heir clocks. The offse beween any pair of nodes, receiving he beacon, is calculaed by exchanging he local imesamps. This scheme successfully removes all possible sources of error excep he variabiliy in processing delay a he receiver. Perhaps he mos complex model ( always-on model) is he one where every node mainains a clock ha is synchronized wih respec o a reference node in he nework. The aim here is o mainain a global and a unique imescale hroughou he nework. lhough his model consumes maximum energy, i is a superse of all he models. Therefore, if he clocks are absoluely synchronized, hey are relaively synchronized oo and a righ chronology of evens can also be deeced. In his paper, we provide an inegraed algorihm where TPSN aims o provide synchronizaion following his model. To he bes of our knowledge, his is he firs work ha ries o provide iming synchronizaion in sensor neworks on he basis of always-on model. In his model, TPSN will be provided as an PI, running coninuously on he backend of a sensor node ransparen o he applicaion wrier. However, we would like o emphasize ha TPSN is no an algorihm resriced o he always-on model. To show he flexibiliy of TPSN, we provide an example implemenaion on moes ha inegraes TPSN wih pos-faco synchronizaion o synchronize node clocks, lying on a mulihop nework, relaively o each oher. RS also uses pos-faco synchronizaion o provide mulihop clock synchronizaion. In his scenario, he difference beween RS and TPSN is he way in which hey carry ou he handshake o synchronize a pair of moes. TPSN uses he classical approach of sender-receiver synchronizaion whereas RS uses he approach of receiver-receiver synchronizaion. s menioned earlier, we shall prove ha for sensor neworks doing sender-receiver synchronizaion gives beer resuls han receiver-receiver synchronizaion. We ake he moivaion from NTP ha has been largely successful in Inerne. However, NTP is compuaionally inensive. I is compleely infeasible o implemen NTP on he energy consrained sensor nodes. Moreover, NTP is a fixed algorihm ha can operae only in he always-on model. Conrary o his, TPSN is flexible o he model used for iming synchronizaion and can also be easily uned o mee he desired operaing poin in energy versus accuracy subspace. NTP has

been successfully able o synchronize he clocks in Inerne o an accuracy of he order of milliseconds bu he ime synchronizaion requiremens for sensor neworks can be much more sringen han ha, ranging ino he order of a few microseconds. Our scheme can be viewed as a pracical, more accurae and a flexible exension of NTP o sensor neworks. 3. SYSTEM MODEL We have N sensor nodes scaered in an area. Every node mainains a 6-bi regiser as a clock ha is riggered by a crysal oscillaor. This is he only noion of ime ha a node has. In his paper, we provide an inegraed algorihm ha aims a providing ime synchronizaion following he always-on model. Thus, he goal is o esablish a common imescale for every node in he sensor nework and herefore, synchronize he 6-bi clock for every sensor node. We begin by describing he basic concep of TPSN and proceed o ouline he assumpions abou he sysem. 3. asic Concep The firs sep of he algorihm is o creae a hierarchical opology in he nework. Every node is assigned a level in his hierarchical srucure. We ensure ha a node belonging o level i can communicae wih a leas one node belonging o level i-. Only one node is assigned o level 0, which we call he roo node. We call his sage of our algorihm as he level discovery phase. Once he hierarchical srucure has been esablished, he roo node iniiaes he second sage of he algorihm, which is called he synchronizaion phase. In his phase, a node belonging o level i synchronize o a node belonging o level i-. Evenually every node is synchronized o he roo node and we achieve nework-wide ime synchronizaion. In general, a user node ha acs as he gaeway beween he sensor nework and he exernal world can ac as he roo node. The user node can be equipped wih a GPS receiver, in which case he sensor nodes would be synchronized o he physical world. In more hosile environmens, where i is impossible o have an exernal eniy, sensor nodes can periodically ake over he funcionaliy of being he roo node, using some leader elecion algorihm [2]. lso, neiher TPSN nor he always-on model resrics he possibiliy of having muliple roo nodes in he nework. In his case, islands of ime-synchronized nodes will be formed in he nework. Furher, a scheme such as RS [7] could be used o mainain a relaive clock beween he adjacen nodes ha lie on he boundary, providing synchronizaion in he whole nework. In his paper, we consider he nework o have jus one roo node. 3.2 ssumpions We assume ha he sensor nodes have unique idenifiers. link level proocol ensures ha each node is aware of he se of nodes wih which i can direcly communicae, also ermed as he neighbor se of he node. Though here can be unidirecional links in he nework, TPSN uses only bi-direcional links o do pair wise synchronizaion beween a se of nodes. We also assume ha i is possible o creae a spanning ree in he nework using jus hese bi-direcional links. In his paper, we have aribued he creaion and mainenance of he hierarchical srucure as he responsibiliies of TPSN. However, many of he sensor nework applicaions rely on in-nework processing and require a similar srucure for heir funcionaliy for example he aggregaion ree required for TinyD [3]. Therefore, creaing and mainaining a hierarchical srucure should no be considered as an overhead exclusive o TPSN.. TIMING-SYNC PROTOCOL FOR SENSOR NETWORKS (TPSN). Level Discovery Phase This phase of he algorihm occurs a he onse, when he nework is deployed. The roo node is assigned a level 0 and i iniiaes his phase by broadcasing a level_discovery packe. The level_discovery packe conains he ideniy and he level of he sender. The immediae neighbors of he roo node receive his packe and assign hemselves a level, one greaer han he level hey have received i.e., level. fer esablishing heir own level, hey broadcas a new level_discovery packe conaining heir own level. This process is coninued and evenually every node in he nework is assigned a level. On being assigned a level, a node neglecs any such fuure packes. This makes sure ha no flooding congesion akes place in his phase. Thus a hierarchical srucure is creaed wih only one node, roo node, a level 0. node migh no receive any level_discovery packes owing o MC layer collisions. We explain how o handle such special cases in Secion.3. In his paper, we use a simple flooding mechanism o creae he hierarchical srucure. Insead, we could have used more accurae minimum spanning ree algorihms. We will show ha he choice beween he wo resuls in an accuracy versus complexiy radeoff..2 Synchronizaion Phase In his phase, pair wise synchronizaion is performed along he edges of he hierarchical srucure esablished in he earlier phase. We use he classical approach of sender-receiver synchronizaion [5] for doing his handshake beween a pair of nodes. We shall show he meris of his approach o he approach of receiver-receiver synchronizaion in laer secions. Le us firs analyze, how a wo-way message exchange beween a pair of nodes can synchronize hem. Figure shows his message-exchange beween nodes and. Here, T, T represen he ime measured by local clock of. Similarly T2, T3 represen he ime measured by local clock of. ime T, sends a synchronizaion_pulse packe o. The synchronizaion_pulse packe conains he level number of and he value of T. Node receives his packe a T2, where T2 is equal o T + + d. Here and d represens he clock drif beween he wo nodes and propagaion delay respecively. ime T3, sends back an acknowledgemen packe o. The acknowledgemen packe conains he level number of and he values of T, T2 and T3. Node receives he packe a T. ssuming ha he clock drif and he propagaion delay do no change in his small span of ime, can calculae he clock drif and propagaion delay as: ( T 2 T) ( T T3) ( T 2 T) + ( T T3) = ; d = () 2 2 Knowing he drif, node can correc is clock accordingly, so ha i synchronizes o node. This is a senderiniiaed approach, where he sender synchronizes is clock o ha of he receiver.

T2 T3 T2, T3 are measured in Node clock. T, T are measured in T T Node clock. Figure : Two-way message exchange beween pair of nodes This message exchange a he nework level begins wih he roo node iniiaing he phase by broadcasing a ime_sync packe. On receiving his packe, nodes belonging o level wai for some random ime before hey iniiae he wo-way message exchange wih he roo node. This randomizaion is o avoid he conenion in medium access. On receiving back an acknowledgmen, hese nodes adjus heir clock o he roo node. The nodes belonging o level 2 will overhear his message exchange. This is based on he fac ha every node in level 2 has a leas one node of level in is neighbor se. On hearing his message, nodes in level 2 back off for some random ime, afer which hey iniiae he message exchange wih nodes in level. This randomizaion is o ensure ha nodes in level 2 sar he synchronizaion phase afer nodes in level have been synchronized. Noe ha a node sends back an acknowledgemen o a synchronizaion_pulse, provided ha i has synchronized iself. This ensures ha no muliple levels of synchronizaion are formed in he nework. This process is carried ou hroughou he nework and evenually every node is synchronized o he roo node. In a sensor nework packe collisions can ake place quie ofen. To handle such scenario a node waiing for an acknowledgemen, imeous afer some random ime and reransmis he synchronizaion_pulse. This process is coninued unil a successful wo-way message exchange has been done..3 Special Provisions In a sensor nework, he nodes are usually deployed in a random fashion. So scenarios migh exis where a sensor node joins an already esablished nework i.e., he node migh join he nework when he level discovery phase is already over. Even if he node is presen a he onse of he nework, i migh no receive any level_discovery packes owing o MC layer collisions. In eiher case i will no be assigned any level in he hierarchy. However, every node needs o be a par of he hierarchical opology so ha i can be synchronized wih he roo node. Thus, when a node is deployed, i wais for some ime o be assigned a level. If i is no assigned a level wihin ha period, i imeous and broadcass a level_reques message. The neighbors reply o his reques by sending heir own level. The new node assigns iself a level, one greaer hen he smalles level i has received and hence, joins he hierarchy. This could be seen as a local level discovery phase. Sensor nodes may also die randomly. siuaion may arise, when a level i node does no have any neighbor a level i-. In such scenarios, he node would no ge back an acknowledgemen o is synchronizaion_pulse. Thus, his node a level i would no be able o synchronize o he roo node. I has already been explained ha in order o handle collisions, a node would reransmi he synchronizaion_pulse afer some random amoun of ime. fer reransmiing he synchronizaion_pulse a fixed number of imes, a node assumes ha i has los all is neighbors on he upper level and broadcass a level_ reques message. On geing back a reply, he node is assigned a new level. ssuming he nework is sill conneced, he node will have a leas one node in is neighbor se and hus i will surely be assigned a new level in he hierarchy. We consider four reransmissions o be a heurisic for deciding nonavailabiliy of a neighbor in he upper level. The validiy of his heurisic has been verified via simulaions. In general, choosing a large number will increase he ime aken for synchronizaion whereas a small number will cause unnecessary flooding in he nework, decreasing he synchronizaion accuracy. We sared wih he premise ha a node has been designaed as he roo node. If an eleced roo node dies, he nodes in level would no receive any acknowledgemen packes and hence, hey will imeou following he scheme described above. Insead of broadcasing a level_reques packe, hey run a leader elecion algorihm and he eleced leader akes over he funcionaliy of he roo node. This new roo node sars from he beginning and reruns he level discovery phase. Noe ha hese special provisions are essenially heurisics o ake care of ambiguiies in he nework. Though we do no claim ha hese are indeed he opimal soluions, we have verified heir efficacy via exensive simulaions. 5. ERROR NLYSIS OF TPSN In his secion, we characerize he possible sources of error and presen a deailed mahemaically analysis for TPSN. We concenrae on pair wise synchronizaion beween wo nodes. We compare he performance of our scheme o RS [7], an algorihm ha synchronizes a se of receivers in sensor neworks. However, as will be clear from our analysis, he resuls can be in general exended o make a comparison beween he classical approach of sender-receiver synchronizaion and receiver-receiver synchronizaion. 5. Decomposiion of Packe Delay Figure 2 shows he decomposiion of packe delay when i raverses over a wireless link beween wo sensor nodes. We designae he node ha iniiaes he packe exchange as he sender and he node ha responds o his message as he receiver. lhough a similar decomposiion has also been presened in [7], we deail he various delay componens from a sysems perspecive. In his discussion, we will borrow erms from a ypical layered archiecure used in radiional compuer neworks. We briefly analyze each componen shown in Figure 2. Send ime: When a node decides o ransmi a packe, i is scheduled as a ask in a ypical sensor node. There is ime spen in acually consrucing he packe a he applicaion layer, afer which i is passed o he lower layers for ransmission. This ime includes he delay incurred by he packe o reach he MC layer from he applicaion layer. This delay is highly variable due o he sofware delays inroduced by he underlying operaing sysem. ccess ime: fer reaching he MC layer, he packe wais unil i can access he channel. This delay is specific o wireless neworks resuling from he propery of common medium for packe ransmission.

This is perhaps he mos criical facor conribuing o packe delay. Moreover, i s highly variable in naure and is specific o he MC proocol employed by he sensor node. Transmission ime: This refers o he ime when a packe is ransmied bi by bi a he physical layer over he wireless link. This delay is mainly deerminisic in naure and can be esimaed using he packe size and he radio speed. The sofware implemenaion of he ransmier will have a few minor variaions due o he response ime for inerrups. In [], a novel hardware based RF ransceiver has been proposed where he variaions would be compleely negligible. Propagaion ime: This is he acual ime aken by he packe o raverse he wireless link from he sender o he receiver. The absolue value of his delay is negligible as compared o oher sources of packe laency. Recepion ime: This refers o he ime aken in receiving he bis and passing hem o he MC layer. This is going o be mainly deerminisic in naure. The variaions in recepion delay would even be smaller if he sensor node employs a hardware based RF ransceiver []. Receive ime: The bis are hen consruced ino a packe and hen his packe is passed on o he applicaion layer where i s decoded. The ime aken in his whole aciviy refers o receive ime. The value of receive ime changes due o he variable delays inroduced by he operaing sysem. In Figure2, he size used for differen boxes is jus o give an inuiion abou he absolue value of each componen. I doesn correspond o heir acual raio. For example, we expec ha he access ime (MC delay) would compleely overshadow oher delays in pracice. Secondly, communicaion akes place in bis and a node opimizes by performing evens in parallel. Thus, when a bi is being coded for ransmission, anoher bi could be in air or being received a he oher end simulaneously. Thus, his decomposiion is jus an approximaion when done a he packe level insead of he bi level. 5.2 Error nalysis In his secion, we will conras TPSN o RS by analyzing he sources of error for boh he schemes. In [7], he efficiency of RS over NTP has already been shown and herefore one can use he wo comparisons o gauge he performance of TPSN o NTP. For his analysis, we inroduce he noion of real ime i.e. he ime measured by an ideal clock as shown in Figure 3. We represen he imes measured by local node clocks in Figure, Sender such as T, in real ime by using lowercase leers. Thus sands for he real ime (measured by ideal clock) equivalen of T (measured by node clock). We consider he same scenario as shown in Figure. Node sends a packe a T and node receives i a T2. Noe ha T and T2 are imes measured by node clocks of and respecively. The following se of equaions can be easily derived: 2 + S + P + R (2) = = T+ S + P > + R + D T2 (3) Here S, P ->, R refer o he ime aken o send packe (send ime + access ime + ransmission ime) a node, propagaion ime beween node, and ime aken o receive packe (recepion ime + receive ime) a node respecively. ll hese imes are wih respec o an ideal clock. Here, refers o he drif beween he nodes and a ime. D > Node hen sends a reply a T3, which is received by node a T. Using similar analysis following equaion can be derived: 3 > T = T + S + P + R D () > > > Noe D D = D. Furher, 3 broken ino wo componens as follows: D = D + RD > > D > (5) can be Here RD > refers o he relaive drif beween he nodes > and from ime o. Figure 3 picorially presens he definiion of drif and relaive drif beween he node clocks. In equaion 5, RD > can be posiive or negaive depending on > which node clock leads he oher. Subracing equaion from 3 and using equaions and 5, we obain: 2* ) (2* > = S + P + R + RD D ) (6) ( > + Here S, R and P sand for he uncerainy a sender, a receiver and in propagaion ime respecively. They are given by he following equaions: S = S S (7) R = R R(8) = P > P (9) P > D > The aim is o calculae, as we correc he clock a T (equal o real ime ) a node. Rearranging he erms of equaion 6, we obain S P R RD > Error = D = + + + (0) 2 2 2 2 Propagaion Receiver Send ccess Transmission Recepion Receive Figure 2: Decomposiion of packe delay over a wireless link

2 Real Time Figure 3: Drif among he local node clocks TPSN is a sender-receiver synchronizaion algorihm, whereas RS is a receiver-receiver synchronizaion algorihm. In RS, wo receiver nodes exchange iming informaion abou he message ha hey have received from a common sender. Suppose he wo nodes and receive he common packe a T2, T3 respecively generaed by C a ime T. Thus, by similar break up of packe laency we can obain he following equaions: 2 C > T = T + S + P + R D () C C > + C > + R + 3 C > T = T + S + P D (2) C Node sends his imesamp informaion (T3) in a separae packe, which is received by a ime T. s menioned earlier, D > he aim is o calculae. RS calculaes i by subracing equaions from 2. Finally, he expression for error can be developed as: C > ) ( ) ( C > = P P + R R + D D ) (3) D Local node ime ( C > C > C > C > > D = D = D + RD > > = D = PD + R + RD > Error D > 2 D > Node clock RD > > 2 Node clock Ideal clock () (5) Here P represens he uncerainy in propagaion ime D beween wo disinc node pairs and is given by: P (6) D = PC > PC > s can be seen from equaions 0 and 5, he wo conribuing facors owards he synchronizaion error for boh TPSN and RS are he variaion in packe delays and he drif among he local clock of moes. Le us analyze each facor individually. 5.2. Variaion in packe delays Uncerainy a he sender (S ): s can be observed from equaion 5, RS compleely eliminaes he uncerainy a he sender side. In fac, his is he main reason why many researchers believe ha receiverreceiver synchronizaion performs beer han classical sender-receiver synchronizaion. This is poenially of advanage when he radio and is driver is a closed black box such as in he case of wireless LNS. However in he case of sensor neworks here exis a srong coupling beween he radio and he applicaion layer. In fac sensor nodes such as moes [5] do mos of he radio processing a he applicaion layer. This provides a huge amoun of flexibiliy in sensor neworks. We use his o drive our moivaion for doing sender-receiver synchronizaion. We propose o reduce his source of error by ime samping he packe a he MC layer (i.e. when he packe is abou o be ransmied) insead of ime samping he packe a he applicaion layer. Thus, S in equaion 7 becomes equal o ransmission ime, insead of he oal ime aken o send he packe a he sender node (send + access + ransmission ime). This means he only erroneous facor ha remains is he uncerainy in ransmission ime. s we have menioned before, we claim ha his delay is mainly deerminisic in naure. Therefore we expec he resuling conribuion of his facor o he ne error o be small. Uncerainy in propagaion ime (P ): s can be observed from equaion 0 and 5, boh TPSN and RS suffer from he variaion in propagaion ime. TPSN uses only symmeric links and on such links, he variaion in delay is going o be negligible. s can be observed from equaion 5, in case of RS, he error is beween wo disinc node pairs and hence can be large depending on he disances beween hem. Le us assume he bes-case scenario for RS, when he variaion in propagaion ime is he same as in TPSN, equal o η ime unis. Using equaions 0 and 5, his will resul in an error of η/2 and η ime unis for TPSN and RS respecively. Thus even for he same variaion in propagaion ime, TPSN is beer off by a facor of 2 han RS. Uncerainy a he receiver (R ): y ime samping he packe a he MC layer, TPSN removes he receive ime compleely. Thus, R in equaion 8 becomes equal o only he recepion ime, insead of he oal ime aken in receiving he packe a he receiver (recepion + receive ime). In is proposed form, RS imesamps he packe a he applicaion layer and hus suffers from variaion in boh recepion as well as receive ime. However, in order o make a fair comparison le us assume ha RS is also implemened wih capabiliy of ime samping he packes a he MC layer. Wih such a sysem even in RS he only source of error will be he variaion in recepion ime. However for he same variaion in recepion ime of α ime unis, RS gives synchronizaion error of α ime unis whereas TPSN gives a synchronizaion error of α/2 ime unis. This can be observed from equaions 0 and 5. Thus, even for a similar sysem, TPSN provides a 2x beer performance as compared o RS. 5.2.2 Drif among he local clocks ( RD > ) > The clocks in sensor nodes are envisioned o be crysal based, mainly because of heir low cos. Such crysals are suscepible o huge drifs from he ideal clock, as shown in Figure 3. However, as can be observed from he las erms on RHS of equaion 0 and 5, all we care abou is jus he relaive drif beween he wo nodes. esides depending on he rae of relaive drif beween he wo nodes, he error performance also depends on he ime aken

for he compleion of he algorihms i.e., he difference of and. To make an approximae comparison, le us assume ha he wo algorihms observe he same variaion in drif of β ime unis. This is quie reasonable as boh TPSN and RS involves wo packe ransfers beween nodes. Using equaion 0 and 5, his shall resul in a synchronizaion error of β ime unis for RS whereas an error of β/2 ime unis for TPSN. Therefore again wih he same variaion in drif, TPSN provides a 2x beer performance as compared o RS. 5.2.3 Conclusion s can be seen from he above analysis, TPSN would give roughly a 2x beer performance for all he sources of error as compared o RS. However, TPSN has an added conribuion from he uncerainy a he sender whereas RS compleely removes his as a source of error. This analysis can be exended o comparison beween sender-receiver and receiver-receiver synchronizaion based algorihms in general. In case of radiional wireless neworks he uncerainy in MC delay is so large ha i compleely overshadows he effec of oher facors, resuling in giving an edge o algorihms based on receiverreceiver synchronizaion. However in case of sensor neworks, by having he flexibiliy of ime samping he packes a he MC layer, we remove his criical source of error. s a resul, we believe ha he classical approach of doing sender-receiver synchronizaion is a beer approach of doing ime synchronizaion han receiver-receiver synchronizaion in sensor neworks. We have shown his via a deailed analysis and we verify our claim by implemening TPSN and RS on moes. 6. IMPLEMENTTION ON ERKELEY MOTES In his secion we describe a prooype sysem ha we buil around erkeley Moes [5] o implemen TPSN. In [7], auhors verify he efficacy of RS by implemening i on an IPQ-moenic esbed. The moe is used as a nic (nework inerface card) o he IPQ. Res of he proocol sack, he ime synchronizaion algorihm as well as he clock mainenance runs on an IPQ. We presen here a more pracical implemenaion of RS on sand-alone sensor nodes (Moes) wihou using any exernal componens. In [7], auhors have repored numbers on synchronizaion error ha has an absolue magniude much less han in his paper (6.5µs). This is jus an arifac of using a superior operaing sysem (Linux) and much more sable crysals available in IPQs. The only sysem requiremen ha TPSN wans is he capabiliy of ime samping he packe a he MC layer. We don see any oher sysem effecs ha will degrade/improve he performance of RS more han ha of TPSN. Therefore, he relaive performance of TPSN wih RS would coninue o be he same, if insead an IPQ-moenic es-bed is used. 6. Overview of erkeley Moes MIC moes [5] are second-generaion wireless modules used for research of low power wireless sensor neworks. The devices have applicaion in research, new securiy applicaions, environmenal monioring, and large-scale disribued neworks. MIC Moes run erkeley's open source Tiny OS Operaing Sysem [6]. In general sensor node archiecure consiss of five major modules: processing, RF communicaion, power managemen, I/O expansion, and secondary sorage. In mica moes, he main conroller is an TMEG03L running a Mhz. There is an T90LS233 included o handle wireless reprogramming. n mel T5D0 serial flash chip provides persisen daa sorage. The RF module consiss of an RF Monolihics RFM TR00 ransceiver and can operae a communicaion raes up o 5Kbps. The sysem is designed o operae off an inexpensive baery ha produces beween 3.2V and 2.0V (e.g., pair of baeries). More deails on he sysem archiecure of moes can be found in [5]. lhough several advancemens in communicaion sacks have been proposed, we are using he erkeley communicaion sack proposed in he original paper [5]. 6.2 Modifying TinyOS The firs ask was o generae a lower granulariy clock in moes. s menioned earlier, a crysal oscillaor riggers he clock in moes. The maximum frequency of he crysal used in moes is Mhz implying ha we can achieve a minimum granulariy of 0.25µs. In is curren form, Tiny OS uses imer 0 (8 bi imer) for providing clock [6]. This made i impossible o generae such a low granulariy clock, as he regiser overflows very quickly generaing frequen inerrups. There is only one 6-bi imer in mel 03 mode, which is used for sampling he radio. fer few modificaions, we were able o uilize he same imer in parallel o generae he clock. We mainain a 6-bi regiser as he clock, which ges riggered by he overflow of imer. We run imer a he maximum frequency of Mhz. The second major modificaion needed was o incorporae he abiliy of ime samping he packes a he RFM layer (MC layer). We were able o achieve his by creaing an inerface beween he applicaion layer and he RFM layer. We exclude he deails here for space consrains bu he readers can find all he deails from he source codes [7]. 6.3 Synchronizing a Pair of Moes We firs waned o es he conribuion of uncerainy a he sender owards he synchronizaion error. Recall ha his was he only facor, which provided degradaion in he performance of TPSN as compared o RS. Our claim was ha his facor conribues negligibly o he ne error, as a resul of which TPSN shall give roughly a 2x beer performance han RS. The se up consised of wo moes. Each moe mainains a 6-bi clock based on is crysal oscillaor. The wo moes were sared randomly, so ha hey have compleely unsynchronized clocks a he beginning. One of he moes was designaed as he sender and was responsible for iniiaing he message exchange afer i has measured 0s in is clock. We measure he ransmission ime (as defined in he earlier secion) a boh he moes. Figure plos he uncerainy a he sender (S ), calculaed as he difference of ransmission imes beween he wo moes, for 00 differen simulaion runs. We have shown here only he magniude of he S. Using equaion 0, i can be observed ha a difference in ransmission ime (S ) of δ ime unis conribues a synchronizaion error of δ/2 ime unis. The average magniude of S was around.5µs. This implies ha on an average, he uncerainy a sender conribues a synchronizaion error of around 0.62µs. s will be seen from resuls in he nex secion, his number is very small as compared o he absolue value of he oal synchronizaion error. This verifies our claim and provides a srong edge o

sender-receiver synchronizaion as compared o receiverreceiver synchronizaion in general. Figure : Uncerainy a sender (only magniude) The nex sep was o calculae he absolue synchronizaion error beween he wo moes. similar se up was used so ha he wo moes ( and ) sar randomly wih compleely unsynchronized clocks. We programmed he wo moes so ha hey coninuously oggle a paricular oupu pin afer every 8ms. fer compleing he message exchange, he synchronizaion error is calculaed by observing he phase shif beween he wo waveforms (corresponding o and ) on a Digial nalyzer. We have also implemened RS under he same se up (i.e. ime samping is done a he MC layer). In case of RS, a hird moe is used and is designaed o ac as he common sender. We calculae he synchronizaion error beween he same pair of moes. fer overhearing he message from he common sender, one of he receivers (node ) ransmis his informaion o he oher receiver (node ). Node correcs is clock by calculaing he drif as menioned in equaion 5. We again calculae he synchronizaion error by observing he phase shif beween he wo waveforms (corresponding o and ). Figure 5 plos he hisogram of he synchronizaion error and he resuls are summarized in able. The resuls are obained afer averaging over 200 independen runs for boh TPSN and RS. Noe ha o calculae he saisics we use only he magniude of he synchronizaion error and neglec he sign (which clock is ahead among he wo nodes). s can be observed from Table, we were able o synchronize a pair of moes o an average accuracy of less han 20µs. The bes case was he wo moes geing perfecly synchronized and he worscase synchronizaion error was around 50 µs. pproximaely 65% of he imes, he error was eiher equal or smaller han he average synchronizaion error. s expeced, under similar scenario TPSN roughly gives a 2x beer performance han RS. In [7], i was shown ha he synchronizaion error beween wo moes could be modeled as a normal disribuion. This is consisen wih he shape of he hisogram in Figure 5. The mean of he disribuion for RS will be wice he mean of he disribuion for TPSN. In general, synchronizaion error for TPSN and RS will be sample poins on heir respecive disribuions and hence, i is no necessary ha for every simulaion run TPSN will give exacly a 2x beer performance han RS. Table : Saisics of Synchronizaion error (only magniude) verage error (in µs) Wors case error (in µs) es case error (in µs) Percenage of ime error is less han or equal o average error TPSN 6.9 0 6 RS 29.3 93 0 53 Figure 5: Hisogram of Synchronizaion error (only magniude)

6. Mulihop Resuls Till now we have presened TPSN in form of an inegraed algorihm ha aims a providing synchronizaion following he always-on model. However, heir exis sensor nework applicaions where ime synchronizaion will be needed over a subse of nodes and ha oo for a small period of ime. To model his scenario, he approach of pos-faco synchronizaion was proposed in [8]. Pos-faco synchronizaion is used o synchronize wo nodes by exrapolaing backwards o esimae he phase shif a a previous ime. Thus he nodes synchronize only when hey need o i.e., afer an even has been deeced. Consider an example scenario where he objecive is o send a packe from source o sink F via pah ->->C->D->E->F and o simulaneously synchronize hem. Thus a every hop, afer receiving he packe, he receiver synchronizes is clock using TPSN o he sender, before sending i o he nex hop. For example a firs hop, synchronizes is clock o and afer ha forwards he packe o C. Thus evenually every node in he pah would have he is clock synchronized wih respec o node. every hop we deliberaely inroduce a delay of 2 seconds o model he packe processing ime as well as he large MC delay ha a node can poenially suffer in a large-scale nework. Every moe runs CSM and he 2 seconds doesno include he random back off ime for deecing he channel o be idle. We implemen his inegraion of TPSN wih pos-faco synchronizaion approach on erkeley moes. Figure 6 plos he average synchronizaion error versus he hop disance. We also plo he hisogram, showing he synchronizaion error observed for every individual pair. The resuls were averaged over every possible pair. For example in order o calculae he error for 2 hop disance, he average was aken over possible moe pairs {(, C), (, D), (C, E), (D, F)}. For every possible pair, we have aken 00 independen measuremens and while calculaing he average, we only consider he magniude of he error. The synchronizaion error was measured in a similar way, by measuring he phase shif on he Digial nalyzer beween he pair of moes being considered. We only consider hose runs where he packe was finally delivered o he sink. s can be seen from Figure 6, he error does no blows up wih hop disance. In fac for his scenario i seems ha error almos becomes a consan beyond 3- hop disance. This is because synchronizaion error beween any pair of moes will probabilisically ake differen values from he normal disribuion obained in he earlier secion. The randomness in he sign as well as he magniude of he synchronizaion error and drif prevens he error from blowing up. If all he moes have been drifing in he same direcion and he error was a deerminisic quaniy, he error would have blown up wih he number of hops. Noe ha we are no claiming ha he error canno blow up. In he wors case, i can increase linearly wih he hop disance. However he probabiliy of ha even is very low. In fac, we have observed insances where he error value was large. To presen a clear picure we deail he obained saisics in Table 2. We are currenly in he process of developing an analyical model for mulihop error. In a similar scenario, RS would have also used he approach of pos-faco synchronizaion o synchronize he nodes along he mulihop pah. However, unlike TPSN, RS will do he handshake beween a pair of nodes using receiver-receiver synchronizaion. s shown earlier, he wo neighboring nodes will be synchronized o an error ha is on an average 2 imes more han TPSN. The errors over mulihop can be assumed o be independen and hus, we can conclude ha he wors-case mean error for an n-hop nework will be 2*n imes more in RS as compared o TPSN. Similarly, he bes case mean error for an n-hop nework will be 2 imes more in RS as compared o TPSN. Though his gives a range o look for he expeced performance, he probabiliy for boh wors and bes case will be negligibly small. I is hard o conclude anyhing abou he average error, as we do no have a model o characerize he mulihop error for eiher TPSN or RS. In general we expec ha he performance of TPSN will be beer han RS by a facor ha lies in he range of 2-2n for an n-hop nework. Noe ha we have made hese speculaions using he independence model for synchronizaion error over mulihop. The basic design of RS makes i easy o exploi he concep of muli pah diversiy among nodes o improve he accuracy performance. In is proposed form, TPSN operaes on a fixed infrasrucure (hierarchical srucure) and is unable o exploi his diversiy. We are currenly working owards a more sophisicaed model o exploi his mulipah diversiy for TPSN. 30 25 20 5 0 5 Saring Moe Idenifiers C D E 0 hop 2 hop 3 hop hop 5 hop Figure 6: Synchronizaion error over mulihop (only magniude)

Table 2: Saisics of synchronizaion error over mulihop (only magniude) hop disance 2 hop disance 3 hop disance hop disance 5 hop disance verage error (in µs) 7.6 20.9 23.23 2.36 22.66 Wors case error (in µs) 5.2 5.6 66.8 6 73.6 es case error (in µs) 0 0 2.8 0 0 Percenage of ime error is less han or equal o average error 62 57 63 5 6 6.5 Need for Resynchronizaion Though he skew and he drif among he crysal based clocks of sensor nodes can be bounded in general, he range of heir deviaion can be large. For erkeley moes, he upper bound given in he daashees [6] is 0ppm i.e. a clock in moe can loose up o 0µs in a second. more deailed descripion of he funcionaliy of moe s clock can be found in [5]. Hence, even if we synchronize he whole nework once, nodes will go ou of sync in a few minues. Thus o esablish accepable levels of accuracy in sensor neworks a every insan of ime, here is a need of doing periodic synchronizaion. lhough sensor node clocks are suscepible o huge drif wih respec o he ideal clock, he synchronizaion error is jus a funcion of relaive drif beween he nodes and no of he acual drif wih he real ime clock. To pu his ino perspecive, we calculae he value of he relaive drif beween moe () and 5 oher moes (, C, D, E and F respecively). In order o calculae he drif beween a pair of moes, we run TPSN and measure he synchronizaion error beween he moes a periodic inervals of minue. Figure 7 plos he obained resuls ha have been averaged over 0 independen runs for every pair of moes. Unlike previous cases, while aking he average we do ake ino accoun he sign of he synchronizaion error. The ime 0 on x-axis represens he ime when he moes ge synchronized for he firs ime. Noe ha value of synchronizaion error a ime 0 is no 0. I s jus an arifac of he scale chosen for he plo. s can be observed from Figure 7, he relaive drif beween every pair of moe increases linearly wih ime. However i is difficul o conclude any consisen mahemaical model for he drif among he moes. In his case, he wors-case relaive drif beween any pair comes ou o be around.75µs/s. We have carried ou a number of experimens bu we have sill no came across a pair of moes ha have relaive drif worse han his number. The period of TPSN can be calculaed wih he knowledge of his relaive drif and he desired accuracy bound. Consider a hypoheical example where he desired wors-case accuracy bound beween a pair of neighboring moes in he nework is 0ms. s can be observed from Table, using TPSN he worscase synchronizaion error beween a pair of moes is around 50µs. If he wors-case drif beween he moes is.75µs/s, he period of TPSN (x) can be calculaed as: 3 6 0 *0 = 50 *0 + (.75*0 6 * x ); x 3 min. 6.6 sympoic nalysis of Synchronizaion Error When TPSN is run periodically, much igher bounds on accuracy can be obained by keeping ino accoun he pas hisory. Suppose a he nh cycle he node averages he drif over he pas n cycles, han he error will be given by: n Error = { i } ( D ) n(6) n i= The subscrip represens he cycle number. Since i is a periodic aciviy, we can assume ha he wo nodes would approximaely drif apar by he same value beween he wo cycles. Thus, a every cycle he value o be esimaed, D > remains he same, excep perhaps he firs cycle. Thus equaion 6 can be rewrien as: n Error = { i ( D ) i } (7) n i= n Si Pi Ri ( RD > ) i Error = { + + + } (8) n i= 2 2 2 2 Using law of large numbers, as n ends o infiniy: E[ S ] E[ P ] E[ R ] E[ RD > ] LimError = + + + (9) n > 2 2 2 2 Here, E[.] sands for he expeced value. There seems no reason o believe ha uncerainy in ransmission ime; propagaion ime and recepion ime would be a non-zero mean process. Therefore we expec he error o converge asympoically o E[ RD > ] / 2. Packe exchanges over moes ake ime of he order of milliseconds and herefore we expec his value o be really small. noher way of inerpreing Equaion 7 is ha he synchronizaion error afer he nh cycle will be he error averaged over all he pas n cycles. We claim ha his error will be very small. way of verifying his claim is o calculae he average error (wih is sign) over n independen runs. However, unlike previous scenarios, insead of randomly saring he wo moes, we sar he sender moe exacly 2 seconds afer saring he receiver moe. This will make sure ha he value o be esimaed,, remains he same, which is a key assumpion D > in his analysis. We do his for five differen moe pairs keeping he sender o be moe. We average ou he resuls for 0,