Security and Fault-tolerance in Distributed Systems ETHZ, Winter 2006/07 Christian Cachin, IBM Zurich Research Lab www.zurich.ibm.com/cca/ *** BONUS EXERCISE / PROGRAMMING PROJECT *** GROUP COMMUNICATION USING THE JGROUPS TOOLKIT The goal of this project is to explore practical group communication with the JGroups toolkit, see http://www.jgroups.org/ I recommend you retrieve the latest stable release 2.4.1; it requires Java 1.4. Get the source package, unpack it, and change to the top directory. If you have ant installed, run the command ant all It will compile the sources, generate the binary distribution, and generate the Javadoc. Without ant, there is a "build.sh/build.bat" script for the same purpose. Then you can invoke any of the demos using the command "jgroups.sh" as follows: ./jgroups.sh demos/Draw ./jgroups.sh demos/Chat ./jgroups.sh demos/ViewDemo (It gets only interesting if you run the multiple instances of the same demo.) The "jgroups.sh" script is derived from the JGroups-2.5.0-preview distribution and can be found on http://www.zurich.ibm.com/~cca/sft06/jgroups/ I recommend to create an empty file named "log4j.properties" to suppress the annoying warning of the log4j package. TASKS Modify the ViewDemo.java example to do the following: a) Make every group member periodically send a message on the channel, for example using Channel.send() and by implementing the MessageListener interface. You can include the identity of the sender in a message with String str = "Hello from " + channel.getLocalAddress(); Make the group members print all received views and messages. b) The ViewDemo example uses UDP and IP multicast for communication. This works when all group members are local on the same machine or on the same LAN. Experiment with the "TCP" stack and get the application running across the Internet. The documentation for the configuration of the communication stack is quite rudimentary; just take the defaults in the source. See the manual for tunneling through firewalls. c) [Real bonus project, only if you are interested] Starting with ViewDemo.java, implement some form of state transfer, such that all group members receive the state/history of the previous members when they join. JGroups already contains this functionality, see demos/Chat.java, but the purpose here is to develop an implementation.