CS533 Concepts of Operating Systems Class 8 Time, Clocks, and the Ordering of Events in a Distributed System By Constantia Tryman.

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.
CS3771 Today: deadlock detection and election algorithms  Previous class Event ordering in distributed systems Various approaches for Mutual Exclusion.
Synchronization Chapter clock synchronization * 5.2 logical clocks * 5.3 global state * 5.4 election algorithm * 5.5 mutual exclusion * 5.6 distributed.
Dr. Kalpakis CMSC 621, Advanced Operating Systems. Logical Clocks and Global State.
Distributed Systems Dinesh Bhat - Advanced Systems (Some slides from 2009 class) CS 6410 – Fall 2010 Time Clocks and Ordering of events Distributed Snapshots.
Distributed Systems Spring 2009
Ordering and Consistent Cuts Presented By Biswanath Panda.
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.
Ordering and Consistent Cuts
20101 Synchronization in distributed systems A collection of independent computers that appears to its users as a single coherent system.
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.
Lecture 12 Synchronization. EECE 411: Design of Distributed Software Applications Summary so far … A distributed system is: a collection of independent.
Time, Clocks, and the Ordering of Events in a Distributed System Leslie Lamport (1978) Presented by: Yoav Kantor.
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.
Chapter 17 Theoretical Issues in 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.
EECS 262a Advanced Topics in Computer Systems Lecture 14 Lamport Clocks and OCC October 20 th, 2014 John Kubiatowicz Electrical Engineering and Computer.
Distributed Mutex EE324 Lecture 11.
© Oxford University Press 2011 DISTRIBUTED COMPUTING Sunita Mahajan Sunita Mahajan, Principal, Institute of Computer Science, MET League of Colleges, Mumbai.
CS425 /CSE424/ECE428 – Distributed Systems – Fall 2011 Material derived from slides by I. Gupta, M. Harandi, J. Hou, S. Mitra, K. Nahrstedt, N. Vaidya.
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.
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.
Event Ordering. CS 5204 – Operating Systems2 Time and Ordering The two critical differences between centralized and distributed systems are: absence of.
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.
COMP 655: Distributed/Operating Systems Summer 2011 Dr. Chunbo Chu Week 6: Synchronyzation 3/5/20161 Distributed Systems - COMP 655.
Mutual Exclusion Algorithms. Topics r Defining mutual exclusion r A centralized approach r A distributed approach r An approach assuming an organization.
CS3771 Today: Distributed Coordination  Previous class: Distributed File Systems Issues: Naming Strategies: Absolute Names, Mount Points (logical connection.
11-Jun-16CSE 542: Operating Systems1 Distributed systems Time, clocks, and the ordering of events in a distributed system Leslie Lamport. Communications.
Ordering of Events in Distributed Systems UNIVERSITY of WISCONSIN-MADISON Computer Sciences Department CS 739 Distributed Systems Andrea C. Arpaci-Dusseau.
John Kubiatowicz and Anthony D. Joseph
Time, Clocks, and Global State Part-2
Distributed Mutex EE324 Lecture 11.
SYNCHORNIZATION Logical Clocks.
EECS 498 Introduction to Distributed Systems Fall 2017
COT 5611 Operating Systems Design Principles Spring 2012
Distributed Systems CS
DISTRIBUTED SYSTEMS Principles and Paradigms Second Edition ANDREW S
John Kubiatowicz Electrical Engineering and Computer Sciences
Logical Clocks and Casual Ordering
Outline Theoretical Foundations - continued Lab 1
Event Ordering.
Outline Theoretical Foundations
Chien-Liang Fok Distribution Seminar Chien-Liang Fok
TIME, CLOCKS AND THE ORDERING OF EVENTS IN A DISTRIBUTED SYSTEM
Distributed Systems CS
Chapter 5 (through section 5.4)
Basics of Distributed Systems
Physical clock synchronization
Outline Theoretical Foundations - continued
Distributed Systems CS
Distributed algorithms
John Kubiatowicz Electrical Engineering and Computer Sciences
CSE 542: Operating Systems
COT 5611 Operating Systems Design Principles Spring 2014
Outline Theoretical Foundations
Presentation transcript:

CS533 Concepts of Operating Systems Class 8 Time, Clocks, and the Ordering of Events in a Distributed System By Constantia Tryman

CS533 - Concepts of Operating Systems 2 What will be covered  Concept of events ordering in distributed system  Synchronization of logical clocks to order events totally  Specialized synchronization using physical clocks  Bound on how far synchrony clocks can drift apart

CS533 - Concepts of Operating Systems 3 Partial Ordering   : “happened before”  Definition: o If a and b are events from Pi, a comes before b then a  b (same process) o If a is sending message m by Pi and b is receiving m by Pj then a  b (b/t 2 processes) o If a  b and b  c, then a  c (1 or more processes)  “space-time” diagram o Horizontal: space o Vertical: time o Wavy lines: message

CS533 - Concepts of Operating Systems 4 Space-time Diagram

CS533 - Concepts of Operating Systems 5 Logical Clocks  Clock: a way of assigning number to an event  Logical Clock: order in which events occur  Ci : define clock Ci to process Pi for event a  System of clock represented by: C = Cj

CS533 - Concepts of Operating Systems 6 Space-Time diagram

CS533 - Concepts of Operating Systems 7 Clock Condition  Clock Condition (CC): For events a,b: if a  b then C  C  Converse condition will not hold => concurrent events happen at the same time  CC is satisfied by: o C1: if a & b are events by Pi, a comes before b, then Ci  Ci o C2: if a sends message m by Pi, b is a receipt of m by Pj, then Ci  Cj

CS533 - Concepts of Operating Systems 8 Implementation Rule  To guarantee that system of clocks satisfies CC  IR1: Each process Pi increments Ci between any two successive events (tick is occurring between P’s events)  IR2: (each message contains Tm = time msg sent) o A. if a is sending message m by Pi then m contains timestamp Tm = Ci o B. upon receiving m, Pj sets Cj  its present value and  Tm  IR1 and 2 imply that CC is satisfied

CS533 - Concepts of Operating Systems 9 Ordering Events Totally  Define  :  If event a in Pi and b in Pj then a  b if either Ci  Cj or Ci = Cj and Pi < Pj  a  b means Ci  Cj   extends 

CS533 - Concepts of Operating Systems 10 Total Ordering of Events  Algorithm for solving mutex problem: I. Process which granted the resource must release before granting resource to another Process II. Different requirements for resource must be granted in order they’re made III. Every Process granted with resource will eventually release it so every request is eventually granted  Issue: doesn’t tell which Process granted if request resource concurrently with another Process

CS533 - Concepts of Operating Systems 11 Scheduling Issue  Cannot be solved by Central Scheduling Process  Ex: P 1 requests P 0, P 1 sends message P 2, P 2 requests P 0 If P 2 is granted first, violate II (granted in the order they make)

CS533 - Concepts of Operating Systems 12 Algorithm Rules 1) Resource Request by Pi o Pi sends message, M: “Tm: Pi request resource” to every Processes o Pi puts message M to its request Queue 2) When Message Received by Pj o Pj places M on request Queue o Sends acknowledgement message to Pi 3) Releasing Resource o Pi removes any M from request Queue o Pi sends message, M 3 : “Tm 3 : Pi releases resource” to every Processes

CS533 - Concepts of Operating Systems 13 Algorithm Rules Cont. 4) When Pj received Pi release resource o Removes any M: “Tm: Pi requests resource” from request Queue 5) Pi is granted the resource i.  M in request Queue ordered before any other requests defined by  ii. Pi has received M 2 from every other process time stamped Tm 2 (where Tm 2  Tm)

CS533 - Concepts of Operating Systems 14 Anomalous Behavior  Resource scheduling algorithm ordered request by  total ordering will result in Anomalous Behavior  Strong Clock Condition:  event a,b in  : if a  b then C  C   : events in all systems   uses physical clocks to eliminate anomalous behavior

CS533 - Concepts of Operating Systems 15 Physical Clocks  Ci(t): reading of clock Ci at physical time t  dCi(t)/dt = rate of clock is running  1  PC1:  a constant K << 1 such that  i: | dCi(t)/dt - 1 | < k, where k   PC2:  i,j: |Ci(t) – Cj(t)| < 

CS533 - Concepts of Operating Systems 16 Physical Clocks Cont.  a  b Cj = t, Cj = t +     shortest transmission time for interprocess messages   i,j,t Cj (t+  ) – Ci (t) > 0  By PC1 Ci (t+  ) – Ci (t) > (1 - k)   By PC2 Ci (t+  ) – Cj (t) > 0 if  / (1-k)  

CS533 - Concepts of Operating Systems 17 Implementation Rules  IR1’:  i if Pi doesn’t receive a message at physical time t then Ci is differentiable at t and dCi(t)/dt  0  IR2’ a. If Pi sends message M at physical time t, then M contains Tm = Ci(t) b. Upon receiving M at time t’ Pj sets Cj(t’) = max ( Cj(t’ – 0), Tm +  m )

CS533 - Concepts of Operating Systems 18 Theorem Theorem: Assume strongly connected graph of Processes with diameter d obeying IR1’ and IR2’ Assume  m,  m   for constant  and  t  t 0 a) PC1 holds b)  constant  and  such that every  seconds a message sent over every arch (  m   ) PC2 is satisfied by:   d (2k  +  )  t ≳ t 0 +  d Assumption:  +  ≪ 