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.

Slides:



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

Time and Global States Part 3 ECEN5053 Software Engineering of Distributed Systems University of Colorado, Boulder.
Synchronization Chapter clock synchronization * 5.2 logical clocks * 5.3 global state * 5.4 election algorithm * 5.5 mutual exclusion * 5.6 distributed.
Distributed Systems Spring 2009
Ordering and Consistent Cuts Presented By Biswanath Panda.
CMPT 431 Dr. Alexandra Fedorova Lecture VIII: Time And Global Clocks.
Ordering and Consistent Cuts
Lecture 13 Synchronization (cont). EECE 411: Design of Distributed Software Applications Logistics Last quiz Max: 69 / Median: 52 / Min: 24 In a box outside.
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 12 Synchronization. EECE 411: Design of Distributed Software Applications Summary so far … A distributed system is: a collection of independent.
Computer Science Lecture 10, page 1 CS677: Distributed OS Last Class: Clock Synchronization Physical clocks Clock synchronization algorithms –Cristian’s.
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.
Synchronization Chapter 6 Part I Clock Synchronization & Logical clocks Part II Mutual Exclusion Part III Election Algorithms Part IV Transactions.
Chapter 17 Theoretical Issues in Distributed Systems
Logical Clocks (2). Topics r Logical clocks r Totally-Ordered Multicasting r Vector timestamps.
Tanenbaum & Van Steen, Distributed Systems: Principles and Paradigms, 2e, (c) 2007 Prentice-Hall, Inc. All rights reserved DISTRIBUTED SYSTEMS.
Chapter 5.
CIS 720 Distributed algorithms. “Paint on the forehead” problem Each of you can see other’s forehead but not your own. I announce “some of you have paint.
CSE 486/586, Spring 2013 CSE 486/586 Distributed Systems Logical Time Steve Ko Computer Sciences and Engineering University at Buffalo.
EECS 262a Advanced Topics in Computer Systems Lecture 14 Lamport Clocks and OCC October 20 th, 2014 John Kubiatowicz Electrical Engineering and Computer.
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.
Page 1 Logical Clocks Paul Krzyzanowski Distributed Systems Except as otherwise noted, the content of this presentation is.
Issues with Clocks. Context The tree correction protocol was based on the idea of local detection and correction. Protocols of this type are complex to.
Synchronization. Why we need synchronization? It is important that multiple processes do not access shared resources simultaneously. Synchronization in.
Logical Clocks. Topics Logical clocks Totally-Ordered Multicasting Vector timestamps.
Lamport’s Logical Clocks & Totally Ordered Multicasting.
CSE 486/586 CSE 486/586 Distributed Systems Logical Time Steve Ko Computer Sciences and Engineering University at Buffalo.
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.
CIS825 Lecture 2. Model Processors Communication medium.
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
CS603 Clock Synchronization February 4, What is Clock Synchronization? All nodes agree on time What do we mean by time? –Monotonic –Any observation.
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.
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.
Lecture 7- 1 CS 425/ECE 428/CSE424 Distributed Systems (Fall 2009) Lecture 7 Distributed Mutual Exclusion Section 12.2 Klara Nahrstedt.
COMP 655: Distributed/Operating Systems Summer 2011 Dr. Chunbo Chu Week 6: Synchronyzation 3/5/20161 Distributed Systems - COMP 655.
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, Spring 2014 CSE 486/586 Distributed Systems Logical Time 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.
CSE 486/586 Distributed Systems Logical Time
SYNCHORNIZATION Logical Clocks.
Distributed Systems CS
Event Ordering.
Outline Theoretical Foundations
CS 425 / ECE 428  2013, I. Gupta, K. Nahrtstedt, S. Mitra, N. Vaidya, M. T. Harandi, J. Hou.
Basics of Distributed Systems
Distributed Systems CS
CSE 486/586 Distributed Systems Logical Time
CSE 542: Operating Systems
Proof of liveness: an example
Outline Theoretical Foundations
Presentation transcript:

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

9/14/20052 Overview Key Points Background Partial Ordering Extension for Total Ordering Further Work Key Points Reiteration Evaluation Discussion

9/14/20053 Key Points 1. The “happens before” relation on the system event set 2. The events partial ordering on the base of the relation 3. The distributed algorithm for logical clock synchronization 4. The algorithm extension to the case of total events ordering 5. The algorithm application for physical clock synchronization

9/14/20054 Background: Distributed System Features Spatially separated processes Processes communicate through messages Message delays are considerable Absence of the single timer leads to synchronization problems Example: totally ordered multicast

9/14/20055 Background: Synchronization Approaches Physical Clock Adjustment All clocks show the same actual time Problems: Most important: backward time flow possible Sophisticated time services (i.e. WWV); or Reliance on a human operator Logical Clock Adjustment Consistency is important, not actual time

9/14/20056 Partial Ordering: Basics A system is a set of processes P i A process is a set of events a, b, … with total ordering “Happened before” (→) relation: (a  P) && (b  P) && (a comes before b)  a → b (P 1 sends a to P 2 ) && (b is the receipt of P 2 for a)  a → b (a → b) && (b → c)  a → c !(a → b) && !(b → a)  a and b are concurrent !(a → a)  a, so “happened before” is an irreflexive partial ordering on the set of all the system events

9/14/20057 Partial Ordering: Example P1 P2 P3 abcdf gijklm nopqrs a  fb  sc  m d || si || qk || r

9/14/20058 Partial Ordering: Synchronization Logical clock: C  a  = C j  a  if a  P j Check condition: for  a, b a → b  C  a  < C  b  (not vice versa) The check condition is satisfied if C1. (a, b  P i ) && (a comes before b)  C i  a  < C i  b  C2. (P i sends a to P j ) && (b is the receipt of P j to a)  C i  a  < C j  b  C never decreases!

9/14/20059 Partial Ordering: Implementation Rules IR1. Each P i increments C i between any two successive events. IR2. a) If a is the sending of a message m by P i, then m contains a timestamp T m = C j  a  ; and b) Upon receiving m, P i sets C j greater than or equal to its present value and greater than T m

9/14/ Partial Ordering: Unregulated Clocks A B D C

9/14/ Partial Ordering: Corrected Clocks A B D C

9/14/ Total Ordering: Definition ‹ is an arbitrary total ordering of processes “Happen before” for total ordering( ): (a ε P i ) && (b ε P j )  a b iff C i  a  < C j  b , or P i ‹ P j The total ordering depends on C i and is not unique

9/14/ Total Ordering: Synchronization 1. P i broadcasts the message T m :P i (request resource) and puts it on its request queue. 2. When P j receives T m :P i, it puts the message on its request queue and sends the acknowledgment to P i. 3. To release the resource, P i removes T m :P i from its queue, broadcasts a timestamped release message. 4. When P j receives the release message, it removes T m :P i from its queue. 5. P i is granted the resource when 1) It has T m :P i in its queue ordered before any other request in the queue by the relation ; and 2) P i has received a message from every other process timestamped later than T m.

9/14/ Further Work: Vector Timestamps Lamport clock is: Consistent: a  b  C  a  < C  b  Not: C  a  < C  b   a  b (not strongly consistent) Vector timestamps (VT) are strongly consistent VT address potential causality Allow to say if a happened before b, but not if a caused b VT say how many events have occurred so far at all processes VT solve the totally-ordered multicasting problem

9/14/ Lack of Strong Consistency P1 P2 P3 abcdf gijklm nopqrs [1] [2] [3] [4] [3] [5] [6] d || sq || i k || r 5 < 64 > 3 5 = 5

9/14/ Vector Clocks (1) P1 P2 P3 abcdf gijklm nopqrs [1 0 0][2 0 0][3 0 0][4 3 0][5 5 3] [0 1 0][2 2 0][2 3 0][2 4 3][2 5 3][3 6 5] [0 0 1][0 1 2][0 1 3][3 1 4][3 1 5][3 1 6] [0 1 0] [2 0 0] [3 0 0] [2 3 0] [0 1 3] [3 1 5] [2 5 3] a  fb  sc  m [1 0 0] < [5 5 3][2 0 0] < [3 1 6][3 0 0] < [3 6 5]

9/14/ Vector Clocks (2) P1 P2 P3 abcdf gijklm nopqrs [1 0 0][2 0 0][3 0 0][4 3 0][5 5 3] [0 1 0][2 2 0][2 3 0][2 4 3][2 5 3][3 6 5] [0 0 1][0 1 2][0 1 3][3 1 4][3 1 5][3 1 6] [0 1 0] [2 0 0] [3 0 0] [2 3 0] [0 1 3] [3 1 5] [2 5 3] d || sq || ik || r [4 3 0] < [3 1 6][3 1 4] < [2 2 0][2 4 3] < [3 1 5]

9/14/ Key Points Reiteration 1. The “happens before” relation on the system event set 2. The events partial ordering on the base of the relation 3. The distributed algorithm for logical clock synchronization 4. The algorithm extension to a case of total events ordering 5. The algorithm application for physical clock synchronization

9/14/ Evaluation The logical clocks idea is very appealing Virtually no revision on previous work Nice to have more mathematically strict extension on total ordering, if possible

9/14/ Discussion Thank you! Any questions?