Page 1 Page 1
Clock Synchronization: Physical Clocks
Paul Krzyzanowski pxk@cs.rutgers.edu
Distributed Systems
Except as otherwise noted, the content of this presentation is licensed under the Creative Commons Attribution 2.5 License.
Distributed Systems Clock Synchronization: Physical Clocks Paul - - PowerPoint PPT Presentation
Distributed Systems Clock Synchronization: Physical Clocks Paul Krzyzanowski pxk@cs.rutgers.edu Except as otherwise noted, the content of this presentation is licensed under the Creative Commons Attribution 2.5 License. Page 1 Page 1
Page 1 Page 1
Paul Krzyzanowski pxk@cs.rutgers.edu
Except as otherwise noted, the content of this presentation is licensed under the Creative Commons Attribution 2.5 License.
Page 2
Page 3 Page 3
Page 4
Page 5
– Curie brothers – Squeeze a quartz crystal & it generates an electric field – Apply an electric field and it bends
– Resonator shaped like tuning fork – Laser-trimmed to vibrate at 32,768 Hz – Standard resonators accurate to 6 parts per million at 31° C – Watch will gain/lose < ½ sec/day – Stability > accuracy: stable to 2 sec/month – Good resonator can have accuracy of 1 second in 10 years
Page 6
Page 7
Page 8
Page 9
– e.g., 60, 100, 250, 1000 interrupts per second
(Linux 2.6+ adjustable up to 1000 Hz)
– Programmable Interval Timer (PIT) – Intel 8253, 8254 – Interrupt service procedure adds 1 to a counter in memory
Page 10
Page 11
Page 12
Skew = +84 seconds +84 seconds/35 days Drift = +2.4 sec/day Skew = +108 seconds +108 seconds/35 days Drift = +3.1 sec/day
Page 13
Page 14
Page 15
Page 16
Page 17
Make clock run slower until it synchronizes
Make clock run faster until it synchronizes
Page 18
e.g.: if system requests interrupts every 17 msec but clock is too slow: request interrupts at (e.g.) 15 msec
Page 19
Page 20
Page 21
Page 22
Page 23
Page 24
Page 25
request reply
Page 26
request reply
Page 27
Page 28
request reply
Page 29
Page 30
request reply
T0 = 5:08:15.100 T1 = 5:08:15.900 Ts = 5:09:25:300 Tmin = 200msec
Page 31
Page 32
Page 33
latency
Page 34
Page 35
Page 36
Page 37
Page 38
Page 39
– Use statistical techniques to filter data and gauge quality of results
– Survive lengthy losses of connectivity – Redundant paths – Redundant servers
– offset effects of clock drift
– Authenticate source of data
Page 40
1 2 3 4
Page 41
Page 42
network transit time
Page 43
Page 44
Page 45
Page 46
– duplicate message?
– Messages arriving in order?
Page 47
Page 48
request reply
Page 49
request reply
Page 50
request reply
Page 51
Page 52 Page 52