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

Slides:



Advertisements
Similar presentations
Lecture 1: Logical, Physical & Casual Time (Part 2) Anish Arora CSE 763.
Advertisements

Time, Clocks, and the Ordering of Events in a Distributed System
Last Class: Clock Synchronization
Logical Clocks (2).
Synchronization.
Parallel and Distributed Simulation Lookahead Deadlock Detection & Recovery.
Lookahead. Outline Null message algorithm: The Time Creep Problem Lookahead –What is it and why is it important? –Writing simulations to maximize lookahead.
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.
Computer Science 425 Distributed Systems CS 425 / CSE 424 / ECE 428 Fall 2011 August 30, 2011 Lecture 3 Time and Synchronization Reading: Sections
Distributed Systems Spring 2009
Ordering and Consistent Cuts Presented By Biswanath Panda.
CMPT 431 Dr. Alexandra Fedorova Lecture VIII: Time And Global Clocks.
1. Explain why synchronization is so important in distributed systems by giving an appropriate example When each machine has its own clock, an event that.
Synchronization Clock Synchronization Logical Clocks Global State Election Algorithms Mutual Exclusion.
Ordering and Consistent Cuts
Issues with Clocks. Problem Lack of global time –Need to compare different events in a distributed system.
Ordering and Consistent Cuts Presented by Chi H. Ho.
Time, Clocks and the Ordering of Events in a Distributed System - by Leslie Lamport.
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.
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.
Add Fault Tolerance – order & time Time, Clocks, and the Ordering of Events in a Distributed System Leslie Lamport Optimal Clock Synchronization T.K. Srikanth.
Lecture 2-1 CS 425/ECE 428 Distributed Systems Lecture 2 Time & Synchronization Reading: Klara Nahrstedt.
Logical Clocks (2). Topics r Logical clocks r Totally-Ordered Multicasting r Vector timestamps.
1 Physical Clocks need for time in distributed systems physical clocks and their problems synchronizing physical clocks u coordinated universal time (UTC)
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
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.
Lamport’s Logical Clocks & Totally Ordered Multicasting.
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.
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.
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.
Logical Clocks. Topics r Logical clocks r Totally-Ordered Multicasting.
Event Ordering. CS 5204 – Operating Systems2 Time and Ordering The two critical differences between centralized and distributed systems are: absence of.
Synchronization Chapter 5. Clock Synchronization When each machine has its own clock, an event that occurred after another event may nevertheless be assigned.
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.
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.
CSE 486/586 CSE 486/586 Distributed Systems Time and Synchronization Steve Ko Computer Sciences and Engineering University at Buffalo.
Ordering of Events in Distributed Systems UNIVERSITY of WISCONSIN-MADISON Computer Sciences Department CS 739 Distributed Systems Andrea C. Arpaci-Dusseau.
CSC 8320 Advanced Operating System
COT 5611 Operating Systems Design Principles Spring 2012
Outline Theoretical Foundations
CS 425 / ECE 428  2013, I. Gupta, K. Nahrtstedt, S. Mitra, N. Vaidya, M. T. Harandi, J. Hou.
TIME, CLOCKS AND THE ORDERING OF EVENTS IN A DISTRIBUTED SYSTEM
Chapter 5 (through section 5.4)
Basics of Distributed Systems
by Manas Hardas for Advanced Operating Systems Nov 27th 2007
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 not important

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 Process k Process jX X X X X a c b d e

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

Logical clocks Verify the clock condition : if a  b then C and the two subconditions: –if a and b are events in process P i and a comes before b, then C i –if a is the sending of a message by P i and b its receipt by P j then C i

Implementation rules Each process P i increments its clock C i between two consecutive events, If a is the sending of a message m by P i then m includes a timestamp T m = C i when P j receives m, it sets its clock to a value greater than or equal to its present value and greater than T m

Defining a total order We can define a total ordering on the set of all system events a  b if either C i or C i = C j and P i < P j 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 Process k Process jX X X X X a c b d e outside interaction

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 C i (t) / dt - 1 | <  The clock is neither too fast nor too slow There is a constant  such that for all i, j : | C i (t) - C j (t) | <  The clocks are more or less synchronized

Implementation rules If P i does not receive a message at time t then C i (t) is differentiable and dC i (t)/dt > 0 If P i sends message m at time t then m includes a timestamp T m = C i (t) When P j receives m at time t’, it sets C j (t’) to maximum of C j (t’ -0 ) and T m +  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 Process jX X X 11:30 am d OK 11:15 am X 11:30 am NO