0% found this document useful (0 votes)
71 views

Bully Election Algorithm

The Bully election algorithm is used to elect a new coordinator when the existing coordinator fails. It works by having each site send an ELECTION message to sites with higher IDs. If none of those sites respond, the site wins the election and becomes the new coordinator. Otherwise, the site with the highest ID that responds takes over as coordinator. The algorithm simulates this process and outputs the number of ELECTION and COORDINATOR messages exchanged.

Uploaded by

Pranav Nayak
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
71 views

Bully Election Algorithm

The Bully election algorithm is used to elect a new coordinator when the existing coordinator fails. It works by having each site send an ELECTION message to sites with higher IDs. If none of those sites respond, the site wins the election and becomes the new coordinator. Otherwise, the site with the highest ID that responds takes over as coordinator. The algorithm simulates this process and outputs the number of ELECTION and COORDINATOR messages exchanged.

Uploaded by

Pranav Nayak
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 6

Election Algorithm: Bully

Election Algorithms

• Choosing a coordinator site.

• Coordinator generally distributes work, takes care of a failed site etc.

• The coordinator is to be elected.

• Every site has an unique id.

• Higher the id higher the precedence to be elected as a coordinator.


Bully Election Algorithm

When is it invoked?

Election starts when the old coordinator no longer responds


to the requests of the sites.

Who starts it?

Any process who notices that coordinator is not responding.


Example
Bully Election Algorithm

Process

1. Site S sends an ELECTION message to all processes with higher numbers.

2. If no one responds, S wins the election and becomes a coordinator.

3. If one of the higher ups answers , it takes over. P’s job is done.

4. When a site receives an ELECTION message from lower numbered site, it sends an OK message, saying that
he is alive and will take over.

5. Eventually, all but one takes over and announces himself to be the COORDINATOR, with coordinator
message.
Lab Expt :

Input:

Number of sites

Priority(optional)

Initiator site

Output: Simulate the algorithm

Number of messages

• Election

• OR

• Coordinator

You might also like