What is the proper use of _any and _node with the option conn_names on a host with multiple NICs?

What is the proper use of _any and _node with the option conn_names on a host with multiple NICs?

book

Article ID: KB0094246

calendar_today

Updated On:

Products Versions
TIBCO SmartSockets -
Not Applicable -

Description

Resolution:
Description:
============
RTservers and SmartSockets clients use Logical Connection Names (LCNs) in the Server_Names and Conn_Names options to simplify the creation of a connection.
An LCN is a triple of the form protocol:node:address. Typically the hostname of a machine is used for the node portion of the LCN, however there are two special values;  "_node" and "_any" that can be used in place of the node value which are useful when dealing with machines that have multiple NIC cards.


Environment:
===========
All versions of SmartSockets


Resolution:
==========
The use of _any in place of the node name in the RTserver's Conn_Names option allows it to listen for connections on all NICs the machine has.

The use of _node in place of the node name in the RTserver's Conn_Names option causes it to listen only on the default NIC (typically eth0).

Using _node and _any on a machine with only one NIC is virtually equivalent.
Note that when using _any in the RTserver's Conn_Names clients running on the same machine will also be able to connect on the loopback address, 127.0.0.1 if configured.

You should not use _any for defining connections that will be used in RTserver-to-RTserver communication as the RTservers might attempt to reconnect to each other every RTserver_Reconnect_Interval seconds. _any is however very useful for allowing the RTserver to listen for client connections on all the IP interfaces.

Example of using both _node and _any in an rtserver.cm file:

Running RTserver with a Conn_Names containing both _node and _any interfaces as follows is the recommended approach for supporting both RTserver to RTserver and client to RTserver connections on a multi-NIC machine.

In the target RTserver's .cm file (the RTserver running on multi-NIC host 'foo'  that you want to connect to) the Conn_Names entry would be:

setopt conn_names   tcp:_node:5105,  tcp:_any:5101

Note the use of different port numbers in the above, this will allow other RTservers to connect using the 5105 port while clients use the 5101 port.

For tcp:_node:5105 the RTserver is listening on the default device eth0 only. Other RTservers should connect here.

For tcp:_any:5101 the RTserver is listening on both device eth0 AND eth1 (or all devices if there are more NIC cards). RTclients should connect here. So, in this example all RTclients should connect to this RTserver using tcp:foo:5101 and all RTservers should connect to it using tcp:foo:5105 .

The Server_Names entry for an RTserver wishing to connect would be:
      setopt server_names tcp:foo:5105
This way the RTserver is guaranteed to connect on the default IP.

The Server_Names entry for a client wishing to connect would be:
       setopt server_names tcp:foo:5101
This will allow the client to connect using any available IP interface.

Issue/Introduction

What is the proper use of _any and _node with the option conn_names on a host with multiple NICs?