1 / 30

CPSC 689: Discrete Algorithms for Mobile and Wireless Systems

CPSC 689: Discrete Algorithms for Mobile and Wireless Systems. Spring 2009 Prof. Jennifer Welch. Lecture 6. Topics: Time Synchronization Sources: Elson et al. paper Karp et al. paper MIT 6.885 Fall 2008 slides. Clock Synchronization. Nodes have individual clocks

archer
Download Presentation

CPSC 689: Discrete Algorithms for Mobile and Wireless Systems

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CPSC 689: Discrete Algorithms for Mobile and Wireless Systems Spring 2009 Prof. Jennifer Welch

  2. Lecture 6 • Topics: • Time Synchronization • Sources: • Elson et al. paper • Karp et al. paper • MIT 6.885 Fall 2008 slides Discrete Algs for Mobile Wireless Sys

  3. Clock Synchronization Nodes have individual clocks Synchronizing the time on the various clocks is essential for many applications • Coordination of wake-up and sleeping times (energy efficiency) • TDMA schedules • Ordering of collected sensor data/events • Co-operation of multiple sensor nodes (e.g. object tracking) • Estimation of position information Discrete Algs for Mobile Wireless Sys

  4. The Clock Synchronization Problem Every node has a local (hardware) clock Logical clock is some function of the hardware clock • add some computed value to hardware clock Goal: Compute local logical clocks to • Compensate for offset orskew between clocks: values are not the same • Compensate for drift between clocks: rates are not the same Discrete Algs for Mobile Wireless Sys

  5. Clock Synchronization Algorithm Distributed algorithm that computes logical local clock for every node Logical clocks should be as close together as possible Logical clocks should also run at approximately the same rate as the hardware clocks • Don't keep them always synchronized to time 0 Discrete Algs for Mobile Wireless Sys

  6. External vs. Internal Synchronization External synchronization: Nodes synchronize with an external clock source • Ex: GPS Internal synchronization: Nodes synchronize to a common time within themselves • to a leader, to an averaged time, or to anything else Discrete Algs for Mobile Wireless Sys

  7. Other Types of Clock Synchronization One-shot versus periodic synchronization • Periodic synchronization required to compensate for clock drift A-priori versus a-posteriori • A-posteriori clock synchronization triggered by an event Local versus global synchronization Discrete Algs for Mobile Wireless Sys

  8. Clock Sources Radio Clock Signal: • Clock signal from a reference source (atomic clock)is transmitted over a longwave radio signal • WWVB station in Colorado transmits at 60 kHz, can be received all over US • Accuracy limited by the distance to the sender • Special antenna/receiver hardware required Discrete Algs for Mobile Wireless Sys

  9. Clock Sources Global Positioning System (GPS): • Satellites continuously transmit own position and time code • Line of sight between satellite and receiver required • Special antenna/receiver hardware required • Accuracy: a few 100 ns Discrete Algs for Mobile Wireless Sys

  10. Clock Devices in Sensor Nodes Oscillator Structure • External oscillator with a nominal frequency (e.g. 32 kHz) • Counter register which is incremented with oscillator pulses • Works also when CPU is in sleep state Discrete Algs for Mobile Wireless Sys

  11. Clock Devices in Sensor Nodes This is a drift of up to 50 μs per second or 0.18s per hour Accuracy • Clock drift: random deviation from the nominal rate dependent on power supply, temperature, etc. • E.g. TinyNodes have a maximum drift of 30-50 ppm at room temp. temperature Discrete Algs for Mobile Wireless Sys

  12. GPS? What if all nodes had a GPS receiver? • High accuracy • Nodes would even get position information for free… Problems: • GPS needs unobstructed access to satellite(e.g., GPS does not work indoors) • Too complex hardware, too expensive for small, simple wireless (sensor) devices Discrete Algs for Mobile Wireless Sys

  13. Time Synchronization in the Internet with NTP Figure: Wikipedia • Several levels of time servers • Servers on same level coordinate among themselves and with servers on adjacent levels • Round-trip time used to get estimate on latency • Heuristic method to best compute time estimate based on different estimates • Jitter buffer to account forvariance in message delays • Clients connect to NTP server(s) • Accuracy at clients highly dependenton symmetry of message delaybetween client and server(typical: 1 – 30 ms) Discrete Algs for Mobile Wireless Sys

  14. Su, Akyildiz Time-Diffusion Practical paper, does not give theoretical guarantees Uses similar ideas as NTP but adapted to wireless scenario: • Multi-hop network (topology cannot be “chosen”) • Dynamic, possibly mobile network • Nodes might fail often • Energy constraints (e.g., need load balancing) • Should be a more symmetric protocol Discrete Algs for Mobile Wireless Sys

  15. Su, Akyildiz Time-Diffusion Two cases: With / without outside sources of time. With: Outside sources tell the time to some special “master” nodes, who diffuse it through the network. Without: Master nodes broadcast their timing info to their neighbors, who continue the time diffusion. Discrete Algs for Mobile Wireless Sys

  16. Su, Akyildiz Time-Diffusion Load Balancing / Fault Tolerance: • Master nodes are elected by random decisions • Frequent reelection of master nodes Time information is propagated in an “ad-hoc” way through the network Nodes adjacent to master/leader nodes may be chosen as leader nodes to further diffuse the info Use statistical heuristics to compute time estimates based on info of neighbors (cf. NTP) Also uses jitter buffers to compensate for varying msg. delays Discrete Algs for Mobile Wireless Sys

  17. Sender/Receiver Synchronization d1 d2 Roundtrip-Based Synchronization Message delays: d1, d2 unknown to A and B Clock offset (B – A): t2 – (t1 + d1) = t3 – (t4 – d2) Average the two expressions and rearrange terms to get (t2 – t1 + t3 – t4)/2 + (d2 – d1)/2 Approximating it with (t2 – t1 + t3 – t4)/2 gives an estimate of B – A whose error is half the difference in the delays Discrete Algs for Mobile Wireless Sys

  18. Influences on Packet Latency • Sending Time S (up to 100ms) • Medium Access Time A (up to 500ms) • Transmission Time T (tens of ms, depending on size) • Propagation Time PA,B (s, depending on distance) • Reception Time R (up to 100ms) • Asymmetric packet delays due to non-determinism • Solution: timestamp packets at MAC layer S T A Timestamp TA R PA,B Timestamp TB Critical path Discrete Algs for Mobile Wireless Sys

  19. Reference Broadcast Synchronization (RBS)[Elson,Girod,Estrin] Observation: sender side delay > receiver side delay Also much higher variability on sender side (needs to wait for free channel) Exploit local broadcast nature of wireless communication Each signal simultaneously received by many nodes Synchronize between receivers of the same message(instead of between sender and receiver) Large part of delay is the same for all receivers Discrete Algs for Mobile Wireless Sys

  20. Reference Broadcast Synchronization A S B • A sender synchronizes a set of receivers with one another • Point of reference: beacon’s arrival time • Only sensitive to the difference in propagation and reception time • Time stamping at the interrupt time when a beacon is received • After a beacon is sent, all receivers exchange their reception times to calculate their clock offset Discrete Algs for Mobile Wireless Sys

  21. RBS Extensions Idea can be used to synchronize over many hops Synchronization can be improved by doing several broadcasts. Clock Drift: Paper assumes that each local clock runs at a fixed rate (rates of different clocks can be different) Uses least-squares linear regression to cope with clock drift Experiments of Elson et al. indicate that the variation in receive time roughly follows a Gaussian distribution Discrete Algs for Mobile Wireless Sys

  22. RBS: Discussion RBS gives method to synchronize between two receivers of the same message Synchronization by nodes without common neighbor done by considering path of receiver-pairs  Skew proportional to length of path Method does not give globally consistent estimates of pair-wise clock offsets • Lj(t)  Li(t)*ai,j + bi,j and Lk(t)  Lj(t)*aj,k + bj,k and Lk(t)  Li(t)*ai,k + bi,k but ai,j*aj,k ≠ ai,k and bi,j*aj,k + bj,k ≠ bi,k Pairwise synchronizations are not optimally precise (do not have minimal variance from the truth) Discrete Algs for Mobile Wireless Sys

  23. Global Synchronization of Sensornets [Karp, Elson,Papadimitriou,Shenker] Tries to exploit full potential of reference broadcasts, ensure globally consistent pairwise translations and optimal precision Model: • No clock drift (only clock offsets) • Given: set of receiver-broadcast pairs (ri, sk)(ri: receiver node, sk: signal) • Offset of clock of node ri: Ti (offset w.r.t. universal time) • Signal sk sent at real time Uk, received by ri at clock timeyi,k = Uk + Ti + ei,k • The ei,k are independent random variables with zero mean and variance Vi,k Goal: Find best globally consistent estimate of offsets Ti Discrete Algs for Mobile Wireless Sys

  24. Two Problems • To find the optimal (minimum-variance) pairwise synchronization between nodes i and j, find the minimum-variance estimate of Tj – Ti. • Can be posed as a flow problem • To produce a globally consistent synchronization, esimate all the Ti's independently and find a maximum likelihood joint choice of all the Ti's. • Can be reduced to a linear system of least-squares equations • These two problems have the same solution! Discrete Algs for Mobile Wireless Sys

  25. Minimum Variance Pairwise Synchronization • Goal: Estimate T1 – T2. • Use differences in receive times of signals • Consider signal sk received by r1 and r2. • Estimate T1 – T2 with y1,k – y2,k = (T1 – T2) + (e1,k – e2,k) sk r1 r2 Discrete Algs for Mobile Wireless Sys

  26. sk1 sk2 r1 ri r2 Minimum Variance Pairwise Synchronization • Consider signal sk1 received by r1 and ri, and signal sk2 received by ri and r2. • Since T1 – T2 = (T1 – Ti) + (Ti – T2), estimate T1 – T2 with y1,k1 – yi,k1+ yi,k2 – y2,k2 = (T1 – T2) + (e1,k1 – e2,k1) + (ei,k2 – e2,k2) Discrete Algs for Mobile Wireless Sys

  27. Minimum Variance Pairwise Synchronization • Similarly, if you have an arbitrary length chain of alternating receivers and signals, the error is the expression given at top of p. 5 of paper. • Since each ei,k has zero mean, this estimator is unbiased. • By considering all possible paths between a pair of receivers, and weighting them appropriately, we get an estimator with much lower variance than any single path can provide. • This approach is pursued using flow theory on a corresponding resistor network • Show that the minimum variance estimators for pairs are globally consistent. Discrete Algs for Mobile Wireless Sys

  28. Maximum Likelihood Offset Assignment • Find the maximally likely set of offset assignments Ti • Will be globally consistent, but why should they be minimum variance? • Assume yi,k's (local clock time when ri receives signal sk) are independent Gaussian random variables with mean Uk + Ti and variance Vi,k • Show the joint probability density of the yi,k's is an expression involving the Uk's and Ti's • Derive a system of linear equations for the Ti's that maximize this joint probability density • Show that a solution to the linear system is obtained when Ti is set equal to the value from the resistor network formulation Discrete Algs for Mobile Wireless Sys

  29. Computing the Estimators • Set up and solve system of linear equations for quantities in the resistive network corresponding to the minimum variance estimators OR • Use a new approximation algorithm based on minimum-cost flow presented in the paper Discrete Algs for Mobile Wireless Sys

  30. Use in Practice? Estimator for two nodes at distance L in infinite grid has variance O(log L), exponential improvement over RBS, which uses only one path and thus has variance O(L) An efficient PTAS for computing the effective resistance is given by the paper. Not clear whether this can be made distributed Cost seems to be rather high Discrete Algs for Mobile Wireless Sys

More Related