|
Distributed Computing This website demonstrates using wikis as teaching and learning tool. The course instructor is also happy to share the teaching materials here with those who find it readable. |
Lecture /
Multicast and Group CommunicationsA Distributed Computing Lecture by Steven Choy Introduction and Design Issues of Group Communication
The simplest one is to require the sender to explicitly specify all the destinations to which the message should be delivered. A second method is to use a single address for the whole group. This method saves bandwidth and also allows a process to send a message without knowing which processes are members of the group.
‘The second design criterion, reliability, deals with recovery from communication failures, such as buffer overflows and garbled packets. Because reliability is more difficult to implement for group communication than for point-to-point communication, a number of existing operating systems provided unreliable group communication, whereas almost all operating systems provide reliable point-to-point communication, for example, in the form of RPC.’
‘Another important design decision in group communication is the ordering of messages sent to a group. Roughly speaking, there are 4 possible orderings: no ordering, FIFO ordering, causal ordering, and total ordering.
‘The fourth item, delivery semantics relates to when a message is considered delivered successfully to a group. There are 3 choices: k-delivery, quorum delivery, and atomic delivery. With k-delivery, a broadcast is successful when k processes have received the message for some constant k. With quorum delivery, a broadcast is defined as being successful when a majority of the current membership has received it. With atomic delivery either all processes receive it or none do. For many applications atomic delivery is the ideal semantics, but is harder to implement if processors can fail.’
‘The last design decision specific to group communication is group structure. Groups can be either closed or open. In a closed group, only members can send messages to the group. In an open group, nonmembers may also send messages to the group. In addition, groups can be static or dynamic. In static groups processes cannot leave or join a group, but remain a member of the group for the lifetime of the process. Dynamic groups may have a varying number of members over time.’
Applications of Group Communications
Mutlicast group
Join – allows a process to join a specific multicast group
Leave – allows a process to stop participating in a multicast group
Send – allows a process to send a message to all processes currently participating in a multicast group
Receive – allows a member process to receive messages sent to a multicast group
Basic multicast and Atomic multicast
Reliable and Unreliable Multicast
Ordering of reliable multicast
Messages are delivered in the order they were sent by any single sender (First-in-first-out or sender ordered multicast)
Local order (a.k.a. Single source FIFO) - Example: video distribution, distance learning using “push technology.”
Causal ordering: If Send( M1 ) → Send( M2 ), then the receipient should receive M1 before M2.
Causal order multicast - If a, b are two updates and a happened before b, then every member must accept a before accepting b. Example: implementation of a bulletin board.
Messages are delivered in same order to all recipients.
Total order multicast - Every member must receive all updates in the same order. Example: consistent update of replicated data on servers
Implementing Causal Ordering
(Source: Coulouris, Dollimore and Kindberg, Distributed Systems: Concepts and Design Edition 4)
Implementing total order multicast
Java Multicast API
import sun.net.*; import java.net.*; int port = 5000; String group = "225.4.5.6"; MulticastSocket s = new MulticastSocket(port); s.joinGroup(InetAddress.getByName(group)); byte buf[] = byte[1024]; DatagramPacket pack = new DatagramPacket(buf, buf.length); s.receive(pack); System.out.println("Received data from: " + pack.getAddress().toString() + ":" + pack.getPort() + " with length: " + pack.getLength()); System.out.write(pack.getData(),0,pack.getLength()); System.out.println(); s.leaveGroup(InetAddress.getByName(group)); s.close();
import sun.net.*; import java.net.*; int port = 5000; String group = "225.4.5.6"; int ttl = 1; MulticastSocket s = new MulticastSocket(); // We don't have to join the multicast group if we are only // sending data and not receiving byte buf[] = byte[10]; for (int i=0; i<buf.length; i++) buf[i] = (byte)i; DatagramPacket pack = new DatagramPacket(buf, buf.length, InetAddress.getByName(group), port); s.send(pack,(byte)ttl); s.close(); Class Exercises
Consider the following example of multicast communication. A multicast group G has five member processes, A, B, C, D and E. Process A multicasts messages a1 then a2 to group G. Process B multicast message b1 and then b2 to group G. Process B multicasts b1 and b2 after delivering a1. Process B then deliveries a2 after multicasting b1 and b2.
Processes C, D, and E may deliver these four messages (a1, a2, b1, b2) in different order. It is based on the ordering requirement implemented by the group.
Consider the following example of multicast communication. A multicast group G has three member processes, P1, P2, and P3. Process P2 multicasts messages m1 and then m3 to group G. Process P3 multicast message m2 to group G. Process P3 multicasts m2 after delivering m1. Processes P1, P2, and P3 may deliver the three messages (m1, m2, m3) in different order. It is based on the ordering requirement implemented by the multicast group.
Extra Materials
Thanks for ReadingIf you would rather like to have this lecture note in printed format, please click the print action link in the top right corner. If you find any problem in this lecture note, please feel free to reach Steven by steven@findaway.hk |