DISTRIBUTED SYSTEMS SLIDES-lesson8
DISTRIBUTED SYSTEMS SLIDES-lesson8
DISTRIBUTED SYSTEMS SLIDES-lesson8
lecture 09
SYNCHRONIZATION
Coordination and Synchronization
– Logical clocks
– Physical clocks
Physical Clocks
• Every computer contains a physical clock
– E.g. if machine has a WWV receiver then the goal becomes keeping
all other machines synchronized to it (external synchronization)
Physical clocks: Computer Clock Synchronization
• Internal clock synchronization requires that the
clocks of different processors be kept within some
minimum relative deviation of each other.
– Each machine keeps its own time and the goal is to keep all
the clocks synchronized as close as possible (internal
synchronization). Approximately synchronized clocks
– Cristian’s Algorithm
– Berkeley Algorithm
– Network Time Protocol (NTP)
Clock Synchronization: Christian's algorithm
b) The machines answer and the time daemon computes the average. It ignores
outliers
a) The time daemon tells everyone how to adjust their clock –either advance or slow
down.
Network Time Protocol (NTP)
• Uses a network of time servers to
synchronize all processors on a net.
• Time servers are connected by a
synchronization subnet tree.
• The root is adjusted directly .
• Each node synchronizes its children
nodes
Network Time Protocol (NTP)
• Time Servers provides time service on the
Internet
• Servers form a Hierarchical network.
– primary servers (100s) — connected directly to a time
source
– secondary servers (1000s) — connected to primary
servers in hierarchical fashion
• ns.cs.kent.edu runs a time server
– servers at higher levels are presumed to be more
accurate than at lower levels
Network Time Protocol (NTP)
Network Time Protocol (NTP)
• Every R seconds, each machine broadcasts its current time.
• The local machine collects all other broadcast time samples during
some time interval, S.
•
Logical time and clocks
• Event ordering can be achieved without the
use of real-time clocks.
• Synchronization need not be absolute
(lamport)