CS603 Clock Synchronization - PowerPoint PPT Presentation

About This Presentation
Title:

CS603 Clock Synchronization

Description:

CS603. Clock Synchronization. February 4, 2002. What is ... 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. ... – PowerPoint PPT presentation

Number of Views:79
Avg rating:3.0/5.0
Slides: 11
Provided by: clif8
Category:

less

Transcript and Presenter's Notes

Title: CS603 Clock Synchronization


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
  • Cant distinguish readings from above definition

3
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) lt C(b)

4
Event-based clocksExample
P
Q
R
q1
p1
r1
q2
p2
q3
p3
q4
r2
q5
p4
r3
q6
r4
5
Time in a Distributed System
P
Q
R
q1
p1
r1
q2
p2
q3
p3
q4
r2
q5
p4
r3
q6
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

7
Anomalous Events
P
Q
R
q1
p1
r1
q2
p2
q3
p3
q4
r2
q5
p4
r3
q6
r4
8
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) lt C(b)

9
Event-based clocks
P
Q
R
q1
p1
r1
q2
p2
q3
p3
q4
r2
q5
p4
r3
q6
10
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 gt Tm
  • Can now define total ordering. a ? b iff
  • Ci(a) lt Cj(b)
  • Ci(a) Cj(b) and Pi lt Pj

11
What if we want wall clock time?
  • Ci must run at correct rate
  • ? ? ltlt 1 such that dCi(t)/dt 1 lt ?
  • Synchronized
  • ? small e such that ? i,j Ci(t) Cj(t) lt e
  • Assume transmission time between µ and µ?
  • Algorithm Upon receiving message m,set Cj(t)
    max(Cj(t), Tmµ)
  • Theorem Assume every t seconds a message with
    unpredictable delay ? is sent over every arc.
    Then ? t t0 td, e d(2?t ?)

12
Is this it?
  • What if we dont 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
Write a Comment
User Comments (0)
About PowerShow.com