TIME, CLOCKS AND THE ORDERING OF EVENTS IN A DISTRIBUTED SYSTEM

Slides:



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

SES Algorithm SES: Schiper-Eggli-Sandoz Algorithm. No need for broadcast messages. Each process maintains a vector V_P of size N - 1, N the number of processes.
Dr. Kalpakis CMSC 621, Advanced Operating Systems. Logical Clocks and Global State.
Distributed Systems Spring 2009
Distributed Operating Systems CS551 Colorado State University at Lockheed-Martin Lecture 7 -- Spring 2001.
Ordering and Consistent Cuts Presented by Chi H. Ho.
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.
Time, Clocks, and the Ordering of Events in a Distributed System Leslie Lamport (1978) Presented by: Yoav Kantor.
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.
TIME, CLOCKS AND THE ORDERING OF EVENTS IN A DISTRIBUTED SYSTEM L. Lamport Computer Science Laboratory SRI International.
Add Fault Tolerance – order & time Time, Clocks, and the Ordering of Events in a Distributed System Leslie Lamport Optimal Clock Synchronization T.K. Srikanth.
Logical Clocks (2). Topics r Logical clocks r Totally-Ordered Multicasting r Vector timestamps.
Chapter 5.
EECS 262a Advanced Topics in Computer Systems Lecture 14 Lamport Clocks and OCC October 20 th, 2014 John Kubiatowicz Electrical Engineering and Computer.
Logical Clocks n event ordering, happened-before relation (review) n logical clocks conditions n scalar clocks condition implementation limitation n vector.
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.
Synchronization Chapter 5.
Communication & Synchronization Why do processes communicate in DS? –To exchange messages –To synchronize processes Why do processes synchronize in DS?
Event Ordering Greg Bilodeau CS 5204 November 3, 2009.
Time, Clocks, and the Ordering of Events in a Distributed System Leslie Lamport Massachusetts Computer Associates,Inc. Presented by Xiaofeng Xiao.
9/14/20051 Time, Clocks, and the Ordering of Events in a Distributed System by L. Lamport CS 5204 Operating Systems Vladimir Glina Fall 2005.
CS603 Clock Synchronization February 4, What is Clock Synchronization? All nodes agree on time What do we mean by time? –Monotonic –Any observation.
CS 3471 CS 347: Parallel and Distributed Data Management Notes13: Time and Clocks.
CS 347Notes 121 CS 347: Parallel and Distributed Data Management Notes12: Time and Clocks Hector Garcia-Molina.
Feb 15, 2001CSCI {4,6}900: Ubiquitous Computing1 Announcements.
Lamport's Scalar clocks and Singhal-Kshemkalyani’s VC Algorithms
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.
Lecture 1: Logical and Physical Time with some Applications Anish Arora CSE 6333 Notes include material from Dr. Jeff Brumfield.
Ordering of Events in Distributed Systems UNIVERSITY of WISCONSIN-MADISON Computer Sciences Department CS 739 Distributed Systems Andrea C. Arpaci-Dusseau.
CS533 Concepts of Operating Systems Class 8 Time, Clocks, and the Ordering of Events in a Distributed System By Constantia Tryman.
6.2 Logical Clocks Kranthi Koya09/23/2015. Overview Introduction Lamport’s Logical Clocks Vector Clocks Research Areas Conclusion.
11-Jun-16CSE 542: Operating Systems1 Distributed systems Time, clocks, and the ordering of events in a distributed system Leslie Lamport. Communications.
Logical Clocks event ordering, happened-before relation (review) logical clocks conditions scalar clocks  condition  implementation  limitation vector.
Ordering of Events in Distributed Systems UNIVERSITY of WISCONSIN-MADISON Computer Sciences Department CS 739 Distributed Systems Andrea C. Arpaci-Dusseau.
Logical time Causality between events is fundamental to the design of parallel and distributed systems. In distributed systems, it is not possible to have.
John Kubiatowicz and Anthony D. Joseph
Time, Clocks, and Global State Part-2
CSE 486/586 Distributed Systems Time and Synchronization
CSC 8320 Advanced Operating System
SYNCHORNIZATION Logical Clocks.
EECS 498 Introduction to Distributed Systems Fall 2017
Time and Clock.
COT 5611 Operating Systems Design Principles Spring 2012
Distributed Systems CS
Outline Communication Primitives - continued Theoretical Foundations
Distributed Systems CS
Time and Clock.
John Kubiatowicz Electrical Engineering and Computer Sciences
Logical Clocks and Casual Ordering
Time And Global Clocks CMPT 431.
Event Ordering.
Outline Theoretical Foundations
Chien-Liang Fok Distribution Seminar Chien-Liang Fok
CS 425 / ECE 428  2013, I. Gupta, K. Nahrtstedt, S. Mitra, N. Vaidya, M. T. Harandi, J. Hou.
Distributed Systems CS
Chapter 5 (through section 5.4)
Basics of Distributed Systems
Distributed Systems CS
by Manas Hardas for Advanced Operating Systems Nov 27th 2007
John Kubiatowicz Electrical Engineering and Computer Sciences
CSE 486/586 Distributed Systems Time and Synchronization
CSE 542: Operating Systems
COT 5611 Operating Systems Design Principles Spring 2014
Outline Theoretical Foundations
Presentation transcript:

TIME, CLOCKS AND THE ORDERING OF EVENTS IN A DISTRIBUTED SYSTEM L. Lamport Computer Science Laboratory SRI International

THE PAPER Addresses the problem of clock drift in distributed systems Identify main function of computer clocks to order events Indicates which conditions clocks must satisfy to fulfill their role Introduces logical clocks

ORDERING EVENTS Event ordering linked with concept of causality: Saying that event a happened before event b is same as saying that event a could have affected the outcome of event b If events a and b occur on processes that do not exchange any data, their exact ordering is irrelevant

Relation “has happened before” (I) Smallest relation satisfying the three conditions: If a and b are events in the same process and a comes before b, then a  b If a is the sending of a message by a process and b its receipt by another process, then a  b If a  b and b  c then a  c

Example (I) Process i d a X X Process j c e X X Process k b X

Example (II) From first condition a  d c  e From second condition a  c b e From third condition a  e

Relation “has happened before” (II) We cannot always order events: relation “has happened” before is only a preorder If a did not happen before b, it cannot causally affect b

if a  b then C<a> < C<b> Logical clocks Verify the clock condition: if a  b then C<a> < C<b> and the two subconditions: if a and b are events in process Pi and a comes before b, then Ci<a> < Ci<b> if a is the sending of a message by process Pi and b its receipt by process Pj then Ci<a> < Cj<b>

Implementation rules Each process Pi increments its clock Ci between two consecutive events, If a is the sending of a message m by Pi then m includes a timestamp Tm = Ci<a> When Pj receives m, it sets its clock to a value greater than or equal to its present value and greater than Tm

Defining a total order We can define a total ordering on the set of all system events a  b if either Ci<a> < Cj<b> or Ci<a> = Cj<b> and Pi < Pj This ordering is not unique

Anomalous behaviors Logical clocks have anomalous behaviors in the presence of outside interactions Carrying a flash drive from one machine to another Dictating file changes over the phone Must use physical clocks

Example Process i d a X X outside interaction Process j c e X X Process k b X

Strong clock condition Let S be set of all systems events plus the relevant external events For all events a, b in S, if a  b then C(a) < C(b)

Physical clock conditions There is a constant  << 1 such that for all i: | d Ci(t) / dt - 1 | <  The clock is neither too fast nor too slow There is a constant  such that for all i, j: | Ci(t) - Cj(t) | <  The clocks are more or less synchronized

Implementation rules If Pi does not receive a message at time t then Ci(t) is differentiable and dCi(t)/dt > 0 If Pi sends message m at time t then m includes a timestamp Tm = Ci(t) When Pj receives m at time t’, it sets Cj(t’) to maximum of Cj(t’-0) and Tm+m, where m is the minimum transmission delay

Observations Like logical clocks, physical clocks cannot be rolled back Required accuracy of a given physical clock depends on the minimum transmission delay of outside interactions If it takes 20 minutes to carry a flash drive between two machines, their clocks can be off by up to 20 minutes

Example Process i d 11:30 am X X OK NO Process j 11:15 am 11:30 am X X