5.2 Physical Clock
5.2 Physical Clock
5.2 Physical Clock
synchronization
Cristian’s algorithm
Compensate for delays
– Note times:
• request sent: T0
• reply received: T1
If master fails
– Any slave can take over
Berkeley Algorithm: example
3:00
9:
25 10
3: 2:50
3:00
9:
25 10
3: 2:50
+0.15
3:00
-6
:20 :0
5
-0 +0:15
Arranged in strata
– 1st stratum: machines 1
connected directly to 2
accurate time
source 3
– 2nd stratum: machines 4
synchronized from
1st stratum machines
– …
SYNCHRONIZATION SUBNET
NTP Synchronization Modes
Multicast mode
– for high speed LANS
– Lower accuracy but efficient
Procedure call mode
– Similar to Cristian’s algorithm
Symmetric mode
– Intended for master servers
– Pair of servers exchange messages and retain data
to improve synchronization over time
d = (T4-T1) - (T2-T3)
SNTP example
T2=800 T3=850
server
request reply
client time
T1=1100
T4=1200
=((-300)
Offset = + (-350))/2 Time offset:
= -650/2
((800 = -325
- 1100) + (850 - 1200))/2
Set time to T4 + t
= 1200 - 325 = 875
Cristian’s algorithm
T2=800 T3=850
server
request reply
Ts=825 time
client
T1 =1100 T4=1200