Using TIBCO SmartSockets Multicast


In addition to standard publish-subscribe with RTserver and RTclient, SmartSockets provides a multicast option to further enhance the features and performance of SmartSockets. This option uses reliable multicast, taking full advantage of its bandwidth optimization properties. Multicast is an efficient way of routing a message to multiple recipients. The SmartSockets Multicast option enables messages to be multicast to RTclients. The SmartSockets Multicast option uses the PGM protocol to route messages and a new RT process called RTgms to handle the message routing. There are special PGM options for RTclients, and an extended logical connection name that allows the RTclient to connect to the RTgms process. To enable an RTclient to receive or send multicast messages, the RTclient simply connects to the RTgms process, instead of connecting to an RTserver.

To use multicast with SmartSockets, you must have a SmartSockets Multicast license, separate from your standard SmartSockets license. The SmartSockets Multicast option is available on UNIX and Windows platforms. Contact your TIBCO sales representative for more information. Any RTservers that RTgms connects to must be at the same SmartSockets version level as the RTgms process. Any RTclients receiving multicast must be running with the SmartSockets Version 6.0 or higher runtime libraries. To use the multicast protocol, PGM, your network hardware, such as routers and switches, must configured for multicast use.

For more information on multicasting or working with RTgms, see the TIBCO SmartSockets User’s Guide. The rest of this section covers Java-related information only.

Using Multicast with Java

To use multicast with Java, there are several things you must do:

  1. Configure and start an RTgms process to manage the multicast routing. There is no Java version of RTgms--like RTservers, it is strictly C-based. For information on configuring, starting, and managing RTgms processes, see the chapter on multicast in the TIBCO SmartSockets User’s Guide.
  1. Use the default configuration for multicast or create the two multicast command files, mcast.cm and mcastopts.cm, for your RTclients that want to use multicast.
  2. The mcast.cm command file uses special PGM options to control the PGM aspects of multicast, and these options are the same in both C and Java. These options must be set in the mcast.cm file.

    The mcastopts.cm command file contains one option, mcast_cm_file, which you can use to specify the location of your mcast.cm file if you do not want to use the default location or you want to share a single mcast.cm file across multiple systems. The value you specify should be a fully qualified pathname.

    For information on the multicast command files and setting the PGM options, see the chapter on multicast in the TIBCO SmartSockets User’s Guide.

  3. Add ss-pgm.jar to your CLASSPATH environment variable. See your operating system documentation for instructions to add a file name to the CLASSPATH.
  4. Create a connection to the RTgms process from your RTclient. The RTclients that want to use multicast connect to an RTgms process instead of an RTserver process. The RTgms process manages the multicast message routing and connects to the RTserver. See Creating a Connection to RTgms on page 165 for more information. Note that you use a special multicast logical connection name to connect to RTgms. This is described in Logical Connection Names for Multicast on page 165.

Creating a Connection to RTgms

If the SmartSockets system is enabled for multicast and the RTclient wants to use multicast, the RTclient must connect to an RTgms for its global connection instead of connecting to an RTserver. In most cases, the only change required is to the ss.group_names and ss.server_names options for the RTclient. The RTclient still uses the TipcSvc.getSrv method to make the connection. For information on RTclient options and how to set them, see Chapter 9, RTclient Options.

The ss.group_names option specifies which multicast group the RTclient belongs to. The default is rtworks, and you only need to change the value if you are not using that group name.

The ss.server_names option must provide the logical connection name for an RTgms process instead of the logical connection name for an RTserver process.

For example, the property database for your RTclient might contain:

ss.group_names=rtworks 
ss.server_names=tcp:nodea  

Let us assume the RTclient should belong to the multicast group mcast1, and should connect to the RTgms on nodea using the default port, which is 5104. Change the lines to:

ss.group_names=mcast1 
ss.server_names=pgm:nodea 

If you want to connect to an RTgms that is not using the default port, change the ss.server_names line to:

ss.server_names=pgm:nodea:tcp.6000 

which connects to the RTgms on nodea using the TCP protocol on port 6000. For more information on the format of RTgms addresses, see Logical Connection Names for Multicast.

Use TipcSvc.getSrv to connect to the RTgms process the same way you connect to an RTserver process:

TipcSrv srv=TipcSvc.getSrv(); 
if (!srv.create()) { 
  Tut.exitFailure("Couldn't connect to RTgms!\n"); 
} 

To also connect to RTservers, the RTclient can use the multiple connections feature, and create those RTserver connections using the TipcSvc.createSrv method.

Logical Connection Names for Multicast

There are two parts of the logical connection name that differ for multicast. Generally, the logical connection name is:

protocol:node:address 

When specifying a multicast logical connection name to connect to RTgms, the value for protocol is always pgm. The address portion of your logical connection name is a different format than for other protocols.

The format for multicast is:

pgm:node:unicast_protocol.address 

where:

node
is the name of the node where RTgms is running. You can use _node rather than specifying a name.
unicast_protocol
specifies the unicast protocol to use when sending data to an RTgms. The valid values you can specify are tcp or local.
On Windows, the default protocol is tcp. On UNIX, the default protocol is local.
This field is optional, unless you specified localhost for the node on a UNIX system. If you specify localhost for the node, the unicast protocol must be tcp. On Windows, the default is tcp, so if you do not specify this field, the default provides the correct value.
For example, on UNIX:
pgm:localhost:tcp 
address
specifies the address portion of the unicast logical connection name used by the RTgms to receive data. This is the address or port defined for the RTgms. The default is 5104.
This field is optional.

If you specify a multicast format address, and your SmartSockets system does not have the multicast option installed, you receive an error when you attempt to connect to RTgms.


TIBCO SmartSockets™ Java Library User’s Guide and Tutorial
Software Release 6.8, July 2006
Copyright © TIBCO Software Inc. All rights reserved
www.tibco.com