Distribuerede systemer – 5. marts 2001 Presentation based on slides by Coulouris et al.

Slides:



Advertisements
Similar presentations
1DT066 D ISTRIBUTED I NFORMATION S YSTEM Time, Coordination and Agreement 1.
Advertisements

Time and synchronization (“There’s never enough time…”)
Time and Clock Primary standard = rotation of earth De facto primary standard = atomic clock (1 atomic second = 9,192,631,770 orbital transitions of Cesium.
Computer Science 425 Distributed Systems CS 425 / ECE 428  2013, I. Gupta, K. Nahrtstedt, S. Mitra, N. Vaidya, M. T. Harandi, J. Hou.
CSE 486/586, Spring 2013 CSE 486/586 Distributed Systems Time and Synchronization Steve Ko Computer Sciences and Engineering University at Buffalo.
Computer Science 425 Distributed Systems CS 425 / CSE 424 / ECE 428 Fall 2011 August 30, 2011 Lecture 3 Time and Synchronization Reading: Sections
Time and Global States Ali Fanian Isfahan University of Technology
From Coulouris, Dollimore, Kindberg and Blair Distributed Systems: Concepts and Design Edition 5, © Addison-Wesley 2012 Exercises for Chapter 14: TIME.
L-8 Synchronizing Physical Clocks 1 Announcements Proj1 checkpoint – due midnight tonight HW1 checkpoint – due 2/12 2.
CS 582 / CMPE 481 Distributed Systems Synchronization.
Distributed Systems Fall 2010 Time and synchronization.
Slides for Chapter 10: Time and Global State
Teaching material based on Distributed Systems: Concepts and Design, Edition 3, Addison-Wesley Copyright © George Coulouris, Jean Dollimore, Tim.
Time and Global States Chapter 11. Why time? Time is an Important and interesting issue in distributes systems. One we can measure accurately. Can use.
Time in Distributed Systems Distributed Systems. Why Time is Important? If you work in the industry, you never have to worry about this You’ll rarely.
Teaching material based on Distributed Systems: Concepts and Design, Edition 3, Addison-Wesley Copyright © George Coulouris, Jean Dollimore, Tim.
© Chinese University, CSE Dept. Distributed Systems / Distributed Systems Topic 9: Time, Coordination and Replication Dr. Michael R. Lyu Computer.
Distributed Systems CS Synchronization – Part II Lecture 8, Sep 28, 2011 Majd F. Sakr, Vinay Kolar, Mohammad Hammoud.
1 Slides for Chapter 10: Time (and Global State) From Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edition 3, © Addison-Wesley.
CSE 486/586, Spring 2012 CSE 486/586 Distributed Systems Logical Time Steve Ko Computer Sciences and Engineering University at Buffalo.
EEC-681/781 Distributed Computing Systems Lecture 10 Wenbing Zhao Cleveland State University.
EEC-681/781 Distributed Computing Systems Lecture 10 Wenbing Zhao Cleveland State University.
Lecture 9: Time & Clocks CDK4: Sections 11.1 – 11.4 CDK5: Sections 14.1 – 14.4 TVS: Sections 6.1 – 6.2 Topics: Synchronization Logical time (Lamport) Vector.
Lecture 2-1 CS 425/ECE 428 Distributed Systems Lecture 2 Time & Synchronization Reading: Klara Nahrstedt.
PHYSICAL AND LOGICAL TIME EE324 Lecture 11 Last Time– RPC  Why remote procedure calls?  Simple way to pass control and data  Elegant transparent way.
1 Physical Clocks need for time in distributed systems physical clocks and their problems synchronizing physical clocks u coordinated universal time (UTC)
1DT066 D ISTRIBUTED I NFORMATION S YSTEM Time, Coordination and Agreement 1.
CSE 486/586, Spring 2013 CSE 486/586 Distributed Systems Logical Time Steve Ko Computer Sciences and Engineering University at Buffalo.
Computer Science Lecture 10, page 1 CS677: Distributed OS Last Class: Naming Name distribution: use hierarchies DNS X.500 and LDAP.
Time and Coordination March 13, Time and Coordination What is time? :-)  Issue: How do you coordinate distributed computers if there is no global.
TIME AND GLOBAL STATES Đàm Vĩnh Tường ( ) Nguyễn Lê Anh Đào ( ) Trần Viễn Phúc ( )
Chapter 10: Time and Global States
Slides for Chapter 9: Time and Global State From Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edition 4, © Pearson Education.
Communication & Synchronization Why do processes communicate in DS? –To exchange messages –To synchronize processes Why do processes synchronize in DS?
1 Time (and Global State). 3 Time – basics zWe want to know when something happened - Physical and logical clocks. zAlgorithms may depend upon clock.
Distributed Systems Principles and Paradigms Chapter 05 Synchronization.
Synchronization Distributed System. Why synchronization? Two sharpshooters in a multiplayer online game kill the same target. Which one gets the points?
Lecture 9: Time and clocks (Chap 11) Haibin Zhu, PhD. Assistant Professor Department of Computer Science Nipissing University © 2002.
Time This powerpoint presentation has been adapted from: 1) sApr20.ppt.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
Real-Time & MultiMedia Lab Synchronization Distributed System Jin-Seung,KIM.
Distributed Systems Concepts and Design Chapter 11: Time and Global States Steve Wallis, Raymond Ho, Bruce Hammer.
Time and global states Chapter 11. Outline Introduction Clocks, events and process states Synchronizing physical clocks Logical time and logical clocks.
Distributed Systems CS Synchronization – Part I Lecture 8, Sep 23, 2013 Mohammad Hammoud.
Distributed Systems Topic 5: Time, Coordination and Agreement
CS 582 / CMPE 481 Distributed Systems Synchronization.
6 SYNCHRONIZATION. introduction processes synchronize –exclusive access. –agree on the ordering of events much more difficult compared to synchronization.
CSE 486/586 CSE 486/586 Distributed Systems Time and Synchronization Steve Ko Computer Sciences and Engineering University at Buffalo.
Distributed Web Systems Time and Global State Lecturer Department University.
Topic 7: Time and Global State Dr. Ayman Srour Faculty of Applied Engineering and Urban Planning University of Palestine.
Distributed Computing
Time and Global States Ali Fanian Isfahan University of Technology
CSE 486/586 Distributed Systems Time and Synchronization
Time and Clock.
Logical time (Lamport)
Distributed Systems CS
Time and Clock.
DISTRIBUTED SYSTEMS Principles and Paradigms Second Edition ANDREW S
Exercises for Chapter 11: TIME AND GLOBAL STATES
CDK: Sections 11.1 – 11.4 TVS: Sections 6.1 – 6.2
Slides for Chapter 11: Time and Global State
Distributed Synchronization
Logical time (Lamport)
Logical time (Lamport)
Jenhui Chen Office number:
CSE 486/586 Distributed Systems Time and Synchronization
Slides for Chapter 14: Time and Global States
Logical time (Lamport)
Last Class: Naming Name distribution: use hierarchies DNS
Outline Theoretical Foundations
Presentation transcript:

Distribuerede systemer – 5. marts 2001 Presentation based on slides by Coulouris et al

Slides for Chapter 10: Time (and Global State) From Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edition 3, © Addison-Wesley 2001

Time - purpose zWe want to know when something happened, e.g., for the purpose of: yE-commerce. ymake utility. zAlgorithms may depend upon clock synchronization, e.g.: yMaintain consistency of distributed data. yEliminating the processing of duplicate updates. zNo global notion of time.

Time – system model zN processes: yEach executes on a single processor. yNo shared memory. yOnly communication means is exchange of messages. zpi has state si. zAn event is the occurrence of a single action, i.e., either: y An internal state-transforming action by pi, or y A communication action. ze (->i) e’ iff e occurs before e’ in pi.

Time - clocks zEach computer contains its own physical clock. zThe software clock Ci can be used to timestamp any event at pi. zClock skew: The instantaneous difference between the readings of any two clocks. zClock drift: Clocks count time at different rates and so diverge. zClock drift rate: The difference in reading between a given clock and a nominal perfect reference clock per time unit measured by the reference clock.

Time - skew between computer clocks in a distributed system

Time – Coordinated Universal Time (UTC) zAn international standard for timekeeping. zBased on atomic time. zSynchronizes with astronomical time using leap seconds. zUTC signals are synchronized and broadcast regularly from land-based radio stations and satellites. zComputers with receivers attached can synchronize their clocks with these timing signals.

Synchronizing physical clocks - basics zExternal synchronization: For each i, synchronize Ci with an authoritative, external source of time. zInternal synchronization: For each i,j, synchronize Ci and Cj with each other. zOther issues: Correctness, monotonicity, faulty clocks, crash failures, arbitrary failures.

Synchronizing physical clocks – in a synchronous system zIn a synchronous system, bounds are known for: yThe drift rates of clocks. yThe maximum message transmission delay. yThe time to execute each step of a process. zOne process sends the time t on its local clock to the other in a message m. The receiving process could set its time to: t + T(trans). zT(trans) is subject to variation and unknown – but within limits; T(trans) in [min,max]. zBetter for receiver to set its time to: t + (max+min)/2.

Synchronizing physical clocks – clock synchronization using a time server (Cristian’s method) m r m t p Time server,S p records total round-trip time T(round); p sets its time to t+T(round)/2; If minimal transmission time is known, accuracy can be calculated. Problem: single-point-of-failure. External synchronization

Synchronizing physical clocks – the Berkeley algorithm zInternal synchronization. zA coordinator computer is chosen to act as master. zMaster periodically polls the other computers (the slaves). zSlaves send back their clock values to master. zMaster calculates an average (taking the roundtrip times into account). zMaster sends the amount by which each individual slave’s clock requires adjustment. zThe algorithm eliminates readings from faulty clocks.

Synchronizing physical clocks – the Network Time Protocol (NTP) zChief design aims and features: yTo provide a service enabling clients across the Internet to be synchronized accurately to UTC. yTo provide a reliable service that can survive lengthy losses of connectivity. yTo enable clients to resynchronize sufficiently frequently to offset the rates of drift found in most computers. yTo provide protection against interference with the timeservice, whether malicious or accidental. zArchitecture: yA network of servers located across the Internet. yPrimary servers connected directly to time source. ySecondary servers synchronized with primary servers. yServers connected in logical hierarchy, synchronization subnet. yThree modes of sync.: Multicast, procedure-call, symmetric.

Synchronizing physical clocks – An example synchronization subnet in an NTP implementation Note: Arrows denote synchronization control, numbers denote strata.

Synchronizing physical clocks – Messages exchanged between a pair of NTP peers T i T i-1 T i-2 T i-3 Server B Server A Time mm' Time

Logical time and logical clocks - basics zSince we cannot synchronize clocks perfectly across a distributed system, we cannot in general use physical time to find out the order of any arbitrary pair of events occurring within it. zEvents can be ordered by the happened-before relation: yIf two events occurred at the same process pi, then they occurred in the order in which pi observes them (->i). yWhenever a message is sent between processes, the event of sending the message occurred before the event of receiving the message.

Logical time and logical clocks - example events occurring at three processes

Logical time and logical clocks – Lamport logical clocks and timestamps zA Lamport logical clock is a monotonically increasing software counter. zEach process pi keeps its own logical clock Li which is used to apply Lamport timestamps to events. zTo capture the happened-before relation ->, processes update their logical clocks and transmit the values of their logical clocks in messages as follows: yBefore each event at pi: Li := Li+1 yWhen pi sends a message m, it piggybacks t=Li. yWhen pj receives (m,t): Lj := max(Lj,t)+1. ze -> e’ => L(e) < L(e’).

Logical time and logical clocks – Lamport timestamps for example events

Logical time and logical clocks – Vector timestamps for example events Vi[i]: The number of events that pi has timestamped; Vi[j]: The number of events that have occurred at pj that pi has potentially been affected by, j <> i.

Summary zTime in general. zSynchronization of physical clocks: yIn a synchronous system. yCristian’s method. yThe Berkeley algorithm. yThe Network Time Protocol (NTP). zLogical time and logical clocks: yThe happened-before relation. yLamport’s logical clocks and Lamport’s timestamps. yVector timestamps.