lecture #12 distributed algorithms (i)

21
Lecture #12 Distributed Algorithms (I) CS492 Special Topics in Computer Science: Distributed Algorithms and Systems

Upload: maine

Post on 23-Feb-2016

57 views

Category:

Documents


0 download

DESCRIPTION

Lecture #12 Distributed Algorithms (I). CS492 Special Topics in Computer Science: Distributed Algorithms and Systems. Admin Stuff. Quiz #5 return Cloud computing article Lynch’s book chapters. The Byzantine Generals Problem. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Lecture #12 Distributed Algorithms (I)

Lecture #12Distributed Algorithms (I)

CS492 Special Topics in Computer Science:Distributed Algorithms and Systems

Page 2: Lecture #12 Distributed Algorithms (I)

2

Admin Stuff

• Quiz #5 return• Cloud computing article• Lynch’s book chapters

Page 3: Lecture #12 Distributed Algorithms (I)

3

The Byzantine Generals Problem

• An agreement problem between the Byzantine generals on whether to attack a city or not– Messengers are not lost, but …– There may be traitors among them

• To find an algorithm to ensure that the loyal gen-erals will reach agreement– Traitors can trick some to attack and other not to– They can force an attack when no general wants– They can confuse some that the generals cannot decide

Page 4: Lecture #12 Distributed Algorithms (I)

4

When the mesg is sent orally

A

B C

Page 5: Lecture #12 Distributed Algorithms (I)

5

Answer:

• There is no solution with fewer than 3m+1 generals can cope with m traitors

Page 6: Lecture #12 Distributed Algorithms (I)

6

Reference

“The Byzantine Generals Problem”Leslie Lamport, Robert Shostak, Marshall PeaseACM Trans. on Programming Languages and Systems, Vol. 4, No. 3, July 1982, pp 382-401

Page 7: Lecture #12 Distributed Algorithms (I)

7

Distributed Algorithms

• A large variety of concurrent algorithms– Originally refer to algorithms that were designed

to run on many processors “distributed” over a large geographical area

– Nowadays those on LAN or even on shared mem-ory multiprocessors

Page 8: Lecture #12 Distributed Algorithms (I)

8

Attributes of distributed algorithms

• IPC• Timing model• Failure model• Problems the algorithms solve– Resource allocation, communication, consensus,

database concurrency control, deadlock detection, global snapshots, synchronization, etc.

Page 9: Lecture #12 Distributed Algorithms (I)

9

General Style of Work

• Problems of significance in practical distrib-uted computing identified

• Abstract versions are defined• Algorithms are developed– They are describe precisely and proved to solve

the stated problems; their complexity analyzed• Impossibility results and lower bounds proved

Page 10: Lecture #12 Distributed Algorithms (I)

10

Topics to Cover

• Synchronous Network Model (Ch. 2-4)– Leader election in a synchronous ring– Breadth-first search– Shortest paths– Min spanning tree– Maximal independent set

• Asynchronous System Model (Ch. 8-9)– Asynchronous shared memory model

Page 11: Lecture #12 Distributed Algorithms (I)

Synchronous Network Systems

• Synchronous Network System as a GraphG = (V, E) where n = |V|M : some fixed alphabetstatesi

starti

msgsi

transi

Page 12: Lecture #12 Distributed Algorithms (I)

12

A round = two steps

1. Apply the message-generation function2. Apply the state-transition function

Page 13: Lecture #12 Distributed Algorithms (I)

13

Difference from a traditional automata

• Accepting states vs halting states

Page 14: Lecture #12 Distributed Algorithms (I)

Failures

• Process vs link failures

• Byzantine failure– A process can generate its next messages and next

state in some arbitrary way, without necessarily following the rules specified by its message-gen-eration and state-transition functions.

Page 15: Lecture #12 Distributed Algorithms (I)

Inputs and Outputs

• Adopt a simple convention to encode the in-puts and outputs in the states

Page 16: Lecture #12 Distributed Algorithms (I)

Executions

• An execution of the system is an infinite se-quence

C0, M1, N1, C1, M2, N2, C3, M3, N3, …

– C: state assignment– M: message assignment (messages sent)– N: message assignment (messages received)

Page 17: Lecture #12 Distributed Algorithms (I)

Proof Methods

• invariant assertion– A property of the system state that is true in every exe-

cution, after every round.– Generally proved by induction on r

• simulation– A goal to show A “implements” another asynchronous

algorithm B, in the sense of producing the same input/ouput behavior.

– Generally proved by induction on r

Page 18: Lecture #12 Distributed Algorithms (I)

Complexity Measures

• time complexity

• communication complexity

Page 19: Lecture #12 Distributed Algorithms (I)

19

Still, how different from an automata?

• Add a random function to pick new states at each round

Page 20: Lecture #12 Distributed Algorithms (I)

20

Now our first problem

• Leader election in a synchronous ring

Page 21: Lecture #12 Distributed Algorithms (I)

The Problem• Electing a unique leader

– In a ring, exactly one process should output the decision that it is the leader.

• Versions– All non-leaders declare non-leader.– The ring can be unidirectional or bidirectional.– The number of nodes can be known or not.– Processes can have identical identifiers or not.

• The former = impossibility result for identical processes• Thus, usually the processes are assumed to be identical except for the

identifier.