39
Multicast Communication

Multicast Communication. Unicast vs. Multicast Multicast Whereas the majority of network services and network applications use unicast for IPC, multicasting

Embed Size (px)

Citation preview

Page 1: Multicast Communication. Unicast vs. Multicast Multicast Whereas the majority of network services and network applications use unicast for IPC, multicasting

Multicast Communication

Page 2: Multicast Communication. Unicast vs. Multicast Multicast Whereas the majority of network services and network applications use unicast for IPC, multicasting

Unicast vs. MulticastUnicast vs. Multicast

s e n de r re ce iv e r

O n e - to -o n e co m m u n ica t io n o r u n ica s t G ro u p co m m u n ica t io n o r m u lt ica s t

Page 3: Multicast Communication. Unicast vs. Multicast Multicast Whereas the majority of network services and network applications use unicast for IPC, multicasting

MulticastMulticast

• Whereas the majority of network services and network applications use unicast for IPC, multicasting is useful for applications such as:

online conferences, interactive distance learning, and can be used for applications such as online auction. It can also be used in replication of services for fault tolerance.

Page 4: Multicast Communication. Unicast vs. Multicast Multicast Whereas the majority of network services and network applications use unicast for IPC, multicasting

Mutlicast groupMutlicast group

• In an application or network service which makes use of multicasting, a set of processes form a group, called a multicast group. Each process in a group can send and receive message. A message sent by any process in the group can be received by each participating process in the group. A process may also choose to leave a multicast group.

 

• In an application such as online conferencing, a group of processes interoperate using multicasting to exchange audio, video, and/or text data.

Page 5: Multicast Communication. Unicast vs. Multicast Multicast Whereas the majority of network services and network applications use unicast for IPC, multicasting

What is Reliable Multicasting?What is Reliable Multicasting?

• Reliability could mean messages are delivered:– To each process

– In same order

– In timely manner

– No duplicates

• Ensure reliability when– Processes enter/leave the group

– Processes fail while communicating

Page 6: Multicast Communication. Unicast vs. Multicast Multicast Whereas the majority of network services and network applications use unicast for IPC, multicasting

Reliable Multicast vs. Unreliable MulticastReliable Multicast vs. Unreliable Multicast

• When a multicast message is sent by a process, the runtime support of the multicast mechanism is responsible for delivering the message to each process currently in the multicast group.

• Due to factors such as failures of network links and/or network hosts, routing delays, and differences in software and hardware, the time between when a unicast message is sent and when it is received may vary among the recipient processes.

Page 7: Multicast Communication. Unicast vs. Multicast Multicast Whereas the majority of network services and network applications use unicast for IPC, multicasting

Reliable Multicast vs. Unreliable MulticastReliable Multicast vs. Unreliable Multicast

• Moreover, a message may not be received by one or more of the processes at all, due to errors and/or failures in the network, the machines, or the runtime support.

• Whereas some applications, such as video conferencing, can tolerate an occasional miss or misordering of messages, there are applications – such as database applications – for which such anomalies are unacceptable.

• Therefore, when employing a multicasting mechanism for an application, it is important that you choose one with the characteristics appropriate for your application. Otherwise, measures will need to be provided in the coding of the application in order to handle the anomalies which may occur in message delivery.

Page 8: Multicast Communication. Unicast vs. Multicast Multicast Whereas the majority of network services and network applications use unicast for IPC, multicasting

Reliable Multicasting ChallengesReliable Multicasting Challenges

• Reliable multicasting can cause more network congestion:

– Than unicast group, because large amounts of data are transmitted to recipients distribute over WAN

– Than unreliable multicast group, because of additional control messages ensuring reliability

• Protocol– TCP is point-to-point

– Multicast is not connection oriented

– UDP does not provide reliability

– Applications have to offer reliability (over UDP)

Page 9: Multicast Communication. Unicast vs. Multicast Multicast Whereas the majority of network services and network applications use unicast for IPC, multicasting

Classification of multicasting mechanisms in terms of message delivery -1

Classification of multicasting mechanisms in terms of message delivery -1

Unreliable multicast: At its most basic, a multicast system will make a good-faith attempt to deliver messages to each participating process, but the arrival of the correct message at each process is not guaranteed.

In the best case, the correct message is received by all processes.

• In some cases, the message may be received by some but not all,

• The messages may be received by some processes in a corrupted form. Such a system is said to provide unreliable multicast.

 

Page 10: Multicast Communication. Unicast vs. Multicast Multicast Whereas the majority of network services and network applications use unicast for IPC, multicasting

Classification of multicasting mechanisms in terms of message delivery - 2

Classification of multicasting mechanisms in terms of message delivery - 2

Reliable multicast: A multicast system which guarantees that each message is eventually delivered to each process in the group in uncorrupted form is said to provide reliable multicast.

Page 11: Multicast Communication. Unicast vs. Multicast Multicast Whereas the majority of network services and network applications use unicast for IPC, multicasting

Classification of multicasting mechanisms in terms of message delivery - 3

Classification of multicasting mechanisms in terms of message delivery - 3

• The definition of reliable multicast requires that each participating process receives exactly one copy of each message sent. However, the definition places no restriction on the order that the messages are delivered to each process: each process may receive the messages in any permutation of those messages.

• For applications where the order of message delivery is significant, it is helpful to further classify reliable multicast systems based on the order of the delivery of messages.

Page 12: Multicast Communication. Unicast vs. Multicast Multicast Whereas the majority of network services and network applications use unicast for IPC, multicasting

Reliable MulticastReliable Multicast• Integrity: A correct (i.e., non-faulty) process p in a

group(m) delivers a multicast message m at most once.

– Safety property: any message delivered is identical to the one that was sent

• Validity: If a correct process multicasts (sends) message m, then it will eventually deliver m.

– Guarantees liveness to the sender.

– Liveness property: any message is eventually delivered to destination

• Agreement: If a correct process delivers message m, then all the other correct processes in group(m) will eventually deliver m.

– Property of “all or nothing.”

– Validity and agreement together ensure overall liveness: if some correct process multicasts a message m, then all correct processes deliver m too.

Page 13: Multicast Communication. Unicast vs. Multicast Multicast Whereas the majority of network services and network applications use unicast for IPC, multicasting

Reliable Multicast AlgorithmReliable Multicast Algorithm

R-multicast

B-multicast

reliable unicast

“USES”

“USES”

Page 14: Multicast Communication. Unicast vs. Multicast Multicast Whereas the majority of network services and network applications use unicast for IPC, multicasting

Reliable Multicast Algorithm (R-multicast)Reliable Multicast Algorithm (R-multicast)

Integrity

Agreement

if some correct process B-multicasts a message m, then,

all correct processes deliver m too. If no correct process

B-multicasts m, then no correct processes deliver m.

Integrity, Validity

Page 15: Multicast Communication. Unicast vs. Multicast Multicast Whereas the majority of network services and network applications use unicast for IPC, multicasting

Classification of reliable multicast Classification of reliable multicast Unordered

An unordered reliable multicast system provides no guarantee on the delivery order of the messages.

Example: Processes P1, P2, and P3 have formed a multicast group. Further suppose that three messages, m1, m2, m3 have been sent to the group. Then an unordered reliable multicast system may deliver the messages to each of the three processes in any of the 3! = 6 permutations (m1-m2-m3, m1-m3-m2, m2-m1-m3, m2-m3-m1, m3-m1-m2, m3-m2-m1). Note that it is possible for each participant to receive the messages in an order different from the orders of messages delivered to other participants.

Page 16: Multicast Communication. Unicast vs. Multicast Multicast Whereas the majority of network services and network applications use unicast for IPC, multicasting

Ordered MulticastOrdered Multicast

• FIFO ordering: If a correct process issues multicast(g,m) and then multicast(g,m’), then every correct process that delivers m’ will have already delivered m.

• Causal ordering: If multicast(g,m) multicast(g,m’) then any correct process that delivers m’ will have already delivered m.

• Total ordering: If a correct process delivers message m before m’, then any other correct process that delivers m’ will have already delivered m.

Page 17: Multicast Communication. Unicast vs. Multicast Multicast Whereas the majority of network services and network applications use unicast for IPC, multicasting

Total, FIFO and Causal OrderingTotal, FIFO and Causal Ordering

F3

F1

F2

T2

T1

P1 P2 P3

Time

C3

C1

C2

•Totally ordered messages T1 and T2.

•FIFO-related messages F1

and F2.

•Causally-related messages C1 and C3

• Causal ordering implies FIFO ordering• Total ordering does not imply causal ordering. • Causal ordering does not imply total ordering.• Hybrid mode: causal-total ordering, FIFO-total ordering.

Totally-ordered

FIFO-ordered

Causal-ordered

Page 18: Multicast Communication. Unicast vs. Multicast Multicast Whereas the majority of network services and network applications use unicast for IPC, multicasting

Example: Display From Bulletin Board Program

Example: Display From Bulletin Board Program

Bulletin board: os.interesting

Item From Subject

23 A.Hanlon Mach

24 G.Joseph Microkernels

25 A.Hanlon Re: Microkernels

26 T.L’Heureux RPC performance

27 M.Walker Re: Mach

end

What is the most appropriate ordering for this application?(a) FIFO (b) causal (c) total

Post to Bulletin Board

User 1

Post to Bulletin Board

User 2

Page 19: Multicast Communication. Unicast vs. Multicast Multicast Whereas the majority of network services and network applications use unicast for IPC, multicasting

FIFO-ORDERED MULTICASTFIFO-ORDERED MULTICAST

Page 20: Multicast Communication. Unicast vs. Multicast Multicast Whereas the majority of network services and network applications use unicast for IPC, multicasting

Process messages from each process in the order they were sent: Each process keeps a sequence

number for each other process.

Messages are sent with local sequence number

When a message is received, as expected (next sequence), accept

higher than expected, buffer in a queue

lower than expected, reject

Providing Ordering Guarantees (FIFO) Providing Ordering Guarantees (FIFO)

If Message# is

Page 21: Multicast Communication. Unicast vs. Multicast Multicast Whereas the majority of network services and network applications use unicast for IPC, multicasting

Hold-back Queue for Arrived Multicast Messages: received yet undelivered messages

Hold-back Queue for Arrived Multicast Messages: received yet undelivered messages

Messageprocessing

Delivery queueHold-back

queue

deliver

Incomingmessages

When delivery guarantees aremet

FO-deliver

Page 22: Multicast Communication. Unicast vs. Multicast Multicast Whereas the majority of network services and network applications use unicast for IPC, multicasting

Implementing FIFO Ordering (FIFO-ordered multicast)

Implementing FIFO Ordering (FIFO-ordered multicast)

• Spg: count of messages p has sent to g.

• Rqg: the recorded sequence number of the latest message

that p has delivered from q to the group g.

• For p to FO-multicast m to g– p increments Sp

g by 1

– p “piggy-backs” the value Spg onto the message.

– p B-multicasts m to g.

• At process p, upon receipt of m from q with sequence number S:

– p checks whether S= Rqg+1. If so, p FO-delivers m and increments Rq

g

– If S > Rqg+1, p places the message in the hold-back queue until the

intervening messages have been delivered and S= Rqg+1.

– If S < Rqg+1, then drop the message (we have already seen the

message)

Page 23: Multicast Communication. Unicast vs. Multicast Multicast Whereas the majority of network services and network applications use unicast for IPC, multicasting

Example: FIFO Multicast Example: FIFO Multicast

P1

P2

P3

0 0 0

Physical Time

1 0 0 2 0 0

1 0 0 2 0 0 2 1 0

2 1 0

0 0 0

0 0 0

2 1 0

0 0 0 1 0 0 2 1 0

11 12 2 1

1

Reject: 1 < 1 + 1

Accept 1 = 0 + 1

Accept: 2 = 1 + 1

2 0 0

Buffer 2 > 0 +

1

Accept: 1 = 0 + 1

2 0 0

Accept Buffer 2 = 1 + 1

Reject: 1 < 1 + 1

Accept 1 = 0 + 1

Sequence Vector for P1

(do NOT confuse with vector timestamps)

0 0 0

S1g R2

gR3

g

0 0 0

R1g S2

g R3g

Sequence Vector for P2

Page 24: Multicast Communication. Unicast vs. Multicast Multicast Whereas the majority of network services and network applications use unicast for IPC, multicasting

Classification of reliable multicast - 2Classification of reliable multicast - 2

04/20/2324

FIFO multicastA system which guarantees that the delivery of the messages adhere to the following condition is said to provide FIFO (first-in-first-out) or send-order multicast:

If process P sent messages mi and mj, in that order, then each process in the multicast group will be delivered the messages mi and mj, in that order.

Suppose P1 sends messages m1, m2, and m3 in order, then each process in the group is guaranteed to have those messages delivered in that same order: m1, m2, then m3.

Page 25: Multicast Communication. Unicast vs. Multicast Multicast Whereas the majority of network services and network applications use unicast for IPC, multicasting

Classification of reliable multicast - 2Classification of reliable multicast - 2

04/20/2325

Note that FIFO multicast places no restriction on the delivery order among messages sent by different processes.

To illustrate the point, let us use a simplified example of a multicast group of two processes: P1 and P2. Suppose P1 sends messages m11 then m12, while P2

sends messages m21 then m22. Then a FIFO multicast system can deliver the messages to each of the two processes in any of the following orders:

m11-m12-m21-m22,

m11-m21-m12-m22,

m11-m21-m22-m12,

m21-m11-m12-m22

m21-m11-m22-m12

m21-m22-m11-m12.

 

Page 26: Multicast Communication. Unicast vs. Multicast Multicast Whereas the majority of network services and network applications use unicast for IPC, multicasting

CAUSAL-ORDERED MULTICASTCAUSAL-ORDERED MULTICAST

Page 27: Multicast Communication. Unicast vs. Multicast Multicast Whereas the majority of network services and network applications use unicast for IPC, multicasting

Causal MulticastCausal Multicast

• Let us focus on multicast group g

• Each process iєg maintains a vector Vgi of length |g|

where– Vg

i[j] counts the number of group g messages from j to i

• Messages multicast by process i are tagged with the vector timestamp Vg

i

• Recall rule for receiving vector timestamps

Max(Vreceiver[j] , Vmessage[j]), if j is not self

Vreceiver[j] + 1 otherwise

• i.e. when process i receives a <m,Vgj> from j, then

– Vgi[k] = max(Vg

i[k], Vgj[k]) if k ≠ i

– Vgi[k] = Vg

i[k] + 1 if k = i

• Remember V(a) < V(b) iff a happens before b

Vreceiver[j] =

Page 28: Multicast Communication. Unicast vs. Multicast Multicast Whereas the majority of network services and network applications use unicast for IPC, multicasting

Causal Ordering using vector timestampsCausal Ordering using vector timestamps

The number of group-g messagesfrom process j that have been seen atprocess i so far

Guarantees Causal ordering

Page 29: Multicast Communication. Unicast vs. Multicast Multicast Whereas the majority of network services and network applications use unicast for IPC, multicasting

Example: Causal Ordering Multicast Example: Causal Ordering Multicast

P1

P2

P3

Physical Time

(1,1,0)

Reject:

Accept

0,0,0

0,0,0

0,0,0

1,0,0 1,1,0

1,0,0

Buffer missing P1(1) (1,1,0) >(1,0,0)

1,1,0

1,1,0

1,1,0

Accept

1,0,0

Accept Buffered message

1,1,0

(1,0,0)

(1,0,0)

(1,1,0) (1,1,0)

Accept

Page 30: Multicast Communication. Unicast vs. Multicast Multicast Whereas the majority of network services and network applications use unicast for IPC, multicasting

Causal Order Multicast – example1Causal Order Multicast – example1

04/20/2330

Suppose three processes P1, P2, and P3 are in a multicast group. P1 sends a message m1, to which P2 replies with a multicast message m2. Since m2 is triggered by m1, the two messages share a causal relationship of m1-> m2. Suppose the receiving of m2 in turn triggers a multicast message m3 sent by P3, that is, m2-> m3. The three messages share the causal relationship of m1-> m2-> m3. A causal-order multicast message system ensures that these three messages will be delivered to each of the three processes in the order of m1- m2- m3.

Page 31: Multicast Communication. Unicast vs. Multicast Multicast Whereas the majority of network services and network applications use unicast for IPC, multicasting

Causal Order Multicast – example2Causal Order Multicast – example2

04/20/2331

As a variation of the above example, suppose P1 multicasts message m1, to which P2 replies with a multicast message m2, and independently P3 replies to m1 with a multicast message m3. The three messages now share these causal relationships: m1 -> m2 and m1 -> m3. A causal-order multicast system can delivery these message in either of the following orders:

m1- m2- m3

m1- m3- m2

since the causal relations are preserved in either of the two sequences. In such a system, it is not possible for the messages to be delivered to any of the processes in any other permutation of the three messages, such as m2- m1- m3 or m3- m1- m2, the first of these violates the causal relationship m1 -> m2 , while the second permutation violates the causal relationship m1 -> m3.

Page 32: Multicast Communication. Unicast vs. Multicast Multicast Whereas the majority of network services and network applications use unicast for IPC, multicasting

TOTAL-ORDERED MULTICASTTOTAL-ORDERED MULTICAST

Page 33: Multicast Communication. Unicast vs. Multicast Multicast Whereas the majority of network services and network applications use unicast for IPC, multicasting

1st Method - Using Sequencer1st Method - Using Sequencer

• Delivery algorithm similar to FIFO

• Except that processes maintain group specific sequence number (as opposed to process specific sequence number)

• Sender attaches unique id ‘i’ to each message m and sends <m,i> to the sequencer(g) as well as to group g

• Sequencer maintains group specific sequence number Sg (consecutive and increasing) and B-multicasts order messages to g

Page 34: Multicast Communication. Unicast vs. Multicast Multicast Whereas the majority of network services and network applications use unicast for IPC, multicasting

Total Ordering Using a Sequencer (Method 1)Total Ordering Using a Sequencer (Method 1)

P1 sequencer

P3P2

<m,i>

<m,i>

<m,i>

Sg

<order, i, Sg><order, i, Sg>

, Sg+1

rg rg

unique msg id

- Single point of failure- Bottleneck

Group g: P1, P2, P3

Sequencer (g) :

Page 35: Multicast Communication. Unicast vs. Multicast Multicast Whereas the majority of network services and network applications use unicast for IPC, multicasting

2nd Method - ISIS Algorithm2nd Method - ISIS Algorithm

• Processes collectively agree on sequence numbers (priority) in three rounds

• Sender sends message m with its id to all receivers;

• Receivers suggest priority (sequence number) and reply to sender with proposed priority;

• Sender collects all proposed priorities; decides on final priority (breaking ties with process ids), and resends the agreed final priority for message m

• Receivers deliver message m according to decided final priority

Page 36: Multicast Communication. Unicast vs. Multicast Multicast Whereas the majority of network services and network applications use unicast for IPC, multicasting

ISIS algorithm for total ordering (Method 2)ISIS algorithm for total ordering (Method 2)

2

1

1

2

2

1 Message

2 Proposed Seq

P2

P3

P1

P4

3 Agreed Seq

3

3

Group g: P1, P2, P3, P4

Page 37: Multicast Communication. Unicast vs. Multicast Multicast Whereas the majority of network services and network applications use unicast for IPC, multicasting

ISIS algorithm for total orderingISIS algorithm for total ordering

1. sender p B-multicasts <m,i> with message m and unique id i to everyone.

2. On receiving m (first time) 1. m is added to a priority queue and tagged as undeliverable2. reply to sender with proposed priority, i.e., a sequence number

» seq number = 1 + largest seq number heard so far, suffixed with the recipient’s process ID

3. priority queue is always sorted by priority

3. Sender 1. collects all responses from the recipients, 2. calculates their maximum, and 3. re-multicasts (B-multicast) original message with this as the final priority for m  

4. On receiving m (with final priority) 1. mark the message as deliverable, 2. reorder the priority queue, and 3. deliver the set of lowest priority messages that are marked as deliverable.

Page 38: Multicast Communication. Unicast vs. Multicast Multicast Whereas the majority of network services and network applications use unicast for IPC, multicasting

Proof of Total Order (By Contradition)Proof of Total Order (By Contradition)

• For m1, consider the first process p that delivers m1

– At p, let m1 have the agreed sequence number (finalpriority(m1)) and marked deliverable (at the front of the hold-back priority queue)

– Let m2 be another message that has not yet been delivered

» i.e., m2 is on the same queue (it has not been assigned its sequence number) or has not been seen yet by p

– Then

» finalpriority(m2) ≥ proposedpriority(m2) due to: “max” operation at sender &

» proposedpriority(m2) ≥ final priority (m1) due to: proposed priorities by p only increase (m1 is ahead of the queue)

• Suppose there is some other process q that delivers m2 before it delivers m1. Then at q

– Finalpriority(m1) ≥ proposedpriority(m1) ≥ finalpriority (m2)

• Contradiction !

Page 39: Multicast Communication. Unicast vs. Multicast Multicast Whereas the majority of network services and network applications use unicast for IPC, multicasting

Atomic Multicast ExampleAtomic Multicast Example

04/20/2339

P1 sends m1 then m2.

P2 replies to m1 by sending m3.

P3 replies to m3 by sending m4.

Although atomic multicast imposes no ordering on these messages, the sequence of the events dictates that P1 must be delivered m1 before sending m2. Likewise, P2 must receive m1 then m3, while P3 must receive m3 before m4. Hence any atomic delivery order must preserve the order m1- m3- m4. The remaining message m2 can, however, be interleaved with these messages in any manner. Thus an atomic multicast will result in the messages being delivered to each of the processes in one of the following orders: m1- m2- m3- m4, m1- m3- m2- m4, or m1- m3- m4- m2. For example, each process may be delivered the messages in this order m1- m3- m2- m4, .