Election algorithms Flashcards

1
Q

Define Election algorithms and give an example

A

Algorithms for choosing a unique process to play a particular role

E.g. choose mutual exclusion central server from among the processes that need to use the critical section

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

State a key property of an elected process

A

Choice of elected process must be unique, even if several processes call elections concurrently

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

The performance of an election algorithm is measured by?

A

♦ Total network bandwidth utilisation (total messages sent)

♦ Turnaround time – number of serialised message transmission times between initiation and termination of a single run

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What type is Chang and Roberts algorithm?

A

ring-based election

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

In Chang and Roberts algorithm how are processes arranged?

A

Processes are arranged in a logical ring

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Explain how in Chang and Roberts algorithm processes send messages

A

Each process p(i) has a communication channel to the next process in the ring, p(i+1)modN.

All messages sent clockwise around the ring.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the goal of Chang and Roberts algorithm?

A

to elect the coordinator, the process with the largest identifier

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

In Chang and Roberts algorithm how are elections initiated?

A

Any process can initiate an election
♦ Marks itself as a participant
♦ Places its identifier in an election message
♦ Sends the message to its clockwise neighbour

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What happens in Chang and Roberts algorithm when a process p[k] receives an election message with enclosed ID p[i]?

A

♦ If p[k] non-participant, forward max(p[i], p[k]); mark itself as participant
♦ If p[k] participant, forward p[i]only if p[i]> p[k] otherwise do nothing

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What happens in Chang and Roberts algorithm when a process p[k] receives an election message and (p[i]== p[k])?

A

♦ p[k] becomes coordinator

♦ Mark itself non-participant; send elected message with its ID to neighbour

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What happens in Chang and Roberts algorithm when a process p[k] receives an elected message with enclosed ID p[i]?

A

♦ Mark itself as non-participant
♦ Set elected[k] = p[i]
♦ If (p[k] != coordinator)
{Forward message to neighbour}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Performance of ring-based election algorithm - state how E1 is met (2 points)

A

♦ All identifiers are compared; a process must receive its own identifier back before sending an elected message
♦ For any two processes, the one with the larger
identifier will not pass on the other’s identifier =>
impossible that both should receive their own identifiers back

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Performance of ring-based election algorithm - state how E2 is met (

A

E2 follows immediately from the guaranteed traversals of the ring (no failures)
♦ non-participant and participant states used so that messages arising when another process starts a
concurrent election are extinguished as soon as
possible, before the winning election result has been
announced

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Give the worst case performance of ring-based election algorithm If only a single process starts an election.

A

Worst case is when anti-clockwise neighbour has the highest identifier

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

In the worst case performance of ring-based election algorithm how many messages are required to reach the winner?

A

N-1 messages are needed to reach this neighbour

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

In the worst case performance of ring-based election algorithm how many messages are required for the winner to receive it’s own identifier?

A

N messages required for this winner to receive its own identifier

17
Q

In the worst case performance of ring-based election algorithm how many elected messages are sent?

A

The elected message is sent N times

18
Q

In the worst case performance of ring-based election algorithm how many messages are sent in total?

A

3N-1 messages

19
Q

State the worst case performance of ring-based election algorithm in terms of:

  • bandwidth utilisation
  • turnaround time
A

Worst case bandwidth utilisation – 3N-1 messages

Worst case turnaround time – O(3N-1)