Time and Clock Primary standard = rotation of earth

Slides:



Advertisements
Similar presentations
Time, Clocks, and the Ordering of Events in a Distributed System
Advertisements

COS 461 Fall 1997 Time and Clocks u uses of time in distributed systems: –time-based algorithms (e.g. in security) –distributed make –gathering event traces.
Last Class: Clock Synchronization
CS4231 Parallel and Distributed Algorithms AY 2006/2007 Semester 2 Lecture 4 Instructor: Haifeng YU.
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.
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.
Dr. Kalpakis CMSC 621, Advanced Operating Systems. Logical Clocks and Global State.
Distributed Systems Spring 2009
CMPT 431 Dr. Alexandra Fedorova Lecture VIII: Time And Global Clocks.
CPSC 668Set 12: Causality1 CPSC 668 Distributed Algorithms and Systems Fall 2009 Prof. Jennifer Welch.
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.
Logical Time and Logical Clocks
Time, Clocks and the Ordering of Events in a Distributed System - by Leslie Lamport.
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.
Computer Science Lecture 10, page 1 CS677: Distributed OS Last Class: Clock Synchronization Physical clocks Clock synchronization algorithms –Cristian’s.
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.
Distributed Systems Foundations Lecture 1. Main Characteristics of Distributed Systems Independent processors, sites, processes Message passing No shared.
Dr. Kalpakis CMSC 621, Advanced Operating Systems. Fall 2003 URL: Logical Clocks and Global State.
Lecture 2-1 CS 425/ECE 428 Distributed Systems Lecture 2 Time & Synchronization Reading: Klara Nahrstedt.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
Chapter 5.
CSE 486/586, Spring 2013 CSE 486/586 Distributed Systems Logical Time Steve Ko Computer Sciences and Engineering University at Buffalo.
Donghyun (David) Kim Department of Mathematics and Physics North Carolina Central University 1 Project Reference Some slides are in courtesy of Dr. Erciyes,
Logical Clocks n event ordering, happened-before relation (review) n logical clocks conditions n scalar clocks condition implementation limitation n vector.
Computer Science Lecture 10, page 1 CS677: Distributed OS Last Class: Naming Name distribution: use hierarchies DNS X.500 and LDAP.
Page 1 Logical Clocks Paul Krzyzanowski Distributed Systems Except as otherwise noted, the content of this presentation is.
Synchronization. Why we need synchronization? It is important that multiple processes do not access shared resources simultaneously. Synchronization in.
Communication & Synchronization Why do processes communicate in DS? –To exchange messages –To synchronize processes Why do processes synchronize in DS?
Synchronization CSCI 4900/6900. Importance of Clocks & Synchronization Avoiding simultaneous access of resources –Cooperate to grant exclusive access.
D u k e S y s t e m s Asynchronous Replicated State Machines (Causal Multicast and All That) Jeff Chase Duke University.
DISTRIBUTED SYSTEMS Principles and Paradigms Second Edition ANDREW S
Feb 15, 2001CSCI {4,6}900: Ubiquitous Computing1 Announcements.
Event Ordering. CS 5204 – Operating Systems2 Time and Ordering The two critical differences between centralized and distributed systems are: absence of.
6 SYNCHRONIZATION. introduction processes synchronize –exclusive access. –agree on the ordering of events much more difficult compared to synchronization.
Hwajung Lee. Primary standard = rotation of earth De facto primary standard = atomic clock (1 atomic second = 9,192,631,770 orbital transitions of Cesium.
Lecture 1: Logical and Physical Time with some Applications Anish Arora CSE 6333 Notes include material from Dr. Jeff Brumfield.
6.2 Logical Clocks Kranthi Koya09/23/2015. Overview Introduction Lamport’s Logical Clocks Vector Clocks Research Areas Conclusion.
Logical Clocks event ordering, happened-before relation (review) logical clocks conditions scalar clocks  condition  implementation  limitation vector.
Proof of liveness: an example
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS
Logical time Causality between events is fundamental to the design of parallel and distributed systems. In distributed systems, it is not possible to have.
Prof. Leonardo Mostarda University of Camerino
Replace all references to “process” by referring to node – or say the synonimity expilictly at the beginning.
Time and Clock Primary standard = rotation of earth
CS 3700 Networks and Distributed Systems
CSC 8320 Advanced Operating System
Overview of Ordering and Logical Time
SYNCHORNIZATION Logical Clocks.
Time and Clock.
Logical time (Lamport)
CS 3700 Networks and Distributed Systems
Time and Clock.
Replace all references to “process” by referring to node – or say the synonimity expilictly at the beginning.
Logical Clocks and Casual Ordering
Time And Global Clocks CMPT 431.
Event Ordering.
CS 425 / ECE 428  2013, I. Gupta, K. Nahrtstedt, S. Mitra, N. Vaidya, M. T. Harandi, J. Hou.
ITEC452 Distributed Computing Lecture 10 Time in a Distributed System
Chapter 5 (through section 5.4)
CDK: Sections 11.1 – 11.4 TVS: Sections 6.1 – 6.2
Distributed Synchronization
Logical time (Lamport)
Logical time (Lamport)
Chap 5 Distributed Coordination
Logical time (Lamport)
Proof of liveness: an example
Last Class: Naming Name distribution: use hierarchies DNS
Outline Theoretical Foundations
Presentation transcript:

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 133 atom. 86400 atomic sec = 1 solar day – 3 ms Coordinated Universal Time (UTC) = GMT ± number of hours in your time zone

Global positioning system: GPS Location and precise time computed by triangulation Right now GPS time is nearly 14 seconds ahead of UTC, since It does not use leap sec. correction Per the theory of relativity, an additional correction is needed. Locally compensate by the Receivers. A system of 32 satellites broadcast accurate spatial corordinates and time maintained by atomic clocks

What does “concurrent” mean? Simultaneous? Happening at the same time? NO. There is nothing called simultaneous in the physical world. Alice Explosion 2 Explosion 1 Bob

Sequential and Concurrent events Sequential = Totally ordered in time. Total ordering is feasible in a single process that has only one clock. This is not true in a distributed system. Two issues are important here: How to synchronize physical clocks ? Can we define sequential and concurrent events without using physical clocks?

Causality Causality helps identify sequential and concurrent events without using physical clocks. Joke  Re: joke ( implies causally ordered before or happened before) Message sent  message received Local ordering: a  b  c (based on the local clock)

Defining causal relationship Rule 1. If a, b are two events in a single process P, and the time of a is less than the time of b then a  b. Rule 2. If a = sending a message, and b = receipt of that message, then a  b. Rule 3. a  b  b  c  a  c

Example of causality Concurrency = absence of causal order a  d since (a  b  b  c  c  d) e  d since (e  f  f  d) (Note that  defines a PARTIAL order). Is g f or f g? NO.They are concurrent. . Concurrency = absence of causal order

Logical clocks Each process maintains its logical clock as follows: LC1. Each time a local event takes place, increment LC. LC2. Append the value of LC to outgoing messages. LC3. When receiving a message, set LC to 1 + max (local LC, message LC) LC is a counter. Its value respects causal ordering as follows a  b  LC(a) < LC(b) Note that LC(a) < LC(b) does NOT imply a  b.

Total order in a distributed system Total order is important for some applications like scheduling (first-come first served). But total order does not exist! What can we do? Strengthen the causal order  to define a total order (<<) among events. Use LC to define total order (in case two LC’s are equal, process id’s will be used to break the tie). Let a, b be events in processes i and j respectively. Then a << b iff -- LC(a) < LC(b) OR -- LC(a) = LC(b) and i < j a  b  a << b, but the converse is not true. The value of LC of an event is called its timestamp.

Vector clock Causality detection can be an important issue in applications like group communication. Logical clocks do not detect causal ordering. Vector clocks do. a  b  VC(a) < VC(b) C may receive Re:joke before joke, which is bad!

Implementing VC {Actions of process j} jth component of VC {Actions of process j} 1. Increment VC[j] for each local event. 2. Append the local VC to every outgoing message. 3. When a message with a vector timestamp T arrives from j, first increment the jth component VC[j] of the local vector clock, and then update it as follows: k: 0 ≤ k ≤N-1:: VC[k] := max (T[k], VC[k]).

Vector clocks Example [3, 3, 4, 5, 3, 2, 1, 4] < [3, 3, 4, 5, 3, 2, 2, 5] But, [3, 3, 4, 5, 3, 2, 1, 4] and [3, 3, 4, 5, 3, 2, 2, 3] are not comparable Let a, b be two events. Define. VC(a) < VC(b) iff i : 0 ≤ i ≤ N-1 : VC(a)[i] ≤ VC(b)[i], and  j : 0 ≤ j ≤ N-1 : VC(a)[j] < VC(b)[j], VC(a) < VC(b)  a  b Causality detection