0% found this document useful (0 votes)
3 views

Synchronization

The document discusses synchronization in both centralized and distributed systems, highlighting the challenges of coordinating actions between processes that operate independently. It details various clock synchronization methods, including physical and logical clock synchronization, and algorithms like Berkeley and Christian's algorithm, which help maintain accurate time across distributed systems. Additionally, it explains the importance of Coordinated Universal Time (UTC) and the mechanisms used to synchronize clocks in a networked environment.

Uploaded by

sajibuddin163
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Synchronization

The document discusses synchronization in both centralized and distributed systems, highlighting the challenges of coordinating actions between processes that operate independently. It details various clock synchronization methods, including physical and logical clock synchronization, and algorithms like Berkeley and Christian's algorithm, which help maintain accurate time across distributed systems. Additionally, it explains the importance of Coordinated Universal Time (UTC) and the mechanisms used to synchronize clocks in a networked environment.

Uploaded by

sajibuddin163
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 16

Synchronization

• Coordination of actions between process.


• Processes are usually asynchronous – means independent of events.
• Sometimes it needs to cooperate and synchronize.
• For mutual exclusion and for event ordering.
Synchronization in Centralize
System
• Shared Memory – Event ordering is clear because all events are timed
by the same clock.
• Only one processor.
• Only one clock.
• Share the same memory.
Synchronization in Distributed
System
• So many systems are there.
• Each system having own memory and processor.
• Own system clock – hard to implement – Difficult to manage
• Ex. Different countries have different clock
Clock Synchronization
• A mechanism to synchronize the time of all computers in distributed
system.
• Uses the Distributed algorithm to maintain the data synchronization.
• Distributed algorithm properties:
I. The relevant information is scattered among multiple machine.
II. The processes make decisions based only on local information.
III. A single point of failure in the system should be avoided.
IV. No common clock of other precise global time source exists.
Types of clock synchronization
• Physical clock synchronization.
• UTC (universal coordinate timer)
• Christians algorithm
• Berkeley algorithm.
• Logical clock synchronization
• Lamports clock
• Mutual clock synchronization
• Lamport algo
• Centralized algo
• Distributed algo
• Token based algo
Physical clock synchronization
• An electronic device that counts oscillations in a crystal at a particular
frequencies.
• Counts stored in counter register.
• Can be used to time stamp and event on that computer.
• The time different between two computer is known as Drift.
• The clock drift over the time is known as Skew
Berkeley clock synchronization
• The server polls each machine periodically, asking it for the time.
• Based on the answers it computes an average time and tells all the
other machine to answer their clocks to the new time or slow their
clock down until some specific reduction has been achieved.
• The time daemon’s time must be set manually by the operator
periodically
(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.
• At 3:00, time daemon tells the other machine its time and ask for
theirs.
• They response with how far a head or behind the time daemon they
are.
• The time daemon computes the average & tells each machine how to
adjust its clock.
Coordinated Universal Time (UTC)
• All computers are generally synchronized to a standard time called
coordinated universal time (UTC). => UTC is the primary time standard
by which the world regulates clocks and time. It is available via radio
signal, telephone line, satellite (GPS).
• UTC is broadcasted via the satellites. => UTC broadcasting service
provides an accuracy of 0.5 msec.
• Computer servers and online services with UTC receivers can be
synchronize by satellite broadcast. => Many popular synchronization
protocols in distributed system use UTC as a reference time to
synchronize clocks of computer.
• Problems: Sometimes we simply need the exact time, not just as
ordering.
• Solution: Universal Coordinate Time (UTC)
Based on the number of transactions per second of the Cesium 133
atom (pretty accurate).
At present, the real time is taken as the average of some 50 Cesium
clocks around the world.
Introduces a leap second for time to time to compensate that days are
getting longer.

Satellite can give an accuracy of about (+/-) 0.5ms.


• Problems: Suppose we have a distributed system with a UTC-receiver
somewhere in it. => We still have to distribute its time to each
machine.
• Basic principle: Every machine has a timer that generates an interrupt
H times per second.
• There is a clock in machine p that ticks on each timer interrupt.
Denote the value of that clock by Cp (t), where t is UTC time.
• Ideally, we have that for each machine p, Cp(t)=t or in other words
(dc/dt)=1.
In practice: 1-p = (dc/dt) <= 1+p.
Where p is the maximum drift rate.

Goal: Never let two clocks in any system differ by more than ‘&’ time
units => synchronize at least every ‘&/(2p)’ seconds.
Christian Algorithm
• The simplest algorithm for setting time, it issues a remote procedure
call to time server and obtain the time.
• A machine sends a request to the time server in “d/2” seconds, where
d=maximum difference between a clock and UTC.
• The time server sends a reply with current UTC when receives the
request.
• The machine measures the time delay between time server sending
the message and machine receiving it. Then it uses the measure to
adjust the clock.
• The best estimation of message propagation time = (T0 + T1)/2.
• The new time can be set to the time returned by server plus time that
elapsed since server generated the time stamp.

• Tnew = Tserver + (T0+T1)/2.

You might also like