SlideShare una empresa de Scribd logo
1 de 25
1
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.
2
 It is impossible to guarantee that physical
clocks run at the same frequency
 Lack of global time, can cause problems
 Example: UNIX make
◦ Edit output.c at a client
◦ output.o is at a server (compile at server)
◦ Client machine clock can be lagging behind the
server machine clock
When each machine has its own clock, an event
that occurred after another event may
nevertheless be assigned an earlier time.
• Every computer is equipped with CMOS clock circuit.
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.
• When counter reaches zero, an interrupt is generated;
this is the clock tick.
• Clock tick have a frequency of 60-100 ticks per
second.
5
• 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.
6
☞ 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.
7
• 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.
8
 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
9
• 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.
10
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.
11
• NTP is an application layer protocol
• Default port number 123
• Uses standard UDP Internet transport protocol
• Adjust system clock as close to UTC as possible
over the Internet.
• Enable sufficiently frequently resynchronizations.
(scaling well on large num
• The NTP service is provided by a network of servers
located across the Internet.
• Primary servers are connected directly to a time
source. (e.g. a radio clock receiving UTC, GPS).
bers of clients and servers)
12
 Secondary servers are synchronized with primary
servers.
 The servers are connected in a logical hierarchy
called a synchronization subnet. Each level of the
synchronization subnet is called stratum.
13
 A requests time of B at its own T1
 B receives request at its T2, records
 B responds at its T3, sending values of T2 and T3
 A receives response at its T4
 Question: what is θ = TB – TA?
Synchronization in
Distributed SystemsCS-4513 D-term 2008
14
A
B
T1
T2 T3
T4
 Question: what is θ = TB – TA?
 Assume transit time is approximately the same both
ways
 Assume that B is the time server that A wants to
synchronize to
Synchronization in
Distributed SystemsCS-4513 D-term 2008
15
A
B
T1
T2 T3
T4
( ) ( )2314 TTTT −−−
 A knows (T4 – T1) from its own clock
 B reports T3 and T2 in response to NTP
request
 A computes total transit time of
Synchronization in
Distributed SystemsCS-4513 D-term 2008
16
A
B
T1
T2 T3
T4
( ) ( )
2
2314 TTTT −−−
( ) ( )
2
2314
3
TTTT
T
−−−
+
 One-way transit time is approximately ½ total,
i.e.,
 B’s clock at T4 reads approximately
Synchronization in
Distributed SystemsCS-4513 D-term 2008
17
A
B
T1
T2 T3
T4
 Servers organized as strata
◦ Stratum 0 server adjusts itself to WWV directly
◦ Stratum 1 adjusts self to Stratum 0 servers
◦ Etc.
 Within a stratum, servers adjust with each other
CS-4513 D-term 2008
Synchronization in Distributed
Systems 18
LogicaL cLocks
19
 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.
20
• 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 .
21
 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
22
Figure 6-9. (a) Three processes, each with its own clock.
The clocks run at different rates.
 For two events a and b in same process p1
 C(b)= C(a)+1
 If a is sending process and b is receiving process
of pi and pj then,
 Cj(b)=max((Ci(a)+1),Cj(b))
24
Lamport’s algorithm corrects the clocks.

Más contenido relacionado

La actualidad más candente

Inter Process Communication Presentation[1]
Inter Process Communication Presentation[1]Inter Process Communication Presentation[1]
Inter Process Communication Presentation[1]Ravindra Raju Kolahalam
 
Group Communication (Distributed computing)
Group Communication (Distributed computing)Group Communication (Distributed computing)
Group Communication (Distributed computing)Sri Prasanna
 
CS9222 ADVANCED OPERATING SYSTEMS
CS9222 ADVANCED OPERATING SYSTEMSCS9222 ADVANCED OPERATING SYSTEMS
CS9222 ADVANCED OPERATING SYSTEMSKathirvel Ayyaswamy
 
Segmentation in Operating Systems.
Segmentation in Operating Systems.Segmentation in Operating Systems.
Segmentation in Operating Systems.Muhammad SiRaj Munir
 
RPC: Remote procedure call
RPC: Remote procedure callRPC: Remote procedure call
RPC: Remote procedure callSunita Sahu
 
Communication in Distributed Systems
Communication in Distributed SystemsCommunication in Distributed Systems
Communication in Distributed SystemsDilum Bandara
 
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
 
distributed Computing system model
distributed Computing system modeldistributed Computing system model
distributed Computing system modelHarshad Umredkar
 
ELEMENTS OF TRANSPORT PROTOCOL
ELEMENTS OF TRANSPORT PROTOCOLELEMENTS OF TRANSPORT PROTOCOL
ELEMENTS OF TRANSPORT PROTOCOLShashank Rustagi
 
Distributed DBMS - Unit 8 - Distributed Transaction Management & Concurrency ...
Distributed DBMS - Unit 8 - Distributed Transaction Management & Concurrency ...Distributed DBMS - Unit 8 - Distributed Transaction Management & Concurrency ...
Distributed DBMS - Unit 8 - Distributed Transaction Management & Concurrency ...Gyanmanjari Institute Of Technology
 
Types of Load distributing algorithm in Distributed System
Types of Load distributing algorithm in Distributed SystemTypes of Load distributing algorithm in Distributed System
Types of Load distributing algorithm in Distributed SystemDHIVYADEVAKI
 
CS9222 ADVANCED OPERATING SYSTEMS
CS9222 ADVANCED OPERATING SYSTEMSCS9222 ADVANCED OPERATING SYSTEMS
CS9222 ADVANCED OPERATING SYSTEMSKathirvel Ayyaswamy
 
Design Goals of Distributed System
Design Goals of Distributed SystemDesign Goals of Distributed System
Design Goals of Distributed SystemAshish KC
 

La actualidad más candente (20)

Inter Process Communication Presentation[1]
Inter Process Communication Presentation[1]Inter Process Communication Presentation[1]
Inter Process Communication Presentation[1]
 
Memory management
Memory managementMemory management
Memory management
 
Process Management-Process Migration
Process Management-Process MigrationProcess Management-Process Migration
Process Management-Process Migration
 
Group Communication (Distributed computing)
Group Communication (Distributed computing)Group Communication (Distributed computing)
Group Communication (Distributed computing)
 
CS9222 ADVANCED OPERATING SYSTEMS
CS9222 ADVANCED OPERATING SYSTEMSCS9222 ADVANCED OPERATING SYSTEMS
CS9222 ADVANCED OPERATING SYSTEMS
 
Segmentation in Operating Systems.
Segmentation in Operating Systems.Segmentation in Operating Systems.
Segmentation in Operating Systems.
 
RPC: Remote procedure call
RPC: Remote procedure callRPC: Remote procedure call
RPC: Remote procedure call
 
Naming in Distributed System
Naming in Distributed SystemNaming in Distributed System
Naming in Distributed System
 
Communication in Distributed Systems
Communication in Distributed SystemsCommunication in Distributed Systems
Communication 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
 
Data link layer
Data link layer Data link layer
Data link layer
 
distributed Computing system model
distributed Computing system modeldistributed Computing system model
distributed Computing system model
 
ELEMENTS OF TRANSPORT PROTOCOL
ELEMENTS OF TRANSPORT PROTOCOLELEMENTS OF TRANSPORT PROTOCOL
ELEMENTS OF TRANSPORT PROTOCOL
 
The medium access sublayer
 The medium  access sublayer The medium  access sublayer
The medium access sublayer
 
Distributed Coordination-Based Systems
Distributed Coordination-Based SystemsDistributed Coordination-Based Systems
Distributed Coordination-Based Systems
 
Distributed DBMS - Unit 8 - Distributed Transaction Management & Concurrency ...
Distributed DBMS - Unit 8 - Distributed Transaction Management & Concurrency ...Distributed DBMS - Unit 8 - Distributed Transaction Management & Concurrency ...
Distributed DBMS - Unit 8 - Distributed Transaction Management & Concurrency ...
 
Distributed DBMS - Unit 6 - Query Processing
Distributed DBMS - Unit 6 - Query ProcessingDistributed DBMS - Unit 6 - Query Processing
Distributed DBMS - Unit 6 - Query Processing
 
Types of Load distributing algorithm in Distributed System
Types of Load distributing algorithm in Distributed SystemTypes of Load distributing algorithm in Distributed System
Types of Load distributing algorithm in Distributed System
 
CS9222 ADVANCED OPERATING SYSTEMS
CS9222 ADVANCED OPERATING SYSTEMSCS9222 ADVANCED OPERATING SYSTEMS
CS9222 ADVANCED OPERATING SYSTEMS
 
Design Goals of Distributed System
Design Goals of Distributed SystemDesign Goals of Distributed System
Design Goals of Distributed System
 

Destacado

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
 
clock synchronization in Distributed System
clock synchronization in Distributed System clock synchronization in Distributed System
clock synchronization in Distributed System Harshita Ved
 
Unit 1 architecture of distributed systems
Unit 1 architecture of distributed systemsUnit 1 architecture of distributed systems
Unit 1 architecture of distributed systemskaran2190
 
Distributed Systems
Distributed SystemsDistributed Systems
Distributed SystemsRupsee
 
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
 
Distributed information sys
Distributed information sysDistributed information sys
Distributed information sysMeena Chauhan
 
Virtualization (Distributed computing)
Virtualization (Distributed computing)Virtualization (Distributed computing)
Virtualization (Distributed computing)Sri Prasanna
 
Autonomous Pervasive Systems and the Policy Challenges of a Small World!
Autonomous Pervasive Systems and the Policy Challenges of a Small World!Autonomous Pervasive Systems and the Policy Challenges of a Small World!
Autonomous Pervasive Systems and the Policy Challenges of a Small World!Emil Lupu
 
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
 
Communication And Synchronization In Distributed Systems
Communication And Synchronization In Distributed SystemsCommunication And Synchronization In Distributed Systems
Communication And Synchronization In Distributed Systemsguest61205606
 
Synchronization Pradeep K Sinha
Synchronization Pradeep K SinhaSynchronization Pradeep K Sinha
Synchronization Pradeep K SinhaJawwad Rafiq
 
Communications is distributed systems
Communications is distributed systemsCommunications is distributed systems
Communications is distributed systemsSHATHAN
 

Destacado (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 in Distributed System
clock synchronization in Distributed System clock synchronization in Distributed System
clock synchronization in Distributed System
 
6.Distributed Operating Systems
6.Distributed Operating Systems6.Distributed Operating Systems
6.Distributed Operating Systems
 
Clock Synchronization
Clock SynchronizationClock Synchronization
Clock Synchronization
 
Unit 1 architecture of distributed systems
Unit 1 architecture of distributed systemsUnit 1 architecture of distributed systems
Unit 1 architecture of distributed systems
 
Distributed Systems
Distributed SystemsDistributed Systems
Distributed Systems
 
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.
 
Distributed information sys
Distributed information sysDistributed information sys
Distributed information sys
 
Virtualization (Distributed computing)
Virtualization (Distributed computing)Virtualization (Distributed computing)
Virtualization (Distributed computing)
 
Autonomous Pervasive Systems and the Policy Challenges of a Small World!
Autonomous Pervasive Systems and the Policy Challenges of a Small World!Autonomous Pervasive Systems and the Policy Challenges of a Small World!
Autonomous Pervasive Systems and the Policy Challenges of a Small World!
 
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
 
Chapter 10
Chapter 10Chapter 10
Chapter 10
 
Communication And Synchronization In Distributed Systems
Communication And Synchronization In Distributed SystemsCommunication And Synchronization In Distributed Systems
Communication And Synchronization In Distributed Systems
 
Synchronization Pradeep K Sinha
Synchronization Pradeep K SinhaSynchronization Pradeep K Sinha
Synchronization Pradeep K Sinha
 
Communications is distributed systems
Communications is distributed systemsCommunications is distributed systems
Communications is distributed systems
 
Distributed System
Distributed System Distributed System
Distributed System
 
Pervasive Computing
Pervasive ComputingPervasive Computing
Pervasive Computing
 
Wireless Security
Wireless SecurityWireless Security
Wireless Security
 

Similar a Time-driven systems and logical clocks

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
 
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
 
Chapter 5-Synchronozation.ppt
Chapter 5-Synchronozation.pptChapter 5-Synchronozation.ppt
Chapter 5-Synchronozation.pptsirajmohammed35
 
Synchronization of multihop sensor networks in the app layer
Synchronization of multihop sensor networks in the app layerSynchronization of multihop sensor networks in the app layer
Synchronization of multihop sensor networks in the app layerVaishnavi
 
Clock Synchronization in Distributed Systems
Clock Synchronization in Distributed SystemsClock Synchronization in Distributed Systems
Clock Synchronization in Distributed SystemsIRJET Journal
 
Physical and Logical Clocks
Physical and Logical ClocksPhysical and Logical Clocks
Physical and Logical ClocksDilum Bandara
 
Getting date and time from ntp server with esp8266 node mcu
Getting date and time from ntp server with esp8266 node mcuGetting date and time from ntp server with esp8266 node mcu
Getting date and time from ntp server with esp8266 node mcuElaf A.Saeed
 
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
 
CS6601-Unit 4 Distributed Systems
CS6601-Unit 4 Distributed SystemsCS6601-Unit 4 Distributed Systems
CS6601-Unit 4 Distributed SystemsNandakumar P
 

Similar a Time-driven systems and logical clocks (20)

Synch
SynchSynch
Synch
 
3. syncro. in distributed system
3. syncro. in distributed system3. syncro. in distributed system
3. syncro. in distributed system
 
Shoaib
ShoaibShoaib
Shoaib
 
Clock.pdf
Clock.pdfClock.pdf
Clock.pdf
 
Shoaib
ShoaibShoaib
Shoaib
 
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
 
Chap 5
Chap 5Chap 5
Chap 5
 
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
 
Chapter 5-Synchronozation.ppt
Chapter 5-Synchronozation.pptChapter 5-Synchronozation.ppt
Chapter 5-Synchronozation.ppt
 
Synchronization of multihop sensor networks in the app layer
Synchronization of multihop sensor networks in the app layerSynchronization of multihop sensor networks in the app layer
Synchronization of multihop sensor networks in the app layer
 
Clock Synchronization in Distributed Systems
Clock Synchronization in Distributed SystemsClock Synchronization in Distributed Systems
Clock Synchronization in Distributed Systems
 
Physical and Logical Clocks
Physical and Logical ClocksPhysical and Logical Clocks
Physical and Logical Clocks
 
Getting date and time from ntp server with esp8266 node mcu
Getting date and time from ntp server with esp8266 node mcuGetting date and time from ntp server with esp8266 node mcu
Getting date and time from ntp server with esp8266 node mcu
 
slides.06.pptx
slides.06.pptxslides.06.pptx
slides.06.pptx
 
Synchronisation
SynchronisationSynchronisation
Synchronisation
 
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
 
Ds ppt imp.
Ds ppt imp.Ds ppt imp.
Ds ppt imp.
 
Synchronization
SynchronizationSynchronization
Synchronization
 
CS6601-Unit 4 Distributed Systems
CS6601-Unit 4 Distributed SystemsCS6601-Unit 4 Distributed Systems
CS6601-Unit 4 Distributed Systems
 

Más de Sunita Sahu

Introduction to Distributed System
Introduction to Distributed SystemIntroduction to Distributed System
Introduction to Distributed SystemSunita Sahu
 
Writing software requirement document
Writing software requirement documentWriting software requirement document
Writing software requirement documentSunita Sahu
 
Writing software requirement document
Writing software requirement documentWriting software requirement document
Writing software requirement documentSunita Sahu
 
Slowly changing dimension
Slowly changing dimension Slowly changing dimension
Slowly changing dimension Sunita Sahu
 
Fact less fact Tables & Aggregate Tables
Fact less fact Tables & Aggregate Tables Fact less fact Tables & Aggregate Tables
Fact less fact Tables & Aggregate Tables Sunita Sahu
 
Dimensional Modeling
Dimensional ModelingDimensional Modeling
Dimensional ModelingSunita Sahu
 
Attacks in MANET
Attacks in MANETAttacks in MANET
Attacks in MANETSunita Sahu
 

Más de Sunita Sahu (7)

Introduction to Distributed System
Introduction to Distributed SystemIntroduction to Distributed System
Introduction to Distributed System
 
Writing software requirement document
Writing software requirement documentWriting software requirement document
Writing software requirement document
 
Writing software requirement document
Writing software requirement documentWriting software requirement document
Writing software requirement document
 
Slowly changing dimension
Slowly changing dimension Slowly changing dimension
Slowly changing dimension
 
Fact less fact Tables & Aggregate Tables
Fact less fact Tables & Aggregate Tables Fact less fact Tables & Aggregate Tables
Fact less fact Tables & Aggregate Tables
 
Dimensional Modeling
Dimensional ModelingDimensional Modeling
Dimensional Modeling
 
Attacks in MANET
Attacks in MANETAttacks in MANET
Attacks in MANET
 

Último

(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 
(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
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSISrknatarajan
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Call Girls in Nagpur High Profile
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Dr.Costas Sachpazis
 
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
 
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
 
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxthe ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxhumanexperienceaaa
 
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
 
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
 
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...RajaP95
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations120cr0395
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 

Último (20)

★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
★ CALL US 9953330565 ( HOT Young Call Girls In Badarpur delhi NCR
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 
(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...
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
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 )
 
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
 
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxthe ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
 
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
 
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
 
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
 
Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 

Time-driven systems and logical clocks

  • 1. 1
  • 2. 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. 2
  • 3.  It is impossible to guarantee that physical clocks run at the same frequency  Lack of global time, can cause problems  Example: UNIX make ◦ Edit output.c at a client ◦ output.o is at a server (compile at server) ◦ Client machine clock can be lagging behind the server machine clock
  • 4. When each machine has its own clock, an event that occurred after another event may nevertheless be assigned an earlier time.
  • 5. • Every computer is equipped with CMOS clock circuit. 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. • When counter reaches zero, an interrupt is generated; this is the clock tick. • Clock tick have a frequency of 60-100 ticks per second. 5
  • 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. 6
  • 7. ☞ 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. 7
  • 8. • 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. 8
  • 9.  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 9
  • 10. • 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. 10
  • 11. 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. 11
  • 12. • NTP is an application layer protocol • Default port number 123 • Uses standard UDP Internet transport protocol • Adjust system clock as close to UTC as possible over the Internet. • Enable sufficiently frequently resynchronizations. (scaling well on large num • The NTP service is provided by a network of servers located across the Internet. • Primary servers are connected directly to a time source. (e.g. a radio clock receiving UTC, GPS). bers of clients and servers) 12
  • 13.  Secondary servers are synchronized with primary servers.  The servers are connected in a logical hierarchy called a synchronization subnet. Each level of the synchronization subnet is called stratum. 13
  • 14.  A requests time of B at its own T1  B receives request at its T2, records  B responds at its T3, sending values of T2 and T3  A receives response at its T4  Question: what is θ = TB – TA? Synchronization in Distributed SystemsCS-4513 D-term 2008 14 A B T1 T2 T3 T4
  • 15.  Question: what is θ = TB – TA?  Assume transit time is approximately the same both ways  Assume that B is the time server that A wants to synchronize to Synchronization in Distributed SystemsCS-4513 D-term 2008 15 A B T1 T2 T3 T4
  • 16. ( ) ( )2314 TTTT −−−  A knows (T4 – T1) from its own clock  B reports T3 and T2 in response to NTP request  A computes total transit time of Synchronization in Distributed SystemsCS-4513 D-term 2008 16 A B T1 T2 T3 T4
  • 17. ( ) ( ) 2 2314 TTTT −−− ( ) ( ) 2 2314 3 TTTT T −−− +  One-way transit time is approximately ½ total, i.e.,  B’s clock at T4 reads approximately Synchronization in Distributed SystemsCS-4513 D-term 2008 17 A B T1 T2 T3 T4
  • 18.  Servers organized as strata ◦ Stratum 0 server adjusts itself to WWV directly ◦ Stratum 1 adjusts self to Stratum 0 servers ◦ Etc.  Within a stratum, servers adjust with each other CS-4513 D-term 2008 Synchronization in Distributed Systems 18
  • 20.  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. 20
  • 21. • 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 . 21
  • 22.  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 22
  • 23. Figure 6-9. (a) Three processes, each with its own clock. The clocks run at different rates.
  • 24.  For two events a and b in same process p1  C(b)= C(a)+1  If a is sending process and b is receiving process of pi and pj then,  Cj(b)=max((Ci(a)+1),Cj(b)) 24