jade: the bully algorithm

6
JADE: The Bully Algorithm

Upload: natane

Post on 20-Jan-2016

49 views

Category:

Documents


0 download

DESCRIPTION

JADE: The Bully Algorithm. Problem. Context of distributed computing Problem of leader election: leader election is the process of designating a single process as the organizer of some task distributed among several computers (nodes). - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: JADE: The Bully Algorithm

JADE: The Bully Algorithm

Page 2: JADE: The Bully Algorithm

ProblemContext of distributedcomputing

Problem of leader election:leader election is the process of designating a single process as the organizer of some task distributed among several computers (nodes).

Before the task is begun, all network nodes are unaware which node will serve as the "leader," or coordinator, of the task.

After a leader election algorithm has been run, each node recognizes a particular, unique node as the task leader.

The network nodes communicate among themselves in order to decide which of them will get into the "leader" state

Nodes can crash and resume

Page 3: JADE: The Bully Algorithm

The Bully Algorithm

The bully algorithm is a method indistributed computing for dynamicallyselecting a coordinator by process ID number.

When a process P determines that the current coordinator is down because of message timeouts, it performs the following:P broadcasts an election message to all other processes with higher process IDs.

If P hears from no process with a higher process ID, it wins the election and broadcasts victory.

If P hears from a process with a higher ID, P waits a certain amount of time for that process to broadcast itself as the leader. If it does not receive this message in time, it re-broadcasts the election message.

Page 4: JADE: The Bully Algorithm

The Bully Algorithm.

Page 5: JADE: The Bully Algorithm

ImplementationEach node is an agent.Each node is assigned a PID number.Actions that each node has to perform during the evolution of the algorithm are mapped into behaviours.Wait for messages (with a certain template)Start electionReply no to agents with lower PIDQuery if coordinator is aliveAnswer I’m alive

Behaviours interact each other putting other behaviours (even themselves) in the queue.

Page 6: JADE: The Bully Algorithm

Screenshots