1. InitializationWhen the user starts the Sniffer, a new instance of the class jade.tools.sniffer.Sniffer is created: this class extends jade.core.Agent, therefore the Sniffer is like any other agent; interaction with Jade environment and with the Sniffer gui are the main tasks of this class. In order to let the user chose which agents are to be sniffed, the Sniffer must be constantly informed on born agents, dead agents, created and deleted container: for security’s sake these informations are not available to a common agent. Hence to get these informations, the Sniffer registers itself as an rma on the Agent Management System (ams). The subscription is performed by sending to the ams a message like the following one :
On the Sniffer takedown a message like the following one is sent to the ams to unsubscribe the Sniffer.
From now on, every time an agent is born, a container is created, the Sniffer is instantly informed with messages like the following one:
2. Telling the Ams to sniff an AgentWhen the user selects an agent to be sniffed from the Add/Remove Agent window, the Sniffer gets the ams to know this by sending a message like the following one:
If the user does not want an agent to be sniffed anymore, the Sniffer informs the ams by sending a message like the following one:
Then the ams parses the incoming message and, if it turns out to be successful, the platform or the container is told to send to the Sniffer a copy of every message coming from or going to an agent in the sniffed agent list. 3. Sniffed MessagesEvery time the agent platform dispatches a message, it looks in the sniffed agents table to find out whether the sender of the message, the receiver of the message or both are in the sniffed agents list: if so, the platform create a new message like the following one:
The message is directed to one or more sniffers registered to sniff one or more agent. The list of the sniffers for an agent is contained in the sniffed agent list. The ontology of the message must be set to sniffed-message. The platform now performs a sort of tunnelling by putting the sniffed message in the :content field of the above message to be sent to the sniffer. When this one receives a message from the ams with the :ontology field set as before it extracts the content and create a new ACLMessage to be displayed from the Gui when the user double-click on the arrow representing it. 4. Integration with JadeThe integration of the Sniffer with Jade environment has been a three-step process, shortly described just after:
The ams always listens for a sniff-on/sniff-of message to arrive: when one of these arrives it invokes the parser to check the message and extract the useful data in it. myAction = (AgentManagementOntology.SniffAgentOnAction) and passes them to his platform telling the sniffer that the action was successful. Within the agent platform, the AMSActivateSniffer and AMSDisableSniffer methods add and remove agents from the SniffedAgents map according to what they have been told by the ams. The SniffedAgents list is ajava.util.Map object: in this map the agent names are the keys and sniffer vectors are the values for the keys: by doing so, every agent can be sniffed by any number of sniffers and every sniffer can sniff any number of agents. For more details please see the code or the relative documentation. It’s important to underline that agents name are put in the list with the following convention: local agent names are put in the list without the address and converted to lower case whereas external agent names are put in the list with address and converted to lowercase. This sniffing task is performed by the container in the commHandle method: as the name itself it handles every incoming or outgoing messagge with internal protocol, rmi or corba/IIOP. In more detail, the commHandle methos check if the sender or the receiver/group of recever is a sniffed agent: if so, it sends a copy of that message to every sniffer registered for that agent. |
JADE is a trademark of TILAB (formerly CSELT).
JADE has been developed jointly by TILAB (formerly CSELT) and the Computer Engineering Group of the University of Parma