• Keine Ergebnisse gefunden

Life is not just Black and White

N/A
N/A
Protected

Academic year: 2021

Aktie "Life is not just Black and White"

Copied!
19
0
0

Wird geladen.... (Jetzt Volltext ansehen)

Volltext

(1)

Life is not just Black and White

Synchronous Message Passing (SMP) Asynchronous Message passing (AMP) But in practice:

Systems do not behave as cleanly as we modeled last week.

There is always some uncertainty

We can’t give any guarantee on system’s performance in AMP

Can we reduce event uncertainty to less than the diameter of the graph?

Faults?

(2)

Life is not just Black and White

The plan for the current week :

- Make use of assumed bounds on end- to-end communication (d)

Extend SMP simulations to cover Crash Faults

Define TMP (Timed Messages Passing)

Limit AMP using local hardware clocks

Prove last week’s results in TMP

(3)

(Clean) Crash Faults

A failed node stops executing the algorithm:

- FSM stops. No further progress

- If crashed during computation some subset of the messages may be sent

- All sent messages are valid messages

SMP: subset of messages in the round it failed.

No future actions

AMP: subset of the messages at the point it failed. No future actions

(TMP: similar to AMP)

(4)

Detecting Crash Faults

SMP: not receiving messages that should have arrived

AMP: no way to detect (as we discuss later on) TMP: how to tell that a message we expect

to receive will never arrive !!

(5)

Simple SMP detection algorithm (� )

SMP: Detection whether node, w, succeeds sending its message when its input is 1.

1. Round 1: Node w sends 1 if its input is 1, output ⊥ 2. Round 2: if received 1 from w output 1, otherwise

output 0.

=> if w succeeds to send 1, its neighbors that receive the message output 1 (all other nodes output 0)

=> If w crashes before sending or if its input is 0, all output 0

(what about w ? Output ?)

(6)

A State Machine in ASM

Inputs / messages

messages outputs

state

The sequence of messages and outputs depends solely on

1. the initial state, initial input, and

2. the sequence of messages and inputs it receives

(7)

AMP can’t simulate SMP with Crash Faults

AMP: Assume (in contrast) that there exists a simulation.

A simulating algorithm, � , needs to provide, for each AMP run, a sequence of outputs that algorithm � outputs in a possible SMP run We will prove that no algorithm in AMP can

simulate algorithm �

1. We need to consider all possible algorithms 2. We have no idea how � works. But we

know that a deterministic algorithm behaves in a consistent way, at each node

3. We will play with similarity of runs

(8)

A State Machine in ASM

Inputs / messages

messages outputs

state

The sequence of messages and outputs depends solely on 1. the initial state and initial input

2. the sequence of messages and inputs it receives (RUN)

(9)

SMP – degrees of freedom

AMP: we assume that algorithm � simulates � Algorithm � needs to provide, for each AMP

run, a sequence of outputs that algorithm � outputs in a possible SMP run

1. So it needs to do so also in specific runs we choose.

2. Look at runs in which only w may fail.

3. Furthermore, runs in which when w fails it happens right after waking up and before sending any message.

4. One can also assume a specific network

(10)

AMP – Alg designer and the scheduler

AMP: we assume in contrast that there exists such algorithm � that simulates �

Algorithm � needs to function under all

possible AMP runs (the scheduler’s choice) 1. � instructs nodes how to exchange

messages, even send their whole state and wait for others’ actions , as long as possible 2. Nodes need to output a value after a finite

number of steps.

3. Recall, � is deterministic. The state machine at each node does the same for the same

sequence of events (run).

(11)

AMP can’t simulate SMP with Crash Faults

AMP: Assume there exists a simulation. Look at runs in which only w may fail

1. Scenario 0: w wakes up with input 0 but crashes before sending any message

2. All SMP runs output “0” at each node.

3. Execute � , round robin, one node at a time.

4. At some point all nodes, other than w, including a neighboring node v, should output 0. Call this run X

5. We will now apply X to other scenarioes.

We will make sure that every node will see

the same sequence of events

(12)

AMP can’t simulate SMP with Crash Faults

AMP: Assume there exists a simulation. Look at runs in which only w may fail

1. Scenario 1: w wakes up with input 1 but crashes before sending any message

2. All SMP runs output “0” at each node.

3. Execute � , by providing run X to all nodes.

4. At some point all nodes, other than w, including a neighboring node v, should output 0.

5. We will now apply X to another scenario.

Again, we will make sure that every node

will see the same sequence of events

(13)

AMP can’t simulate SMP with Crash Faults

AMP: Assume there exists a simulation. Look at run in which only w may fail

1. Scenario 2: w wakes up with input 1 but it is VERY VERY VERY slow, as the model allows.

2. In AMP, execute run X. Every node (but w)

follows � , and takes the same actions. Once all nodes output 0, let w continue.

3. THEY CANNOT OUTPUT 1.

4. Notice that without the possibility of a crash the neighbors of w could wait for it to send a message.

5. A contradiction. SMP outputs 1 at some v

(14)

A State Machine in TSM

Inputs / messages

messages outputs

state

The sequence of messages and outputs depends solely on 1. the initial state and initial input

2. the sequence of messages and inputs it receives 3. hardware clock readings

H

(15)

The Timed Message Passing model (TMP)

- Each network node has a local hardware clock H - Each hardware clocks ’follows’ real-time

- Clocks may drift apart, but there is a bound such � that

- There is a bound d on end-to-end messages’

transmission time

- Calculate logical time L

- How to model the state machine?

- an event:

+ wake up, get/send message, timer, input

+ processing events ....

(16)

TMP detection algorithm (simplified)

TMP: Assume that only w may crash. All nodes wake up at the same time with the same local hardware time, 0.

EX 1: design an algorithm similar to the one we

previously desbribed for the SMP model

(17)

Sender/Receiver Synchronization

Assume a node w has acccess to external time source

EX 2: design an algorithm to synchronize the clocks of

its neighbors

(18)

TMP detection algorithm (simplified)

TMP: Assume a that only w may crash. All nodes wake up at the same time and same local hardware time, 0.

1. Wake up: Node w sends 1 when its input is 1

2. By local time d : if received 1 from � w output 1, otherwise output 0.

Þ if w succeeds to send 1, when waking up, its neighbors output 1

Þ If w crashes before sending, all output 0

Þ BUT HOW CAN WE SYNCHRONIZE THE CLOCKS?

(19)

Sender/Receiver Synchronization

• Round-Trip Time (RTT) based synchronization

• Receiver synchronizes to the sender‘s clock

• Propagation delay  and clock offset  can be calculated

t1

t2 t3

t4

w

v Time according

to v Request

from v Answer

from w

Time according to w

2 2

2

4 3 1

2 3

4 1

2

2 3 1

4

) t (t + ) t

= (t δ)) + (t (t δ)) + (t

= (t θ

) t (t ) t

= (t δ

Referenzen

ÄHNLICHE DOKUMENTE

The aim of this book is to describe how solar photovoltaic (PV) and wind energy have a huge potential to supply clean water for the developing world, in particular in areas with

Hier ansässige schwarze Künstler ließen mit ihren Gedichten Einblicke indas Leben als Aüchtling aufeinem fremden Konti-..

Kategorie Palmöl/fett (bitte eintragen, wenn Palmbestandteile enthalten sind) Best in Food GmbH | Mittellinie 159 | 26160 Bad Zwischenahn. www.bestinfood.de | info@bestinfood.de

Recently the RIFLE criteria have been modified by the Acute Kidney Injury Network (AKIN) [4], and the change in eGFR is no longer included in this consensus definition set..

The introduction of different shades of grey may help to improve the interpretation of diagnostic test results and, more importantly, improve clinical

Unless the deceased deposited access information for online accounts, his or her dependents will have no easy way of accessing this data and will therefore have to rely on

The performance of the loop digester (F1) was compared with a conventional mesophilic digester (F2) using the key performance indicators (KPI) SMY, anaerobic digestion efficiency

The East-West Center promotes better relations and understanding among the people and nations of the United States, Asia, and the Pacific through cooperative study, research, and