6Clock Synchronization
6Clock Synchronization
p1
a b m1
p2 Physical
c d time
m2
p3
e f
Lamport Timestamps
1 2
p1
a b m1
3 4
Physical
p2
time
c d
m2
1 5
p3
e f
mr
mt
p Time server,S
Broadcast based
• First approach
– Time service broadcast time periodically
– Clients evaluate their clock in comparison with
broadcast time
– Client clock ahead --- slows down its clock
– Client clock behind --- forward the clock or
gradually increase
– No fault tolerance
II approach - Berkeley Algorithm
• Internal synchronization of group of computers
• Uses an elected master process to synchronize
among clients, without the presence of a time server
• The elected master pools or broadcasts to all
machines requesting for their time,
• Adjusts times received for RTT & latency, averages
times, and tells each machine how to adjust.
• Uses round trip time estimates to obtain slaves’ clock
values
• Elimination of out-liers (large RTTs, strong
deviations from average)
• Form average and send required adjustments to
slaves
• Upon failure of master, re-election by group
Drawbacks:
•Multiple leaders are used.
•Averaging client’s clocks may cause the entire
system to drift away from UTC over time
•Failure of the master requires some time for re-
election, so accuracy cannot be guaranteed
Request Driven - Cristian’s Algorithm
Secondry servers,
synched by the 2 2 2
Strata 3,
primary server synched by the
3 3 3 3 3 3 secondary
servers