Coordination and Agreement: Check Point Threat Extraction Secured This Document
Coordination and Agreement: Check Point Threat Extraction Secured This Document
A ring-based algorithm
Arrange processes in a logical ring to rotate a token
Wait for the token if it requires to enter the critical section
The ring could be unrelated to the physical configuration
pi sends messages to p(i+1) mod N
when a process requires to enter the critical section, waits for the token
when a process holds the token
If it requires to enter the critical section, it can enter
when a process releases a token (exit), it sends to its neighbor
If it doesn‘t, just immediately forwards the token to its neighbor
Elections
•Properties
safety: only the process with the largest id can send an elected message
liveness: every process in the ring eventually participates in the election;
extra elections are stopped Performance
one election, best case, when?
N election messages
N elected messages
turnaround: 2N messages
one election, worst case, when?
2N - 1 election messages
N elected messages
turnaround: 3N - 1 messages
can't tolerate failures, not very practical
The bully election algorithm
•Assumption
– Each process knows which processes have higher identifiers, and that it can
communicate with all such processes
•Compare with ring-based election
– Processes can crash and be detected by timeouts
• synchronous
• timeout T = 2Ttransmitting (max transmission delay) + Tprocessing (max
processing delay)
•Three types of messages
– Election: announce an election
– Answer: in response to Election
– Coordinator: announce the identity of the elected process
Multicast Communication
Group (multicast) communication: for each of a group of processes to
receive copies of the messages sent to the group, often with delivery
guarantees
The set of messages that every process of the group should receive
On the delivery ordering across the group members
Challenges
Efficiency concerns include minimizing overhead activities and increasing
throughput and bandwidth utilization
Delivery guarantees ensure that operations are completed
Types of group
Static or dynamic: whether joining or leaving is considered Closed or open
A group is said to be closed if only members of the group can multicast to
it. Reliable Multicast
Simple basic multicasting (B-multicast) is sending a message to every
process that is a member of a defined group
B-multicast (g, m) for each process p ∈ group g, send (p, message m)
On receive (m) at p: B-deliver (m) at p
Reliable multicasting (R-multicast) requires these properties
Integrity: a correct process sends a message to only a member of the group
Validity: if a correct process sends a message, it will eventually bedelivered
Agreement: if a message is delivered to a correct process, all other correct
processes in the group will deliver it
Types of message ordering
Three types of message ordering
– FIFO (First-in, first-out) ordering: if a correct process delivers a message
before another, every correct process will deliver the first message before the
other
– Casual ordering: any correct process that delivers the second message will
deliver the previous message first
– Total ordering: if a correct process delivers a message before another, any
other correct process that delivers the second message will deliver the first
message first
•Note that
– FIFO ordering and casual ordering are only partial orders
– Not all messages are sent by the same sending process
– Some multicasts are concurrent, not able to be ordered by happened before –
Total order demands consistency, but not a particular order
Note that T1 and T2 are delivered in opposite order to the physical time of
message creation
Bulletin board example (FIFO ordering)
• A bulletin board such as Web Board at NJIT illustrates the desirability of
consistency and FIFO ordering. A user can best refer to preceding messages if
they are delivered in order. Message 25 in Figure 12.13 refers to message 24,
and message 27 refers to message 23.
• Note the further advantage that Web Board allows by permitting messages to
begin threads by replying to a particular message. Thus messages do not have
to be displayed in the same order they are delivered
Implementing total ordering
• The normal approach to total ordering is to assign totally ordered identifiers to
multicast messages, using the identifiers to make ordering decisions.
• One possible implementation is to use a sequencer process to assign identifiers.
See Figure
12.14. A drawback of this is that the sequencer can become a bottleneck.
• An alternative is to have the processes collectively agree on identifiers. A
simple algorithm is shown in Figure 12.15.
Consensus Process
1. Each process pi begins in an undecided state and proposes a single value vi,
drawn from a set D (i=1…N)
2. Processes communicate with each other, exchanging values
3. Each process then sets the value of a decision variable di and enters the decided
state
Requirements for Consensus
• Problem description
– Three or more generals must agree to attack or to retreat
– One general, the commander, issues the order
– Other generals, the lieutenants, must decide to attack or retreat
– One or more generals may be treacherous
• A treacherous general tells one general to attack and another to retreat
• Difference from consensus is that a single process supplies the value to agree
on
• Requirements
– Termination: eventually each correct process sets its decision variable
– Agreement: the decision variable of all correct processes is the same
– Integrity: if the commander is correct, then all correct processes agree on the
value that the commander has proposed (but the commander need not be
correct)