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 8 Topics: Time Synchronization Lower Bounds Sources: Fan, Chakraborty & Lynch paper Fan & Lynch paper Lenzen, Locher & Wattenhofer paper MIT 6.885 Fall 2008 slides
3
Discrete Algs for Mobile Wireless Sys3 Clock Synchronization Model (Again) Nodes have physical (hardware) clocks H i (t), with bounded drift rate Rate of physical clock, relative to real time, always in the range [1- , 1+ ]. Some nodes may have periodic access to external sources of reliable real time signals (GPS). Nodes communicate by passing messages (point- to-point or broadcast). Message delay from i to j is variable, within [0, d i,j ]. Call d i,j the distance from i to j; may be related to Euclidean distance. Adversary controls clock drift and message delay.
4
Discrete Algs for Mobile Wireless Sys4 Clock Synchronization Problem (Again) Nodes compute logical clock L i (t) based on physical clock and messages received. Logical clocks should be synchronized with each other and with real time: (Well-behaved) Don’t move backwards. (Agreement) Minimize difference (skew) between nodes’ logical clocks. (Internal validity) Logical clocks remain (approximately) within range of physical clocks. (External validity) Logical clocks remain close to real time (closeness depends on
5
Discrete Algs for Mobile Wireless Sys5 Gradient Clock Synchronization Nearby nodes should have small worst-case logical clock skew, nodes that are further away may have larger clock skews. E.g., can we ensure that all i,j always have O(d i,j ) skew ? Or find some small function f such that, for every i, j, and t, | L i (t) – L j (t) | f(d i,j ) ? Gradient synchronizaton good enough for many uses: Nearby nodes comparing observations at nearby points in time, e.g., for determining speed of object observed by two nodes. For collision-avoidance algorithms based on time, e.g., reservation-based protocols, or TDMA.
6
Discrete Algs for Mobile Wireless Sys6 Gradient Clock Synchronization Motivation Anyway, it’s impossible to guarantee too-close synchronization between distant network nodes: Consider a line network G with D nodes. Distance between neighbors is 1, diameter is D-1. Can’t achieve better than (D-1) / 2 worst-case logical clock skew between nodes 1 and D. … 123D 1111
7
Discrete Algs for Mobile Wireless Sys7 Lower Bound on Skew for a Line First let's consider a simpler case when there is no clock drift but clocks start unsynchronized Use a simple shifting argument: nodes on the line are 1, 2, 3, …, D In reference execution , message delay from k to k+1 is 0 and from k+1 to k is 1 Shift to create new execution ': shift node 1 by 0, node 2 by 1, node 3 by 2, …, and node D by (D-1)
8
Discrete Algs for Mobile Wireless Sys8 Lower Bound on Skew for a Line Check that msg delays in ' are in range: msg from i to i+1: new delay = old delay – i's shift + (i+1)'s shift = 0 – (i – 1) + i = 1 msg from i+1 to i: new delay = old delay – (i+1)'s shift + i's shift = 1 – i + (i – 1) = 0 After algorithm terminates in both executions: L 1 ' = L 1 since node 1 shifted by 0 ≥ L D – since is max skew = (L D ' + D – 1) – since node D shifted by D – 1 ≥ (L 1 ' – ) + D – 1 – since is max skew Implies ≥ (D – 1)/2
9
Discrete Algs for Mobile Wireless Sys9 Lower Bound on Skew for a Line Can modify the previous argument for the case when clocks start synchronized but there is clock drift: Execution : Delays from left-to-right are always 0. Delays from right-to-left are always 1. Physical clocks don’t drift. ': Shift , keeping drift rate within bounds, so that after a while: Delays from left-to-right are always 1. Delays from right-to-left are always 0. Then for large t, | L 1 (t) – L D (t) | ≤ in both executions. But L D (t) differs by D-1 in the two executions, contradiction.
10
Discrete Algs for Mobile Wireless Sys10 Shifting to Get ' Slow down the clocks, until enough skew is created time 1 D ' 1 D
11
Discrete Algs for Mobile Wireless Sys11 Gradient Clock Synchronization So, it seems we are forced to settle for gradient clock synchronization. Now describe: A simple almost-gradient algorithm A surprising impossibility result for gradient synchronization---says that worst-case skews between neighbors must depend on the size of the network! A new algorithm that matches the lower bound.
12
Discrete Algs for Mobile Wireless Sys12 An Algorithm [Fan, Chakraborty, Lynch] A good attempt at a practical wireless network algorithm that “usually” satisfies the gradient property. Best/newest version in [Fan, PhD thesis 2008]. Accommodates external clock inputs. Tolerates node failures/recoveries, changing network. Assume symmetric link delays: d ij = d ji. GPS service. Periodically (at least every time G ) delivers correct real times to nodes in a designated subset V G of the nodes V. Propagate through network (as part of the GPS service) using local broadcasts. Stability: Analyze what happens when network stops changing (for sufficiently long).
13
Discrete Algs for Mobile Wireless Sys13 Algorithm Guarantees External accuracy lower bound: In any execution, sufficiently long after stabilization, each node i’s logical clock is at least the real time, minus a quantity that depends on the GPS period G and closest distance from i to a GPS source. External accuracy upper bound: Sufficiently long after stabilization, i’s logical clock is at most the real time, plus a quantity that depends on G and the diameter of the network. Need diameter here, because time information could arrive via roundabout paths. Gradient accuracy: After stabilization, except during certain “synchronization periods”, logical clocks satisfy gradient property. Can translate this claim to say that, under reasonable assumptions, the gradient property holds “most of the time”.
14
Discrete Algs for Mobile Wireless Sys14 The Algorithm [Fan’s thesis, p. 62] Based on earlier algorithm of [Kaynar et al. 2005]: Each node i estimates time using a local clock, which is the same as its physical clock. Estimates maximum of all nodes’ local clocks using a global clock. Increases global clock, but at a slower rate than the physical clock, to be sure it never exceeds the maximum local clock. Everyone sends around maximum known local clock. Logical clock = max (local clock, global clock) Modify the algorithm to incorporate GPS inputs, tolerate network changes: For each known GPS input value g, node i maintains: local(g), for the best local estimate of real time based on GPS input g. global(g), for the best estimate of the maximum of all nodes’ local(g).
15
Discrete Algs for Mobile Wireless Sys15 The Gradient Lower Bound [Fan, Lynch 04] A surprising lower bound result expressing an inherent limitation for gradient algorithms. Best/newest version in [Fan, PhD thesis 2008]. System model (simpler setting than previous algorithm): Static graph network, no failure, no GPS inputs Symmetric link delays: d ij = d ji Hardware clock, H i (t) Initially 0, rate in [1- , 1+ ], for non-zero drift Adversary controls hardware clock rates (drift) and message delays.
16
Discrete Algs for Mobile Wireless Sys16 The Gradient Lower Bound Logical clock, L i (t), determined by the algorithm. Requirements: Well-behavedness: Logical clocks always advance at rate ½. Agreement (f-gradient property): For every i, j, and t, L i (t) – L j (t) f(d i,j )
17
Discrete Algs for Mobile Wireless Sys17 The Gradient Lower Bound Theorem Theorem: For any f-gradient clock synchronization algorithm, we have: f(1) = (log D / log log D). More precisely, for every D, there is some graph G of diameter D, and some execution in which two neighbors in G exhibit skew (log D / log log D). Thus, the skew depends on the total size of the network: as the network grows, neighboring nodes will have weaker synchronization guarantees. Surprising that the skew between neighbors should depend on the size of the entire network
18
Discrete Algs for Mobile Wireless Sys18 Discussion of Assumptions Requires a non-zero drift In the case of no drift, with a one-shot algorithm, this result does not hold Only applies to a class of algorithms in which logical clocks always increase at some minimum rate rules out algorithms which set clocks backwards (e.g., average algorithms) but also rules out algorithms that can "smooth" out negative adjustments
19
Discrete Algs for Mobile Wireless Sys19 Overview of the Proof Construct explicit executions in which we adversarially control the hardware clock rates and message delays. Uses “shifting” ideas as in the earlier example. Use line graph for nodes 1,…,D, with d ij = 1 for all pairs of neighbors; actually, diameter = D -1, but ignore this detail here. Begin with execution in which hardware clock rates and message delays have specially-chosen values. Then transform in stages into another execution with high skew between two neighbors, using two lemmas: Add Skew Lemma (ASL) Bounded Increase Lemma (BIL) … 123D 1111
20
Discrete Algs for Mobile Wireless Sys20 Overview of the Proof Create a series of executions 0, 1,… s.t. for each k, there are 2 nodes i k and j k : distance b/w i k and j k is (D–1)/(c*f(1)) k = n k skew b/w i k and j k at end of k is at least k*n k /24 k satisfies preconditions of Add Skew Lemma (ASL) k satisfies preconditions of Bounded Increase Lemma (BIL)
21
Discrete Algs for Mobile Wireless Sys21 Inductive Construction Start with carefully chosen 0 Suppose k satisfying the above properties has been constructed. To create k+1 : k-1 kk kk apply ASL to scrunch ASL implies skew b/w i k and j k has increased then add a suffix to k to get: k-1 k+1 '' k+1 satisfies precond. of BIL, so skew b/w i k and j k decreases in ' only half as much as it increased
22
Discrete Algs for Mobile Wireless Sys22 Limits to the Construction We can continue creating new executions in the inductive process as long as n k, the distance b/w i k and j k, is greater than 1, i.e., the two nodes identified are not the same Set 1 = n k and solve for k: 1 = (D–1)/(c*f(1)) k k = log c*f(1) (D–1)
23
Discrete Algs for Mobile Wireless Sys23 Finishing Up In the final k, there are nodes i k and j k : So there are nodes i and i+1 such that the skew between them is at least k/24 So f(1) ≥ k/24 Since k = (log f(1) D), algebra gives us that f(1) = (log D / log log D). ikik i k +1ii+1 jkjk distance is n k, skew is ≥ k*n k /24 distance is 1, skew is ≥ k/24
24
Discrete Algs for Mobile Wireless Sys24 Significance Lower bound result says that, for any gradient clock synchronization algorithm, the worst-case skew between neighbors must depend on the diameter D of the network, (log D / log log D). Significance in practice? Maybe not so serious, because the constants in the (log D / log log D) lower bound are extremely small. Also, how long does the large skew persist?
25
Discrete Algs for Mobile Wireless Sys25 A New Gradient Algorithm [Lenzen, Locher, Wattenhofer 08] Algorithm ensures close-to-optimal gradient and network-wide bounds. O(log D) local skew (cf. lower bound O(log D/log log D) O(D) global skew Uses an interesting strategy of sending very carefully crafted demands for neighbors to increase their clocks. Can this algorithm be a practical synchronization strategy for real ad hoc networks?
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.