Monday, February 21, 2011

Digging into Tibco Rendezvous network details - II

Daemon Parameter -
The daemon parameter instructs the transport creation function about how and where to find the Rendezvous daemon and establish communication. Each Rendezvous transport establishes a communication conduit with theRendezvous daemon, as the following steps describe:
  1. The daemon process opens a (TCP) client socket, and waits for a client to request a connection.The -listen option of the Rendezvous daemon (rvd) specifies the socketwhere the Rendezvous daemon should listen for new client programconnections.
  2. The program calls the transport creation function, which contacts the daemon at the client socket specified in its daemon parameter. The daemon parameter of the transport creation function must correspond tothe -listen option of daemon process; that is, they must specify the same communication type and socket number.If no daemon process is listening on the specified client socket, then thetransport creation call automatically starts a new daemon process (which listens on the specified client socket), and then attempts to connect to it.
  3. The daemon process opens a conduit for private communication with the newtransport object in the program. All future communication uses that conduit.The request socket is now free for additional requests from other clienttransports.
  • Specifying a Local Daemon - For local daemons, specify the transport creation function‘s daemon parameter andthe -listen option to the daemon process as a (TCP) socket number; for example:"6555".To use the default client socket, supply NULL as the daemon argument to thetransport creation function, and omit the -listen option to the daemon process.
  • Remote Daemon - In most cases, programs connect to a local daemon, running on the same host asthe program. Certain situations require a remote daemon, for example: The program runs on a laptop computer that is not directly connected to thenetwork. Instead, the laptop connects to a workstation on the network, andthe daemon runs on that workstation. Another example could be that the program connects to a network at a remote site.

For remote daemons, specify two parts (introducing the remote host name as thefirst part): Remote host name: Port number. For example:"purple_host:6555"

Network Parameter -

Every network transport object communicates with other transport objects over anetwork. On computers with only one network interface, the Rendezvous daemon communicates on that network without further instruction from the program. On computers with more than one network interface, the network parameter instructs the Rendezvous daemon to use a particular network for all communications involving this transport. To communicate over more than one network, a program must create a separate transport object for each network. The network parameter also specifies multicast addressing details
The network parameter consists of up to three parts, separated by semicolons—network, multicast groups, send address—as in these examples:

lan0 -- > network only

lan0;225.1.1.1 --> one multicast group

lan0;225.1.1.1,225.1.1.5;225.1.1.6 --> two multicast groups, send address

lan0;;225.1.1.6 -->no multicast group, send address

  1. Part one identifies the network, which you can specify in several ways: - Host name, Host IP address, Network name, Network IP number, Interface name, Default TRDP daemons use the network interface which corresponds to the hostname of the system as determined by the C function gethostname(). PGM daemons use the default PGM multicast interface, 224.0.1.78.
  2. Part Two—Multicast Groups - Part two is a list of zero or more multicast groups to join, specified as IP addresses, separated by commas. Each address in part two must denote a valid multicast address. Joining a multicast group enables listeners on the resulting transport to receive data sent to that multicast group.
  3. Part Three—Send Address, Part three is a single send address. When a program sends multicast data on the resulting transport, it is sent to this address. (Point-to-point data is not affected.) If present, this item must be an IP address—not a host name or network name. The send address need not be among the list of multicast groups joined in part two. If you join one or more multicast groups in part two, but do not specify a send address in part three, the send address defaults to the first multicast group listed in part two.

Digging into Tibco Rendezvous network details - I

Tibco RV is is one of the most used messaging systems. Athough lot of people use RV but there are some concepts which are known mainly to admins. These are some concepts which are better to be known by developers also for better programming.

Rendezvous Daemon -

The Rendezvous daemon is a background process that supports all Rendezvous communications. Distributed processes depend on it for reliable and efficient network communication. All information that travels between processes passes through a Rendezvous daemon as it enters a host computer or exits a sending process. Its functions are as following :-

• Transmits outbound messages from program processes to the network.
• Delivers inbound messages from the network to program processes.
• Filters subject-addressed messages.
• Shields programs from operating system idiosyncrasies, such as low-level sockets.

The Rendezvous daemon process, rvd, starts automatically when needed, runs continuously and may exit after a period of inactivity. We can run the deamon on our local machine or can even connect to another daemon running on some remote machine.

Transport -

Programs use transport objects to send messages and listen for messages. A transport determines three aspects of message delivery:
  1. Delivery scope—the potential range of its messages
  2. Delivery mechanism—the path (including software, hardware and networkaspects) that its messages travel
  3. Delivery protocol—the ways in which programs cooperate and shareinformation concerning message delivery. Various types of transport object combine these aspects to yield different qualities of service—for example, intra-process delivery, network delivery, reliabledelivery, virtual circuit, certified delivery, and distributed queue delivery.
Rendezvous software distinguishes between two broad classes of transports.

• Network transports - A network transport delivers messages across a network, to processes on one ormore hosts. It also can deliver messages to several processes on a single host. All messages pass through a Rendezvous daemon process.The service, network and daemon parameters of a network transport specifyits scope within the network

• Intra Process Transport - An intra-process transport delivers messages between program threads within asingle process.Intra-process messages do not pass through a Rendezvous daemon process;instead, they remain local within the program process. Intra-process messagesare significantly faster than network messages.Each program contains exactly one intra-process transport; the Rendezvousopen call creates it automatically. Its scope is the program process. Any threadcan dispatch intra-process events from an appropriate queue.

Service parameter -

The service parameter instructs the Rendezvous daemon to use this servicewhenever it conveys messages on the transport. As a direct result, services divide the network into logical partitions. Eachtransport communicates on a single service; a transport can communicate onlywith other transports on the same service. To communicate on more than oneservice, a program must create a separate transport object for each service. Within each rvd process, all the transports that specify a given service mustspecify the same network parameter. That is, if the service parameters resolve tothe same UDP or PGM port, then the network parameters must also be identical.(This restriction extends also to routing daemons.)

For example, suppose that the program foo, on the computer named orange, hasa transport that communicates on the service svc1 over the network lan1. It isillegal for any program to subsequently create a transport (connecting to the samedaemon process on orange) to communicate on svc1 over any other network—such as lan2. Once rvd binds svc1 to lan1, that service cannot send outboundbroadcast messages to any other network. Attempting to illegally rebind a serviceto a new network fails; transport creation calls produce an error status(TIBRV_INIT_FAILURE).

The limitation is not as severe as it might seem at first, because it only affectsoutbound broadcast messages:

--> Point-to-point messages on the transport’s service travel on the appropriatenetwork (as determined by the operating system) irrespective of thetransport’s network parameter.

--> Inbound broadcast messages on the transport’s service can arrive from anynetwork, irrespective of the transport’s network parameter.

Rendezvous programs specify services in one of three ways, shown below inorder of preference:

  1. Service name - When you specify a service name, the transport creation function callsgetservbyname(), which searches a network database (such as NIS) or a flat file(such as services in the system directory).
  2. Port number - When you specify a port number, it must be a string representing a decimalinteger (for example, "7890").
  3. Default - If you specify null, the transport creation function searches for the service namerendezvous. If getservbyname() does not find rendezvous, the Rendezvous daemoninstructs the transport creation function to use a hard default:

The TRDP daemon offers the default service 7500.The PGM daemon offers the default service 7550.