What Can Be Implemented Anonymously ? Paper by Rachid Guerraui and Eric Ruppert Presentation by Amir Anter 1.

Slides:



Advertisements
Similar presentations
C++ Programming:. Program Design Including
Advertisements

Mutual Exclusion – SW & HW By Oded Regev. Outline: Short review on the Bakery algorithm Short review on the Bakery algorithm Black & White Algorithm Black.
Two absolute bounds for distributed bit complexity Yefim Dinitz, Noam Solomon, 2007 Presented by: Or Peri & Maya Shuster.
1 © R. Guerraoui The Limitations of Registers R. Guerraoui Distributed Programming Laboratory.
N-Consensus is the Second Strongest Object for N+1 Processes Eli Gafni UCLA Petr Kuznetsov Max Planck Institute for Software Systems.
The weakest failure detector question in distributed computing Petr Kouznetsov Distributed Programming Lab EPFL.
1 © R. Guerraoui The Power of Registers Prof R. Guerraoui Distributed Programming Laboratory.
Failure Detection The ping-ack failure detector in a synchronous system satisfies – A: completeness – B: accuracy – C: neither – D: both.
Mutual Exclusion By Shiran Mizrahi. Critical Section class Counter { private int value = 1; //counter starts at one public Counter(int c) { //constructor.
Multiprocessor Synchronization Algorithms ( ) Lecturer: Danny Hendler The Mutual Exclusion problem.
CPSC 668Set 18: Wait-Free Simulations Beyond Registers1 CPSC 668 Distributed Algorithms and Systems Fall 2006 Prof. Jennifer Welch.
Consensus problem Agreement. All processes that decide choose the same value. Termination. All non-faulty processes eventually decide. Validity. The common.
1 © R. Guerraoui Implementing the Consensus Object with Timing Assumptions R. Guerraoui Distributed Programming Laboratory.
Byzantine Generals Problem: Solution using signed messages.
CPSC 668Set 19: Asynchronous Solvability1 CPSC 668 Distributed Algorithms and Systems Fall 2006 Prof. Jennifer Welch.
CPSC 668Set 3: Leader Election in Rings1 CPSC 668 Distributed Algorithms and Systems Spring 2008 Prof. Jennifer Welch.
CPSC 668Set 9: Fault Tolerant Consensus1 CPSC 668 Distributed Algorithms and Systems Spring 2008 Prof. Jennifer Welch.
CSE115/ENGR160 Discrete Mathematics 03/03/11 Ming-Hsuan Yang UC Merced 1.
CPSC 668Set 17: Fault-Tolerant Register Simulations1 CPSC 668 Distributed Algorithms and Systems Fall 2009 Prof. Jennifer Welch.
Distributed systems Module 2 -Distributed algorithms Teaching unit 1 – Basic techniques Ernesto Damiani University of Bozen Lesson 2 – Distributed Systems.
CPSC 668Set 11: Asynchronous Consensus1 CPSC 668 Distributed Algorithms and Systems Fall 2009 Prof. Jennifer Welch.
 Idit Keidar, Principles of Reliable Distributed Systems, Technion EE, Spring Principles of Reliable Distributed Systems Lecture 12: Impossibility.
Distributed Systems Tutorial 4 – Solving Consensus using Chandra-Toueg’s unreliable failure detector: A general Quorum-Based Approach.
C++ Programming: From Problem Analysis to Program Design, Third Edition Chapter 17: Recursion.
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS Fall 2011 Prof. Jennifer Welch CSCE 668 Set 11: Asynchronous Consensus 1.
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS Spring 2014 Prof. Jennifer Welch CSCE 668 Set 19: Asynchronous Solvability 1.
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS Fall 2011 Prof. Jennifer Welch CSCE 668 Set 18: Wait-Free Simulations Beyond Registers 1.
Distributed Algorithms Lecture 10b – by Ali Ghodsi Fault-Tolerance in Asynchronous Networks – Probabilistic Consensus.
1 Chapter 9 Synchronization Algorithms and Concurrent Programming Gadi Taubenfeld © 2014 Synchronization Algorithms and Concurrent Programming Synchronization.
CSC 211 Data Structures Lecture 13
1 © R. Guerraoui Regular register algorithms R. Guerraoui Distributed Programming Laboratory lpdwww.epfl.ch.
Java Programming: Guided Learning with Early Objects Chapter 11 Recursion.
Data Structure Introduction.
Common2 extended to stacks and unbound concurrency By:Yehuda Afek Eli Gafni Adam Morrison May 2007 Presentor: Dima Liahovitsky 1.
CS294, Yelick Consensus revisited, p1 CS Consensus Revisited
Approximation of δ-Timeliness Carole Delporte-Gallet, LIAFA UMR 7089, Paris VII Stéphane Devismes, VERIMAG UMR 5104, Grenoble I Hugues Fauconnier, LIAFA.
Distributed systems Consensus Prof R. Guerraoui Distributed Programming Laboratory.
SysRép / 2.5A. SchiperEté The consensus problem.
Hwajung Lee.  Improves reliability  Improves availability ( What good is a reliable system if it is not available?)  Replication must be transparent.
Chapter 15: Recursion. Objectives In this chapter, you will: – Learn about recursive definitions – Explore the base case and the general case of a recursive.
Agreement in Distributed Systems n definition of agreement problems n impossibility of consensus with a single crash n solvable problems u consensus with.
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS Spring 2014 Prof. Jennifer Welch CSCE 668 Set 3: Leader Election in Rings 1.
1 Fault tolerance in distributed systems n Motivation n robust and stabilizing algorithms n failure models n robust algorithms u decision problems u impossibility.
Distributed Algorithms (22903) Lecturer: Danny Hendler The wait-free hierarchy and the universality of consensus This presentation is based on the book.
Replication predicates for dependent-failure algorithms Flavio Junqueira and Keith Marzullo University of California, San Diego Euro-Par Conference, Lisbon,
DISTRIBUTED ALGORITHMS Spring 2014 Prof. Jennifer Welch Set 9: Fault Tolerant Consensus 1.
“Towards Self Stabilizing Wait Free Shared Memory Objects” By:  Hopeman  Tsigas  Paptriantafilou Presented By: Sumit Sukhramani Kent State University.
Distributed Algorithms (22903) Lecturer: Danny Hendler The Atomic Snapshot Object The Renaming Problem This presentation is based on the book “Distributed.
Concurrent Computing Seminar Introductory Lecture Instructor: Danny Hendler
“Distributed Algorithms” by Nancy A. Lynch SHARED MEMORY vs NETWORKS Presented By: Sumit Sukhramani Kent State University.
Distributed Algorithms (22903) Lecturer: Danny Hendler Shared objects: linearizability, wait-freedom and simulations Most of this presentation is based.
Chapter 15: Recursion. Recursive Definitions Recursion: solving a problem by reducing it to smaller versions of itself – Provides a powerful way to solve.
1 © R. Guerraoui Set-Agreement (Generalizing Consensus) R. Guerraoui.
Distributed Algorithms (22903)
CSE15 Discrete Mathematics 03/06/17
Computing with anonymous processes
A Balanced Introduction to Computer Science David Reed, Creighton University ©2005 Pearson Prentice Hall ISBN X Chapter 13 (Reed) - Conditional.
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS
Distributed Algorithms (22903)
Distributed Algorithms (22903)
Distributed Algorithms (22903)
Distributed Algorithms (22903)
Distributed Algorithms (22903)
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS
Distributed Algorithms (22903)
R. Guerraoui Distributed Programming Laboratory lpdwww.epfl.ch
A Balanced Introduction to Computer Science David Reed, Creighton University ©2005 Pearson Prentice Hall ISBN X Chapter 13 (Reed) - Conditional.
Computing with anonymous processes
Distributed systems Consensus
R. Guerraoui Distributed Programming Laboratory lpdwww.epfl.ch
Presentation transcript:

What Can Be Implemented Anonymously ? Paper by Rachid Guerraui and Eric Ruppert Presentation by Amir Anter 1

Talk outline  What is anonymously ?  Motivation  Anonymously implementation  Counter  Snapshot  Consensus  Summary 2

Talk outline  What is anonymously ?  Anonymously implementation  Counter  Snapshot  Consensus  Summary 3

What is anonymously ?  There is no unique identifiers for the processes. 4

5 Leader election in rings Each process has to decide whether it is a leader or not Termination states are partitioned to elected and not-elected. In every execution, exactly one process enters an elected state, all others enter a non-elected state. We assume rings are oriented. p0p0 p1p1 p2p

6 Leader election in anonymous rings A ring algorithm is anonymous if processes don’t have an ID they can use in the algorithm (all perform the same code) An anonymous leader election algorithm is… Impossible!! p0p0 p1p1 p2p

Motivation  Sensor networks – Might not have id’s  Privacy:  Web servers  Peer-to-peer sharing systems 7

Talk outline  What is anonymously?  Anonymously implementation  Weak Counter  Snapshot  Consensus  Summary 8

Anonymously Implementation  Number of processes is know – n.  Shared memory – multi-reader, multi-writer.  Using registers  Crash failures may occur  Deterministic  Asynchronous 9

Wait freedom Definition: An algorithm is wait-free if a process invoking it will finish after a finite number of steps 10

Talk outline  What is anonymously?  Anonymously implementation  Weak Counter  Snapshot  Consensus  Summary 11

Atomic Counter Read-Modify-Write operation: Fetch-and-add(w, d) do atomically prev:=w w:= prev+d return prev 12

Atomic Counter 13 Example: the sequential spec of a counter H 0 : H 1 : c.f&i() c:0 H 2 : c.f&i() c:0 c.f&i() c:1 H 3 : c.f&i() c:0 c.f&i() c:1 c.f&i() c:2 H 4 : c.f&i() c:0 c.f&i() c:1 c.f&i() c:2 c.f&i() c:3...

Atomic Counter It has been shown by Herlihy that fetch& increment object has no wait-free implementation from registers, even for the non anonymous case. 14

Anonymous Counter So how can we implement a counter only from registers and also anonymously ?! 15

Weak Counters  Single operation: GetTimestamp  Returns an integer  Properties:  Let GetTimestamp(t) = x, GetTimestamp(t’)=x’, If t≥t’ then x ≥x’.  If GetTimestamp was invoked n times then each of those invocation returned a value x ≤n.  Weaker version of fetch&increment.  Strong enough for our purposes. 16

Weak Counters 17 Example: the sequential spec of a weak counter H 0 : H 1 : c.f&i() c:0 H 2 : c.f&i() c:0 c.f&i() c:1 H 3 : c.f&i() c:0 c.f&i() c:1 c.f&i() c:1 H 4 : c.f&i() c:0 c.f&i() c:1 c.f&i() c:1 c.f&i() c:2...

Weak Counters Array A[1,2,…] of binary registers. Initially each register A[i]=0. Invariant: If A[k]=1, then all entries A[1..k]= A

Weak Counters 1234 A

Weak Counters a - Last location returned by the process’s previous GetTimestamp operation. 20

Weak Counters L -Shared register initialized to 0. -When process change some A[b] to 1, it also writes b to L. 21

Weak Counters j -Local variable -The number of times the process has seen L changes. 22

Weak Counters t -Local variable -The largest value the process has seen in L. 23

Weak Counters 1234 A Line 3, iteration # 1: a=1, b=2, l=2 A[2]=1 24

Weak Counters 1234 A Line 3, iteration # 2: a=1, b=4, l=2 A[4]=0 25

Weak Counters 1234 A Line 11, iteration # 1: a=1, b=4 mid=2 A[2]=1  a=3 26

Weak Counters 1234 A Line 11, iteration # 2: a=3, b=4 mid=3 A[3]=0  b=3 27

Weak Counters 1234 A Line 11, iteration # 3 a=3=b  A[3]=1, L=3 28

Weak Counters Wait freedom  The second loop stops – binary search.  The first loop stops  If j≥n then return t In any finite execution in which k GetTimestamp operations are invoked:  O(k) registers are accessed.  Any operation takes O(log k). 29

Weak Counters 30

Talk outline  What is anonymously?  Anonymously implementation  Weak Counter  Snapshot  Consensus  Summary 31

Snapshot object  R[1…n] registers  Operations  Scan  Returns a vector V, where V is an n-element vector called a view (with a value for each segment).  Update(d)  Process i writes d to R[i] V[i] must return the value of the latest Update i operation (or the initial value if there were none) Scan returns a snapshot of the segments array that existed at some point during the execution! 32

A wait-free simulation of atomic snapshot 33 Initially segment[i].ts=0, segment[i].data=v i, segment[i].view= Scan i (S) 1.for all j <> i c[j]=Segment[j] 2.while true do 3. for all j a[j] = Segment[j] 4. for all j b[j] = Segment[j] 5. if, for all j a[j]=b[j] ; Comparison includes timestamp! 6. return ; Direct scan 7. else if, for some j ≠ i, b[j].ts - c[j].ts ≥ 2 8. return b[j].view ; Indirect scan Update i (S, d) 1.view:=scan() 2.Segment[i]=

Anonymous snapshot object  R[1…m] registers  Operations  Scan  Returns a vector V, where V is an m-element vector called a view (with a value for each segment).  Update(i,x)  Writes x to R[i] 34

Anonymous snapshot object 35

Anonymous snapshot object  The algorithm is anonymous and wait-free.  The average number of steps per operation in any finite execution is 36

Talk outline  What is anonymously?  Anonymously implementation  Weak Counter  Snapshot  Consensus  Summary 37

Consensus Object 38

39 Formally: Consensus Object - Supports a single operation: decide - Each process p i calls decide with some input v i from some domain. decide returns a value from the same domain. - The following requirements must be met: Agreement: In any execution E, all decide operations must return the same value. Validity: The values returned by the operations must equal one of the inputs.

FIFO queue + registers can implement 2-process consensus 40 Decide(v) ; code for p i, i=0,1 1.Prefer[i]:=v 2.qval=Q.deq() 3.if (qval = 0) then return v 4.else return Prefer[1-i] Initially Q= and Prefer[i]=null, i=0,1 There is a proof that wait-free consensus for 2 or more processes cannot be solved by registers.

Anonymous Consensus So how can we implement it only from registers and also anonymously ?! 41

Obstruction freedom  Obstruction-freedom guarantees that a process will complete its algorithm whenever it has an opportunity to take enough steps without interruption by other processes. 42

Consensus 43

Consensus  The algorithm is using 8n+2 registers.  Anonymous  Uses anonymous snapshot object.  Obstruction free  Correct 44

Consensus - Obstruction freedom  Let’s see that if process is running by itself it eventually halts. 45

Consensus - Obstruction freedom  Let C be any configuration.  m is the maximum value of R in C.  P run by itself forever from C. 46

Consensus - Obstruction freedom  lap increases at least once every iterations  Eventually and  Now P will write values larger than m to in the next iterations. 47

Consensus - correctness  Let P’ be a process that decides 0 (without loss of generality).  Let T be the time P’ last scans R and S’ that scan.  We shall show that every other process that terminates also decides 0. 48

Consensus - correctness  Let m be the minimum value in  All values in are less than m. 49

Consensus - correctness  Claim 1: After T, at most n UPDATES write smaller value than m to R. 50

Consensus - correctness  Proof: n+1 writes, let’s look at the first process P that writes to R in the second time.  4n+1>n one of the values in is at least m, from line 10 we get that P local P will write at least m to R. 51

Consensus - correctness  Claim 2: After T, at most n UPDATES write a value to 52

Consensus - correctness  Proof: n+1 writes, let’s look at the iteration of the first process P that writes to R in the second time.  At most n values are greater than m in  From claim 1, at most n values are smaller than m in 53

Consensus - correctness  We get that for at least values of i. P will change its local value to 0 in line 5. 54

Talk outline  What is anonymously?  Anonymously implementation  Weak Counter  Snapshot  Consensus  Summary 55

Summary  We showed anonymous algorithms by using only read/write registers.  Weak counter – wait free implementation  Snapshot object – wait free implementations  Consensus – obstruction free implementation 56

Thank you! 57