Sei sulla pagina 1di 25

Synchronizing Physical

Clocks

Dr A K Singh
Professor, Computer Engineering
N I T Kurukshetra
2
3
4
5
6
7
8
9
10
11
The Berkeley Algorithm (Contd.)

a) The time daemon asks all the other machines for their clock values
b) The machines answer
c) The time daemon tells everyone how to adjust their clock
12
Limitations of Cristian’s Method

• The method achieves synchronization only if the observed round-trip


times between client and server are sufficiently short compared with
required accuracy.

• Problem of single server/point failure.

• Sources of external time signals are assumed self-checking. Hence,


faulty time servers that replied with spurious time values, or an imposter
time server that replied with deliberately incorrect times, can’t be
detected.

Note:- Cristian’s method and the Berkeley algorithm are intended


primarily for use within intranets.

13
14
Network Time Protocol (NTP)

 Provides UTC synchronization service across Internet.


 Uses time servers to sync. networked processes.
 Time servers are connected by sync. subnet tree.
 The root is adjusted directly.
 Each node synchronizes its children nodes.

Primary server, direct synch.


1
Secondary servers,
synched by the 2 2 2
primary server Strata 3, synched
3 3 3 by the secondary
3 3 3
servers

15
NTP Synchronization Modes

 Multicast Mode
– One or more servers periodically multicast the time to other servers
– Low accuracy, hence, intended for use on a high speed LAN
 Procedure-call Mode
– Similar to Christian’s method
– Higher accuracy than multicast
 Symmetric Mode
– The highest accuracy (hence our concern)

16
26
27
28
29
30
31
32
33
Is it enough to synchronize physical clocks?

• in a distributed system, there is no common clock, so we have to:


– use atomic clocks to minimize clock drift
– synchronize with time servers that have UTC receivers, trying to
compensate for unpredictable network delay
• is this sufficient?
– value received from UTC receiver is only accurate to within 0.1–10
milliseconds
• at best, we can synchronize clocks to within 10–30 milliseconds of each other
• we have to synchronize frequently, to avoid local clock drift
– in 10 ms, a 100 MIPS machine can execute 1 million instructions
• accurate enough as time-of-day
• two events will have different timestamps only if clock resolution is sufficiently
small
• many applications are interested only in the order of the events, not the exact time
of day at which they occurred
• not sufficiently accurate to determine the relative order of events on different
computers in a distributed system

34

Potrebbero piacerti anche