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 de๏ฌned
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 in๏ฌ‚uence 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 ๏ฌnishes 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 de๏ฌnes 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

Replication in Distributed Systems
Replication in Distributed SystemsReplication in Distributed Systems
Replication in Distributed SystemsKavya Barnadhya Hazarika
ย 
Distributed Operating Systems
Distributed Operating SystemsDistributed Operating Systems
Distributed Operating SystemsUmmiya Mohammedi
ย 
Distributed operating system(os)
Distributed operating system(os)Distributed operating system(os)
Distributed operating system(os)Dinesh Modak
ย 
Synchronization in distributed systems
Synchronization in distributed systems Synchronization in distributed systems
Synchronization in distributed systems SHATHAN
ย 
Design Goals of Distributed System
Design Goals of Distributed SystemDesign Goals of Distributed System
Design Goals of Distributed SystemAshish KC
ย 
Distributed file system
Distributed file systemDistributed file system
Distributed file systemAnamika Singh
ย 
6.distributed shared memory
6.distributed shared memory6.distributed shared memory
6.distributed shared memoryGd Goenka University
ย 
Distributed Systems Introduction and Importance
Distributed Systems Introduction and Importance Distributed Systems Introduction and Importance
Distributed Systems Introduction and Importance SHIKHA GAUTAM
ย 
Distributed system Tanenbaum chapter 1,2,3,4 notes
Distributed system Tanenbaum chapter 1,2,3,4 notes Distributed system Tanenbaum chapter 1,2,3,4 notes
Distributed system Tanenbaum chapter 1,2,3,4 notes SAhammedShakil
ย 
2. Distributed Systems Hardware & Software concepts
2. Distributed Systems Hardware & Software concepts2. Distributed Systems Hardware & Software concepts
2. Distributed Systems Hardware & Software conceptsPrajakta Rane
ย 
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
ย 
Load Balancing in Parallel and Distributed Database
Load Balancing in Parallel and Distributed DatabaseLoad Balancing in Parallel and Distributed Database
Load Balancing in Parallel and Distributed DatabaseMd. Shamsur Rahim
ย 
Fault tolerance in distributed systems
Fault tolerance in distributed systemsFault tolerance in distributed systems
Fault tolerance in distributed systemssumitjain2013
ย 
Trends in distributed systems
Trends in distributed systemsTrends in distributed systems
Trends in distributed systemsJayanthi Radhakrishnan
ย 
Introduction to Parallel and Distributed Computing
Introduction to Parallel and Distributed ComputingIntroduction to Parallel and Distributed Computing
Introduction to Parallel and Distributed ComputingSayed Chhattan Shah
ย 
Clock Synchronization in Distributed Systems
Clock Synchronization in Distributed SystemsClock Synchronization in Distributed Systems
Clock Synchronization in Distributed SystemsZbigniew Jerzak
ย 
Optimistic concurrency control in Distributed Systems
Optimistic concurrency control in Distributed SystemsOptimistic concurrency control in Distributed Systems
Optimistic concurrency control in Distributed Systemsmridul mishra
ย 
8. mutual exclusion in Distributed Operating Systems
8. mutual exclusion in Distributed Operating Systems8. mutual exclusion in Distributed Operating Systems
8. mutual exclusion in Distributed Operating SystemsDr Sandeep Kumar Poonia
ย 

What's hot (20)

Replication in Distributed Systems
Replication in Distributed SystemsReplication in Distributed Systems
Replication in Distributed Systems
ย 
Distributed Operating Systems
Distributed Operating SystemsDistributed Operating Systems
Distributed Operating Systems
ย 
Distributed operating system(os)
Distributed operating system(os)Distributed operating system(os)
Distributed operating system(os)
ย 
Synchronization in distributed systems
Synchronization in distributed systems Synchronization in distributed systems
Synchronization in distributed systems
ย 
Design Goals of Distributed System
Design Goals of Distributed SystemDesign Goals of Distributed System
Design Goals of Distributed System
ย 
Distributed file system
Distributed file systemDistributed file system
Distributed file system
ย 
Distributed Deadlock Detection.ppt
Distributed Deadlock Detection.pptDistributed Deadlock Detection.ppt
Distributed Deadlock Detection.ppt
ย 
6.distributed shared memory
6.distributed shared memory6.distributed shared memory
6.distributed shared memory
ย 
Distributed Systems Introduction and Importance
Distributed Systems Introduction and Importance Distributed Systems Introduction and Importance
Distributed Systems Introduction and Importance
ย 
Distributed system Tanenbaum chapter 1,2,3,4 notes
Distributed system Tanenbaum chapter 1,2,3,4 notes Distributed system Tanenbaum chapter 1,2,3,4 notes
Distributed system Tanenbaum chapter 1,2,3,4 notes
ย 
2. Distributed Systems Hardware & Software concepts
2. Distributed Systems Hardware & Software concepts2. Distributed Systems Hardware & Software concepts
2. Distributed Systems Hardware & Software concepts
ย 
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
ย 
Load Balancing in Parallel and Distributed Database
Load Balancing in Parallel and Distributed DatabaseLoad Balancing in Parallel and Distributed Database
Load Balancing in Parallel and Distributed Database
ย 
Fault tolerance in distributed systems
Fault tolerance in distributed systemsFault tolerance in distributed systems
Fault tolerance in distributed systems
ย 
11. dfs
11. dfs11. dfs
11. dfs
ย 
Trends in distributed systems
Trends in distributed systemsTrends in distributed systems
Trends in distributed systems
ย 
Introduction to Parallel and Distributed Computing
Introduction to Parallel and Distributed ComputingIntroduction to Parallel and Distributed Computing
Introduction to Parallel and Distributed Computing
ย 
Clock Synchronization in Distributed Systems
Clock Synchronization in Distributed SystemsClock Synchronization in Distributed Systems
Clock Synchronization in Distributed Systems
ย 
Optimistic concurrency control in Distributed Systems
Optimistic concurrency control in Distributed SystemsOptimistic concurrency control in Distributed Systems
Optimistic concurrency control in Distributed Systems
ย 
8. mutual exclusion in Distributed Operating Systems
8. mutual exclusion in Distributed Operating Systems8. mutual exclusion in Distributed Operating Systems
8. mutual exclusion in Distributed Operating Systems
ย 

Viewers also liked

Clock Synchronization (Distributed computing)
Clock Synchronization (Distributed computing)Clock Synchronization (Distributed computing)
Clock Synchronization (Distributed computing)Sri Prasanna
ย 
6.Distributed Operating Systems
6.Distributed Operating Systems6.Distributed Operating Systems
6.Distributed Operating SystemsDr Sandeep Kumar Poonia
ย 
Clock Synchronization
Clock SynchronizationClock Synchronization
Clock Synchronizationinnovationwireless
ย 
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
ย 
Presentation
PresentationPresentation
Presentationjunaid abbasi
ย 
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 (Distributed computing)
Clock Synchronization (Distributed computing)Clock Synchronization (Distributed computing)
Clock Synchronization (Distributed computing)
ย 
6.Distributed Operating Systems
6.Distributed Operating Systems6.Distributed Operating Systems
6.Distributed Operating Systems
ย 
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

3. syncro. in distributed system
3. syncro. in distributed system3. syncro. in distributed system
3. syncro. in distributed systemGd Goenka University
ย 
Synchronization Pradeep K Sinha
Synchronization Pradeep K SinhaSynchronization Pradeep K Sinha
Synchronization Pradeep K SinhaJawwad Rafiq
ย 
Chap 5
Chap 5Chap 5
Chap 5suks_87
ย 
Chapter 5-Synchronozation.ppt
Chapter 5-Synchronozation.pptChapter 5-Synchronozation.ppt
Chapter 5-Synchronozation.pptsirajmohammed35
ย 
Unit iii-Synchronization
Unit iii-SynchronizationUnit iii-Synchronization
Unit iii-SynchronizationDhivyaa C.R
ย 
Chapter 6-Synchronozation2.ppt
Chapter 6-Synchronozation2.pptChapter 6-Synchronozation2.ppt
Chapter 6-Synchronozation2.pptMeymunaMohammed1
ย 
Synchronization
SynchronizationSynchronization
SynchronizationAmeena Tijjani
ย 
Clock Synchronization in Distributed Systems
Clock Synchronization in Distributed SystemsClock Synchronization in Distributed Systems
Clock Synchronization in Distributed SystemsIRJET Journal
ย 
CS6601-Unit 4 Distributed Systems
CS6601-Unit 4 Distributed SystemsCS6601-Unit 4 Distributed Systems
CS6601-Unit 4 Distributed SystemsNandakumar P
ย 
Synchronization in distributed computing
Synchronization in distributed computingSynchronization in distributed computing
Synchronization in distributed computingSVijaylakshmi
ย 
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.pptxLagamaPasala
ย 
Time in distributed systmes
Time in distributed systmesTime in distributed systmes
Time in distributed systmesmohammad amid abbasi
ย 
Real Time Systems
Real Time SystemsReal Time Systems
Real Time SystemsDeepak John
ย 

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
ย 
Synchronization Pradeep K Sinha
Synchronization Pradeep K SinhaSynchronization Pradeep K Sinha
Synchronization Pradeep K Sinha
ย 
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
ย 
Synchronization in distributed computing
Synchronization in distributed computingSynchronization in distributed computing
Synchronization in distributed computing
ย 
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
ย 

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

KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlysanyuktamishra911
ย 
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank  Design by Working Stress - IS Method.pdfIntze Overhead Water Tank  Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank Design by Working Stress - IS Method.pdfSuman Jyoti
ย 
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7Call Girls in Nagpur High Profile Call Girls
ย 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptMsecMca
ย 
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Bookingroncy bisnoi
ย 
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELLPVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELLManishPatel169454
ย 
chapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringchapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringmulugeta48
ย 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfRagavanV2
ย 
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Bookingroncy bisnoi
ย 
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
ย 
Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01KreezheaRecto
ย 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756dollysharma2066
ย 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . pptDineshKumar4165
ย 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptDineshKumar4165
ย 
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 for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Christo Ananth
ย 
NFPA 5000 2024 standard .
NFPA 5000 2024 standard                                  .NFPA 5000 2024 standard                                  .
NFPA 5000 2024 standard .DerechoLaboralIndivi
ย 
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxBSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxfenichawla
ย 

Recently uploaded (20)

KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
ย 
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank  Design by Working Stress - IS Method.pdfIntze Overhead Water Tank  Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
ย 
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
ย 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
ย 
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Wakad Call Me 7737669865 Budget Friendly No Advance Booking
ย 
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELLPVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
ย 
chapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringchapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineering
ย 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdf
ย 
Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024
ย 
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
ย 
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...
ย 
Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01Double rodded leveling 1 pdf activity 01
Double rodded leveling 1 pdf activity 01
ย 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
ย 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . ppt
ย 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
ย 
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
ย 
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 for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
ย 
NFPA 5000 2024 standard .
NFPA 5000 2024 standard                                  .NFPA 5000 2024 standard                                  .
NFPA 5000 2024 standard .
ย 
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptxBSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.pptx
BSides Seattle 2024 - Stopping Ethan Hunt From Taking Your Data.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 de๏ฌned 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 in๏ฌ‚uence 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 ๏ฌnishes 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 de๏ฌnes 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