17.0 Discovering Other Multi-Protocol agents in a Network

 


17.1 Discovery Service : An Overview

17.2 The Discovery Service MBean

17.3 Creating the Discovery Service MBean

17.4 The Discovery Client

17.5 Performing the Discovery Operation

17.6 Running the Example


 

17.1 Discovery Service : An Overview

 

Multi-Protocol agents in a network can be discovered using the AdventNet Discovery Service. The discovery service enables the Multi-Protocol agents to be discovered in a network. This service relies on a discovery client object, which sends out multicast requests to find agents. In order to be discovered, an agent must have implemented the discovery service. This functionality allows interested applications to establish a list of active Multi-Protocol agents and keep it updated.

 

In addition to knowing about the existence of an agent, agent applications are free to use the discovery service since they may require such information for cascading (refer topic Master-Subagent Architecture in Multi-Protocol Agent) . To provide Remote manageability of the discovery service in an agent, all of its components are implemented as MBeans.

 

17.2 The Discovery Service MBean

 

Agent Toolkit provides the Discovery Service as a MBean. Multi-Protocol agents should have com.adventnet.services.discovery.DiscoveryService MBean registered with the MBean Server to be discovered by the discovery client.

 

The Discovery mechanism uses XML over UDP (multicast datagram socket) for communication between the agent (discovery service) and discovery Clients. This enables,

Note: The Multicast group is a combination of Class D IP Address and standard UDP port number to which the recipients are subscribed to listen for the packets. Multicast group IP addresses are in the range 224.0.0.1 to 239.255.255.255, inclusive. The address 224.0.0.0 is reserved and should not be used. The default multicast group IP Address for AdventNet discovery service is 225.225.225.0 and multicast port is 8222.

 

Time to live is an 8 bit unsigned byte associated with each multicast packet to determine how many hops it can travel. When this reaches zero, the packet is completely discarded. Time to live ranges from 0 - 255.

 

17.3 Creating the Discovery Service MBean

 

You can create the discovery service MBean using the JMX Compiler UI or using the API.

 

Using JMX Compiler UI

 

You can configure the Multi-Protocol agent with discovery service by following the steps given below:

On code generation, the above entry adds the necessary code to register the Discovery Service with the given multicast group IP Address and port number.

 

Using API

The above code snippet registers the discovery service MBean with multicast group IP Address 225.225.225.255 and multicast port 8222.

 

17.4 The Discovery Client

 

The Discovery client service  enables to discover AdventNet Multi-Protocol agents in a network.  Discovery clients can only discover the agents listening on the same multicast group and port and which has implemented the discovery service.

The DiscoveryClient class provides methods to discover agents. The discovery client (com.adventnet.services.discovery.DiscoveryClient)  is the client that sends the broadcast packet when it comes up. The Multi-Protocol agents (with discovery service) running in the network will respond to it with the information such as Host Name, MBean Server ID, Adaptors/Connectors information.

 

Discovery Client  Code Snippet

      DiscoveryClient client = new DiscoveryClient();
      client.addDiscoveryObjectListener(this);
      client.start();
      ....
      //discover all agents in the network
      DiscoveryEvent event = client.discoverJMXAgents();
      ....
      //discover all agents in the host "agent-testpc1"
      event = client.discoverJMXAgents("agent-testpc1");

The default multicast group IP address is 225.225.225.255 and port Number is 8222. These may be set to other values through the MulticastGroup and MulticastPort attributes. Before initiating searches, you must call the discovery client’s start method. This creates its multicast socket and joins the multicast group used for broadcasting its discovery request.

 

The scope of the discovery request depends on the time-to-live used by the multicast socket.  Time to live ranges from 0 - 255.  You can modify this value at any time by setting the discovery client’s TimeToLive attribute. 

 

By default, a discovery client waits for responses for five second after it has sent a discovery request. This period can be customized by setting a value in milliseconds for its TimeOut attribute.

 

17.5 Performing the Discovery Operation

 

The AdventNet MBean Browser is a Manager application, which enables the user to access a Multi-Protocol agent's MBeans and use the provided services through the RMI/ CORBA/ HTTP protocol adaptor. To perform the discovery operation from MBean Browser, follow the steps given below :

 

Connecting to the discovered agent

 

To connect to a discovered agent,

Viewing properties of the discovered agent

 

To view the properties of the discovered agent,

Note: To be discovered by the discovery client :

  • The Multi-Protocol agents must have implemented the Discovery service

  • The Multi-Protocol agents must belong to the same multicast group and port number.

 

17.6 Running the Example

 

Please refer  the Discovery Service example present in the <Agent Toolkit Home>/example/jmx/discovery directory. This is a simple example to illustrate the usage of discovery service provided by the Agent Toolkit.

The Readme.html file explains the usage of the example and the steps involved in running the example .

 



Copyright © 1996-2004, AdventNet Inc. All Rights Reserved.