SlideShare a Scribd company logo
10
Most read
13
Most read
22
Most read
1
BY-
Harshita Ved
Vini Garg
 A Real-time system is a computer system in
which the correctness of the system behavior
depends not only on the logical results of the
computations but also on the time when the
results are produced.
 Real-time systems usually are in strong
interaction with their physical environment. They
receive data, process it, and return results in right
time. E.g. A Distributed real time system.
2
A common
‘Resource’
Node A Node B
request A request B
A Distributed System
Q. WHICH REQUEST WAS MADE FIRST?Q. WHICH REQUEST WAS MADE FIRST?
3
SolutionSolution
A Global Clock ??
Global
Synchronization?
A common
‘Resource’
Node A Node B
request A request B
A Distributed System
Q. WHICH REQUEST WAS MADE FIRST?Q. WHICH REQUEST WAS MADE FIRST?
4
Individual Clocks?
Are individual clocks
accurate, precise?
One clock might run
faster/slower?
Q. WHICH REQUEST WAS MADE FIRST?Q. WHICH REQUEST WAS MADE FIRST?
A common
‘Resource’
Node A Node B
request A request B
A Distributed System
SolutionSolution
10:00 AM
10:02 AM
5
 A quartz crystal oscillates at well defined
frequency and oscillations are counted (by
hardware) in a register.
 After a certain number of oscillations, an
interrupt is generated; this is the clock tick.
 At each clock tick, the computer clock is
incremented by software.
6
 The problems:
1. Crystals cannot be tuned perfectly. Temperature and
other external factors can also influence their frequency.
Clock drift: the computer clock differs from the real time.
2. Two crystals are never identical.
Clock skew: the computer clocks on different processors of the
distributed system show different time.
7
8
NEED??
 Time driven systems: in statically scheduled systems
activities are started at "precise" times in different points of
the distributed system.
 Time stamps: certain events or messages are associated with
a time stamp showing the actual time when they have been
produced; certain decisions in the system are based on the
"exact" time of the event or event ordering.
 Calculating the duration of activities: if such an activity
starts on one processor and finishes on another (e.g.
transmitting a message), calculating the duration needs
clocks to be synchronized.
9
 These are electronic devices that count oscillations occurring
in a crystal.
 Also called timer, usually a quartz crystal, oscillating at a well
defined frequency.
 Timer is associated with two registers: A Counter and a
Holding Register, counter decreasing one at each oscillations.
 Synchronizing Physical Clocks: done by two methods:
1. External Synchronization
2. Internal Synchronization
10
 The standard for measurement of time intervals:
 International Atomic Time (TAI): It defines the
standard second and is based on atomic
oscillators.
 Coordinated Universal Time (UTC): is based on
TAI, but is kept in step with astronomical time
(by occasionally inserting or deleting a "leap
second").
 UTC signals are broadcast from satellites and
land based radio stations.
11
Synchronization with a time source external to the
distributed systems, such as UTC broadcasting
system.
 One processor in the system (possibly several) is
equipped with UTC receivers (time providers).
 By external synchronization the system is kept
synchronous with the "real time".
 This allows to exchange consistently timing
information with other systems and with users.
12
Synchronization among processors of the system.
 It is needed in order to keep a consistent view of
time over the system.
 A few processors synchronize externally and the
whole system is kept consistent by internal
synchronization.
 Sometimes only internal synchronization is
performed (we don’t care for the drift from
external/ real time).
13
 Assume no central time source –
 Each system maintains its own local clock .
 No total ordering of events .
 Allow to get global ordering on events.
 Assign sequence numbers to messages –
 All cooperating processes can agree on order of event.
14
 It is used to provide a partial ordering of events
with minimal overhead.
 It is used to synchronize the logical clock.
 It follows some simple rules:
 A process increments its counter before each event in that
process i.e. Clock must tick once between every two events.
 When a process sends a message, it includes its timestamp
with the message.
 On receiving a message, the receiver process sets its counter
to be the maximum of the message counter and increments
its own counter .
15
 a ‘Happened Before’ b : a→b
1. If a and b are events in the same process, and a
comes before b, then a → b.
2. If
a :message sent
b : receipt of the same message
then a → b.
1. Transitive: If a → b and b → c then a → c.
2. Two distinct events a and b are said to be
concurrent if a -/->b and b -/->a
16
☞ Centralized Algorithms
 There exists one particular node, the so called Time
server node and clock time of this node is used as
reference.
- Passive time server: The other machines ask periodically
for the time. The goal is to keep the clocks of all other
nodes synchronized with the time server.
- Active time server: the Time server is active, broadcasting
other machines periodically about the time.
 Disadvantages:
- Single point of failure i.e. less reliable.
- Propagation delay is unpredictable.
17
☞ Distributed Algorithms
 There is no particular time server.
 The processors periodically reach an agreement on the
clock value by averaging the time of neighbors clock
and its local clock.
-This can be used if no UTC receiver exists (no external
synchronization is needed). Only internal
synchronization is performed.
- Processes can run on different machines and no global
clock to judge which event happens first.
18
 Cristian’s Algorithm is centralized 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 time server in “d/2”
seconds, where d=max 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.
19
20
 The best estimate 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 timestamp:
Tnew = Tserver + (T0 + T1)/2
 It is also a Centralized algorithm and its Time server is an
Active Machine.
 The server polls each machine periodically, asking it for
the time.
 When all the results are in, the master computes the
average time.
 Instead of sending the updated time back to slaves,
which would introduce further uncertainty due to
network delays, it sends each machine the offset by
which its clock needs adjustment.
 If master machine fails, any other slave could be elected
to take over.
21
22
a) The time daemon sends synchronization query to other
machines in group.
b) The machines sends timestamps as a response to query.
c) The Server averages the three timestamps and tells
everyone how to adjust their clock by sending offsets.
23

More Related Content

PPTX
Presentation on GREEN TECHNOLOGY
PPT
FDS (Sixth Edition) | C1 | Databases and Database Users
PPTX
Network protocols
PPTX
Fuzzy logic
PDF
CSPro Training Slides
PDF
Internet of Things (IOT) - Technology and Applications
PDF
Identify and resolve network problems
PPTX
update and document.pptx
Presentation on GREEN TECHNOLOGY
FDS (Sixth Edition) | C1 | Databases and Database Users
Network protocols
Fuzzy logic
CSPro Training Slides
Internet of Things (IOT) - Technology and Applications
Identify and resolve network problems
update and document.pptx

What's hot (20)

PPT
Clock synchronization in distributed system
PPTX
Physical and Logical Clocks
PDF
8. mutual exclusion in Distributed Operating Systems
PPT
Clock Synchronization (Distributed computing)
PPT
Group Communication (Distributed computing)
PPT
Logical Clocks (Distributed computing)
DOC
Distributed Mutual exclusion algorithms
PPTX
Distributed Mutual Exclusion and Distributed Deadlock Detection
PPT
Distributed Deadlock Detection.ppt
PPTX
Trends in distributed systems
PPT
distributed shared memory
PPTX
Synchronization in distributed computing
PPTX
Market oriented Cloud Computing
DOC
Naming in Distributed System
PPT
Lamport’s algorithm for mutual exclusion
PPTX
Synchronization Pradeep K Sinha
PPTX
Distributed Transactions(flat and nested) and Atomic Commit Protocols
PDF
Distributed deadlock
PPT
Synchronization in distributed systems
PPT
Chapter 14 replication
Clock synchronization in distributed system
Physical and Logical Clocks
8. mutual exclusion in Distributed Operating Systems
Clock Synchronization (Distributed computing)
Group Communication (Distributed computing)
Logical Clocks (Distributed computing)
Distributed Mutual exclusion algorithms
Distributed Mutual Exclusion and Distributed Deadlock Detection
Distributed Deadlock Detection.ppt
Trends in distributed systems
distributed shared memory
Synchronization in distributed computing
Market oriented Cloud Computing
Naming in Distributed System
Lamport’s algorithm for mutual exclusion
Synchronization Pradeep K Sinha
Distributed Transactions(flat and nested) and Atomic Commit Protocols
Distributed deadlock
Synchronization in distributed systems
Chapter 14 replication
Ad

Viewers also liked (20)

PDF
Clock Synchronization in Distributed Systems
PDF
6.Distributed Operating Systems
PDF
Clock Synchronization
PPT
04 ota053001 clock synchronization theory issue1.0
PPT
Presentation
PPTX
Microprocessor presentation
PPSX
Election algorithms
PPTX
Clock synchronization using servo-clock
PPTX
Marketing and concepts of database.
PDF
2013 Jeep Grand Cherokee Owners Manual (courtesy of The Jeep Store)
PDF
Distributed computing time
PPTX
Flexible Symmetric Global Snapshot
PPTX
Distributed algorithm for electronic voting system
PPT
Distributed Snapshots
PPT
network filesystem briefs
PPTX
Global state recording in Distributed Systems
PPT
Posix threads(asha)
PDF
Day 2 global_state_and_snapshot_algorithms
PPT
La2 powerpoint
Clock Synchronization in Distributed Systems
6.Distributed Operating Systems
Clock Synchronization
04 ota053001 clock synchronization theory issue1.0
Presentation
Microprocessor presentation
Election algorithms
Clock synchronization using servo-clock
Marketing and concepts of database.
2013 Jeep Grand Cherokee Owners Manual (courtesy of The Jeep Store)
Distributed computing time
Flexible Symmetric Global Snapshot
Distributed algorithm for electronic voting system
Distributed Snapshots
network filesystem briefs
Global state recording in Distributed Systems
Posix threads(asha)
Day 2 global_state_and_snapshot_algorithms
La2 powerpoint
Ad

Similar to clock synchronization in Distributed System (20)

PPTX
3. syncro. in distributed system
PDF
Clock.pdf
PPT
dokumen.tips_synchronization-in-distributed-systems-chapter-6.ppt
PPT
Time-Synchronization-ds14.pptmmmmmmmmmmmmmmmmmmmmmmmmmmm
PPT
Chap 5
PPT
Chapter 10
PPTX
Cross cutting concerns should be logically centralized DRY ,but it may appear...
PPT
Chapter 5-Synchronozation.ppt
PPTX
Unit iii-Synchronization
PPT
Chapter 6-Synchronozation2.ppt
PPT
Chapter Five: Introduction to Syncho.pptduction to Syncho.ppt
PPT
Chapter Five Synchonization distributed Sytem.ppt
PPTX
Synchronization
PDF
Clock Synchronization in Distributed Systems
PPT
CS6601-Unit 4 Distributed Systems
PPTX
Clock synchronization
PPTX
Unit V Synchronization of distributed system.pptx
3. syncro. in distributed system
Clock.pdf
dokumen.tips_synchronization-in-distributed-systems-chapter-6.ppt
Time-Synchronization-ds14.pptmmmmmmmmmmmmmmmmmmmmmmmmmmm
Chap 5
Chapter 10
Cross cutting concerns should be logically centralized DRY ,but it may appear...
Chapter 5-Synchronozation.ppt
Unit iii-Synchronization
Chapter 6-Synchronozation2.ppt
Chapter Five: Introduction to Syncho.pptduction to Syncho.ppt
Chapter Five Synchonization distributed Sytem.ppt
Synchronization
Clock Synchronization in Distributed Systems
CS6601-Unit 4 Distributed Systems
Clock synchronization
Unit V Synchronization of distributed system.pptx

More from Harshita Ved (7)

PDF
Cyber Law & Forensics
PDF
Cyber Law & Forensics
PDF
Cyber Law & Forensics
PDF
Cyber Law & Forensics
PPTX
Cyber Crime Investigation
PPTX
Multimedia system, Architecture & Databases
PPT
Ink jet and thermal printers
Cyber Law & Forensics
Cyber Law & Forensics
Cyber Law & Forensics
Cyber Law & Forensics
Cyber Crime Investigation
Multimedia system, Architecture & Databases
Ink jet and thermal printers

Recently uploaded (20)

PPTX
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
PPTX
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
PPTX
Welding lecture in detail for understanding
PPTX
Lecture Notes Electrical Wiring System Components
PPTX
Foundation to blockchain - A guide to Blockchain Tech
PPTX
Geodesy 1.pptx...............................................
PPT
Project quality management in manufacturing
PDF
Operating System & Kernel Study Guide-1 - converted.pdf
PDF
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
PPTX
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
PDF
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
PPTX
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
PPTX
Internet of Things (IOT) - A guide to understanding
PDF
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
PPTX
UNIT 4 Total Quality Management .pptx
PPTX
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
PPTX
CH1 Production IntroductoryConcepts.pptx
PPTX
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
PDF
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
PPTX
bas. eng. economics group 4 presentation 1.pptx
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
Welding lecture in detail for understanding
Lecture Notes Electrical Wiring System Components
Foundation to blockchain - A guide to Blockchain Tech
Geodesy 1.pptx...............................................
Project quality management in manufacturing
Operating System & Kernel Study Guide-1 - converted.pdf
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
Internet of Things (IOT) - A guide to understanding
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
UNIT 4 Total Quality Management .pptx
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
CH1 Production IntroductoryConcepts.pptx
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
bas. eng. economics group 4 presentation 1.pptx

clock synchronization in Distributed System

  • 2.  A Real-time system is a computer system in which the correctness of the system behavior depends not only on the logical results of the computations but also on the time when the results are produced.  Real-time systems usually are in strong interaction with their physical environment. They receive data, process it, and return results in right time. E.g. A Distributed real time system. 2
  • 3. A common ‘Resource’ Node A Node B request A request B A Distributed System Q. WHICH REQUEST WAS MADE FIRST?Q. WHICH REQUEST WAS MADE FIRST? 3
  • 4. SolutionSolution A Global Clock ?? Global Synchronization? A common ‘Resource’ Node A Node B request A request B A Distributed System Q. WHICH REQUEST WAS MADE FIRST?Q. WHICH REQUEST WAS MADE FIRST? 4
  • 5. Individual Clocks? Are individual clocks accurate, precise? One clock might run faster/slower? Q. WHICH REQUEST WAS MADE FIRST?Q. WHICH REQUEST WAS MADE FIRST? A common ‘Resource’ Node A Node B request A request B A Distributed System SolutionSolution 10:00 AM 10:02 AM 5
  • 6.  A quartz crystal oscillates at well defined frequency and oscillations are counted (by hardware) in a register.  After a certain number of oscillations, an interrupt is generated; this is the clock tick.  At each clock tick, the computer clock is incremented by software. 6
  • 7.  The problems: 1. Crystals cannot be tuned perfectly. Temperature and other external factors can also influence their frequency. Clock drift: the computer clock differs from the real time. 2. Two crystals are never identical. Clock skew: the computer clocks on different processors of the distributed system show different time. 7
  • 8. 8
  • 9. NEED??  Time driven systems: in statically scheduled systems activities are started at "precise" times in different points of the distributed system.  Time stamps: certain events or messages are associated with a time stamp showing the actual time when they have been produced; certain decisions in the system are based on the "exact" time of the event or event ordering.  Calculating the duration of activities: if such an activity starts on one processor and finishes on another (e.g. transmitting a message), calculating the duration needs clocks to be synchronized. 9
  • 10.  These are electronic devices that count oscillations occurring in a crystal.  Also called timer, usually a quartz crystal, oscillating at a well defined frequency.  Timer is associated with two registers: A Counter and a Holding Register, counter decreasing one at each oscillations.  Synchronizing Physical Clocks: done by two methods: 1. External Synchronization 2. Internal Synchronization 10
  • 11.  The standard for measurement of time intervals:  International Atomic Time (TAI): It defines the standard second and is based on atomic oscillators.  Coordinated Universal Time (UTC): is based on TAI, but is kept in step with astronomical time (by occasionally inserting or deleting a "leap second").  UTC signals are broadcast from satellites and land based radio stations. 11
  • 12. Synchronization with a time source external to the distributed systems, such as UTC broadcasting system.  One processor in the system (possibly several) is equipped with UTC receivers (time providers).  By external synchronization the system is kept synchronous with the "real time".  This allows to exchange consistently timing information with other systems and with users. 12
  • 13. Synchronization among processors of the system.  It is needed in order to keep a consistent view of time over the system.  A few processors synchronize externally and the whole system is kept consistent by internal synchronization.  Sometimes only internal synchronization is performed (we don’t care for the drift from external/ real time). 13
  • 14.  Assume no central time source –  Each system maintains its own local clock .  No total ordering of events .  Allow to get global ordering on events.  Assign sequence numbers to messages –  All cooperating processes can agree on order of event. 14
  • 15.  It is used to provide a partial ordering of events with minimal overhead.  It is used to synchronize the logical clock.  It follows some simple rules:  A process increments its counter before each event in that process i.e. Clock must tick once between every two events.  When a process sends a message, it includes its timestamp with the message.  On receiving a message, the receiver process sets its counter to be the maximum of the message counter and increments its own counter . 15
  • 16.  a ‘Happened Before’ b : a→b 1. If a and b are events in the same process, and a comes before b, then a → b. 2. If a :message sent b : receipt of the same message then a → b. 1. Transitive: If a → b and b → c then a → c. 2. Two distinct events a and b are said to be concurrent if a -/->b and b -/->a 16
  • 17. ☞ Centralized Algorithms  There exists one particular node, the so called Time server node and clock time of this node is used as reference. - Passive time server: The other machines ask periodically for the time. The goal is to keep the clocks of all other nodes synchronized with the time server. - Active time server: the Time server is active, broadcasting other machines periodically about the time.  Disadvantages: - Single point of failure i.e. less reliable. - Propagation delay is unpredictable. 17
  • 18. ☞ Distributed Algorithms  There is no particular time server.  The processors periodically reach an agreement on the clock value by averaging the time of neighbors clock and its local clock. -This can be used if no UTC receiver exists (no external synchronization is needed). Only internal synchronization is performed. - Processes can run on different machines and no global clock to judge which event happens first. 18
  • 19.  Cristian’s Algorithm is centralized 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 time server in “d/2” seconds, where d=max 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. 19
  • 20. 20  The best estimate 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 timestamp: Tnew = Tserver + (T0 + T1)/2
  • 21.  It is also a Centralized algorithm and its Time server is an Active Machine.  The server polls each machine periodically, asking it for the time.  When all the results are in, the master computes the average time.  Instead of sending the updated time back to slaves, which would introduce further uncertainty due to network delays, it sends each machine the offset by which its clock needs adjustment.  If master machine fails, any other slave could be elected to take over. 21
  • 22. 22 a) The time daemon sends synchronization query to other machines in group. b) The machines sends timestamps as a response to query. c) The Server averages the three timestamps and tells everyone how to adjust their clock by sending offsets.
  • 23. 23