1 / 10

CS603 Clock Synchronization

CS603 Clock Synchronization. February 4, 2002. What is Clock Synchronization?. All nodes agree on time What do we mean by time? Monotonic Any observation increases When sun is overhead, time is “noon” What do we mean by agree?

nanda
Download Presentation

CS603 Clock Synchronization

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. CS603Clock Synchronization February 4, 2002

  2. What is Clock Synchronization? All nodes agree on time • What do we mean by time? • Monotonic • Any observation increases • When sun is overhead, time is “noon” • What do we mean by agree? • Clocks on different nodes give same reading when time requested simultaneously • Can’t distinguish readings from above definition

  3. Time in a Distributed System P Q R q1 p1 r1 q2 p2 q3 p3 q4 r2 p4 q5 r3 q6

  4. Event-based definition(Lamport ’78) Define partial order of processes • A  B: A “happened before” B: Smallest relation such that: • If A and B in same process and A occurs first, A  B • If A is sending a message and B is receipt of a message, A  B • If A  B and B  C, then A  C

  5. Anomalous Events P Q R q1 p1 r1 q2 p2 q3 p3 q4 r2 p4 q5 r3 q6 r4

  6. Event-based definition(Lamport ’78) Define partial order of processes • A  B: A “happened before” B: Smallest relation such that: • If A and B in same process and A occurs first, A  B • If A is sending a message and B is receipt of a message, A  B • If A  B and B  C, then A  C • Clock: C(x) is time x occurs: • C(x) = Ci(x) where x running on node i. • Clocks correct if  a,b: ab  C(a) < C(b)

  7. Event-based clocks P Q R q1 p1 r1 q2 p2 q3 p3 q4 r2 p4 q5 r3 q6

  8. Lamport Clock Implementation • Node i Increments Ci between any two successive events • If event a is sending of a message m from i to j, • m contains timestamp Tm = Ci(a) • Upon receiving m, set Cj≥ current Cj and > Tm • Can now define total ordering. a  b iff: • Ci(a) < Cj(b) • Ci(a) = Cj(b) and Pi < Pj

  9. What if we want “wall clock” time? • Ci must run at correct rate: • κ << 1 such that | dCi(t)/dt – 1 | < κ • Synchronized: •  small ε such that  i,j: | Ci(t) – Cj(t) | < ε • Assume transmission time between μ and μ+ξ • Algorithm: Upon receiving message m,set Cj(t) = max(Cj(t), Tm+μ) • Theorem: Assume every τ seconds a message with unpredictable delay ξ is sent over every arc. Then t ≥ t0 + τd, ε≈ d(2κτ + ξ)

  10. Is this it? • What if we don’t know maximum delay ξ? • What if a clock goes “bad” • Runs much too fast/slow • Gives wrong answers • What about network faults? • Can we do better in practice? • Probabilistic algorithms

More Related