M S 07 Synchronizing Wallclock Time
M S 07 Synchronizing Wallclock Time
M S 07 Synchronizing Wallclock Time
Outline
Clock Synchronization Problem Wallclock Time: Definitions Synchronization algorithms Correcting clock errors
Received @ 3.030 Message received before it was sent ! Dead reckoning? Wallclock time (processor 2) 3.010 3.020 3.030 3.040 3.050 3.060 3.070 3.080
Time Definitions
Historically, time definitions based on periodic astronomical events
Solar day: time duration that elapses between event where the sun is at the highest point in the sky 24 hours per solar day, 3600 seconds per hour Greenwich mean time: solar time at the Greenwich meridian (observatory near London)
Distributed algorithms
No central time server Processors use distributed algorithm to synchronize their local clock
Time Server
I
Wallclock time TS = local time in requestor when request sent I = interrupt service time T = time value provided by server TR = local time in requestor when response received TR = T + L where L is communication latency Estimate L = (TR - TS - I) / 2 Collect several estimates of L, discard outliers, average Latency often symmetric in LANs, typically not in WANs
TS T TR
Distributed algorithms
Avoids single point of failure, bottleneck for large systems A push algorithm
Each processor periodically sends time values to a subset of the other processors Incoming time values: discard outliers, average received values
Primary servers
Level 1 of tree Synchronized with national time servers
Secondary servers
Level 2, 3,
T2=T1++L
T3
Wallclock time
A = T2T1 = +L; A is an upper bound on B = T3T4 = L; B is a lower bound on Estimate offset as (A+B)/2 Round trip delay = L+L = A B
Summary
Clock synchronization needed for features like latency compensation in dead reckoning algorithms Coordinated Universal Time (UTC) standard reference Synchronization: Unknown message latency source of problems Several styles of clock synchronization available
Centralized vs. distributed Push vs. pull