next up previous contents
Next: Bibliography Up: JChannel Protocols Previous: TUNNEL

   
UDP

UDP is currently the bottommost layer available to use in a protocol stack.

When it receives a START event (upon channel connection), it creates a unicast and an IP multicast socket. The IP address plus the port number of the unicast socket form the channel's address: every message sent to either a single destination or the whole group will be marked with this address (in the source field). As soon as the local address is know, a SET_LOCAL_ADDRESS event will be sent up the stack, followed by a START_OK.

When a STOP event is received, the sockets are closed and a STOP_OK event is passed up the stack as acknowledgment. When a channel is closed, local address becomes meaningless (since based on a open socket).

Messages sent down the stack will be added a UDP header containing the group name and then put on the network as datagram packets. Datagrams received from the network will be converted into messages and their UDP header removed. If the header's group name is different from the channel's group name, then the message will be dropped. Otherwise, it is passed up the stack.

UDP can either use IP multicasting or unicasting to disseminate messages to the group. If option ip_mcast is false, unicast is used: when a message is to be sent to all group members, it is sent n times to each member. To do this, UDP has to cache the membership when receiving VIEW_CHANGE events.

The IP multicast address and port can be configured using options mcast_addr and mcast_port. Although it is not a problem when different groups use the same IP multicast address and port (since messages by members belonging to a different group are discarded by UDP), it is often preferable to choose different parameters. However, all group members must have their UDP layers configured too the same IP multicast address and port (when using IP mcast).


next up previous contents
Next: Bibliography Up: JChannel Protocols Previous: TUNNEL

1999-12-13