390 likes | 399 Views
Explore the importance of time synchronization in sensor networks, using protocols like NTP and RBS. Learn how wireless sensor networks differ and why existing solutions may not work. Discover the innovative Reference Broadcast System and its impact on precise network time synchronization.
E N D
Time synchronization in sensor networks Presented by: Nirav Jasapara Graduate Student, USC. jasapara@isi.edu Time Synchronization in Sensor Networks
Time Synchronization – Introduction. Network Time Protocol (NTP). Challenges for time-sync in Sensor networks. Reference Broadcast System. Time-sync protocol for sensor networks. Summary. Conclusion Table of Contents Time Synchronization in Sensor Networks
What is time-synchronization ? A method which allows individual entities in a group to synchronize their clocks w.r.t each other or to some coordinated universal time (UTC). Why do we need time-synchronization ? Agreeing on a common time scale Track relative order of events Co-ordinate future events Order logged events for debugging Handling leases Introduction Time Synchronization in Sensor Networks
Wired Domain -- NTP (Network Time Protocol) - most widely used time-synchronization protocol for large multi-hop networks. - allows construction of a hierarchy of time servers rooted at sources of external time (eg. UTC) Wireless Domain -- RBS (Reference Broadcast System) -- TPSN (Time-sync protocol for sensor networks) How is it done ? Time Synchronization in Sensor Networks
Used since 1985 for time-synchronization over WAN’s. Unix NTP daemon ported to almost every server platform available today - from PCs to Crays - Unix, Windows, VMS and embedded systems. Provides clients with an average accuracy below 5 ms. Stands out by virtue of its scalability, self-configuration in large multi-hop networks, robustness to failures and ubiquitous deployment. Network Time Protocol Time Synchronization in Sensor Networks
Uses a hierarchical design. At the top are stratum 1 clocks, computers with source of accurate time (eg. GPS, WWVB). Stratum 2 clocks synchronize themselves with stratum 1 clocks over the network. This process repeats up to stratum 16 which is effectively infinity for NTP. A typical NTP network would have stratum 1 somewhere on the internet, stratum 2 clocks near a gateway and stratum 3 clocks on a LAN. NTP network is semi-self-organizing: each node requires some manual configuration, once the NTP host is set up it can run itself autonomously. Figure 1[3]: A schematic design of an NTP network NTP: A Brief Overview Time Synchronization in Sensor Networks
Wireless Sensor Networks (WSN) consists of large numbers of cooperating small-scale nodes, spread over a geographical area, each capable of limited computation, wireless communication, and sensing. Why existing solutions for wired networks (NTP) won’t work ? - Energy constrained. - Dynamic topology. - No infrastructure support. Sensor Networks: A New Domain Time Synchronization in Sensor Networks
Reference Broadcast System (RBS) Developed by: Jeremy Elson, Lewis Girod and Deborah Estrin. Time Synchronization in Sensor Networks
Exploits the broadcast channel available in many physical-layer networks. -- Works by sending periodic reference beacons to a set of receivers using physical layer broadcasts. -- Broadcasts do not contain a time-stamp. -- Broadcasts used as a relative time reference to synchronize a set of receivers. Scheme is receiver-receiver as opposed to sender-receiver (NTP). Tries to achieve accuracy by removing the sender’s non-determinism from the system. Federate clocks over different broadcast domains with little loss of accuracy over multiple hops. Reference Broadcast System Time Synchronization in Sensor Networks
“The enemy of precise network time-sync is non-determinismin latency whichcontributes directly to synchronization error.” [1] Sources of Latency include Send Time Time required to construct the message Access Time Time required to access the medium Propagation Time Time taken for beacon to travel from one NIC card to the other Receive Time Time taken to receive the beacon and notify the host of its arrival Broadcast at the physical layer will arrive at a set of receivers with very little variability in its delay. This reduces non-determinism due to send-time and receive-time. Figure 2 [1]: Critical path analysis for traditional protocols. Figure 3 [1]: Critical path analysis for RBS Reference Broadcast System Time Synchronization in Sensor Networks
Sequence of Events A transmitter broadcasts a reference packet to two receivers (i and j). Each receiver records the time that the reference was received, according to its local clock. The receivers exchange their observations. Based on this single broadcast the receivers can form a relative timescale. Estimation of Phase Offset Time Synchronization in Sensor Networks
A transmitter broadcasts m reference packets. Each of the n receivers records the time that the reference was observed, according to its local clock. The receivers exchange their observations. Each receiver i can compute its phase offset to any other receiver j as the average of the phase offsets implied by each pulse received by both nodes i and j. That is, given n: the number of receivers m: the number of reference broadcasts Tr,b: r’s clock when it received broadcast b The receiver error is Gaussian. We can increase precision by sending more reference beacons. Estimation of Phase Offset Time Synchronization in Sensor Networks
What is Clock Skew ? The change in frequency of the oscillator over time. Why is it necessary ? Clock Skew is major source of error. Oscillator Characteristics Accuracy Agreement between the oscillator’s actual and expected frequencies Stability An oscillators tendency to stay at the same frequency over a period To calculate clock skew, least squares linear regression is performed The slope of the best fit line through the phase offsets can give the relative clock skew of the remote node. Estimation of Clock Skew Time Synchronization in Sensor Networks
First test 5 Berkeley motes sending out reference pulses periodically at 2 micro sec clock resolution. Residual error detected: 11.2 micro sec Second Test Used motes as ‘NIC’ cards for std. Linux boxes. Modified Linux kernel to time-stamp serial port interrupts for reduction in phase calculation error. Tried to test the clock skew measurement algorithm by sending a few synchronization pulses, then silencing the radio for a minute and sending synchronization pulses again. Residual error detected: 7.6 micro sec Implementation on Berkeley Motes Time Synchronization in Sensor Networks
Implemented RBS under same constraints as NTP. Ran RBS as a UNIX daemon on a Compaq IPAQ, with “Familiar” Linux running, using UDP datagrams as motes. Daemon ran completely in user space, using standard system calls the same as NTP. Three different synchronization schemes tested RBS NTP NTP with offset Test application queried the NTP daemon for the clock’s phase offset and subtracted it from the test pulse time. Two Different scenarios tested Light Network Load Little or not background traffic Heavy Network Load Two additional IPAQs configured as traffic generators sending UDP datagrams at 6.5Mbit/sec. Relative Performance of RBS and NTP Time Synchronization in Sensor Networks
RBS performs 8 times better than NTP in the same environment. The performs of RBS remains almost the same even with heavy traffic The performance of NTP degrades 32 fold in the presence of heavy traffic Figure 5: [1] Test Results Time Synchronization in Sensor Networks
What is Post-Facto synchronization ? Post-facto synchronization strives to conserve energy in sensor nodes by not keeping the clocks in continuous synchrony. Clocks are synchronized only when an event of interest occurs. RBS clock skew estimator acts as an effective form of post-facto synchronization. Once nodes power up from deep sleep and exchange updates, exact time of events of interest can be calculated using backwards extrapolation of clock-skew. Application to Post-Facto synchronization Time Synchronization in Sensor Networks
Let the notation Ei(Rj) mean the time of event i according to receiver j’s clock. Receivers R1 and R7 observe events at times E1(R1) and E7(R7), respectively. R4 uses A’s reference broadcasts to convert clock values from R1 to R4. This is used to convert E1(R1) to E1(R4). R4 similarly uses B’s broadcasts to convert E1(R4) to E1(R7). The time elapsed between the events is computed as E1(R7)-E7(R7) Figure 6: [1] A simple topology where multi-hop time synchronization is required. Multi-Hop Time Synchronization Time Synchronization in Sensor Networks
RBS can be extended to include external timescales. Only one node is required to be as the reference external timescale, for e.g. a special node can be GPS enabled and can synchronize its own clock externally. Then other nodes can convert their time to GPS times using the conversion algorithms. Synchronization with external timescales Time Synchronization in Sensor Networks
Advantages Receiver-Receiver mechanism, hence most sources of non-deterministic latency removed giving high precision. Multiple reference broadcasts reduce synchronization offset. Allows nodes to construct local timescales which is sufficient for applications like sensor networks Time can be propagated across broadcast domains. Limitations It requires a network with a physical broadcast channel It can not be used, for example, in networks that employ point-to-point links. Scrutiny: RBS Time Synchronization in Sensor Networks
Time Synch Protocol for Sensor Networks (TPSN) Developed by Saurabh Ganeriwal, Ramkumar Rengaswamy and Mani B Srivastava. Time Synchronization in Sensor Networks
Extend NTP’s approach for Time Synchronization in wireless sensor networks. Uses the sender-receiver paradigm of NTP Works in two steps Sets up Level hierarchy (Level discovery phase) Propagates synchronization messages (Synchronization Phase) Tries is to maintain a unique global timescale, at every instant of time, throughout the network. Time Sync Protocol for Sensor Networks Time Synchronization in Sensor Networks
Root node assigned level 0 The root node initiates this phase by broadcasting a level-discovery packet Any neighbor receiving this packet will set its own level to one greater than the one they received and send its own level discovery packet. This process is continued and eventually every node in the network is assigned a particular level. Once a node’s level has been decided, it ignores all such packets in the future Level Discovery Phase Time Synchronization in Sensor Networks
Root node sends out a ‘time-sync’ packet. Pair-wise synchronization is performed over the entire network. Figure 8: At time T1, ‘A’ sends a sync pulse packet to ‘B’ which contains the level number of ‘A’ and T1. Node B receives this packet at T2, where T2 is equal to T1 + D + d. D=clock drift between the two nodes d=propagation delay At time T3, ‘B’ sends back an acknowledgement packet to ‘A’ with values of T1, T2 and T3. ‘A’ can calculate the phase offset as shown in figure 9. Figure 8 [2]: Two Way Message Exchange Figure 9 [2]: Synchronization Phase Time Synchronization in Sensor Networks
TPSN has some special provisions for; when a new node joins a network or when it does not get a level discovery packet Wait for some time and listen for a level discovery packet Timeout and Broadcast a ‘Level Request’ query Neighboring nodes send their own level Again select the lowest level received i and assign yourself i+1 when a node ‘i’ loses all its neighbors with level ‘i+1’ After sending synchronization initiation messages a fixed number of times, a node times out and sends out a ‘Level Request’ query when the root node dies Level 1 nodes will timeout on ack packets to root. Instead of ‘Level Request’ query, they run an election algorithm and select a new root node. A brand new Level Discovery phase is started till all the nodes get reassigned their new level. Some Special Provisions Time Synchronization in Sensor Networks
Decomposition of packet delay Figure 9 [2] Figure 10 [2]: Drift among Local nodes Figure 11 [2]: Error Calculation Error Analysis in TPSN Time Synchronization in Sensor Networks
Tested on IPAQ testbed with no external components used. Modification to TinyOS Generate a lower granularity clock. Timestamp packets at the MAC layer. Implementation on Berkeley Motes Time Synchronization in Sensor Networks
Contribution of uncertainty at the sender towards the sync-error is very low (0.65 microsec) thus can be ignored. Comparison with RBS showed that on an average it was twice as accurate as RBS under similar conditions. Figure 12 [2] : Statistics of Sync-error Figure 12 [2] : Histogram of Sync-error Test Results Time Synchronization in Sensor Networks
Figure 13 [2]: Sync-error over Multi-Hop It was observed that error does not blow up as the hop count increases. Some experiments showed high error values but its probability is low. Better analytical models for multi-top topologies are under research. Multi-Hop results Time Synchronization in Sensor Networks
Advantages Being a logical extension of NTP to sensor networks, supports high level of scalability. Error is almost entirely based on hop distance of adjacent nodes and independent of total number of nodes in the network. Can achieve better accuracy by using a min. spanning tree algorithm (level discovery phase) with an added complexity of O(N). Limitations Requires MAC layer time-stamping. The main drawback is the time taken for synchronization phase which increases linearly with N (the number of nodes). This initial setup might take a long time and might have to be done more than once especially in dynamic situation. Performance in the presence of traffic is not investigated. Scrutiny: TPSN Time Synchronization in Sensor Networks
Summary Time Synchronization in Sensor Networks
NTP is the most widely used time synchronization protocol over the large WAN’s and other wired networks RBS works very well in broadcast networks (eg. WSN) giving higher precision as compared to NTP. TPSN improves accuracy over RBS by a factor of 2 but performance in actual sensor network environments is yet to be tested. Conclusion Time Synchronization in Sensor Networks
Dr. Wei Ye Dr. Jeremy Elson Acknowledgements Time Synchronization in Sensor Networks
Jeremy Elson, Lewis Girod and Deborah Estrin, Fine-Grained Network Time Synchronization using Reference Broadcasts, In Proceedings of the Fifth Symposium on Operating Systems Design and Implementation (OSDI 2002), Boston, MA. December 2002. Saurabh Ganeriwal, Ramkumar Rengaswamy, Mani B Srivastava, Timing-sync Protocol for Sensor Networks, ACM SenSys'03, November 2003. D.L. Mills, Precision synchronization of computer network clocks, ACM Computer Communication Review 24, 2, April 1994. References Time Synchronization in Sensor Networks
Questions ? Thank You. Time Synchronization in Sensor Networks
Backup Slides Time Synchronization in Sensor Networks
Figure 4 shows the maximum pair-wise error after RBS. The receiver reports errors according to the Gaussian distribution. Figure 4-a shows the mean group dispersion and the standard deviation from the mean. Figure 4-b shows a 3D view of the same dataset, from 2 to 20 receivers Figure 4: [1] Estimation of Phase Offset Time Synchronization in Sensor Networks
Time-stamping at interrupt time, before the packet is even transferred from the NIC, significantly reduces jitter. Kernel Time stamping significantly improved the performance over the same setup. 1.85 ± 1.28 microseconds from 6.29 ± 6.45 microseconds. RBS using kernel timestamps. Time Synchronization in Sensor Networks
Figure 7: [1] A more complex multi-hop network topology. Time Routing in Multi-Hop Networks Time Synchronization in Sensor Networks