Professional Documents
Culture Documents
Revised 10/03/15
Global Time
2
Outline
Defining and Measuring Time
Correcting Clocks and NTP
Logical Clocks
Vector Clocks
Historical Clocks
5
Sundials
Astronomical clocks
Candle clocks
Hourglasses
Electrical Clocks
8
Atomic Clocks
9
11
Outline
Defining and Measuring Time
Correcting Clocks and NTP
Logical Clocks
Vector Clocks
Correctness
12
Monotonicity
13
Maintains monotonicity
Simple Synchronization
14
Cristians Method
15
RTT
Sample
Why?
NTP Hierarchy
17
Provides redundancy
NTP in Practice
18
E.g., time.ccs.neu.edu
19
Outline
Defining and Measuring Time
Correcting Clocks and NTP
Logical Clocks
Vector Clocks
Logical Ordering
20
m1
m2
B
C
m3
m4
m5
Happened-before Relation
22
m1
m2
B
C
m3
m4
m5
Say e1 || e2
Limits of Happened-before
23
Logical Clocks
24
= max(Li, t) + 1
No Reverse Implication
25
A
B
C
1
e
f
5
26
Outline
Defining and Measuring Time
Correcting Clocks
NTP
Logical Clocks
Vector Clocks
Vector Clocks
27
Vector Key:
[LA, LB, LC, LD]
m1
[1,2,0,0]
?
[3,3,4,0]
m2
[1,3,0,0]
m3
[1,1,0,0]
[0,0,1,0]
[1,0,0,0]
B
C
?
[2,3,0,0]
m6
[0,0,2,0]
m4
[0,0,1,1]
m5
[1,2,3,0]
[1,2,4,0]
[0,0,2,2]
Invariant:
Vi[b] is the number of events in process Pb that happened
before the current state of process Pa
Both can say when certain events happened before each other
But, only vector clocks allow you to compare events across
processes
Challenges with vector clocks
The Future?
31