Chapter 13 Using Multicast : Configuring Multicast

Configuring Multicast
Multicast is configured in the EMS server configuration files. Configuration is a simple three-step process:
1.
Enable the multicast parameter in the tibemsd.conf file. Optional multicast parameters allow you to control other settings, such as the default multicast daemon port and the maximum amount of multicast traffic allowed. See Multicast Parameters for more information.
2.
Create named channels in the channels.conf file. See channels.conf on page 214 for more information about the channels configuration file.
3.
In the topics.conf configuration file, add the channel property to the definitions of those topics you wish to be multicast. See channel on page 52 for more information about the channel property. Note that a topic can be associated with only one multicast channel.
Configuring Multicast Dynamically
For the most part, multicast is configured statically. Only limited changes can be made to multicast settings during runtime. Once the EMS server has been started, the only multicast configuration change you can make is to the channel property of a topic. With the administration tool, you can assign to or remove an assigned multicast channel from a topic. You cannot change the channel configuration or the channels.conf file. To do that, you must stop the server.
These commands can be used to change a topic’s channel property:
addprop topic adds the channel property to a topic. For example, this sets the channel property for the topic foo.bar to mychannel:
addprop topic foo.bar channel=mychannel
However, although this enables the topic foo.bar for multicast, current subscribers to the topic will continue to receive messages over TCP. An existing message consumer will not receive messages sent to foo.bar over multicast until the consumer has been stopped and restarted.
setprop topic offers the same functionality as addprop topic, with one important difference: when setprop topics is used, it resets all other properties to their default values.
This command also enables the topic for multicast, but does not cause existing topic subscribers to receive messages over multicast. Only messages consumers that are created after the channel property is set will receive multicast messages.
removeprop topic removes the channel property from the topic. Current multicast subscribers will begin to receive messages sent to the topic over TCP.
If a backlog of messages exists in the server or multicast daemon, the EMS client may receive some messages out of order, and some message loss is possible. The multicast daemon will continue to deliver queued messages until the backlog is gone, while the EMS server will deliver later messages immediately.
 
A current topic subscriber will stop receiving messages if the multicast channel is changed from one channel to a different channel. This can happen when:
The channel is changed explicitly using addprop topic or setprop topic.
The channel is removed using removeprop topic, and the topic inherits a different channel from a parent.
If the channel assigned to a topic changes, current subscribers to the topic will not receive messages until they have resubscribed to the topic. The server will not send messages to the client over TCP if there is another channel assigned to the topic.
Configuring the Multicast Daemon
The multicast daemon, or tibemsmcd, is the process that receives multicast messages from EMS servers and delivers them to individual clients. The multicast daemon runs on the local host computer with the client. One daemon can receive messages from multiple servers, and can deliver messages to multiple clients.
Configuration for the multicast daemon is set in the EMS server, and passed to the daemon when the EMS client creates a multicast message consumer and connects to the multicast daemon. In some cases, you may wish to make configuration changes to the daemon directly. You can do this using command line options.
For example, if your configuration requires more than one network interface on a single computer, you can run multiple multicast daemons on the local host. Use the -ifc command line option to change the interface for a daemon. See Command Line Options below for more information.
Command Line Options
The multicast daemon accepts a few command-line options. When starting tibemsmcd, you can specify the following options:
-ifc interface
Select the IP address that identifies the network interface used by the multicast daemon to receive multicast data.
If this option is not included, the multicast daemon uses the default interface, determined by the IP address INADDR_ANY.
If your configuration requires multiple interfaces, you will need one multicast daemon instance for each interface. It may be helpful to use the commands ipconfig on Windows or ifconfig on UNIX systems to determine what interfaces are available and support multicast.
-help or -h
-listen [ip-address:]tcp-port
Change the IP address and TCP port on which the daemon listens for connections from EMS clients, where:
ip-address  is an optional parameter that, when provided, restricts the interface on which the multicast daemon will accept client connections to a specific IP address. If an ip-address is not provided, the multicast daemon listens for EMS clients on all interfaces.
tcp-port  is the TCP port on which the daemon listens for connections from EMS clients. The default port is 7444.
Note that if the default TCP port that the daemon listens on is changed, then the client must be directed to attempt a connection to the daemon on the same TCP port. To change the port that the client uses, set the multicast_daemon_default parameter in the tibemsd.conf file.
Enable tracing in the multicast daemon. If this option is included, trace information for events such as client connections to the daemon and channel creation is written to file.
-max-msg-memory size[MB|KB]
Specify the maximum amount of memory allowed for all messages waiting to be sent to consumers. Once the specified memory limit is reached, new messages are discarded. Specify the size in units of MB or GB. The minimum permitted size is 8MB.
-max-loss-rate percentage
Specify the maximum percentage (between 1 and 100) of acceptable loss rate. When the rate rises above the given percentage, the multicast daemon stops sending NAKs.
Prevent the multicast daemon from sending tracing messages to the console.
Controlling Access to Multicast-Enabled Topics
Publish and subscribe permissions for multicast-enabled topics are controlled the same way that they are controlled for topics that are not multicast-enabled. See Destination Control for more information about controlling access to destinations.