next up previous contents
Next: TCP Up: UDP Previous: Using UDP and plain   Contents


Using UDP without IP multicasting

The protocol stack with UDP and PING as the bottom protocols use IP multicasting by default to send messages to all members (UDP) and for discovery of the initial members (PING). However, if multicasting cannot be used, the UDP and PING protocols can be configured to send multiple unicast messages instead of one multicast message5.4 (UDP) and to access a well-known server (GossipServer) for initial membership information (PING).

To configure UDP to use multiple unicast messages to send a group message instead of using IP multicasting, the ip_mcast property has to be set to false.

To configure PING to access a GossipServer instead of using IP multicast the following properties have to be set:

gossip_host
The name of the host on which GossipServer is started
gossip_port
The port on which GossipServer is listening
gossip_refresh
The number of milliseconds to wait until refreshing our address entry with the GossipServer

Before any members are started the GossipServer has to be started, e.g.

java org.javagroups.stack.GossipServer -port 5555.

This starts the GossipServer on the local host on port 5555. The GossipServer is essentially a lookup service for groups and members. It is a process that runs on a well-known host and port and accepts GET(group) and REGISTER(group, member) requests. The REGISTER request registers a member's address and group with the GossipServer. The GET request retrieves all member addresses given a group name. Each member has to periodically (gossip_refresh) re-register their address with the GossipServer, otherwise the entry for that member will be removed (accommodating for crashed members).

The following example shows how to disable the use of IP multicasting and use a GossipServer instead. Only the bottom two protocols are shown, the rest of the stack is the same as in the previous example:

      "UDP(ip_mcast=false;mcast_addr=224.0.0.35;mcast_port=45566;ip_ttl=32;" +
          "mcast_send_buf_size=150000;mcast_recv_buf_size=80000):" +
      "PING(gossip_host=localhost;gossip_port=5555;gossip_refresh=15000;" +
           "timeout=2000;num_initial_members=3):" +

The property ip_mcast is set to false in UDP and the gossip properties in PING define the GossipServer to be on the local host at port 5555 with a refresh rate of 15 seconds. If PING is parameterized with the GossipServer's address and port, then gossiping is enabled, otherwise it is disabled. If only one parameter is given, gossiping will be disabled.

Make sure to run the GossipServer before starting any members, otherwise the members will not find each other and each member will form its own group5.5.


next up previous contents
Next: TCP Up: UDP Previous: Using UDP and plain   Contents
Bela Ban 2002-11-16