The problem is that we would like to avoid all computers know each other, but only the leader.
Leadership elections are the problem of choosing the only leader out of many potential candidate candidates. Look at this as having two essential properties: resilience and safety. Here, vitality will mean "most of the time, there is a leader," while security will mean "there is either zero or one leader." Let's look at how we enable this security feature in your example using broadcast.
We choose a simple (broken) algorithm, assuming that each node has a unique identifier. Each node translates its identifier and listens. Upon receipt of a higher identifier than his own, he ceases to participate. If he receives a lower identifier than his own, he sends his own transmissions again. Accepting a synchronous network, the last identifier that everyone receives is the leader identifier. Now imagine the network partition. The protocol will happily continue on both sides of the section, and two leaders will be elected.
This applies to this broken protocol, but also applies to all possible protocols. How do you tell the difference between nodes that you cannot communicate with and nodes that do not exist if you do not know (at least) how many nodes exist? So, there is the first result of security: you need to know how many nodes exist, or you cannot guarantee that there is only one leader.
Now let me relax our security constraint as probabilistic: "there may be zero or more leaders, but most often there is one." This makes the problem acceptable, and the widely used solution is gossip (epidemic protocols). For example, see the Gossip-Style Failure Detection Service , which discusses a variant of this exact problem. This is mainly about probabilistically correct fault detection and enumeration, but if you can do this, you can make probabilistically correct leader choices.
As far as I can tell, you cannot have safe, non-probabilistic election of leaders in common networks without listing at least the participants.
Marc brooker
source share