MAD. Models & Algorithms for Distributed systems -- 2/5 -- download slides at h9p://people.rennes.inria.fr/eric.fabre/

Size: px
Start display at page:

Download "MAD. Models & Algorithms for Distributed systems -- 2/5 -- download slides at h9p://people.rennes.inria.fr/eric.fabre/"

Transcription

1 MAD Models & Algorithms for Distributed systems -- /5 -- download slides at h9p://peoplerennesinriafr/ericfabre/ 1

2 Today Runs/execuDons of a distributed system are pardal orders of events We introduce logical clocks (Lamport, Fidge-Ma9ern) event structures distributed algorithms to build them Then explore applicadons to money coundng in a distributed transacdonal system the construcdon of snapshots

3 Runs of distributed systems Context We assume processes have UIDs {1,,,n} So far, we had an undirected interacdon graph of processes G=(V,E), where V={1,,,n} Processes are asynchronous (no global clock), don t fail, messages eventually reach their desdnadon We now examine a run of such a distributed system, with local events in each process P i, and message exchanges from P i to P j (where allowed) P 1 a b c d e f g P h i j k l m n o p 3

4 P 1 a b c d e f g P h i j k l m n o p!me t a chronogram view e = local event at P1 a = sending of a message at P1, i = recepdon of this message at P channels need not be FIFO : see jàg and kàf in each procees, events are totally ordered (local clock) the physical Dme can be seen as given by verdcal slices no one knows this physical Dme (we only know it exists up to reladvity!) 4

5 P 1 a b c d e f g a P h i j k l m n o p a m h b i n c d j e k o pf l g unknown physical Dme a chronogram view e = local event at P1 a = sending of a message at P1, i = recepdon of this message at P channels need not be FIFO : see jàg and kàf in each procees, events are totally ordered (local clock) the physical Dme can be seen as given by verdcal slices no one knows this physical Dme (we only know it exists up to reladvity!) 5

6 P 1 a b c d e f g a P h i j k l m n o p a m h b i c n d e j o k pf l g unknown physical Dme a chronogram view e = local event at P1 a = sending of a message at P1, i = recepdon of this message at P channels need not be FIFO : see jàg and kàf in each procees, events are totally ordered (local clock) the physical Dme can be seen as given by verdcal slices no one knows this physical Dme (we only know it exists up to reladvity!) 6

7 P 1 a b c d e f g a P h i j k l m n o p a m h b i c n d e j o k pf l g unknown physical Dme a chronogram view events can slide on their axis, and preserve their ordering in processes, and the emission/recepdon ordering this yields another possible (total) ordering of events in physical Dme, resuldng in the same final global state of the system, but going through different intermediate global states this advocates the modeling of a run as a par7al order of events 7

8 P 1 a b c d e f g a P h i j k l m n o p a m h b i c n d e j o k pf l g unknown physical Dme Ques7ons to address Q : how to (formally) define and handle a run as a pardal order of events, rather than a sequence? Q : the physical Dme is lost, but can we track/compute this pardal order? Q : can we compute one (all) possible total ordering(s)? Q : what are the possible intermediate (global) states along a run? 8

9 Event structures Warning Runs of distributed systems can be modeled in numerous (quite ohen uselessly complex) manners : - one can start from communicadng automata (Lynch) - or more simply from processes with local acdons, emissions and their matching recepdons (Lamport, Fidge, Raynal) - or even more simply from pardally ordered events (Ma9ern, Winskel, MacMillan, Nielsen, Engelfriet) - this goes with simple to more complex proofs for similar results! (simple no7on of) event structure it is a finite DAG (directed acyclic graph) events are parddoned into n subets (processes) E = E 1 ] ] E n E i E =(E,!) events in each are totally ordered (local clock) an event e E i has at most one direct successor/predecessor e 6 E i (to model emission/recepdon of messages) 9

10 P 1 a b c d P e f g h i k l m n pardal order on events : iff in the DAG, ie is the smallest pardal order ( = transidve+irreflexive) reladon generated by past of an event e = predecessors of e for future of an event e = successors of e for e e e! e! a! b! h! i! m! n ) a n concurrency : e?e i e e and e e a?k h?c b?l b 6? m c?m 1

11 P 1 P a b c d past of h concurrent with h e f h i g concurrent with h future of h k l m n pardal order on events : iff in the DAG, ie is the smallest pardal order (transidve, irreflexive) reladon generated by past of an event e = predecessors of e for future of an event e = successors of e for e e e! e! a! b! h! i! m! n ) a n concurrency : e?e i e e and e e a?k h?c b?l b 6? m c?m 11

12 P 1 cut not cut a b c d P e f g h i k l m n E =(E,!) E E A cut in is a subset closed for the precedence reladon 8e, e E, e E ^ e e ) e E A cut can be seen as a line/curve, cunng all threads, thus defining a past (E ) and a future (E\E ) The line represents a possible present Interpreta7on: a cut idendfies a possible global state of the distributed process, that could be characterized by the current state of each process, and the messages already sent but not yet received ( in flight messages) Remark: it is generally not possible to have cuts with no pending messages, ie that do not separate emission from recepdon of a message Exercise: build a counter-example 1

13 P 1 a b c d P e f g h i k l m n A linear extension of is a total order < in E preserving : Obtained by recursively adding arcs for some pair of concurrent events,, then compledng by transidvity, undl becomes a total order e?e 8e, e E, e e ) e<e e! e Thm : any linear extension < of is a possible execudon order (in physical Dme) for the events present in the event structure E =(E,!) Proof: trivial, as messages transit Dmes are unknown [See also later] Visually : how to build all such orderings? imagine events are pearls on a necklace, made of n theads, one per process pearls are free to move along each thread but edges can never point back e! e 13

14 Remarks We will see later how to encode pardal orders in convenient data structures, in order to compute with them In modern computer science, event structures are studied per se They are simply event sets E (possibly infinite ) enriched with several reladons like precedence, or causality conflict : different possible outcomes/futures alternadve causes/predecessors of events asymmetric causality (e can appear concurrently or aher e, but not before) etc 14

15 Logical clock Historically introduced by Lamport in 78 was one of the contribudons modvadng the Turing award easy, pleasant to read, applicadons described, a li9le frustradng on formalizadon and proofs read it! Objec7ve build one possible total ordering of events, by a9aching a logical Dme to them do this with a distributed asynchronous algorithm 15

16 Objec7ve: tag every event e with a logical clock value C(e), taken in some totally ordered set these Dcks should reflect one linear extension of in run E =(E,!) 8e, e E, e e ) C(e) <C(e ) nodce that it is sufficient to guarantee 8e, e E, e! e ) C(e) <C(e ) and to make sure that C defines a total order we want compute these tags with a distributed algorithm 16

17 Algorithm: if e E i is a new event in process P i if 9e E i,e! e then C(e) =C(e )+1 otherwise C(e) =1 if e E i is the sending of some message m from P i to P j send C(m) =C(e) with message m (piggybacking) if e E i is the recepdon of a message m tagged by C(m) make correcdon C(e) :=max(c(e),c(m) + 1) P 1 P a b c d () () e f 1 g (1) 3 h 4 i 5 (3) (5) k l m n 17

18 Algorithm: if e E i is a new event in process P i if 9e E i,e! e then C(e) =C(e )+1 otherwise C(e) =1 if e E i is the sending of some message m from P i to P j send C(m) =C(e) with message m (piggybacking) if e E i is the recepdon of a message m tagged by C(m) make correcdon C(e) := max(c(e),c(m) + 1) Proper7es clearly ensures 8e, e E, e! e ) C(e) <C(e ) but events may not be totally ordered : concurrent event could have the same tag a total order is obtained by appending index i to C(e) for e E i the total order is the lexicographic order on pairs (C(e),i) each process can order its received messages in a unique manner consistent with what all other processes do and consistent with the causality of events in the run however, this might not be the true order of message producdon in physical Dme which anyway is lost forever! 18

19 Algorithm: if e E i is a new event in process P i if 9e E i,e! e then C(e) =C(e )+1 otherwise C(e) =1 if e E i is the sending of some message m from P i to P j send C(m) =C(e) with message m (piggybacking) if e E i is the recepdon of a message m tagged by C(m) make correcdon C(e) := max(c(e),c(m) + 1) P 1 P a b c d () () e f 1 g (1) 3 h 4 i 5 (3) (5) k l m n a e k b f l c g d h i m n 19

20 Applica7ons Shared objects/states Mutual exclusion Banking problem determine the total amount of money circuladng among a set of actors (banks) local state = their current balance messages = transacdons (money sent) Principle tag events and messages with a logical Dme assume all messages arrive, and message flows never stop decide some logical Dme slice t at which coundng takes place then all processes wait undl they have an event greater than Dme t collect the balance of each bank aher the last event preceding Dme t determine the amount of money in flight at Dme t between all pairs P i and P j (ie sent by P i to P j, but not yet received by P j ) easy : P i knows how much it sent to P j before Dme t P j knows how much it received from P i before Dme t

21 P 1 $ $3 P $ $5 5 $ $ $ $

22 P 1 $ $14 $3 P $ $5 5 $7 8 $ $ $ $3 3 6 $ Before 7me 9 P sent $5+$=$7 to received $5 from P $ are in flight

23 Applica7ons DefiniDon of a snapshot (checkpoint), ie capture of a consistent global state from where a (failing) distributed computadon could restart General idea : at some logical Dme t, all processes store their current state, and the content of messages that have been sent and are not yet received similar to the banking problem, where in flight messages must also be idendfied and stored Specific case of FIFO channels : see the Chandy-Lamport algorithm ( 85), that uses a marker to separate past messages from new ones in a channel Worth reading : important algorithm + historical interest Paper driven by examples, not a formal presenta!on 3

24 Vector clock Historically introduced independently by Fidge (Aust) and Ma9ern (Germ) in 88 Fidge uses a slightly different construcdon, and is less formalized Ma9ern is a bit more formalized, and uses the nodon of event structure Read MaKern! 4

25 Vector clock Objec7ve recover all possible consistent total orderings of events in a distributed run track the causality reladons among events of a distributed system, with a distributed algorithm 5

26 A drawback of Lamport s logical 7me not all total orderings of events are accessible logical Dme is totally ordered : how to capture only causality? 8e, e E, e e ) C(e) <C(e ) one would like to have : 8e, e E, e e () VC(e) VC(e ) Fidge-Ma]ern s idea one local clock C i per process P i clock Dcks are tuples VC(e) =(C 1 (e),,c n (e)) N n Algorithm: if e E i is a new event in process Pi if 9e E i,e! e then VC(e) =(C 1 (e ),,C i (e )+1,,C n (e )) otherwise VC(e) =(,,, 1,,,) with 1 on the i th coordinate if e E i is the sending of some message m from Pi to Pj send VC(m) =VC(e) with message m (piggybacking) if e E i is the recepdon of a message m tagged by VC(m) make correcdon 8k, C k (e) =max(c k (e),c k (m)) in VC(e) 6

27 P 1 P a b c d e f g h i n k l m

28 Thm: The event structure E =(E,!) and Ma9ern s vector clock values on it generate isomorphic trellises of event subsets [Ma9ern 88] 8e, e E, e e () VC(e) VC(e ) Proof one defines VC(e) VC(e ) by 8i, C i (e) apple C i (e ) and VC(e) VC(e ) by VC(e) VC(e ) ^ VC(e) 6= VC(e ) the theorem expresses that the pardal order of the DAG and the one on vector clock values are idendcal ) ( proof of is the same as for the logical clock proof of is more involved (see hint below) E =(E,!) 8

29 P 1 P a b c d e f g h i n k l m

30 P 1 P a a b ab c abc d ef ab ef e f g e h ab i ef efg efgh e efg ab efghi ab efghi ab e efghi k k l kl m klm n abcd ef ab efghi klmn The text recoding of the Vector Clock captures exactly all events that are causal predecessors of some given event in the DAG 3

31 Applica7ons distributed debugging : to keep track of the causality of events versioning system : discover inconsistent versions (concurrent edidng) snapshots (storage of consistent global states), when channels are not FIFO (Chandy-Lamport not applicable) 31

32 Take home messages runs of distributed systems are pardal orders (causal reladons) of events be9er encoded as event structures this pardal order can be tracked by distributed algorithms this is the stardng point of more elaborate funcdons (snapshots, mutual exclusion, detecdon of stable properdes, ) next 7me processes as automata models for distributed systems true concurrency semandcs to capture causality/parallelism 3

MAD. Models & Algorithms for Distributed systems -- 2/5 -- download slides at

MAD. Models & Algorithms for Distributed systems -- 2/5 -- download slides at MAD Models & Algorithms for Distributed systems -- /5 -- download slides at http://people.rennes.inria.fr/eric.fabre/ 1 Today Runs/executions of a distributed system are partial orders of events We introduce

More information

Distributed Algorithms (CAS 769) Dr. Borzoo Bonakdarpour

Distributed Algorithms (CAS 769) Dr. Borzoo Bonakdarpour Distributed Algorithms (CAS 769) Week 1: Introduction, Logical clocks, Snapshots Dr. Borzoo Bonakdarpour Department of Computing and Software McMaster University Dr. Borzoo Bonakdarpour Distributed Algorithms

More information

Chandy-Lamport Snapshotting

Chandy-Lamport Snapshotting Chandy-Lamport Snapshotting COS 418: Distributed Systems Precept 8 Themis Melissaris and Daniel Suo [Content adapted from I. Gupta] Agenda What are global snapshots? The Chandy-Lamport algorithm Why does

More information

Agreement. Today. l Coordination and agreement in group communication. l Consensus

Agreement. Today. l Coordination and agreement in group communication. l Consensus Agreement Today l Coordination and agreement in group communication l Consensus Events and process states " A distributed system a collection P of N singlethreaded processes w/o shared memory Each process

More information

Today. Vector Clocks and Distributed Snapshots. Motivation: Distributed discussion board. Distributed discussion board. 1. Logical Time: Vector clocks

Today. Vector Clocks and Distributed Snapshots. Motivation: Distributed discussion board. Distributed discussion board. 1. Logical Time: Vector clocks Vector Clocks and Distributed Snapshots Today. Logical Time: Vector clocks 2. Distributed lobal Snapshots CS 48: Distributed Systems Lecture 5 Kyle Jamieson 2 Motivation: Distributed discussion board Distributed

More information

Logical Time. 1. Introduction 2. Clock and Events 3. Logical (Lamport) Clocks 4. Vector Clocks 5. Efficient Implementation

Logical Time. 1. Introduction 2. Clock and Events 3. Logical (Lamport) Clocks 4. Vector Clocks 5. Efficient Implementation Logical Time Nicola Dragoni Embedded Systems Engineering DTU Compute 1. Introduction 2. Clock and Events 3. Logical (Lamport) Clocks 4. Vector Clocks 5. Efficient Implementation 2013 ACM Turing Award:

More information

Cuts. Cuts. Consistent cuts and consistent global states. Global states and cuts. A cut C is a subset of the global history of H

Cuts. Cuts. Consistent cuts and consistent global states. Global states and cuts. A cut C is a subset of the global history of H Cuts Cuts A cut C is a subset of the global history of H C = h c 1 1 hc 2 2...hc n n A cut C is a subset of the global history of H The frontier of C is the set of events e c 1 1,ec 2 2,...ec n n C = h

More information

Clocks in Asynchronous Systems

Clocks in Asynchronous Systems Clocks in Asynchronous Systems The Internet Network Time Protocol (NTP) 8 Goals provide the ability to externally synchronize clients across internet to UTC provide reliable service tolerating lengthy

More information

Distributed Algorithms

Distributed Algorithms Distributed Algorithms December 17, 2008 Gerard Tel Introduction to Distributed Algorithms (2 nd edition) Cambridge University Press, 2000 Set-Up of the Course 13 lectures: Wan Fokkink room U342 email:

More information

Consistent Global States of Distributed Systems: Fundamental Concepts and Mechanisms. CS 249 Project Fall 2005 Wing Wong

Consistent Global States of Distributed Systems: Fundamental Concepts and Mechanisms. CS 249 Project Fall 2005 Wing Wong Consistent Global States of Distributed Systems: Fundamental Concepts and Mechanisms CS 249 Project Fall 2005 Wing Wong Outline Introduction Asynchronous distributed systems, distributed computations,

More information

Slides for Chapter 14: Time and Global States

Slides for Chapter 14: Time and Global States Slides for Chapter 14: Time and Global States From Coulouris, Dollimore, Kindberg and Blair Distributed Systems: Concepts and Design Edition 5, Addison-Wesley 2012 Overview of Chapter Introduction Clocks,

More information

Distributed Algorithms Time, clocks and the ordering of events

Distributed Algorithms Time, clocks and the ordering of events Distributed Algorithms Time, clocks and the ordering of events Alberto Montresor University of Trento, Italy 2016/04/26 This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International

More information

Distributed Systems. 06. Logical clocks. Paul Krzyzanowski. Rutgers University. Fall 2017

Distributed Systems. 06. Logical clocks. Paul Krzyzanowski. Rutgers University. Fall 2017 Distributed Systems 06. Logical clocks Paul Krzyzanowski Rutgers University Fall 2017 2014-2017 Paul Krzyzanowski 1 Logical clocks Assign sequence numbers to messages All cooperating processes can agree

More information

CptS 464/564 Fall Prof. Dave Bakken. Cpt. S 464/564 Lecture January 26, 2014

CptS 464/564 Fall Prof. Dave Bakken. Cpt. S 464/564 Lecture January 26, 2014 Overview of Ordering and Logical Time Prof. Dave Bakken Cpt. S 464/564 Lecture January 26, 2014 Context This material is NOT in CDKB5 textbook Rather, from second text by Verissimo and Rodrigues, chapters

More information

Causality and physical time

Causality and physical time Logical Time Causality and physical time Causality is fundamental to the design and analysis of parallel and distributed computing and OS. Distributed algorithms design Knowledge about the progress Concurrency

More information

Distributed Systems Fundamentals

Distributed Systems Fundamentals February 17, 2000 ECS 251 Winter 2000 Page 1 Distributed Systems Fundamentals 1. Distributed system? a. What is it? b. Why use it? 2. System Architectures a. minicomputer mode b. workstation model c. processor

More information

Snapshots. Chandy-Lamport Algorithm for the determination of consistent global states <$1000, 0> <$50, 2000> mark. (order 10, $100) mark

Snapshots. Chandy-Lamport Algorithm for the determination of consistent global states <$1000, 0> <$50, 2000> mark. (order 10, $100) mark 8 example: P i P j (5 widgets) (order 10, $100) cji 8 ed state P i : , P j : , c ij : , c ji : Distributed Systems

More information

Time. To do. q Physical clocks q Logical clocks

Time. To do. q Physical clocks q Logical clocks Time To do q Physical clocks q Logical clocks Events, process states and clocks A distributed system A collection P of N single-threaded processes (p i, i = 1,, N) without shared memory The processes in

More information

Time. Today. l Physical clocks l Logical clocks

Time. Today. l Physical clocks l Logical clocks Time Today l Physical clocks l Logical clocks Events, process states and clocks " A distributed system a collection P of N singlethreaded processes without shared memory Each process p i has a state s

More information

416 Distributed Systems. Time Synchronization (Part 2: Lamport and vector clocks) Jan 27, 2017

416 Distributed Systems. Time Synchronization (Part 2: Lamport and vector clocks) Jan 27, 2017 416 Distributed Systems Time Synchronization (Part 2: Lamport and vector clocks) Jan 27, 2017 1 Important Lessons (last lecture) Clocks on different systems will always behave differently Skew and drift

More information

EE 144/244: Fundamental Algorithms for System Modeling, Analysis, and Optimization Fall 2016

EE 144/244: Fundamental Algorithms for System Modeling, Analysis, and Optimization Fall 2016 EE 144/244: Fundamental Algorithms for System Modeling, Analysis, and Optimization Fall 2016 Discrete Event Simulation Stavros Tripakis University of California, Berkeley Stavros Tripakis (UC Berkeley)

More information

The Weakest Failure Detector to Solve Mutual Exclusion

The Weakest Failure Detector to Solve Mutual Exclusion The Weakest Failure Detector to Solve Mutual Exclusion Vibhor Bhatt Nicholas Christman Prasad Jayanti Dartmouth College, Hanover, NH Dartmouth Computer Science Technical Report TR2008-618 April 17, 2008

More information

Our Problem. Model. Clock Synchronization. Global Predicate Detection and Event Ordering

Our Problem. Model. Clock Synchronization. Global Predicate Detection and Event Ordering Our Problem Global Predicate Detection and Event Ordering To compute predicates over the state of a distributed application Model Clock Synchronization Message passing No failures Two possible timing assumptions:

More information

CS505: Distributed Systems

CS505: Distributed Systems Cristina Nita-Rotaru CS505: Distributed Systems Ordering events. Lamport and vector clocks. Global states. Detecting failures. Required reading for this topic } Leslie Lamport,"Time, Clocks, and the Ordering

More information

Distributed Mutual Exclusion Based on Causal Ordering

Distributed Mutual Exclusion Based on Causal Ordering Journal of Computer Science 5 (5): 398-404, 2009 ISSN 1549-3636 2009 Science Publications Distributed Mutual Exclusion Based on Causal Ordering Mohamed Naimi and Ousmane Thiare Department of Computer Science,

More information

A subtle problem. An obvious problem. An obvious problem. An obvious problem. No!

A subtle problem. An obvious problem. An obvious problem. An obvious problem. No! A subtle problem An obvious problem when LC = t do S doesn t make sense for Lamport clocks! there is no guarantee that LC will ever be S is anyway executed after LC = t Fixes: if e is internal/send and

More information

Clojure Concurrency Constructs, Part Two. CSCI 5828: Foundations of Software Engineering Lecture 13 10/07/2014

Clojure Concurrency Constructs, Part Two. CSCI 5828: Foundations of Software Engineering Lecture 13 10/07/2014 Clojure Concurrency Constructs, Part Two CSCI 5828: Foundations of Software Engineering Lecture 13 10/07/2014 1 Goals Cover the material presented in Chapter 4, of our concurrency textbook In particular,

More information

Distributed Systems Principles and Paradigms. Chapter 06: Synchronization

Distributed Systems Principles and Paradigms. Chapter 06: Synchronization Distributed Systems Principles and Paradigms Maarten van Steen VU Amsterdam, Dept. Computer Science Room R4.20, steen@cs.vu.nl Chapter 06: Synchronization Version: November 16, 2009 2 / 39 Contents Chapter

More information

Distributed Systems Principles and Paradigms

Distributed Systems Principles and Paradigms Distributed Systems Principles and Paradigms Chapter 6 (version April 7, 28) Maarten van Steen Vrije Universiteit Amsterdam, Faculty of Science Dept. Mathematics and Computer Science Room R4.2. Tel: (2)

More information

1 Introduction During the execution of a distributed computation, processes exchange information via messages. The message exchange establishes causal

1 Introduction During the execution of a distributed computation, processes exchange information via messages. The message exchange establishes causal Quasi-Synchronous heckpointing: Models, haracterization, and lassication D. Manivannan Mukesh Singhal Department of omputer and Information Science The Ohio State University olumbus, OH 43210 (email: fmanivann,singhalg@cis.ohio-state.edu)

More information

Petri nets. s 1 s 2. s 3 s 4. directed arcs.

Petri nets. s 1 s 2. s 3 s 4. directed arcs. Petri nets Petri nets Petri nets are a basic model of parallel and distributed systems (named after Carl Adam Petri). The basic idea is to describe state changes in a system with transitions. @ @R s 1

More information

6.852: Distributed Algorithms Fall, Class 24

6.852: Distributed Algorithms Fall, Class 24 6.852: Distributed Algorithms Fall, 2009 Class 24 Today s plan Self-stabilization Self-stabilizing algorithms: Breadth-first spanning tree Mutual exclusion Composing self-stabilizing algorithms Making

More information

1 Introduction During the execution of a distributed computation, processes exchange information via messages. The message exchange establishes causal

1 Introduction During the execution of a distributed computation, processes exchange information via messages. The message exchange establishes causal TR No. OSU-ISR-5/96-TR33, Dept. of omputer and Information Science, The Ohio State University. Quasi-Synchronous heckpointing: Models, haracterization, and lassication D. Manivannan Mukesh Singhal Department

More information

Causal Broadcast Seif Haridi

Causal Broadcast Seif Haridi Causal Broadcast Seif Haridi haridi@kth.se Motivation Assume we have a chat application Whatever written is reliably broadcast to group If you get the following output, is it ok? [Paris] Are you sure,

More information

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

Time, Clocks, and the Ordering of Events in a Distributed System Time, Clocks, and the Ordering of Events in a Distributed System Motivating example: a distributed compilation service FTP server storing source files, object files, executable file stored files have timestamps,

More information

Time in Distributed Systems: Clocks and Ordering of Events

Time in Distributed Systems: Clocks and Ordering of Events Time in Distributed Systems: Clocks and Ordering of Events Clocks in Distributed Systems Needed to Order two or more events happening at same or different nodes (Ex: Consistent ordering of updates at different

More information

Overview. Discrete Event Systems Verification of Finite Automata. What can finite automata be used for? What can finite automata be used for?

Overview. Discrete Event Systems Verification of Finite Automata. What can finite automata be used for? What can finite automata be used for? Computer Engineering and Networks Overview Discrete Event Systems Verification of Finite Automata Lothar Thiele Introduction Binary Decision Diagrams Representation of Boolean Functions Comparing two circuits

More information

Coordination. Failures and Consensus. Consensus. Consensus. Overview. Properties for Correct Consensus. Variant I: Consensus (C) P 1. v 1.

Coordination. Failures and Consensus. Consensus. Consensus. Overview. Properties for Correct Consensus. Variant I: Consensus (C) P 1. v 1. Coordination Failures and Consensus If the solution to availability and scalability is to decentralize and replicate functions and data, how do we coordinate the nodes? data consistency update propagation

More information

Absence of Global Clock

Absence of Global Clock Absence of Global Clock Problem: synchronizing the activities of different part of the system (e.g. process scheduling) What about using a single shared clock? two different processes can see the clock

More information

C 1. Recap: Finger Table. CSE 486/586 Distributed Systems Consensus. One Reason: Impossibility of Consensus. Let s Consider This

C 1. Recap: Finger Table. CSE 486/586 Distributed Systems Consensus. One Reason: Impossibility of Consensus. Let s Consider This Recap: Finger Table Finding a using fingers Distributed Systems onsensus Steve Ko omputer Sciences and Engineering University at Buffalo N102 86 + 2 4 N86 20 + 2 6 N20 2 Let s onsider This

More information

Logic Design II (17.342) Spring Lecture Outline

Logic Design II (17.342) Spring Lecture Outline Logic Design II (17.342) Spring 2012 Lecture Outline Class # 10 April 12, 2012 Dohn Bowden 1 Today s Lecture First half of the class Circuits for Arithmetic Operations Chapter 18 Should finish at least

More information

CS505: Distributed Systems

CS505: Distributed Systems Cristina Nita-Rotaru CS505: Distributed Systems. Required reading for this topic } Michael J. Fischer, Nancy A. Lynch, and Michael S. Paterson for "Impossibility of Distributed with One Faulty Process,

More information

CSE 4111/5111/6111 Computability Jeff Edmonds Assignment 3: Diagonalization & Halting Problem Due: One week after shown in slides

CSE 4111/5111/6111 Computability Jeff Edmonds Assignment 3: Diagonalization & Halting Problem Due: One week after shown in slides CSE 4111/5111/6111 Computability Jeff Edmonds Assignment 3: Diagonalization & Halting Problem Due: One week after shown in slides First Person: Second Person: Family Name: Family Name: Given Name: Given

More information

Formal Methods for Monitoring Distributed Computations

Formal Methods for Monitoring Distributed Computations Formal Methods for Monitoring Distributed Computations Vijay K. Garg Parallel and Distributed Systems Lab, Department of Electrical and Computer Engineering, The University of Texas at Austin, FRIDA 15

More information

Chapter 11 Time and Global States

Chapter 11 Time and Global States CSD511 Distributed Systems 分散式系統 Chapter 11 Time and Global States 吳俊興 國立高雄大學資訊工程學系 Chapter 11 Time and Global States 11.1 Introduction 11.2 Clocks, events and process states 11.3 Synchronizing physical

More information

Lecture 4 Event Systems

Lecture 4 Event Systems Lecture 4 Event Systems This lecture is based on work done with Mark Bickford. Marktoberdorf Summer School, 2003 Formal Methods One of the major research challenges faced by computer science is providing

More information

Time is an important issue in DS

Time is an important issue in DS Chapter 0: Time and Global States Introduction Clocks,events and process states Synchronizing physical clocks Logical time and logical clocks Global states Distributed debugging Summary Time is an important

More information

CS4026 Formal Models of Computation

CS4026 Formal Models of Computation CS4026 Formal Models of Computation Turing Machines Turing Machines Abstract but accurate model of computers Proposed by Alan Turing in 1936 There weren t computers back then! Turing s motivation: find

More information

Lecture Notes on Ordered Proofs as Concurrent Programs

Lecture Notes on Ordered Proofs as Concurrent Programs Lecture Notes on Ordered Proofs as Concurrent Programs 15-317: Constructive Logic Frank Pfenning Lecture 24 November 30, 2017 1 Introduction In this lecture we begin with a summary of the correspondence

More information

Recap. CS514: Intermediate Course in Operating Systems. What time is it? This week. Reminder: Lamport s approach. But what does time mean?

Recap. CS514: Intermediate Course in Operating Systems. What time is it? This week. Reminder: Lamport s approach. But what does time mean? CS514: Intermediate Course in Operating Systems Professor Ken Birman Vivek Vishnumurthy: TA Recap We ve started a process of isolating questions that arise in big systems Tease out an abstract issue Treat

More information

6.852: Distributed Algorithms Fall, Class 10

6.852: Distributed Algorithms Fall, Class 10 6.852: Distributed Algorithms Fall, 2009 Class 10 Today s plan Simulating synchronous algorithms in asynchronous networks Synchronizers Lower bound for global synchronization Reading: Chapter 16 Next:

More information

Figure 10.1 Skew between computer clocks in a distributed system

Figure 10.1 Skew between computer clocks in a distributed system Figure 10.1 Skew between computer clocks in a distributed system Network Instructor s Guide for Coulouris, Dollimore and Kindberg Distributed Systems: Concepts and Design Edn. 3 Pearson Education 2001

More information

Failure Detection and Consensus in the Crash-Recovery Model

Failure Detection and Consensus in the Crash-Recovery Model Failure Detection and Consensus in the Crash-Recovery Model Marcos Kawazoe Aguilera Wei Chen Sam Toueg Department of Computer Science Upson Hall, Cornell University Ithaca, NY 14853-7501, USA. aguilera,weichen,sam@cs.cornell.edu

More information

EE 144/244: Fundamental Algorithms for System Modeling, Analysis, and Optimization Fall 2014

EE 144/244: Fundamental Algorithms for System Modeling, Analysis, and Optimization Fall 2014 EE 144/244: Fundamental Algorithms for System Modeling, Analysis, and Optimization Fall 2014 Discrete Event Simulation Stavros Tripakis University of California, Berkeley Stavros Tripakis (UC Berkeley)

More information

Ordering and Consistent Cuts Nicole Caruso

Ordering and Consistent Cuts Nicole Caruso Ordering and Consistent Cuts Nicole Caruso Cornell University Dept. of Computer Science Time, Clocks, and the Ordering of Events in a Distributed System Leslie Lamport Stanford Research Institute About

More information

Parallel Performance Evaluation through Critical Path Analysis

Parallel Performance Evaluation through Critical Path Analysis Parallel Performance Evaluation through Critical Path Analysis Benno J. Overeinder and Peter M. A. Sloot University of Amsterdam, Parallel Scientific Computing & Simulation Group Kruislaan 403, NL-1098

More information

Finally the Weakest Failure Detector for Non-Blocking Atomic Commit

Finally the Weakest Failure Detector for Non-Blocking Atomic Commit Finally the Weakest Failure Detector for Non-Blocking Atomic Commit Rachid Guerraoui Petr Kouznetsov Distributed Programming Laboratory EPFL Abstract Recent papers [7, 9] define the weakest failure detector

More information

CS505: Distributed Systems

CS505: Distributed Systems Department of Computer Science CS505: Distributed Systems Lecture 5: Time in Distributed Systems Overview Time and Synchronization Logical Clocks Vector Clocks Distributed Systems Asynchronous systems:

More information

A VP-Accordant Checkpointing Protocol Preventing Useless Checkpoints

A VP-Accordant Checkpointing Protocol Preventing Useless Checkpoints A VP-Accordant Checkpointing Protocol Preventing Useless Checkpoints Roberto BALDONI Francesco QUAGLIA Bruno CICIANI Dipartimento di Informatica e Sistemistica, Università La Sapienza Via Salaria 113,

More information

Information-Theoretic Lower Bounds on the Storage Cost of Shared Memory Emulation

Information-Theoretic Lower Bounds on the Storage Cost of Shared Memory Emulation Information-Theoretic Lower Bounds on the Storage Cost of Shared Memory Emulation Viveck R. Cadambe EE Department, Pennsylvania State University, University Park, PA, USA viveck@engr.psu.edu Nancy Lynch

More information

Introduction to Turing Machines. Reading: Chapters 8 & 9

Introduction to Turing Machines. Reading: Chapters 8 & 9 Introduction to Turing Machines Reading: Chapters 8 & 9 1 Turing Machines (TM) Generalize the class of CFLs: Recursively Enumerable Languages Recursive Languages Context-Free Languages Regular Languages

More information

Functional Dependencies and Normalization

Functional Dependencies and Normalization Functional Dependencies and Normalization There are many forms of constraints on relational database schemata other than key dependencies. Undoubtedly most important is the functional dependency. A functional

More information

CSCI3390-Lecture 6: An Undecidable Problem

CSCI3390-Lecture 6: An Undecidable Problem CSCI3390-Lecture 6: An Undecidable Problem September 21, 2018 1 Summary The language L T M recognized by the universal Turing machine is not decidable. Thus there is no algorithm that determines, yes or

More information

Quiz 2 Solutions Room 10 Evans Hall, 2:10pm Tuesday April 2 (Open Katz only, Calculators OK, 1hr 20mins)

Quiz 2 Solutions Room 10 Evans Hall, 2:10pm Tuesday April 2 (Open Katz only, Calculators OK, 1hr 20mins) UNIVERSITY OF CALIFORNIA AT BERKELEY ERKELEY DAVIS IRVINE LOS ANGELES RIVERSIDE SAN DIEGO SAN FRANCISCO SANTA BARBARA SANTA CRUZ Department of Electrical Engineering and Computer Sciences Quiz 2 Solutions

More information

TESTING is one of the most important parts of the

TESTING is one of the most important parts of the IEEE TRANSACTIONS 1 Generating Complete Controllable Test Suites for Distributed Testing Robert M. Hierons, Senior Member, IEEE Abstract A test suite is m-complete for finite state machine (FSM) M if it

More information

Distributed Computing. Synchronization. Dr. Yingwu Zhu

Distributed Computing. Synchronization. Dr. Yingwu Zhu Distributed Computing Synchronization Dr. Yingwu Zhu Topics to Discuss Physical Clocks Logical Clocks: Lamport Clocks Classic paper: Time, Clocks, and the Ordering of Events in a Distributed System Lamport

More information

Turing Machines. 22c:135 Theory of Computation. Tape of a Turing Machine (TM) TM versus FA, PDA

Turing Machines. 22c:135 Theory of Computation. Tape of a Turing Machine (TM) TM versus FA, PDA Turing Machines A Turing machine is similar to a finite automaton with supply of unlimited memory. A Turing machine can do everything that any computing device can do. There exist problems that even a

More information

7680: Distributed Systems

7680: Distributed Systems Cristina Nita-Rotaru 7680: Distributed Systems Physical and logical clocks. Global states. Failure detection. Ordering events in distributed systems } Time is essential for ordering events in a distributed

More information

6. Finite State Machines

6. Finite State Machines 6. Finite State Machines 6.4x Computation Structures Part Digital Circuits Copyright 25 MIT EECS 6.4 Computation Structures L6: Finite State Machines, Slide # Our New Machine Clock State Registers k Current

More information

AGREEMENT PROBLEMS (1) Agreement problems arise in many practical applications:

AGREEMENT PROBLEMS (1) Agreement problems arise in many practical applications: AGREEMENT PROBLEMS (1) AGREEMENT PROBLEMS Agreement problems arise in many practical applications: agreement on whether to commit or abort the results of a distributed atomic action (e.g. database transaction)

More information

Week 4-5: Generating Permutations and Combinations

Week 4-5: Generating Permutations and Combinations Week 4-5: Generating Permutations and Combinations February 27, 2017 1 Generating Permutations We have learned that there are n! permutations of {1, 2,...,n}. It is important in many instances to generate

More information

Using Happens-Before Relationship to debug MPI non-determinism. Anh Vo and Alan Humphrey

Using Happens-Before Relationship to debug MPI non-determinism. Anh Vo and Alan Humphrey Using Happens-Before Relationship to debug MPI non-determinism Anh Vo and Alan Humphrey {avo,ahumphre}@cs.utah.edu Distributed event ordering is crucial Bob receives two undated letters from his dad One

More information

Recognizing Safety and Liveness by Alpern and Schneider

Recognizing Safety and Liveness by Alpern and Schneider Recognizing Safety and Liveness by Alpern and Schneider Calvin Deutschbein 17 Jan 2017 1 Intro 1.1 Safety What is safety? Bad things do not happen For example, consider the following safe program in C:

More information

15.1 Proof of the Cook-Levin Theorem: SAT is NP-complete

15.1 Proof of the Cook-Levin Theorem: SAT is NP-complete CS125 Lecture 15 Fall 2016 15.1 Proof of the Cook-Levin Theorem: SAT is NP-complete Already know SAT NP, so only need to show SAT is NP-hard. Let L be any language in NP. Let M be a NTM that decides L

More information

1 Introduction to information theory

1 Introduction to information theory 1 Introduction to information theory 1.1 Introduction In this chapter we present some of the basic concepts of information theory. The situations we have in mind involve the exchange of information through

More information

Semantic Equivalences and the. Verification of Infinite-State Systems 1 c 2004 Richard Mayr

Semantic Equivalences and the. Verification of Infinite-State Systems 1 c 2004 Richard Mayr Semantic Equivalences and the Verification of Infinite-State Systems Richard Mayr Department of Computer Science Albert-Ludwigs-University Freiburg Germany Verification of Infinite-State Systems 1 c 2004

More information

Algorithmic verification

Algorithmic verification Algorithmic verification Ahmed Rezine IDA, Linköpings Universitet Hösttermin 2018 Outline Overview Model checking Symbolic execution Outline Overview Model checking Symbolic execution Program verification

More information

Theoretical Foundations of the UML

Theoretical Foundations of the UML Theoretical Foundations of the UML Lecture 17+18: A Logic for MSCs Joost-Pieter Katoen Lehrstuhl für Informatik 2 Software Modeling and Verification Group moves.rwth-aachen.de/teaching/ws-1718/fuml/ 5.

More information

Implementing Uniform Reliable Broadcast with Binary Consensus in Systems with Fair-Lossy Links

Implementing Uniform Reliable Broadcast with Binary Consensus in Systems with Fair-Lossy Links Implementing Uniform Reliable Broadcast with Binary Consensus in Systems with Fair-Lossy Links Jialin Zhang Tsinghua University zhanggl02@mails.tsinghua.edu.cn Wei Chen Microsoft Research Asia weic@microsoft.com

More information

Distributed Consensus

Distributed Consensus Distributed Consensus Reaching agreement is a fundamental problem in distributed computing. Some examples are Leader election / Mutual Exclusion Commit or Abort in distributed transactions Reaching agreement

More information

Causality & Concurrency. Time-Stamping Systems. Plausibility. Example TSS: Lamport Clocks. Example TSS: Vector Clocks

Causality & Concurrency. Time-Stamping Systems. Plausibility. Example TSS: Lamport Clocks. Example TSS: Vector Clocks Plausible Clocks with Bounded Inaccuracy Causality & Concurrency a b exists a path from a to b Brad Moore, Paul Sivilotti Computer Science & Engineering The Ohio State University paolo@cse.ohio-state.edu

More information

Actors for Reactive Programming. Actors Origins

Actors for Reactive Programming. Actors Origins Actors Origins Hewitt, early 1970s (1973 paper) Around the same time as Smalltalk Concurrency plus Scheme Agha, early 1980s (1986 book) Erlang (Ericsson), 1990s Akka, 2010s Munindar P. Singh (NCSU) Service-Oriented

More information

Unreliable Failure Detectors for Reliable Distributed Systems

Unreliable Failure Detectors for Reliable Distributed Systems Unreliable Failure Detectors for Reliable Distributed Systems A different approach Augment the asynchronous model with an unreliable failure detector for crash failures Define failure detectors in terms

More information

Timo Latvala. March 7, 2004

Timo Latvala. March 7, 2004 Reactive Systems: Safety, Liveness, and Fairness Timo Latvala March 7, 2004 Reactive Systems: Safety, Liveness, and Fairness 14-1 Safety Safety properties are a very useful subclass of specifications.

More information

where Q is a finite set of states

where Q is a finite set of states Space Complexity So far most of our theoretical investigation on the performances of the various algorithms considered has focused on time. Another important dynamic complexity measure that can be associated

More information

Pairing Transitive Closure and Reduction to Efficiently Reason about Partially Ordered Events

Pairing Transitive Closure and Reduction to Efficiently Reason about Partially Ordered Events Pairing Transitive Closure and Reduction to Efficiently Reason about Partially Ordered Events Massimo Franceschet Angelo Montanari Dipartimento di Matematica e Informatica, Università di Udine Via delle

More information

Consensus and Universal Construction"

Consensus and Universal Construction Consensus and Universal Construction INF346, 2015 So far Shared-memory communication: safe bits => multi-valued atomic registers atomic registers => atomic/immediate snapshot 2 Today Reaching agreement

More information

arxiv: v1 [cs.dc] 3 Oct 2011

arxiv: v1 [cs.dc] 3 Oct 2011 A Taxonomy of aemons in Self-Stabilization Swan ubois Sébastien Tixeuil arxiv:1110.0334v1 cs.c] 3 Oct 2011 Abstract We survey existing scheduling hypotheses made in the literature in self-stabilization,

More information

S1 S2. checkpoint. m m2 m3 m4. checkpoint P checkpoint. P m5 P

S1 S2. checkpoint. m m2 m3 m4. checkpoint P checkpoint. P m5 P On Consistent Checkpointing in Distributed Systems Guohong Cao, Mukesh Singhal Department of Computer and Information Science The Ohio State University Columbus, OH 43201 E-mail: fgcao, singhalg@cis.ohio-state.edu

More information

Automata and Languages

Automata and Languages Automata and Languages Prof. Mohamed Hamada Software Engineering Lab. The University of Aizu Japan Mathematical Background Mathematical Background Sets Relations Functions Graphs Proof techniques Sets

More information

Shared Memory vs Message Passing

Shared Memory vs Message Passing Shared Memory vs Message Passing Carole Delporte-Gallet Hugues Fauconnier Rachid Guerraoui Revised: 15 February 2004 Abstract This paper determines the computational strength of the shared memory abstraction

More information

CS411 Notes 3 Induction and Recursion

CS411 Notes 3 Induction and Recursion CS411 Notes 3 Induction and Recursion A. Demers 5 Feb 2001 These notes present inductive techniques for defining sets and subsets, for defining functions over sets, and for proving that a property holds

More information

I R I S A P U B L I C A T I O N I N T E R N E LOGICAL TIME: A WAY TO CAPTURE CAUSALITY IN DISTRIBUTED SYSTEMS M. RAYNAL, M. SINGHAL ISSN

I R I S A P U B L I C A T I O N I N T E R N E LOGICAL TIME: A WAY TO CAPTURE CAUSALITY IN DISTRIBUTED SYSTEMS M. RAYNAL, M. SINGHAL ISSN I R I P U B L I C A T I O N I N T E R N E N o 9 S INSTITUT DE RECHERCHE EN INFORMATIQUE ET SYSTÈMES ALÉATOIRES A LOGICAL TIME: A WAY TO CAPTURE CAUSALITY IN DISTRIBUTED SYSTEMS M. RAYNAL, M. SINGHAL ISSN

More information

Impossibility of Distributed Consensus with One Faulty Process

Impossibility of Distributed Consensus with One Faulty Process Impossibility of Distributed Consensus with One Faulty Process Journal of the ACM 32(2):374-382, April 1985. MJ Fischer, NA Lynch, MS Peterson. Won the 2002 Dijkstra Award (for influential paper in distributed

More information

CS5412: REPLICATION, CONSISTENCY AND CLOCKS

CS5412: REPLICATION, CONSISTENCY AND CLOCKS 1 CS5412: REPLICATION, CONSISTENCY AND CLOCKS Lecture X Ken Birman Recall that clouds have tiers 2 Up to now our focus has been on client systems and the network, and the way that the cloud has reshaped

More information

CS3110 Spring 2017 Lecture 21: Distributed Computing with Functional Processes

CS3110 Spring 2017 Lecture 21: Distributed Computing with Functional Processes CS3110 Spring 2017 Lecture 21: Distributed Computing with Functional Processes Robert Constable Date for Due Date PS6 Out on April 24 May 8 (day of last lecture) 1 Introduction In the next two lectures,

More information

Quantifying Uncertainty & Probabilistic Reasoning. Abdulla AlKhenji Khaled AlEmadi Mohammed AlAnsari

Quantifying Uncertainty & Probabilistic Reasoning. Abdulla AlKhenji Khaled AlEmadi Mohammed AlAnsari Quantifying Uncertainty & Probabilistic Reasoning Abdulla AlKhenji Khaled AlEmadi Mohammed AlAnsari Outline Previous Implementations What is Uncertainty? Acting Under Uncertainty Rational Decisions Basic

More information

DESIGN THEORY FOR RELATIONAL DATABASES. csc343, Introduction to Databases Renée J. Miller and Fatemeh Nargesian and Sina Meraji Winter 2018

DESIGN THEORY FOR RELATIONAL DATABASES. csc343, Introduction to Databases Renée J. Miller and Fatemeh Nargesian and Sina Meraji Winter 2018 DESIGN THEORY FOR RELATIONAL DATABASES csc343, Introduction to Databases Renée J. Miller and Fatemeh Nargesian and Sina Meraji Winter 2018 1 Introduction There are always many different schemas for a given

More information

Rollback-Recovery. Uncoordinated Checkpointing. p!! Easy to understand No synchronization overhead. Flexible. To recover from a crash:

Rollback-Recovery. Uncoordinated Checkpointing. p!! Easy to understand No synchronization overhead. Flexible. To recover from a crash: Rollback-Recovery Uncoordinated Checkpointing Easy to understand No synchronization overhead p!! Flexible can choose when to checkpoint To recover from a crash: go back to last checkpoint restart How (not)to

More information