IntelligentAgentProject PH1
IntelligentAgentProject PH1
1
Contents
1 Introduction 4
1.1 Problem Description . . . . . . . . . . . . . . . . . . . . . . . 4
1.2 Aims and Objectives . . . . . . . . . . . . . . . . . . . . . . . 5
1.3 Organization . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2 Architecture 5
2.1 Overview of GOLEM platform . . . . . . . . . . . . . . . . . . 6
2.2 Analyzer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.3 Master and Monitor . . . . . . . . . . . . . . . . . . . . . . . 9
3 Interaction 10
3.1 Master-Monitor-Analyzer Interaction . . . . . . . . . . . . . . 11
3.2 Analyzer DCS update Interaction . . . . . . . . . . . . . . . . 11
3.3 Monitor-Analyzer DCS update Interaction . . . . . . . . . . . 13
3.4 Monitor-Analyzer NetDB update Interaction . . . . . . . . . . 13
5 Data representation 17
5.1 Default Communication Data . . . . . . . . . . . . . . . . . . 17
5.2 Network Data . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
6 Implementation 20
6.1 Analyzer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
6.2 Monitor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
6.3 Data Base . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
6.4 User Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
7 Installation 22
7.1 Minimal System Requirements . . . . . . . . . . . . . . . . . . 22
7.2 Installing Swipl and Nmap . . . . . . . . . . . . . . . . . . . . 23
7.3 Installing Raima DB . . . . . . . . . . . . . . . . . . . . . . . 23
7.4 Installing the application . . . . . . . . . . . . . . . . . . . . . 24
2
List of Figures
1 An Overview of the system . . . . . . . . . . . . . . . . . . . . 6
2 Agents, Objects, Containers and Topologies . . . . . . . . . . . . 7
3 The Analyzer Architecture . . . . . . . . . . . . . . . . . . . . 9
4 The Master Architecture . . . . . . . . . . . . . . . . . . . . . 10
5 Overview of the Interaction Model . . . . . . . . . . . . . . . . 11
6 Master-Monitor-Analyzer Interaction Model . . . . . . . . . . 12
7 Agent-Object Interaction Model . . . . . . . . . . . . . . . . . 13
8 Monitor-Analyzer Agent-Object Interaction Model . . . . . . . 14
9 Monitor-Analyzer Agent-Object Interaction Model . . . . . . . 15
10 The Analyzer Model . . . . . . . . . . . . . . . . . . . . . . . 16
11 Analyzer Fail over . . . . . . . . . . . . . . . . . . . . . . . . . 17
12 The Master Model . . . . . . . . . . . . . . . . . . . . . . . . 18
13 Master Failover . . . . . . . . . . . . . . . . . . . . . . . . . . 19
14 Default Communication Structure DB . . . . . . . . . . . . . 20
15 Network DB . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
3
1 Introduction
This Park project is funded by the Research and Enterprise Office at Royal
Holloway University of London. The project is a collaboration between
Dr. Kostas Stathis at the Computer Science Department and ThinkingSafe
company.
In this document we report the technical achievements of the project and
provide the necessary installation information. In particular we focus on the
architecture of the system and the designing choices.
In this project seek to collect and classify information about networks
and their devices. We use GOLEM (Generalized Onto-Logical Environment
for Multi-agent Systems), a multi-agent platform, to deploy a set of agents
which by interacting in a distributed setting, exchange network information.
4
with the data collection mechanism. An agent is a autonomous software
entity that acts pro actively to solve a particular goal. We consider agents
that are situated in an environment.
1.3 Organization
The document is structured as follows: In section 2 we give an overview of
the architecture of the system. In section 3 we describe in more detail how
the entities of the system interact with each other, and we provide the details
of the fail-over mechanisms. In section 5 we describe how we represent the
data in the data base. In section 6 we provide the implementation details. In
section 7 we illustrate how to install the system and the dependencies with
other software. Finally, in section 8 we conclude with a summary of the work
and possible future extension to this problem.
2 Architecture
The main goal in our system is to collect detailed information about a set
of networks and their devices. To achieve this we introduced three main
entities: Analyzer, Master and Monitor.
The Monitor’s main functionality is to collect information about a specific
device. In particular it actively collects information about the processes, the
hardware, the services running on a machine. The Masters functionality is to
control one network and to send this information to a data collector, namely
the Analyzer.
5
The Analyzer interacts with Monitor agents to receive information about
devices, It also interacts with a Master agents to collect the information
about the network. The network information includes the IP address, MAC
address, Device type name and state. The analyzer can also detect to which
a device belongs.
The collected data is stored in a DB associated to the Analyzer. A user
can view these data by requesting them to the Analyzer. The Analyzer will
send the data and eventually the updates when they occur.
Printer
User Remote &
Local Local
Monitor Monitor
Analayzer A
Printer
Local
Monitor Local
Local Printer Monitor
Monitor Local
Monitor
6
The GOLEM agent platform allows the deployment of three main entities:
agents, objects and containers. Agents are active and cognitive entities
that can interact with other agents and objects in the agent environment.
Agents are composed by a declarative mind, a component that supports
the reasoning abilities of the agent such as planning, decision making, and
temporal reasoning. The mind is situated in the agent environment via
another component that is called the agent body. This component contains
sensors for the agent to be able to perceive the environment and effectors
to be able to affect the environment. In other words, sensors and effectors
represent the interface between the agent environment and the agent mind.
Affordances
Agent
Physical action
Sensors Object
Emitter
Trigger
Effector
Speech
Act
Event
Intra Container Extra Container
Super/Sub Containers Adjacent Containers
7
a virtualisation of an external resource of the external real environment, for
example, a printer, a web service, or a database.
Central to the GOLEM agent platform is the concept of affordances:
normally this concept is taken to describe “all the action possibilities latent
in the environment, objectively measurable, and independent of an agent’s
ability to recognize those possibilities” [6].
GOLEM relies upon perceived affordances where entities of an environment
“suggest” to agents (whether artificial or human) how they should interact
with them. In other words the concept affordances in GOLEM represent the
external observable state of an agent or of an object as shown in Fig. 2(a).
Agents and objects are situated within containers. A container represents
a portion of the distributed agent environment and it works as a mediator
for the interaction taking place between agents and objects. Events describe
what happens in the agent environment as a result of actions being executed
by effectors. According to the happening of an event the agent environment
notifies those sensors capable of perceiving the action of the event. In
GOLEM three types of acts are embedded in an event: speech acts - to
allow agents to communicate with other agents and users; sensing acts - to
allow an agent to perceive the environment actively; and physical acts - to
allow the agent to interact with other entities, in particular objects, but also
agents as well. To simulate these acts GOLEM relies upon different kinds
of sensors and effectors the agent should possess in the agent environment.
Fig. 2(b) shows how the result of a physical act of an agent on an object is
perceived not only by the agent itself but also by another agent, using the
affordances of these entities within the container in which they are situated.
Containers provide the support for the mediation of the interaction in the
agent environment by means of the Ambient Event Calculus (AEC) [3]. The
AEC allows GOLEM to behave like a distributed agent environment where
the interaction between the entities (agents, objects, containers) is mediated
in the distributed settings, defining rules of interactions between the entities
involved. The AEC formalism also allows GOLEM to link containers between
each other in such a way that agents deployed across a network of containers
can move in the distributed agent environment.
Finally, GOLEM provides a Transportation Layer which transports the
exchanged messages from a container to another container.
2.2 Analyzer
The analyzer functionalities are realized in GOLEM by defining an Analyzer
Agent which exchanges actions within the environment. As shown in figure
3, a GOLEM container is deployed in a device and an Analyzer agent is
8
registered in the GOLEM container. Every Analyzer uses an analyzer object
for performing a set of procedures such as read and write information about
the networks in the data base, update or read the DCS etc.
Additionally, figure 3 shows an analyzer ack object which notifies to the
analyzer that a fail over mechanism is needed.
Analyzer Container
no
tify
Analyzer
Ack Object
FAIL OVER
Transportation Layer
9
Monitor Container
no
tify tify
no
Monitor
Ack Object
FAIL OVER
Transportation Layer
3 Interaction
In this section we explain more in detail how the entities we intrdiced in
section 2 interact to offer the functionalities of the system. In particular,
we explain how Analyzers interact with one another and how agents interact
with objects to update the data base and to detect failures in communicating
with the other agents. We also explain the interaction between the Analyzers
and the Master and Monitor agents in the network.
There are two types of interaction within the system: the first has to do
with the interactions between a GOLEM Agent and a GOLEM Object, and
the second is the interactions between agents.
In figure 5 we show how an agent relies on an object to perform a set of
procedures or to retrieve data or update the data base when such operations
are needed. We also show that agents interact with one another by sending
messages.
10
Analyzer Container
Object
Monitor Container
Agent Database
Object
11
Container (2) something new in network_data Analyzer
getInfo
add_master
getDB Analyzer
Analyzer Agent (2.1) Notify
update Object
messageReceived
Analyzer
getInfo
getDevice
getProcesses Monitor
Monitor Agent
getServices Object
getHardware
message
(0.3) stop ||
(0.1) start Timer (0.4) Fail-over
Container
12
«implementation class» «implementation class»
Analyzer Object Analyser Object
Database
{active} Analyzer Agent Analyser Agent {active} Database
hello
update_dcs()
update Database
send updates
container event
receive updates
update Database failOver()
progagate updates update Database
send updates
The updates are sent both to
the analyzer father and the down event
the analyzers children.
If a fail-over occured, instead DCS
of the father the update is sent
to the new father.
all the analyzer childs. The fail over mechanism will be better explained in
section 4.
13
«implementation class» «implementation class»
Monitor Object Analyser Object
Monitor Agent Analyser Agent
Database
{active} {active} Database
alive
update_dcs()
update Database
receive updates
update Database
connection down
update Database
down event
DCS
14
«implementation class» «implementation class» «implementation class»
Monitor Object Analyser Object Analyser Ack Object
Database
{active} Monitor Agent Master Agent Analyser Agent {active} {active} Database
Net DB
15
When a message is received, an
acknowledge is sent either to the
Message from the Monitor (the
connected Master or to the
first will be the Master)
connected Analyzer
When an acknowledge is
A
received, the TimeCount Thread
associated with the sender is
stopped
receiver=true
When something change either
in the DCS or in the Network, an
update to the neighbour nodes
(Analyzer which this one is
connected to) is sent. The
TimeCount Thread is activated
update to check for the ack arrival.
Fail Over
analyzer interaction
message. This helps the entity who sent the message to be sure that the
message was received successfully. For every message that the Analyzer sents,
a time counter is activated. If an ackowledgement is received before the due
time,the counter is stopped, and the connection is said to be working well.
However, if there is no acknowledgment and the time count exceeds the due
time, a fail over procedure is started.
Figure 11 shows how when an analyzer fails the default communication
structure is updated so that the analyzer who had as a father the failed
analyzer, connects to the grand father analyzer. To achieve this behavior, the
fail-over mechanism notifies the agent that its father is down. The analyzer
sents a hello to the grand-father which updates the DCS by adding the sender
as a child.
16
Analyzer
Analyzer
ANALYZER Analyzer
FAIL-OVER
5 Data representation
5.1 Default Communication Data
Figure 14 represents the structure of the information about the default communication
structure data. This data is stored in the database component of the featured
application and it purposefully illustrates the child-parent relationships between
the analyzers in the system. It is used for the communication among the
network nodes(analyzers) and for providing the necessary node localization
information to the featured application to perform its tasks. As we can see in
Figure 14, there is a generic type of a data structure containing the identifier
of an analyzer (node) along with entries for its state(up or down), children
and parents. Multiple instances of this generic type are stored and they could
be described a follows:
• Instance for child. Contains the node ID, its state and a child.
• Instance for child. Contains the node ID, its state and a parent.
17
If the ack is not received, the
Ack from the Analyser
MONITOR
Monitor Object, according to the Fail Over
DCS stored in its database, will
choose the new Analyser to be
connected to. analyser interaction
M
accordingly to its structure and
analyser’s behaviour.
this change is notified through
the parents of the node.
updateDCS
analyser interaction
ack
These instances are stored as entries in the database and they are linked
together by the node ID field. The complete description of an analyzer default
communication data is allowed by their collective information.
18
Analyzer
Analyzer
Analyzer Analyzer
FAIL-OVER
Printer
19
Node Children
PK AnalyzerID PK ChildrenID
Type State
NodeID FK1 AnalyzerID
State
Parents
PK ParentsID
State
FK1 AnalyzerID
Master Monitor
PK MasterID PK MonitorID
State State
FK1 AnalyzerID FK1 AnalyzerID
6 Implementation
6.1 Analyzer
The analyzer is composed by three entities:
• the agent (prolog)
6.2 Monitor
The analyzer is composed by three entities:
• the monitor agent (prolog)
20
Network CD Rom
PK NetID
PK Device ID Process
FK1 NetID
Name FK1 Device ID
IP Cd Rom : [MultiSet]
FK1 NetID
MAC FK1 Device ID
OS Processes : [MultiSet]
Processors Service
System Info
Owner
System Root
RAM FK1 NetID
HD DeviceID
Video Driver
Service Pack Seriveces : [MultiSet]
FK1 NetID
State DeviceID
HD : [MultiSet]
FK1 NetID
DeiviceID
Starte : [MultiSet]
21
GUI acquires data from the Data Base through the custom DB filters and it
displays them using a JTree structure(see javax.swing). The Network data
uses similar filters to acquire data regarding all the devices in all networks
stored in the Data Base and it displays them using the JTABLE structure (see
javax.swing). The JTable structure is updated dynamically and it displays
all the types of elements described in 5.2 or a subset of them. The user
has an option of choosing this subset by pressing the names of the types in
a sub-interface that was implemented using the JList structure. Also, the
JTable features two buttons (Jbutton in javax.swing). The first triggers a
pop-up window that is again implemented using the JTable structure for
displaying information regarding all devices in a particular network. The
second button triggers a pop-up window that is as well implemented using the
JTable structure and it displays all the information the system has regarding
a particular device in a network.
7 Installation
7.1 Minimal System Requirements
The system has been tested on several dual core computers, even if a single
core processor is enough. The operating system installed on this machine was
Windows XP: so the behaviour is tested only for this operating system. The
use of other operating system could affect the result of the data collected
since, for istance, nmap has different output depending on the operating
system on which is running on. Anyway, it is possible to change and, so,
to generalize the way the data are collected using an ad-hoc network data
collection system: in this way platform independent system could be easily
defined.
The minimum hardware requirements to make the system properly working
include:
The software requirements to make the system properly working include these
installation:
22
• Swipl offers a comprehensive Free Software Prolog environment, licensed
under the Lesser GNU Public License;
23
7.4 Installing the application
After the installation of Swipl, Nmap, JVM and the database, it is enough
to put the jdk and the swipl bin folder in the PATH of the Environment
Variables (i.e. C : /P rogramF iles/Java/jdk1.6.01 8/bin; C : /P rogramF iles(x86)/pl/bin)
to have the application environment ready to run the application. par Now, it
will be enough to run the Analyzer.bat and the Monitor.bat in the preferred
configuration.
• improving the system performances playing both with the agent mind
specification and the object functionalities;
• completing both the analyzer and the monitor entities in order to make
the system adaptable at many different fail-over occurences as a an
interesting case study.
References
[1] S. Bromuri, V. Urovi, P. Contreras, and K. Stathis. Virtual e-retailing
environment in golem. In Intelligent Environments (IE’08). IET, Jul
2008.
24
[3] Stefano Bromuri and Kostas Stathis. Distributed Agent Environments
in the Ambient Event Calculus. In DEBS ’09: Proceedings of the third
international conference on Distributed event-based systems, New York,
NY, USA, 2009. ACM.
25