Motivatio: Clock Sychroizatio Oblivious Gradiet Clock Sychroizatio Thomas Locher, ETH Zurich Roger Wattehofer, ETH Zurich Clock sychroizatio is a classic, importat problem! May results have bee published about differet subtopics (skew miimizatio, commuicatio cost, fault-tolerace ). More ad more distributed applicatios are appearig! Distributed systems become eve more popular (Iteret, wireless etworks ). These applicatios ofte require sychroized clocks! is 98!??? is 99! Distributed Computig 0th IEEE It. Coferece o Distributed Computig (DISC) Group Stockholm, Swede, September 006 Thomas Locher, ETH Zurich @ DISC 006 is 98! is 03! Motivatio: Gradiet Property We focus o the miimizatio of the clock skew! We would like the clock skew to be small betwee ay two odes, eve if they are ot directly coected! This is called the global property! More importatly, we wat the skew betwee two odes to be small, if the legth of the shortest paths betwee those odes is short! This is called the gradiet property! Motivatio: Obliviousess How ca the local clock value be computed? Store message arrival times ad their time stamps! Use old messages to estimate the curret clock value of the eighborig odes ad/or the message delays How much ad what has to be stored? What if odes do ot have much memory? Really? How? Oblivious model: Each ode ca store oly oe clock value for each eighborig ode! Advatage: Oblivious algorithms is My eighbor s ca easily be 99! 0! clock says trasformed ito 99! 9980! self-stabilizig algorithms! Thomas Locher, ETH Zurich @ DISC 006 3 Thomas Locher, ETH Zurich @ DISC 006 4
Motivatio: Goal Outlie We study the effect of obliviousess o clock sychroizatio! The goal is to get isights ito the difficulty of gradiet clock sychroizatio! What level of sychroizatio ca be achieved without storig a larger history? Fid good gradiet clock sychroizatio algorithms i this restricted model! Such a algorithm might facilitate the developmet of a geeral gradiet clock sychroizatio algorithms guarateeig eve better bouds o the skew! I. Motivatio II. Model / Results III. Sychroizatio Algorithms IV. Coclusio / Outlook Thomas Locher, ETH Zurich @ DISC 006 5 Thomas Locher, ETH Zurich @ DISC 006 6 Model Model The graph used i all examples is the liear list! Messages have variable delays i the rage [0,]. Distace d(i,j) is defied as the legth of the shortest path betwee ode i ad j. Each ode i has a hardware clock H i ( ). I the list: d(i,j) = j-i + The hardware clock rate of ode i at time t is h i (t) [L,U], where 0 < L < U ad U. of ode i at time t is H i (t) = 0t h i (τ) dτ! Each ode i further has a logical clock L i ( )! H i (t) L i (t) Goal: Miimize the skew betwee the logical clocks! L i ( ) icreases at the rate of H i ( )! A message received with a fresh clock value from a eighborig ode Update L i ( ) accordig to the algorithm i use! If L i ( ) chaged Iform all eighborig odes about the ew clock value! L i ( ) caot ru backwards! A algorithm A: L x ψ L specifies how ode i adapts its logical clock at time t, give its curret value L i (t) ad the stored message history ψ! Oblivious! The most accurate clock value from each eighbor! A executio is E = (M,R), where M(t,i,j) [0,] specifies how log it takes for a message from ode i set at time t to arrive at ode j, ad h i (t) = R(t,i)! Thomas Locher, ETH Zurich @ DISC 006 7 Thomas Locher, ETH Zurich @ DISC 006 8
Results A well-kow result is that the skew betwee two odes at distace d is at least Ω(d)! Proof Sketch: The followig scearios caot be distiguished! L (t) = x! Delivery time d Delivery time 0 L (t) = x! L (t) = x+d! Delivery time 0 Delivery time d L (t) = x! There is a clock sychroizatio algorithm with a worst-case skew of Θ(d) betwee ay two odes at distace d! The oly result o gradiet clock sychroizatio [Fa, Lych @ PODC 004] is that odes at distace caot be sychroized better tha Ω(log D / log log D) where D deotes the diameter of G! Thomas Locher, ETH Zurich @ DISC 006 9 Results [Fa, Lych @ PODC 004] Proof Sketch for the Ω(log D / log log D) lower boud: The skew betwee all eighbors amog k odes ca be icreased by O() i O(k) time, but the skew ca oly be decreased by O(f()) i O() time! f() = Worst-case skew allowed betwee eighbors! Recursive skew iductio: Iduce a skew of c i O() time. Let the algorithm ru agai for /O(f()) time Skew decreases by c < c! Icrease the skew betwee O(/f()) odes durig this time agai by c! Repeat this for log O(f()) steps! Sice D = - ad f() Ω(log O(f()) ), the result follows! skew Skew decrease! /O(f()) /O(f()) /O(f()) 3 Skew icrease! time No algorithm with f() = o(d) published! Thomas Locher, ETH Zurich @ DISC 006 0 Results Outlie Our results: We show that for several ituitive algorithms the worst-case skew betwee two eighborig odes is Θ(D)! Not easy to fid a good gradiet clock sychroizatio algorithm! We preset a algorithm with a worst-case skew of O(d + D) betwee ay two odes at distace d i ay graph! I. Motivatio II. Model / Results III. Sychroizatio Algorithms IV. Coclusio / Outlook First algorithm with a worst-case boud of o(d) betwee odes at distace! Thomas Locher, ETH Zurich @ DISC 006 Thomas Locher, ETH Zurich @ DISC 006
Sychroizatio Algorithms: A max A simple algorithm: Always set the clock to the maximum clock value received from ay eighbor (if > ow clock value)! Ituitio: Nodes have to keep up with the fastest ode ayway! Sychroize to its clock as closely as possible! This is a poor gradiet clock sychroizatio algorithm!!! A skew of betwee all ( = D-) eighbors caot be avoided Fast propagatio of the largest clock value icurs a large skew betwee two eighborig odes! D+x Time: D + x Time: D + x Time: D + x Old clock value: D+x - New time is D+x! Old clock value: x+ New time is D+x! Skew D! Old clock value: x Thomas Locher, ETH Zurich @ DISC 006 3 Sychroizatio Algorithms: (A max ) The problem of A max is that the clock is always icreased to the maximum value! Idea: Allow a slack betwee the maximum clock value ad the ow value! The algorithm (A max ) sets the clock value to L i (t) := max(l i (t), max j Ni L i (t) - γ) The worst-case clock skew betwee two eighborig odes is still Θ(D) idepedet of the choice of γ!!! The costat slack! Thomas Locher, ETH Zurich @ DISC 006 4 Sychroizatio Algorithms: A avg Oly cosiderig the largest clock value is a bad idea! Idea: Take the clocks of all eighborig odes ito accout ad choose the average clock value! Surprisigly, this algorithm A avg is eve worse!!! Assume that the message delay is always. Assume that the clock rate of ode is always ad the clock rates of all other odes are arbitrary values less tha. After a while, the skew betwee ode ad - is -3 Θ()! Sychroizatio Algorithms: A avg Bad global property: The skew betwee ode ad is (-) Θ( ) Θ(D )! A max guaratees a boud of Θ(D) betwee ay two odes! Note: Nodes have at most eighbors i this graph The maximum clock value must have a larger weight tha ½! This also holds for other graphs: I a k-ary tree, if the k childre have a weight larger or equal to ½, the worst-case skew is also Θ(D ) betwee the root ad the leaf odes! x + (-) - Time: x + (-) Time: x + (-) Time: x+4 x + (-) x+ Time: x+ x x + (-) - Time: x + (-) Time: x + (-) Time: x+4 x + (-) x+ Time: x+ x Thomas Locher, ETH Zurich @ DISC 006 5 Thomas Locher, ETH Zurich @ DISC 006 6
Sychroizatio Algorithms: A boud Miimizig the skew to the fastest eighbor or all eighbors does ot work Idea: Miimize the skew to the slowest ode! Give the slowest ode time to catch up! All odes wait for each other! Algorithm A boud does ot icrease its logical clock due to a message if ay eighborig ode s clock is B behid! Problem with approach: Chai of depedecy! x Time: x - x - B Time: x - B - x B Time: x - B Chai of legth Θ() = Θ(D) results i Θ(D) waitig time Θ(D) skew! Node - has to wait for ode -, ode - has to wait for ode -3 Thomas Locher, ETH Zurich @ DISC 006 7 Sychroizatio Algorithms: Idea! Waitig for slower odes is ot such a bad idea Do it smarter: Set B = O( D) Skew is allowed to be O( D)! But the waitig time is at most O(D/B) = O( D) as well! Set the costats right ad slow odes ca always catch up! O( D) time Node with fast clock! Node with slow clock! Legth of chai = O( D)! O( D) O( D) Progress: O( D)! Progress: O( D)! Real time Thomas Locher, ETH Zurich @ DISC 006 8 Sychroizatio Algorithms: A root Algorithm A root works as follows: Whe a message is received, execute the followig steps: max := Maximum clock value of all eighborig odes mi := Miimum clock value of all eighborig odes if(max > ow clock ad mi + U D+ > ow clock ow clock := mi(max, mi + U D+) iform all eighborig odes about ew clock value! ed if Remider: U is the maximum hardware clock rate! Sychroizatio Algorithms: A root Properties of A root Global Property: The logical clock skew betwee ay two odes is at most UD +. Θ(D) is asymptotically optimal!!! This fact is required to prove the gradiet property of A root! Gradiet Property: The logical clock skew betwee ay two eighborig odes is at most U D+. O( D) is the best kow boud so far! Thomas Locher, ETH Zurich @ DISC 006 9 Thomas Locher, ETH Zurich @ DISC 006 0
Outlie Coclusio I. Motivatio II. Model / Results III. Sychroizatio Algorithms IV. Coclusio / Outlook Geeral results: Dilemma: Focusig o the maximum clock value does ot work. However, this value must have a large weight! Cosiderig all clocks to be equally importat does ot work! Algorithmic result: Algorithm with a worst-case skew of O(d+ D)! Thomas Locher, ETH Zurich @ DISC 006 Thomas Locher, ETH Zurich @ DISC 006 Outlook Questios ad Commets? Geeral O( D) Oblivious Upper boud Thak you for your attetio! O(log D / log log D) Lower boud Thomas Locher Distributed Computig Group ETH Zurich, Switzerlad lochert@tik.ee.ethz.ch http://dcg.ethz.ch/members/thomasl.html Thomas Locher, ETH Zurich @ DISC 006 3