/
What Can Be Implemented Anonymously ? What Can Be Implemented Anonymously ?

What Can Be Implemented Anonymously ? - PowerPoint Presentation

debby-jeon
debby-jeon . @debby-jeon
Follow
375 views
Uploaded On 2015-10-18

What Can Be Implemented Anonymously ? - PPT Presentation

Paper by Rachid Guerraui and Eric Ruppert Presentation by Amir Anter 1 Talk outline What is anonymously Motivation Anonymously implementation Counter Snapshot Consensus Summary ID: 164691

anonymously amp consensus weak amp anonymously weak consensus counters process anonymous segment wait registers object free return counter correctness

Share:

Link:

Embed:

Download Presentation from below link

Download Presentation The PPT/PDF document "What Can Be Implemented Anonymously ?" is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.


Presentation Transcript

Slide1

What Can Be Implemented Anonymously ?

Paper by Rachid Guerraui and Eric Ruppert

Presentation by Amir Anter

1Slide2

Talk outline

What is anonymously ?MotivationAnonymously implementationCounterSnapshotConsensusSummary

2Slide3

Talk outline

What is anonymously ?Anonymously implementationCounterSnapshotConsensusSummary

3Slide4

What is anonymously ?

There is no unique identifiers for the processes.4Slide5

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

.

p

0

p

1

p

2

1

1

1

2

2

2Slide6

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!!

p

0

p

1

p

2

1

1

1

2

2

2Slide7

Motivation

Sensor networks – Might not have id’sPrivacy:

Web serversPeer-to-peer sharing systems7Slide8

Talk outline

What is anonymously? Anonymously implementationWeak CounterSnapshotConsensusSummary

8Slide9

Anonymously Implementation

Number of processes is know – n.Shared memory – multi-reader, multi-writer.Using registersCrash failures may occurDeterministicAsynchronous

9Slide10

Wait freedom

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

10Slide11

Talk outline

What is anonymously? Anonymously implementationWeak CounterSnapshotConsensusSummary

11Slide12

Atomic Counter

Read-Modify-Write operation:

Fetch-and-

add

(

w

,

d

)

do atomically

prev

:=w

w:=

prev+

d

return

prev

12Slide13

Atomic Counter

13

Example: the sequential spec of a counter H0: 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:2H4

: c.f&i() c:0

c.f&i() c:1 c.f&i

() c:2 c.f&i() c:3

..

. Slide14

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.

14Slide15

Anonymous Counter

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

15Slide16

Weak Counters

Single operation: GetTimestampReturns an integerProperties: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.16Slide17

Weak Counters

17

Example: the sequential spec of a weak counter H0:

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

H4

: c.f&i() c:0

c.f&i() c:1 c.f&i()

c:1 c.f&i()

c:2

..

. Slide18

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]=1.12

3

4

A

1

1

1

0

0

0

18Slide19

Weak Counters

1

23

4

A

0

0

0

0

0

0

19Slide20

Weak Counters

a

Last location returned by the process’s previous GetTimestamp operation.20Slide21

Weak Counters

L

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

Weak Counters

j

Local variableThe number of times the process has seen L changes.22Slide23

Weak Counters

t

Local variableThe largest value the process has seen in L.23Slide24

Weak Counters

1

2

3

4

A

1

1

0

0

0

0

Line 3, iteration # 1: a=1 , b=2 , l=2

A[2]=1

24Slide25

Weak Counters

1

2

3

4

A

1

1

0

0

0

0

Line 3, iteration # 2: a=1 , b=4 , l=2

A[4]=0

25Slide26

Weak Counters

1

2

3

4

A

1

1

0

0

0

0

Line 11, iteration # 1: a=1 , b=4

mid=2

A[2]=1

 a=3

26Slide27

Weak Counters

1

2

3

4

A

1

1

0

0

0

0

Line 11, iteration # 2: a=3 , b=4

mid=3

A[3]=

0

 b=3

27Slide28

Weak Counters

1

2

3

4

A

1

1

1

0

0

0

Line 11, iteration # 3

a=3=b

 A[3]=1 , L=3

28Slide29

Weak Counters

Wait freedomThe second loop stops – binary search.The first loop stopsIf j≥n then return tIn any finite execution in which k GetTimestamp operations are invoked:

O(k) registers are accessed.Any operation takes O(log k).29Slide30

Weak Counters

30Slide31

Talk outline

What is anonymously? Anonymously implementationWeak CounterSnapshotConsensusSummary

31Slide32

Snapshot object

R[1…n] registersOperationsScanReturns 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!

32Slide33

A wait-free simulation of atomic snapshot

33

Initially segment[i].ts=0, segment[i].data=vi, segment[i].view=<v0, …, vn-1>

Scan

i

(S)

for all j <>

i

c[j]=Segment[j]

while true do

for all j a[j] = Segment[j]

for all j b[j] = Segment[j]

if, for all j a[j]=b[j] ;

Comparison includes timestamp!

return <b[0].data, …, b[n-1].data>

;

Direct scan

else if, for some j ≠

i

, b[j].

ts

- c[j].

ts

≥ 2 return b[j].view ;

Indirect scan

Update

i

(S, d)

view:=

scan

()

Segment[

i

]=<segment[

i

].ts+1, d, view>Slide34

Anonymous snapshot object

R[1…m] registersOperationsScanReturns 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]34Slide35

Anonymous snapshot object

35Slide36

Anonymous snapshot object

The algorithm is anonymous and wait-free.The average number of steps per operation in any finite execution

is36Slide37

Talk outline

What is anonymously? Anonymously implementationWeak CounterSnapshotConsensusSummary

37Slide38

Consensus Object

38Slide39

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.Slide40

FIFO queue + registers can implement 2-process consensus

40

Decide(v) ; code for pi, i=0,1Prefer[i]:=vqval=Q.deq()

if (qval = 0) then return v

else return

Prefer

[1-i]

Initially

Q

=<0> 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.Slide41

Anonymous Consensus

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

41Slide42

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.42Slide43

Consensus

43Slide44

Consensus

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

Correct44Slide45

Consensus - Obstruction freedom

Let’s see that if process is running by itself it eventually halts.

45Slide46

Consensus - Obstruction freedom

Let C be any configuration.

m is the maximum value of R in C.P run by itself forever from C.46Slide47

Consensus - Obstruction freedom

l

ap increases at least once every iterationsEventually and Now P will write values larger than m to in the next iterations.

47Slide48

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.48Slide49

Consensus - correctness

Let m be the minimum value in

All values in are less than m.

49Slide50

Consensus - correctness

Claim 1: After T, at most n UPDATES write smaller value than m to R.

50Slide51

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.

51Slide52

Consensus - correctness

Claim 2: After T, at most n UPDATES write a value to

52Slide53

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

53Slide54

Consensus - correctness

We get that for at least

values of i. P will change its local value to 0 in line 5.

54Slide55

Talk outline

What is anonymously? Anonymously implementationWeak CounterSnapshotConsensusSummary

55Slide56

Summary

We showed anonymous algorithms by using only read/write registers.Weak counter – wait free implementationSnapshot object – wait free implementationsConsensus – obstruction free implementation

56Slide57

Thank you!

57