SlideShare a Scribd company logo
1 of 23
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

What's hot

Distributed system lamport's and vector algorithm
Distributed system lamport's and vector algorithmDistributed system lamport's and vector algorithm
Distributed system lamport's and vector algorithmpinki soni
 
Synchronization Pradeep K Sinha
Synchronization Pradeep K SinhaSynchronization Pradeep K Sinha
Synchronization Pradeep K SinhaJawwad Rafiq
 
Physical and Logical Clocks
Physical and Logical ClocksPhysical and Logical Clocks
Physical and Logical ClocksDilum Bandara
 
Consistency protocols
Consistency protocolsConsistency protocols
Consistency protocolsZongYing Lyu
 
Agreement Protocols, distributed File Systems, Distributed Shared Memory
Agreement Protocols, distributed File Systems, Distributed Shared MemoryAgreement Protocols, distributed File Systems, Distributed Shared Memory
Agreement Protocols, distributed File Systems, Distributed Shared MemorySHIKHA GAUTAM
 
9 fault-tolerance
9 fault-tolerance9 fault-tolerance
9 fault-tolerance4020132038
 
Distributed Operating System
Distributed Operating SystemDistributed Operating System
Distributed Operating SystemSanthiNivas
 
Deadlock in Distributed Systems
Deadlock in Distributed SystemsDeadlock in Distributed Systems
Deadlock in Distributed SystemsPritom Saha Akash
 
CS9222 ADVANCED OPERATING SYSTEMS
CS9222 ADVANCED OPERATING SYSTEMSCS9222 ADVANCED OPERATING SYSTEMS
CS9222 ADVANCED OPERATING SYSTEMSKathirvel Ayyaswamy
 
Synchronization in distributed systems
Synchronization in distributed systems Synchronization in distributed systems
Synchronization in distributed systems SHATHAN
 
Distributed process and scheduling
Distributed process and scheduling Distributed process and scheduling
Distributed process and scheduling SHATHAN
 
8 memory management strategies
8 memory management strategies8 memory management strategies
8 memory management strategiesDr. Loganathan R
 
Distributed Computing system
Distributed Computing system Distributed Computing system
Distributed Computing system Sarvesh Meena
 
message passing vs shared memory
message passing vs shared memorymessage passing vs shared memory
message passing vs shared memoryHamza Zahid
 
Distributed System-Multicast & Indirect communication
Distributed System-Multicast & Indirect communicationDistributed System-Multicast & Indirect communication
Distributed System-Multicast & Indirect communicationMNM Jain Engineering College
 

What's hot (20)

Distributed system lamport's and vector algorithm
Distributed system lamport's and vector algorithmDistributed system lamport's and vector algorithm
Distributed system lamport's and vector algorithm
 
Synchronization Pradeep K Sinha
Synchronization Pradeep K SinhaSynchronization Pradeep K Sinha
Synchronization Pradeep K Sinha
 
Physical and Logical Clocks
Physical and Logical ClocksPhysical and Logical Clocks
Physical and Logical Clocks
 
Consistency protocols
Consistency protocolsConsistency protocols
Consistency protocols
 
Agreement Protocols, distributed File Systems, Distributed Shared Memory
Agreement Protocols, distributed File Systems, Distributed Shared MemoryAgreement Protocols, distributed File Systems, Distributed Shared Memory
Agreement Protocols, distributed File Systems, Distributed Shared Memory
 
6.Distributed Operating Systems
6.Distributed Operating Systems6.Distributed Operating Systems
6.Distributed Operating Systems
 
9 fault-tolerance
9 fault-tolerance9 fault-tolerance
9 fault-tolerance
 
Distributed Operating System
Distributed Operating SystemDistributed Operating System
Distributed Operating System
 
Deadlock in Distributed Systems
Deadlock in Distributed SystemsDeadlock in Distributed Systems
Deadlock in Distributed Systems
 
CS9222 ADVANCED OPERATING SYSTEMS
CS9222 ADVANCED OPERATING SYSTEMSCS9222 ADVANCED OPERATING SYSTEMS
CS9222 ADVANCED OPERATING SYSTEMS
 
Synchronization in distributed systems
Synchronization in distributed systems Synchronization in distributed systems
Synchronization in distributed systems
 
Distributed process and scheduling
Distributed process and scheduling Distributed process and scheduling
Distributed process and scheduling
 
8 memory management strategies
8 memory management strategies8 memory management strategies
8 memory management strategies
 
6.distributed shared memory
6.distributed shared memory6.distributed shared memory
6.distributed shared memory
 
Distributed Computing system
Distributed Computing system Distributed Computing system
Distributed Computing system
 
Message passing in Distributed Computing Systems
Message passing in Distributed Computing SystemsMessage passing in Distributed Computing Systems
Message passing in Distributed Computing Systems
 
Memory management
Memory managementMemory management
Memory management
 
message passing vs shared memory
message passing vs shared memorymessage passing vs shared memory
message passing vs shared memory
 
Chpt7
Chpt7Chpt7
Chpt7
 
Distributed System-Multicast & Indirect communication
Distributed System-Multicast & Indirect communicationDistributed System-Multicast & Indirect communication
Distributed System-Multicast & Indirect communication
 

Viewers also liked

Clock Synchronization in Distributed Systems
Clock Synchronization in Distributed SystemsClock Synchronization in Distributed Systems
Clock Synchronization in Distributed SystemsZbigniew Jerzak
 
Clock Synchronization (Distributed computing)
Clock Synchronization (Distributed computing)Clock Synchronization (Distributed computing)
Clock Synchronization (Distributed computing)Sri Prasanna
 
04 ota053001 clock synchronization theory issue1.0
04 ota053001 clock synchronization theory issue1.004 ota053001 clock synchronization theory issue1.0
04 ota053001 clock synchronization theory issue1.0Vũ Trần Huy
 
Microprocessor presentation
Microprocessor presentationMicroprocessor presentation
Microprocessor presentationUmer Kalyar
 
Election algorithms
Election algorithmsElection algorithms
Election algorithmsAnkush Kumar
 
Clock synchronization using servo-clock
Clock synchronization using servo-clockClock synchronization using servo-clock
Clock synchronization using servo-clockAndré Costa Lima
 
Marketing and concepts of database.
Marketing and concepts of database.Marketing and concepts of database.
Marketing and concepts of database.Ashutosh Mishra
 
2013 Jeep Grand Cherokee Owners Manual (courtesy of The Jeep Store)
2013 Jeep Grand Cherokee Owners Manual (courtesy of The Jeep Store)2013 Jeep Grand Cherokee Owners Manual (courtesy of The Jeep Store)
2013 Jeep Grand Cherokee Owners Manual (courtesy of The Jeep Store)The Jeep Store NJ Jeep Dealership
 
Distributed computing time
Distributed computing timeDistributed computing time
Distributed computing timeDeepak John
 
Flexible Symmetric Global Snapshot
Flexible Symmetric Global Snapshot Flexible Symmetric Global Snapshot
Flexible Symmetric Global Snapshot Ashutosh Jaiswal
 
Distributed algorithm for electronic voting system
Distributed algorithm for electronic voting systemDistributed algorithm for electronic voting system
Distributed algorithm for electronic voting systemCasper Chingwe
 
Distributed Snapshots
Distributed SnapshotsDistributed Snapshots
Distributed Snapshotsawesomesos
 
network filesystem briefs
network filesystem briefsnetwork filesystem briefs
network filesystem briefsbergwolf
 
Global state recording in Distributed Systems
Global state recording in Distributed SystemsGlobal state recording in Distributed Systems
Global state recording in Distributed SystemsArsnet
 
Posix threads(asha)
Posix threads(asha)Posix threads(asha)
Posix threads(asha)Nagarajan
 
Day 2 global_state_and_snapshot_algorithms
Day 2 global_state_and_snapshot_algorithmsDay 2 global_state_and_snapshot_algorithms
Day 2 global_state_and_snapshot_algorithmsVI Ni
 

Viewers also liked (20)

Clock Synchronization in Distributed Systems
Clock Synchronization in Distributed SystemsClock Synchronization in Distributed Systems
Clock Synchronization in Distributed Systems
 
Clock Synchronization (Distributed computing)
Clock Synchronization (Distributed computing)Clock Synchronization (Distributed computing)
Clock Synchronization (Distributed computing)
 
Clock Synchronization
Clock SynchronizationClock Synchronization
Clock Synchronization
 
04 ota053001 clock synchronization theory issue1.0
04 ota053001 clock synchronization theory issue1.004 ota053001 clock synchronization theory issue1.0
04 ota053001 clock synchronization theory issue1.0
 
Presentation
PresentationPresentation
Presentation
 
Microprocessor presentation
Microprocessor presentationMicroprocessor presentation
Microprocessor presentation
 
Election algorithms
Election algorithmsElection algorithms
Election algorithms
 
Clock synchronization using servo-clock
Clock synchronization using servo-clockClock synchronization using servo-clock
Clock synchronization using servo-clock
 
Marketing and concepts of database.
Marketing and concepts of database.Marketing and concepts of database.
Marketing and concepts of database.
 
2013 Jeep Grand Cherokee Owners Manual (courtesy of The Jeep Store)
2013 Jeep Grand Cherokee Owners Manual (courtesy of The Jeep Store)2013 Jeep Grand Cherokee Owners Manual (courtesy of The Jeep Store)
2013 Jeep Grand Cherokee Owners Manual (courtesy of The Jeep Store)
 
Distributed computing time
Distributed computing timeDistributed computing time
Distributed computing time
 
LDAP
LDAPLDAP
LDAP
 
Flexible Symmetric Global Snapshot
Flexible Symmetric Global Snapshot Flexible Symmetric Global Snapshot
Flexible Symmetric Global Snapshot
 
Distributed algorithm for electronic voting system
Distributed algorithm for electronic voting systemDistributed algorithm for electronic voting system
Distributed algorithm for electronic voting system
 
Distributed Snapshots
Distributed SnapshotsDistributed Snapshots
Distributed Snapshots
 
network filesystem briefs
network filesystem briefsnetwork filesystem briefs
network filesystem briefs
 
Global state recording in Distributed Systems
Global state recording in Distributed SystemsGlobal state recording in Distributed Systems
Global state recording in Distributed Systems
 
Posix threads(asha)
Posix threads(asha)Posix threads(asha)
Posix threads(asha)
 
Day 2 global_state_and_snapshot_algorithms
Day 2 global_state_and_snapshot_algorithmsDay 2 global_state_and_snapshot_algorithms
Day 2 global_state_and_snapshot_algorithms
 
La2 powerpoint
La2 powerpointLa2 powerpoint
La2 powerpoint
 

Similar to clock synchronization in Distributed System

Similar to clock synchronization in Distributed System (20)

Shoaib
ShoaibShoaib
Shoaib
 
3. syncro. in distributed system
3. syncro. in distributed system3. syncro. in distributed system
3. syncro. in distributed system
 
Clock.pdf
Clock.pdfClock.pdf
Clock.pdf
 
Synch
SynchSynch
Synch
 
Shoaib
ShoaibShoaib
Shoaib
 
Chap 5
Chap 5Chap 5
Chap 5
 
Chapter 10
Chapter 10Chapter 10
Chapter 10
 
Chapter 5-Synchronozation.ppt
Chapter 5-Synchronozation.pptChapter 5-Synchronozation.ppt
Chapter 5-Synchronozation.ppt
 
Unit iii-Synchronization
Unit iii-SynchronizationUnit iii-Synchronization
Unit iii-Synchronization
 
Chapter 6-Synchronozation2.ppt
Chapter 6-Synchronozation2.pptChapter 6-Synchronozation2.ppt
Chapter 6-Synchronozation2.ppt
 
Synchronization
SynchronizationSynchronization
Synchronization
 
Clock Synchronization in Distributed Systems
Clock Synchronization in Distributed SystemsClock Synchronization in Distributed Systems
Clock Synchronization in Distributed Systems
 
CS6601-Unit 4 Distributed Systems
CS6601-Unit 4 Distributed SystemsCS6601-Unit 4 Distributed Systems
CS6601-Unit 4 Distributed Systems
 
Clock synchronization
Clock synchronizationClock synchronization
Clock synchronization
 
Chapter 6 synchronization
Chapter 6 synchronizationChapter 6 synchronization
Chapter 6 synchronization
 
Lesson 05 - Time in Distrributed System.pptx
Lesson 05 - Time in Distrributed System.pptxLesson 05 - Time in Distrributed System.pptx
Lesson 05 - Time in Distrributed System.pptx
 
Time in distributed systmes
Time in distributed systmesTime in distributed systmes
Time in distributed systmes
 
Real Time Systems
Real Time SystemsReal Time Systems
Real Time Systems
 
D021201024031
D021201024031D021201024031
D021201024031
 
Ds ppt imp.
Ds ppt imp.Ds ppt imp.
Ds ppt imp.
 

More from Harshita Ved

Cyber Law & Forensics
Cyber Law & ForensicsCyber Law & Forensics
Cyber Law & ForensicsHarshita Ved
 
Cyber Law & Forensics
Cyber Law & ForensicsCyber Law & Forensics
Cyber Law & ForensicsHarshita Ved
 
Cyber Law & Forensics
Cyber Law & ForensicsCyber Law & Forensics
Cyber Law & ForensicsHarshita Ved
 
Cyber Law & Forensics
Cyber Law & ForensicsCyber Law & Forensics
Cyber Law & ForensicsHarshita Ved
 
Cyber Crime Investigation
Cyber Crime InvestigationCyber Crime Investigation
Cyber Crime InvestigationHarshita Ved
 
Multimedia system, Architecture & Databases
Multimedia system, Architecture & DatabasesMultimedia system, Architecture & Databases
Multimedia system, Architecture & DatabasesHarshita Ved
 
Ink jet and thermal printers
Ink jet and thermal printersInk jet and thermal printers
Ink jet and thermal printersHarshita Ved
 

More from Harshita Ved (7)

Cyber Law & Forensics
Cyber Law & ForensicsCyber Law & Forensics
Cyber Law & Forensics
 
Cyber Law & Forensics
Cyber Law & ForensicsCyber Law & Forensics
Cyber Law & Forensics
 
Cyber Law & Forensics
Cyber Law & ForensicsCyber Law & Forensics
Cyber Law & Forensics
 
Cyber Law & Forensics
Cyber Law & ForensicsCyber Law & Forensics
Cyber Law & Forensics
 
Cyber Crime Investigation
Cyber Crime InvestigationCyber Crime Investigation
Cyber Crime Investigation
 
Multimedia system, Architecture & Databases
Multimedia system, Architecture & DatabasesMultimedia system, Architecture & Databases
Multimedia system, Architecture & Databases
 
Ink jet and thermal printers
Ink jet and thermal printersInk jet and thermal printers
Ink jet and thermal printers
 

Recently uploaded

Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlysanyuktamishra911
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Christo Ananth
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations120cr0395
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordAsst.prof M.Gokilavani
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)Suman Mia
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).pptssuser5c9d4b1
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdfankushspencer015
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxpranjaldaimarysona
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSRajkumarAkumalla
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...roncy bisnoi
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...ranjana rawat
 

Recently uploaded (20)

Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
 
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
247267395-1-Symmetric-and-distributed-shared-memory-architectures-ppt (1).ppt
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptx
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
 

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