Download presentation
Presentation is loading. Please wait.
1
CPSC 689: Discrete Algorithms for Mobile and Wireless Systems Spring 2009 Prof. Jennifer Welch
2
Discrete Algs for Mobile Wireless Sys2 Lecture 7 Topics: Time Synchronization Lower Bounds Sources: Attiya et al. paper MIT 6.885 Fall 2008 slides
3
Discrete Algs for Mobile Wireless Sys3 Attiya, Hay & Welch Theoretical study External clock synchronization Wireless communication but static nodes Motivating issue: To save energy, use short hops (small transmission radius) energy cost is super-linear in distance To reduce skew, have fewer hops uncertainty accumulates with each hop and skew is proportional to uncertainty Contradictory goals!
4
Discrete Algs for Mobile Wireless Sys4 Power vs. Uncertainty xxx 3x power 9x 2 uncertainty u power 3x 2 uncertainty 3u A AB B
5
Discrete Algs for Mobile Wireless Sys5 Overview Relate energy costs to optimal skew that can be obtained Each node has a maximum transmission range, based on its "energy budget" results in an arbitrary communication topology Compute optimal skew as a function of uncertainty Algorithm and matching lower bound
6
Discrete Algs for Mobile Wireless Sys6 Environment Energy constraints induce a communication topology graph TG TG is assumed to be connected, bidirectional links Each link e in TG has message delays in the range [d e – u e, d e + u e ] same range in each direction, but can be different for different links u e is the uncertainty of link e u i min is minimum weight of any path in TG from v i to any source (sum uncertainties of all links on the path)
7
Discrete Algs for Mobile Wireless Sys7 Problem Statement Every source node in the network has the same clock time, ST(t), at every time t Assume no clock drift => one-shot problem Each node v i should compute an adjustment adj i to add to its hardware clock HC i to obtain logical clock LC i. For all times t after termination time t f, |ST(t) – LC i (t)| should be at most (skew). Want to be small
8
Discrete Algs for Mobile Wireless Sys8 Algorithm with Precomputed Spanning Forest Assume there is a spanning forest of TG with each source as the root of a separate tree in the forest Each source sends its clock value to its children, which then propagate the information down the tree When a node gets the clock value, it adopts it after adding the sum of the median delays along the path the message has traveled so far
9
Discrete Algs for Mobile Wireless Sys9 Skew of Algorithm with Spanning Forest Largest error occurs when messages take either maximum or minimum time over each edge error per edge is then the uncertainty Error accumulates linearly as message propagates down the tree Best case is when spanning forest is shallow: maximum depth (w.r.t. sum of uncertainties) over all the trees is minimized In this case, worst-case skew of each node v i is at most u i min
10
Discrete Algs for Mobile Wireless Sys10 Precomputing a Shallow Spanning Forest Centralized algorithm: given TG and weights, run a generalization of Dijkstra's algorithm (to handle the multiple sources) Distributed algorithm: 1.each node computes its neighbors in TG by doing a bcast and waiting for acks 2.invoke known distributed algs for finding a BFS forest rooted at multiple sources
11
Discrete Algs for Mobile Wireless Sys11 Computing Shallow Spanning Forest on the Fly Combine computing a shallow spanning forest with doing (the first) synchronization Local var. uncertainty keeps track of smallest uncertainty to a source discovered so far Local var. parent keepts track of which neighbor is its parent in path to source corresponding to uncertainty var. Each msg contains local time when sent, id of sender, value of sender's uncertainty var.
12
Discrete Algs for Mobile Wireless Sys12 Computing Shallow Spanning Forest on the Fly Each source bcasts a message When a node receives a message (T,j,u) over link e: if uncertainty > u + u e then adj := (T + d e ) – HC uncertainty := u + u e parent := j bcast a message according to some heuristic (simple rule is whenever you update your vars)
13
Discrete Algs for Mobile Wireless Sys13 Analysis of On-The-Fly Algorithm Lemma 1: If uncertainty at node v i is defined, then it is the uncertainty along a path to some source, and v i 's clock skew is at most that amount. Proof is by induction on the sequence of events in the execution Lemma 2: Eventually uncertainty at node v i equals u i min (min. uncertainty of any path to any source). Proof is by induction on the length (w.r.t. number of hops) of minimum-uncertainty paths to sources
14
Discrete Algs for Mobile Wireless Sys14 Lower Bound Show that the skew achieved by the simple shallow spanning forest (SSF) algorithm is optimal. Not necessarily obvious, since SSF algorithm uses only point-to-point communication and ignores extra information that nodes get by overhearing broadcasts not intended for them
15
Discrete Algs for Mobile Wireless Sys15 Lower Bound Strategy To prove lower bounds on skew: 1.Start with a (carefully chosen) execution 2.Modify the times when events happen at the nodes (in a carefully chosen way) 3.Check that resulting execution is "legal" (message delays w/in bounds) 4.Use info about the original and the new execution, together with some algebra, to show that the skew cannot be too small
16
Discrete Algs for Mobile Wireless Sys16 Shifting Executions Given execution and real numbers x 0, x 1, …, x n-1, shift( ,(x 0, x 1, …, x n-1 )) is created by adding x i to the real time of each event by node v i
17
Discrete Algs for Mobile Wireless Sys17 Shifting Examples h/w clock times real times HC i (t) = T t h/w clock times real times HC i (t+x) = T t + x shift by positive amount h/w clock times real times HC i (t+x) = T t + x shift by negative amount
18
Discrete Algs for Mobile Wireless Sys18 Facts About Shifted Executions Result of shifting might not be reasonable: could shift receipt of a message earlier than its sending, for example, or exceed delay bounds. But these facts hold (shifting lemma): New hardware clock HC' i satisfies: HC' i (t) = HC i (t – x i ) = HC i (t) – x i Delay of a msg from p i to p j goes from to – x i + x j since msg is sent x i later and received x j later
19
Discrete Algs for Mobile Wireless Sys19 Changes to Message Delays pipi pjpj pipi pjpj – x i + x j xixi xjxj
20
Discrete Algs for Mobile Wireless Sys20 Reference Execution and Shifted Execution Assume an arbitrary external clock synch algorithm for the given model. Consider execution in which every message delay is the median (d e on link e). Pick any node v i and suppose v i 's logical clock at the end is equal to or behind source time. Shift to obtain ': v j is shifted by u j min (min uncertainty of any path from v j to a source)
21
Discrete Algs for Mobile Wireless Sys21 Intuition for Shifted Execution Suppose all uncertainties are the same, u Neighbors of sources are shifted by u Nodes 2 hops from a source are shifted by 2u, etc. Smooth gradient of shift amounts Boundaries between different trees (for different sources) are also smooth
22
Discrete Algs for Mobile Wireless Sys22 Shifted Execution is Legal If shifted execution does not obey system assumptions, nothing that we conclude about the algorithm in this execution is relevant So we must show that in shifted execution, all message delays are within stated bounds If sender and receiver of a message are shifted by same amount, then message delay in ' is same as in -- still within bounds
23
Discrete Algs for Mobile Wireless Sys23 Shifted Execution is Legal Suppose sender v j is shifted by less than receiver v k. In , delay is d e. In ', delay is d e – u j min + u k min ≤ d e + u e. legal! vjvj vkvk u j min u k min ≤ u j min + u e link e
24
Discrete Algs for Mobile Wireless Sys24 Shifted Execution is Legal Case when sender is shifted by more than receiver is similar. Thus the shifted execution is legal and the algorithm is supposed to be correct and obey desired bounds in it.
25
Discrete Algs for Mobile Wireless Sys25 Skew Must Be Large What happens to v i 's skew in ' ? By shifting lemma, v i 's logical clock in ' is u i min behind what it is in . Since in , v i 's logical clock is 0 or more behind source time, in ', v i 's logical clock is u i min or more behind source time. Thus v i 's skew is at least u i min. (If v i 's logical clock is ahead of source time at the end of , then shift by negative amts)
26
Discrete Algs for Mobile Wireless Sys26 Discussion What about handling clock drift? periodically redo the algorithm? This paper studied optimizing worst-case skew; what about optimizing expected skew? experimental results indicate that shallow energy-contrained spanning forests are optimal under this measure as well What about optimizing skew on a per-execution basis? What about fixing desired skew and finding minimal-energy algorithm to achieve this skew? What about mobile nodes? Compare simplicity of lower bound for external synch to complicated analysis for internal synch (Halpern et al.)
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.