=Paper=
{{Paper
|id=None
|storemode=property
|title=Agent-based Development of Wireless Sensor Network Applications
|pdfUrl=https://ceur-ws.org/Vol-741/ID19_FortinoGalzaranoGravinaGuerrieri.pdf
|volume=Vol-741
|dblpUrl=https://dblp.org/rec/conf/woa/FortinoGGG11
}}
==Agent-based Development of Wireless Sensor Network Applications==
Agent-based Development of Wireless Sensor
Network Applications
Giancarlo Fortino, Stefano Galzarano, Raffaele Gravina, Antonio Guerrieri
DEIS – University of Calabria
Via P. Bucci cubo 41c, 87036 Rende (CS), Italy
g.fortino@unical.it, sgalzarano@deis.unical.it, rgravina@deis.unical.it, aguerrieri@deis.unical.it
Abstract— Due to the growing exploitation of wireless sensor platform-specific details;
networks (WSNs) for enhancing all major conventional - Reusable pattern-oriented frameworks, rather than
application domains and enabling brand new application (re)building software monolithically for each
domains, the development of applications based on WSNs has application;
recently gained a significant focus. Thus, design methods,
middleware and frameworks have been defined and made
- Higher-level network-oriented programming
available to support high-level programming of WSN abstractions that better match distributed application
applications. However, even though many proposals do exist, requirements;
more research efforts should still be devoted to the definition of - A wide array of non-functional services, such as
WSN-oriented methodologies and tools fully supporting the logging, deployment management and security that
development lifecycle of WSN applications. In this paper, we have been proven necessary to operate effectively in a
promote the use of the agent paradigm for the development of networked environment.
WSN applications. After providing motivations about synergies
between agents and WSNs and a brief overview about agent Moreover, specific WSN features that have to be fully
technology for WSNs, we describe the use of MAPS (Mobile supported are:
Agent Platform for Sun SPOTs), our agent platform for WSNs,
- Resource-constrained nature of WSNs in terms of
for the development of applications in important application
domains based on wireless body sensor networks (e.g. e-Health) processing and memory capabilities, and battery life;
and building sensor and actuator networks (e.g. energy efficient - WSN nodes are usually dynamic and mobile in nature
buildings). Finally, we delineate the characteristics on which full- instead of being static and fixed as in traditional
fledged agent-oriented methodologies for WSN applications could distributed systems;
be built.
- Differently from traditional distributed systems, WSN
Keywords-Agent-based development; agent-oriented nodes usually incorporate both application-level
programming frameworks; wireless sensor networks; state-based functions and the management of low-level aspects
programming; MAPS; body sensor networks; bulding sensor and related to mobility, routing and security.
actuator networks
Several middleware architectures based on different models
I. INTRODUCTION (database, macroprogramming, event-based, virtual machine,
Advances in micro-electro-mechanical systems (MEMS) etc) have been to date proposed to support the development,
technology, wireless communications, and digital electronics deployment, execution, and maintenance of sensor-based
have enabled the development of low-cost, low-power, applications [40]. Nevertheless, considering the commonalities
multifunctional sensor nodes that are small in size and can that bind the intrinsic properties of WSNs with those of agents
communicate over short distances in an ad-hoc manner. Such [46], agent-based middleware could be more effective in the
nodes are, in general, characterized by constrained computing context of WSNs than middleware based on other models.
and communication capabilities. A given number of such It is therefore reasonable to wonder whether agent
cooperating sensor nodes can be organized and deployed as a technology can effectively support the construction of WSN
wireless sensor network (WSN) [3]. applications. The paradigm of agent-oriented software
The development of applications for WSNs requires not engineering (AOSE) is argued to be well suited for developing
only the same middleware/programming support required by complex software systems in distributed and dynamic
conventional distributed applications but also the fulfillment of environments [25, 28]. In particular, agent technology already
additional requirements specific to WSNs [1]. In particular, offers several approaches for the design and implementation of
middleware support for conventional distributed applications agent-based sensor applications: (i) the development of a multi-
includes: agent application atop non agent-oriented middleware for
WSNs [40]; (ii) the development of agent-based middleware
- Shielding application developers from low-level that supports agent-based programming [39]; and (iii) the
extension of an existing multi-agent platform with middleware - In large-scale WSNs, centralized control is not feasible
capabilities for WSNs (if possible) [46]. as nodes can have intermittent connections and also
can suddenly disappear due to energy lack. Thus,
Although agent-oriented programming support is available, decentralized control should be exploited. The multi-
there is still a lack of full-fledged methodologies specifically agent approach is usually based on control
supporting all phases (from requirement analysis to system decentralization transferred either to multiple agents
maintenance) of the development lifecycle of agent-based dynamically elected among the available set of agents
WSN applications. or to the whole ensemble of agents coordinating as
In this paper, we first provide an overview of agent-based peers.
computing in WSNs from several perspectives: network - Adaptiveness is the main shared property between
routing, data dissemination and fusion, in-network sensors and agents. An agent is by definition adaptive
coordination, programming frameworks, high-level system in the environment in which is situated. Thus,
architectures and applications (see Section II). Then, in Section modeling the sensor activity as an agent or a multi-
III, agent-based development of WSN applications enabled by agent system and, consequently, the whole WSN as a
the MAPS (Mobile Agent Platform for Sun SPOT) framework multi-agent system, could facilitate the implementation
[2] is exemplified. Section IV discusses the identified
of the adaptiveness properties.
requirements for defining a full-fledged agent-oriented
methodology for the development of WSN applications. Moreover an interesting taxonomy about sensor networks
Finally, some concluding remarks along with a brief and their relationships with multi-agent systems can be found
description of the on-going work are provided. in [46].
II. AGENTS AND WIRELESS SENSOR NETWORKS The main agent-oriented research efforts have been to date
devoted to the following WSN research themes: network
Agent technology has been successfully used in WSNs at routing, data dissemination and fusion, in-network
different levels (application, middleware, network) [39]. In the coordination, programming frameworks, high-level system
following we provide motivations of using agents for WSNs. architectures and applications. In the following subsections an
As sensors in a WSN must typically coordinate their actions to overview of some of the main outcomes related to such themes
achieve system-wide goals, coordination among dynamic
will be presented.
entities (or agents) is one of the main features of multi-agent
systems. Moreover, WSNs are characterized by the following A. Network routing
properties: physical distribution, resource boundedness, Several agent-oriented techniques have been defined to
information uncertainty, large scale, decentralized control and support efficient routing in WSNs. Most of them are based on
adaptiveness [46]. Such properties are shared with and can be mobile agents that are able to roam across the sensor nodes,
supported by agents and multi-agent systems. In particular: performing routing tasks.
- Physical distribution implies that sensors are situated in An interesting routing technique based on mobile agents is
an environment from which they can receive stimuli rumor routing [8] that allows for routing queries to nodes that
and act accordingly, also through control actions have observed a particular event (i.e. a localized phenomenon
aiming at changing their environment. Situatedness is a detected by some sensor node/s). The rumor routing algorithm
main property of an agent and several well-known aims at lower energy consumption than algorithms that flood
agent architectures were defined to support such the whole network with query or event messages. The main
important property. idea is that mobile agents a priori create paths leading to event
- Boundedness of resources (computing power, nodes as the events occur; later queries are sent on random
communication and energy) is a typical property both walks until they find one of the created paths, and then route
of sensor nodes as single units and of the WSN as a along the path to event nodes.
whole. Agents and related infrastructures can support In [22] authors propose a solution where mobile agents are
such limitation through intelligent resource-aware, created whenever a source node decides to send a data packet
single and cooperative behaviors. to the sink. Agents are then responsible for carrying the data
- Information uncertainty is typical in large-scale WSNs through the network. After reaching the destination, the agent
in which both the status of the network and the data delivers the data to the application and then dies. After arriving
gathered to observe the monitored/controlled at a node, the agent checks a forwarding table available at the
phenomena could be incomplete. In this case, node with the possible next hops, including such nodes
intelligent (mobile) agents could recover inconsistent respective costs and energy levels. Based on that information,
states and data through cooperation and mobility. agents take a decision. Since energy levels are depleted as
agents use a given path, future agents might take more
- Large scale is a property of WSNs either sparsely expensive paths that happen to have more energy available,
deployed on a wide area or densely deployed on a achieving some degree of load balancing. Moreover, agents
restricted area. Agents in multi-agent systems usually could negotiate and aggregate their data when they “meet” in
cooperate in a decentralized way through highly the network, possibly becoming one single agent after such
scalable interaction protocols and/or time- and space- aggregation.
decoupled coordination infrastructures.
B. Data Dissemination and Fusion available research prototypes based on TinyOS [45], and then,
Several data fusion and dissemination schemes based on we introduce AFME and MAPS which are based on Java.
mobile agents have been to date proposed. In [31], authors Agilla [19] is an agent-based middleware developed on
review and evaluate the most representative mobile agent- TinyOS and supporting multiple agents on each node. Agilla
based middleware proposals for autonomic data fusion tasks in provides two fundamental resources on each node: a tuplespace
WSNs, highlighting their relevant strengths and shortcomings. and a neighbor list. The tuplespace represents a shared memory
They classify such research proposals in five main categories: space where structured data (tuples) can be stored and
single mobile agent-based, multiple mobile agent-based, retrieved, allowing agents to exchange information through
autonomic data fusion in clustered WSN architectures, spatial and temporal decoupling. A tuplespace can be also
hardware based and combined multiple mobile agent/stationary accessed remotely. The neighbor list contains the address of all
agents-based autonomic data fusion. In [11] mobile agents are one-hop nodes needed when an agent has to migrate. Agents
used to disseminate data. According to client/server can migrate carrying their code and state, but they cannot carry
architectures, data at multiple sources is transferred to a their tuples locally stored on a tuplespace. Packets used for
destination whereas, according to the mobile agent paradigm, a node communication (e.g. for agent migration/cloning, remote
task-specific mobile agent traverses the relevant sources to tuple accessing) are very small to minimize messages losses,
gather data and disseminate them according to specific policies. whereas retransmission techniques are also adopted.
Many inherent advantages (e.g. scalability, extensibility,
energy awareness, reliability) of the mobile agent architecture ActorNet [27] is an agent-based platform specifically
make it suitable for WSNs than the client/server architecture. designed for Mica2/TinyOS sensor nodes. To overcome the
Mobile agents can be exploited at three levels (node level, task difficulties in allowing code migration and interoperability due
level, and combined task level) to reduce the information to the strict coupling between applications and sensor node
redundancy and communication overhead. architectures, actorNet exposes services like virtual memory,
context switching, and multi-tasking. Thanks to these features,
C. Energy-aware Coordination it effectively supports agent programming by providing a
Within application domains involving low-power, wireless uniform computing environment for all agents, regardless of
devices physically distributed over an environment to acquire hardware or operating system differences. The actorNet
and integrate information, one of the main challenges to face language used for high-level agent programming has syntax
with is to coordinate the activities of such devices in order to and semantics similar to those of Scheme with proper
achieve good system-wide performance. Moreover, several instruction extension.
constraints have to be considered: specific constraints on each Both Agilla and actorNet are designed for TinyOS that
device (e.g. limited power, communication and computational relies on the nesC language that is not an object-oriented
resources), the limitation for each of them to be able to language but an event- and component-based extension of the
communicate with only its local neighborhood and the need for ANSI C language. The Java language, through which Sun
a decentralized approach such that there is no central point of SPOT [43] and Sentilla JCreate [41] sensors can be
failure and no communication bottleneck. The problem of programmed, due to its object-oriented features, could provide
performing decentralized coordination of low-power devices is more flexibility and extendibility for an effective
addressed in [18] by considering the generic problem of implementation of agent-based platforms. Currently, the only
maximizing social welfare within a group of interacting agents. two available Java-based mobile agent platforms for WSNs are
Each agent interacts locally with a number of other agents such
MAPS [2] and AFME [32].
that the utility of an individual agent is dependent on its own
state and the states of these other agents. In particular, a novel The AFME framework [32], a lightweight version of the
representation of the problem, through a cyclic bipartite factor agent factory framework purposely designed for wireless
graph composed of variable and function nodes (representing pervasive systems and implemented in J2ME, has been
the agents’ states and utilities respectively), is proposed. Such recently ported onto Sun SPOT and used for exemplifying
descriptive model allows using an extension of the sum- agent communication and migration in WSNs. AFME is
product algorithm (specifically the max-sum algorithm), which strongly based on the Belief-Desire-Intention (BDI) paradigm, in
is adopted, along with a local decentralized message passing, to which agents follow a sense-deliberate-act cycle. In AFME,
generate approximate solutions to the global optimization agents are defined through a mixed declarative/imperative
problem. It is shown that this approach has a communication programming model. The declarative Agent Factory Agent
cost (in terms of total messages size and, consequently, in Programming Language (AFAPL), based on a logical formalism
energy consumption) that scales very well with the number of of beliefs and commitments, is used to encode an agent’s
agents in the system because the complexity of the calculation behavior by specifying rules that define the conditions under
that each agent performs depends only on the number of which commitments are adopted. The imperative Java code is
neighbors that it has and not on the total size of the network. instead used to encode perceptors and actuators. However,
AFME was not specifically designed for WSNs and,
D. Programming Frameworks particularly, for Java Sun SPOT. MAPS, the Java-based agent
Very few agent frameworks for WSNs have been to date platform overviewed in the next section, is conversely
proposed and concretely implemented. In the following, we specifically designed for WSNs and fully uses the release 4.0
first describe Agilla and actorNet, the most significant blue of the Sun SPOT library to provide advanced functionality
of communication, migration, sensing/actuation, timing and
flash memory storage. Moreover, it allows developers to with respect to the execution time and energy consumption
program agent-based applications in Java according to the rules perspectives through both simulation and analytical study.
of the MAPS framework, and thus no translator and/or Results indicate that in the context of sensor networks where
interpreter need to be developed and no new language has to be the number of sensor nodes is very large, the communication
learnt as in the case of Agilla, ActorNet and AFME. bandwidth is considerably low, and the energy resource is
contingent, the mobile-agent-based computing model is more
E. System Architectures, Services and Applications suitable for conducting collaborative processing.
Mobile agents have been also exploited to design WSN system
architectures and develop services and applications based on III. USING MAPS FOR AGENT-BASED DEVELOPMENT
WSNs. In [10, 23] authors propose mobile agents for WSN MAPS [2, 30] is an innovative Java-based framework
applications and, specifically, decompose the agent design specifically developed on Sun SPOT technology for enabling
functionality into four components: architecture, itinerary agent-oriented programming of WSN applications. It has been
planning, middleware system design, and agent cooperation. defined according to the following requirements:
This decomposition covers low-level to high-level design
issues and facilitates the creation of a component-based and - Component-based lightweight agent server architecture
efficient mobile agent system for a wide range of applications. to avoid heavy concurrency and agents cooperation
With reference to applications, a measurable bandwidth saving models.
can be obtained either when large amounts of data are locally - Lightweight agent architecture to efficiently execute
processed by mobile agents, or when the deployment of a and migrate agents.
programmable approach enabling task autonomy is required.
To this purpose, an efficient design for the core components is - Minimal core services involving agent migration, agent
required to support the scheme being followed by the agent- naming, agent communication, timing and sensor node
based application when dealing with a particular type of resources access (sensors, actuators, flash memory, and
problem. Similarly, the WSN application has a direct influence radio).
on the type of communications mechanism employed by the
- Plug-in-based architecture extensions through which
mobile agent system to perform its task efficiently. However,
any other service can be defined in terms of one or
their applicability mainly is warranted not only by the overall
more dynamically installable components implemented
energy savings they introduce, but also by the extra flexibility
as single or cooperating (mobile) agents.
they offer when coping with frequent and/or unexpected
aspects of the event being sensed that other types of approaches - Use of Java language for defining the mobile agent
are unable to address efficiently. behavior.
In [12] the MAWSN (Mobile Agent-based WSN) architecture The architecture of MAPS (see Fig. 1) is based on several
for data processing/aggregating/concatenating in a planar components interacting through events and offering a set of
sensor architecture is proposed. MAWSN can exhibit better services to mobile agents, including message transmission,
performance than client/server communications in terms of agent creation, agent cloning, agent migration, timer handling,
energy consumption and packet delivery ratio. However, and an easy access to the sensor node resources. In particular,
MAWSN has a longer end-to-end latency than client/server the main components are the following:
communications in certain conditions.
- Mobile Agent (MA). MAs are the basic high-level
Mobile agents have also been applied for location tracking component defined by user for constituting the agent-
services based on WSNs. The goal is to monitor the roaming based applications.
path of a moving object through wireless sensor nodes
disseminated on an environment. While similar to the problem - Mobile Agent Execution Engine (MAEE). It manages
of location update in personal communication service the execution of MAs by means of an event-based
networks, it is more challenging as there are no central control scheduler enabling lightweight concurrency. MAEE
mechanism and backbone network and the communication also interacts with the other services-provider
bandwidth is very limited. In [44], a mobile agent-based components to fulfill service requests (message
protocol for location tracking is proposed. Once a new object is transmission, sensor reading, timer setting, etc) issued
detected, a mobile agent is initiated to track the roaming path by MAs.
of the object. The agent follows the object by moving to the - Mobile Agent Migration Manager (MAMM). This
sensor closest to the object. Moreover, the mobile agent may component supports agents migration through the
invite some nearby sensor agent to cooperatively locate the Isolate (de)hibernation feature provided by the Sun
object and inhibit other irrelevant sensor agents from tracking SPOT environment. The MAs hibernation and
the object. As a result, the communication and sensing serialization involve data and execution state whereas
overheads can be greatly reduced. the code must already reside at the destination node
Finally, in [38] an energy-efficient, fault-tolerant approach (this is a current limitation of the Sun SPOTs which do
for collaborative signal and information processing (CSIP) not support dynamic class loading and code migration).
among multiple sensor nodes using a mobile agent-based - Mobile Agent Communication Channel (MACC). It
computing model, is proposed. The performance of such a enables inter-agent communications based on
model is compared with the classic client/server-based model
asynchronous messages (unicast or broadcast) allows rapid prototyping of WSN-based distributed
supported by the Radiogram protocol. applications/systems that use JADE at the
basestation/coordinator/host sides and MAPS at the sensor
- Mobile Agent Naming (MAN). MAN provides agent
node side.
naming based on proxies for supporting MAMM and
MACC in their operations. It also manages the Recently a tiny version of MAPS, named TinyMAPS, has
(dynamic) list of the neighbor sensor nodes which is been developed for the Java-based Sentilla JCreate sensor
updated through a beaconing mechanism based on platform [41]. Sentilla sensors are much more resource-
broadcast messages. constrained than Sun SPOT sensors so both the mobile agent
system architecture and the agent architecture of TinyMAPS
- Timer Manager (TM). It manages the timer service for have been purposely tailored to be actually implemented. In the
supporting timing of MA operations. following a comparison between TinyMAPS and MAPS with
- Resource Manager (RM). RM allows access to the respect to their architectures and programming models is
resources of the Sun SPOT node: sensors (3-axial reported.
accelerometer, temperature, light), switches, leds, Both TinyMAPS and MAPS offer similar services for
battery, and flash memory. developing WSN agent-based applications. They use state
machines to model the agent behavior and directly the Java
language to program guards and actions. Moreover, differently
from TinyMAPS, MAPS is more powerful and fully exploits
the last release of the Sun SPOT library to provide advanced
functionality of communication, migration, sensing/actuation,
timing, and flash memory storage. In MAPS, the
implementation of mobile agents is based on Isolates, whose
migration mechanism is directly offered by the SPOT Squawk
JVM. The concept of Isolates within Sentilla JCreate
technology is different; they are used as system mechanisms
together with the concept of Binary when the code is deployed
on the motes [41]. TinyMAPS supports migration by simply
sending an event that contains agent status information and
data (which are coded and encapsulated inside the event); the
agent needs to re-start its execution on the remote node. In any
case, both platforms suffer from the current limitation of the
Figure 1. The architecture of MAPS.
Sentilla JCreate and the Sun SPOT that do not allow dynamic
The dynamic behavior of a mobile agent (MA) is modeled class loading, so preventing from the possibility to support
through a multi-plane state machine (MPSM). Each plane may code migration (i.e. any class required by the agent must be
represent the behavior of the MA in a specific role so enabling already present at the destination node). Finally, both MAPS
role-based programming. In particular, a plane is composed of and TinyMAPS allow developers to program agent-based
local variables, local functions, and an automaton whose applications in Java according to its rules so no translator
transitions are labeled by Event-Condition-Action (ECA) rules and/or interpreter need to be developed and no new language
E[C]/A, where E is the event name, [C] is a boolean expression has to be learnt.
evaluated on global and local variables, and A is the atomic MAPS is being applied in two WSN application domains:
action. Thus, agents interact through events, which are body sensor networks [4] for supporting assisted livings and
asynchronously delivered and managed by the MAEE building sensor networks for intelligent management of energy
component. consumptions and resident comfort [24]. In the following
It is worth noting that the MPSM-based agent behavior subsections, we describe the application of MAPS in the two
programming allows exploiting the benefits deriving from aforementioned application domains.
three main paradigms for WSN programming: event-driven A. Body Sensor Networks
programming, state-based programming and mobile agent-
Among the WSN domains, wireless Body Sensor
based programming.
Networks (BSNs) [36] are conveying notable attention as their
MAPS has been also made interoperable with the JADE real-world applications aim at supporting humans in every
framework [6]. Specifically, a JADE-MAPS gateway [16] has facets of their daily life. BSNs involve wireless wearable
been developed for allowing JADE agents to interact with physiological sensors applied to the human body for medical
MAPS agents and vice versa. While both MAPS and JADE are and non-medical purposes and, in particular, BSNs enable
Java-based, they use a different communication method. JADE continuous, real-time, non-invasive, anywhere and anytime
sends messages according to the FIPA standards (using the monitoring of assisted livings. Applications where BSNs could
ACL specifications), while MAPS creates its own messages be greatly useful include early detection or prevention of
based on events. Therefore, the JADE-MAPS Gateway diseases (heart attacks, Parkinson, diabetes, etc.), elderly
facilitates message exchange between MAPS and JADE assistance at home, e-Sport, e-Entertainment, post-trauma
agents. This inter-platform communication infrastructure rehabilitation after surgeries, motion and gestures detection,
cognitive and emotional recognition for social interactions, 2. Computation of specific features (Mean function on all
medical assistance in disaster events, e-Factory. accelerometer axes and Max and Min functions on the
To demonstrate the effectiveness of agent-based platforms X accelerometer axis for the WaistSensorAgent and
to support programming of BSN applications, in [5] a MAPS- Max on the X accelerometer axis for the
based agent-oriented signal processing in-node environment ThighSensorAgent) on the acquired raw data;
specialized for real-time human activity monitoring has been 3. Features aggregation and transmission to the
presented. In particular, the system is able to recognize coordinator;
postures (e.g. lying down, sitting and standing still) and 4. Goto 1.
movements (e.g. walking) of assisted livings. The system In [5] the entire system has been analyzed by considering
architecture, shown in Fig. 2, is organized into a coordinator
the following two aspects:
(based on a PC/smartphone), implemented with Java and
JADE, and two sensor nodes implemented with MAPS [2]. - the performance evaluation of the timing granularity
degree of the sensing activity at the sensor node and
the synchronization degree or skew of the activities of
the two sensor agents;
- the recognition accuracy which shows how well the
human postures/movements are recognized by the
system.
On the basis of the obtained performance results it can be
stated that MAPS shows its great suitability for supporting
efficient BSN applications, so demonstrating that the agent
approach is not only effective during the design of a BSN
application but also during the implementation phase.
Furthermore, the recognition accuracies are good and
encouraging if compared with other works in the literature that
use more than two sensors on the human body to recognize
activities [29]. While it has been shown that MAPS provides
enough efficiency to support the requirements of real-time
recognition of human activities, with reference to programming
effectiveness, its agent programming model based on finite
state machine offers a very straightforward and intuitive
instrument for supporting BSN application development.
Figure 2. Architecture of the agent-based activity monitoring system. B. Building Sensor Networks
The coordinator side is based on a JADE Agent which Building sensor networks are WSNs that are deployed
incorporates several modules of the Java-based coordinator inside buildings, on the building structure, or among buildings
developed in the context of the SPINE framework [4]. In to support building automation, energy saving and structural
particular, it is used by end-user applications (e.g. the real-time health monitoring. Building sensor networks require an
activity recognition application) for sending commands to the efficient domain-specific framework for their management and
sensor nodes and is responsible of capturing low-level for the flexible and rapid development of related applications
messages and events coming from the nodes. The JADE agent (smart home, passive house, intra-smart GRID, energy efficient
coordinator also integrates an application-specific logic for the buildings, etc). To this purpose the Building Management
synchronization of the two sensors. In particular, the activity Framework (BMF) has been developed [24].
recognition application, running above the JADE agent, BMF is a domain-specific framework for intelligent
integrates a classifier based on the K-Nearest Neighbor management of WSAN (Wireless Sensor and Actuator
algorithm that is capable of recognizing postures and Networks) enabling proactive monitoring of spaces and control
movements defined in a training phase. of devices/equipments. BMF specifically provides: (i) flexible
The two sensor nodes are based on the Java Sun SPOT and efficient management of (large) sets of cooperating
platform and are respectively positioned on the waist and the networked sensors and actuators; (ii) abstractions for logical
thigh of the monitored person. In particular, MAPS is resident and physical node group organization to specifically capture
on the sensor nodes and supports the execution of the the morphology of buildings; (iii) intelligent sensing and
WaistSensorAgent and the ThighSensorAgent, whose actuation techniques; (iv) integration of heterogeneous WSNs;
behaviours are modelled though a finite-state machine (v) flexible system programming at low- and high-level.
executing the following step-wise cycle: In particular, BMF is basically organized in two processing
layers: Low-Level Processing (LLP) and High-Level
1. Sensing the 3-axial accelerometer sensor according to a
Processing (HLP). LLP resides on the sensor nodes and
given sampling time;
provides the following sensor-based services: acquisition of
data from sensors, execution of actions on actuators, in-node
processing (selection and aggregation), scheduling of sensing the sensor nodes. Specifically A-BMF relies on a multi-
and actuation requests, data and request routing, dynamic node basestation approach to allow for large buildings composed of
addressing, and group management. multiple floors and diversified environments. Thus, the A-BMF
architecture is hybrid: hierarchical and peer-to-peer. Interaction
LLP is currently available for TinyOS and Sun SPOT nodes among CAs is peer-to-peer whereas interaction between
with implementations following respectively the TinyOS coordinator agents and their related SAs (or SA cluster) is
event-driven and the Java object-oriented paradigms. LLP is usually master/slave. Moreover, SAs of the same cluster
highly modular so that it is easy to extend it for new platforms
coordinate to dynamically form a multi-hop ad-hoc network
and to allow for a fast integration of new sensors/actuators. rooted at the CA. Functionalities of CAs and SAs are similar to
HLP resides at the basestation side and provides the those described for BMF at the basestation and sensor node
following system-wide services: device discovery and sides. Moreover, CAs can cooperate for submitting queries and
management, group-based programming of sensors and retrieving data spanning multiple SA clusters. A-BMF is
actuators, adaptation of heterogeneous devices, and support for currently being implemented through JADE at basestation side
higher-level application-specific components. and through MAPS at sensor side.
HLP is currently based on the OSGi framework [34] so
having strong modularity and allowing to implement all needed
services in different bundles that can communicate with each
other through OSGi. In particular, the following bundles are
available: The Platform Bundle which is a bundle allowing to
interface the system with different type of platforms. Every
Platform Bundle is linked to an hardware component able to
communicate with a platform in the network; The
Communication Bundle which allows to send and receive
packets over the air enabling communication between bundles
and a WSN; The Groups and Nodes Management Bundle
which keeps track of nodes and groups in a WSAN, and stores
nodes configurations and groups compositions; The Packet
Manager Bundle which allows the creation and the
interpretation of low level packets according to the Building
Management Framework Communication Protocol; The
Network Manager Bundle which allows to fully manage a
Figure 3. High-level view of the A-BMF architecture
WSN running the BMF; The Data Saving Bundle which is
designed to save data from the WSN to files or DB; The
IV. TOWARDS A FULL-FLEDGED AGENT-ORIENTED
Aggregation Bundle which is delegated to execute aggregations
on data from the network; The BMF Management GUI Bundle METHODOLOGY FOR THE DEVELOPMENT OF WSN
which is a standard graphical configuration application APPLICATIONS
designed to allow the user to manage a WSN submitting The complexity of WSN application development currently
requests, waiting for and visualizing data from the network and derives from two major issues: (i) a lack of adequate
displaying charts about sensing operations. abstractions in application development that application
developers can exploit for the rapid implementation of WSN
LLP and HPL interact through an application level applications; in fact, the level of abstraction remains very low
communication protocol, namely Building Management in the current practice of WSN application development; (ii)
Framework Communication Protocol (BMFCP). BMFCP lack of coherent tool chains for application development; in
therefore supports the communication between HLP and LLP fact, in addition to programming, WSN application
to configure and monitor the building sensor network in an development involves a series of labor-intensive tasks such as
effective manner. The packets exchanged can be formed, the compilation and verification of program code,
depending on the specific request or the specific data from the configuration of a simulator or of sensor nodes, and
nodes, by different fields having a different amount of bytes. deployment/injection of compiled code to nodes. Among the
The BMFCP is developed to send over-the-air variable length new paradigms and tools that the Software Engineering has
packets containing only the meaningful bits of the significant proposed, the agent-oriented software engineering (AOSE)
fields. Thus, the BMFCP optimizes transmissions saving [25], which has shown high suitability to support the
battery on the single nodes and network bandwidth so allowing development of distributed applications in terms of multi-agent
more nodes to share the same radio channel. systems (MAS) in dynamic and heterogeneous environments,
An agent-oriented design of BMF, named A-BMF, has could be a very good candidate to effectively support WSN
been recently carried out. A-BMF exploits agents and their applications. In particular, several agent-oriented
supporting infrastructure to enhance the management methodologies [49, 9, 15, 13, 37, 21] have been defined to
functionality of BMF with in-node and basestation-side agent- enable the concrete use of the abstractions of the agent
oriented features. The architecture of A-BMF (see Figure 3) is paradigm and effectively and successfully applied in diverse
composed of coordinator agents (CAs), which run in the application domains. Such methodologies are different in the
basestations, and sensor agents (SAs), which are executed in following aspects: (i) supported phases of the software
development lifecycle; (ii) adopted modeling languages; (iii) abstraction and their relative platforms: a service
availability of a CASE tool supporting the methodology; (iv) platform at the application layer, a protocol platform to
agent platforms for executing the produced software. However, describe the protocol stacks, and an implementation
since they are general-purpose, to obtain specific platform for the hardware nodes. In this case, the first
methodologies for the resolution of specific problems in refinement step maps the high-level service platform
specific application domains, the method engineering, which instance to an implementation platform instance,
allows for the integration of method fragments taken from leading to a topology. It is the output of this step that
existing methodologies or developed ad-hoc, has been identifies the type, the number, and the location of the
exploited [20]. In addition, several research efforts have physical sensor nodes needed by the application. The
recently been devoted to integrating simulation into agent- communication problem is addressed only later, with a
oriented methodologies for supporting MAS validation before further mapping process that choose the right
MAS deployment [14]. It is worth noting that such communication protocol stack (MAC and/or routing)
methodologies are not currently exploited for the development that meets the application requirements and satisfies
of applications on WSN even though the agent paradigm is the energy constraints of the selected physical network
emerging as promising paradigm for programming WSN infrastructure. PBD for WSNs [7]
applications.
- WSN simulation techniques and frameworks. The
A pure agent-oriented methodology for WSN application growth of WSN applications has opened the way to
development could be based on: their performance evaluation. Since mathematical
analysis and experimental deployments are not always
- The use and customization of agent-oriented existing allowed, for the WSNs most of researchers have
methodologies [49, 9, 15, 13, 37, 21]; chosen simulation for their study. This approach is a
- The ad-hoc definition of agent-oriented methodologies delicate matter due to the complexity of the WSNs.
by possibly re-using parts of already existing First of all, the large number of nodes heavily impacts
methodologies through a method engineering approach simulation performance and scalability. Second,
[14, 20]. credible results demand an accurate characterization of
the radio channel. New aspects inherent in WSN must
However, being WSNs a specific type of distributed embedded be included in simulators (e.g., a physical environment
system, often integrated into other distributed embedded and an energy model), leading to different degrees of
systems, the following techniques and methods developed in accuracy against performance [17]. Many simulators
the research area of embedded computing could be fruitfully like ATEMU, EmStar, SNAP, TOSSIM, and COOJA
exploited: platform-based design, simulation-driven are specifically designed for WSNs. Among them
prototyping, and model-driven development based on domain- COOJA allows to simulate WSNs choosing if
specific languages. We therefore believe that an effective increasing the accuracy or the performance giving the
methodology for WSN application development should possibility to simulate different nodes at different
integrate method fragments from agent-oriented methodologies levels. The COOJA simulator [35] is a flexible Java-
with the following WSN-oriented techniques/methods: based sensor network simulator with specific
- Platform-Based Design [26] is a methodology algorithms to simulate entities like the WSN radio
originally developed for the design of embedded channel and battery consumption and capable to
systems. According to the PBD, a design is obtained as emulate microcontrollers like the MSP430 one.
a sequence of refinement steps that guide the designer COOJA is the only simulator that has the ability to mix
from the initial specification all the way down to a simulations of sensor devices at multiple abstraction
physical implementation. To support this process, a set levels: (i) Application level, the simulated nodes run
of intermediate abstraction layers and platforms are to the application logic re-implemented in Java
be identified. These platforms therefore represent the (simulating at this level increases performances); (ii)
target system at different levels of abstraction. Each OS level, the nodes use the same code as real nodes,
platform is composed on a set of instances. An iterative but compiled for COOJA; (iii) Hardware level, the
refinement (mapping) process translates a platform nodes run the same compiled code that can be used in
instance to another one of a lower level, until the final real nodes (simulating at this level increases accuracy).
implementation is reached. Each refinement step is a The nodes at different abstraction levels can
design choice taken as the solution of a constrained communicate with each other using the radio channel.
optimization problem. The cost function is typically COOJA can effectively support the prototyping of
the energy consumption (to optimize the system WSN applications giving the possibility to simulate
lifetime). The constraints are usually the error rate, high-level code (Java, at the application level) to test
latency, and the budget. The PBD methodology has the algorithms and then the code can be re-
been applied for the system-level design of WSNs [7] implemented for WSN nodes like TelosB and
to address, through a formal and systematic approach, simulated again at low-level (hardware level).
issues such as reliability and support for heterogeneity - MDD and Domain-Specific Languages for WSNs. The
that are still one of the main limiting factors to the Model-Driven Development is based on the idea of
commercial spread of the WSN technology. In separating the specification of the operation of a
particular, the approach is based on three layers of
system from the details of the way that system uses the ACKNOWLEDGMENT
capabilities of its platform. The three primary goals of This work has been partially supported by CONET, the
MDD are portability, interoperability and reusability Cooperating Objects Network of Excellence, funded by the
through architectural separation of concerns. MDD European Commission under FP7 with contract number FP7-
provides a set of guidelines for structuring
2007-2-224053.
specifications expressed as models. It defines system
functionality using an appropriate domain-specific REFERENCES
language (DSL). The MDD approach can be very
[1] S. R. Afzal, C. Huygens, W. Joosen, “Extending middleware
useful in the WSN domain [47] giving the possibility frameworks for Wireless Sensor Networks,” Proc. of the International
to overcome the limitation in the programming of Conference on Ultra Modern Telecommunications, ICUMT 2009, 12-14
heterogeneous WSN due to different platforms and October, St. Petersburg, Russia, pp. 1-7, 2009.
OSs. In [33], for example, a complete framework for [2] F. Aiello, G. Fortino, R. Gravina and A. Guerrieri, A Java-based Agent
modeling, simulation, and multiplatform code Platform for Programming Wireless Sensor Networks, The Computer Journal,
54(3), pp. 439-454, 2011.
generation for WSN based on MathWorks tools is [3] I. F. Akyildiz, W. Su, Y. Sankarasubramaniam, and E. Cayirci,
presented. This framework offers application "Wireless Sensor Networks: A Survey," Computer Networks Elsevier Journal,
developers rich libraries for digital signal processing Vol. 38, No. 4, pp. 393–422, March 2002.
and control algorithm behavior simulation, along with [4] F. Bellifemine, G. Fortino, R. Giannantonio, R. Gravina, A. Guerrieri,
a broad variety of debugging and analysis tools, such M. Sgroi, “SPINE: A domain-specific framework for rapid prototyping of
WBSN applications” Software Practice and Experience, Wiley, 41(3), 2011,
as animated state chart displays, scopes, and plots. pp. 237-265.
Moreover, with this framework users can automatically [5] F. Bellifemine, F. Aiello, G. Fortino, S. Galzarano, R. Gravina, “An
generate the complete application code for several agent-based signal processing in-node environment for real-time human
target operating systems from the same simulated and activity monitoring based on wireless body sensor networks”. Journal of
debugged model, without thinking about the details of Engineering Applications of Artificial Intelligence, Elsevier. 2011, to appear.
[6] F. Bellifemine, A. Poggi, and G. Rimassa,, “Developing multi agent
the target platform implementation. systems with a FIPA-compliant agent framework,”. Software Practice And
Moreover, the methodology should also aim at supporting the Experience 31, 103-128, 2001.
[7] A. Bonivento, L. P. Carloni, A. L. Sangiovanni-Vincentelli, “Platform
development of applications both for single-application WSNs
based design for wireless sensor networks,” MONET 11(4), 469-485, 2006.
and for future multiple-purpose WSNs [42, 48]. [8] D. Braginsky and D. Estrin, “Rumor routing algorithm for sensor
networks,” in First ACM International Workshop on Wireless Sensor
Finally, as demonstrated in the software engineering research Networks and Applications, pp.22–31, Sept. 2002.
area, the development of a CASE tool specifically and [9] P. Bresciani, P. Giorgini, F. Giunchiglia, J. Mylopoulos and A. Perini,
seamlessly supporting all phases of the methodology from "TROPOS: an agent-oriented software development methodology", Journal of
requirement analysis to system deployment and maintenance Autonomous Agents and Multi-Agent Systems, 8(3), pp.203-236, 2004.
would promote usability and effectiveness of the methodology. [10] M. Chen, S. González-Valenzuela, V. C. M. Leung, “Applications and
design issues for mobile agents in wireless sensor networks”, IEEE Wireless
V. CONCLUSIONS Communications, pp. 20-26, Dec 2007.
[11] M. Chen, T. Kwon, and Y. Choi. “Data Dissemination based on Mobile
In this paper we have proposed the agent paradigm and Agent in Wireless Sensor Networks,” Proc. of the IEEE Conference on Local
technology as very suitable for supporting the development of Computer Networks 30th Anniversary (LCN '05). IEEE Computer Society,
WSNs. “Agents” and “sensors” have many common aspects Washington, DC, USA, 527-529, 2005
[12] M. Chen, T. Kwon, Y. Yuan and V.C.M. Leung, “Mobile Agent Based
that can be fruitfully exploited to design efficient agent-based Wireless Sensor Networks,” Journal of computers, 1(1), pp. 14-21, April
WSNs. In fact, several agent-oriented research efforts on 2006.
routing, data dissemination and fusion, [13] M. Cossentino, "From requirements to code with the PASSI
frameworks/middleware, services, systems, and applications methodology", in B. Henderson-Sellers and P. Giorgini (Eds.) Agent-Oriented
for WSNs have been defined. Moreover, in this paper we have Methodologies, Hershey, PA: Idea Group Inc., pp.79-106, 2005.
[14] M. Cossentino, G. Fortino, A. Garro, S. Mascillaro, W. Russo,
shown how MAPS, a mobile agent framework for Sun SPOT
"PASSIM: A Simulation-based Process for the Development of Multi-Agent
sensor platform, can actually support the development of Systems" in Int'l Journal on Agent Oriented Software Engineering, 2(2), 2008.
applications in the context of wireless body sensor networks [15] S.A. DeLoach, M. Wood, and C. Sparkman, "Multi-agent system
and building sensor and actuators networks that are conveying engineering", Int'l Journal of Software Engineering and Knowledge
notable attention as enablers of a great variety of high-impact Engineering, 11(3), pp.231-258, 2001.
application domains (e.g. e-Health, e-Factory, energy efficient [16] J.J. Domanski, R. Dziadkiewicz, M. Ganzha, A. Gab and M.M.
Mesjasz “Implementing GliderAgent – an agent-based decision support
buildings). Finally, we discussed the requirements that a full- system for glider pilots,” in NATO ASI Book, IOS press, 2011, to appear.
fledged agent-oriented methodology for the development of [17] E. Egea-Lopez, J. Vales-Alonso, A. Martinez-Sala, P. Pavon-Mario, J.
WSN applications could have. Such methodology not only Garcia-Haro. "Simulation scalability issues in wireless sensor networks"
should incorporate useful methods and models derived from Communications Magazine, IEEE, Vol. 44, No. 7. (2006), pp. 64-73.
available agent-oriented methodology but also it should include [18] A. Farinelli, A. Rogers, A. Petcu and N.R. Jennings, “Decentralised
Coordination of Low-Power Embedded Devices Using the Max-Sum
methods and techniques derived from embedded computing Algorithm,” Proc. of Seventh International Conference on Autonomous
such as platform-based design, simulation-driven testing and Agents and Multi-Agent Systems (AAMAS-08), 12-16 May 2008, Estoril,
model-driven development based on domain-specific Portugal. pp. 639-646, 2008.
languages. On-going research activity is therefore focused at [19] C.-L. Fok, G.-C. Roman and C. Lu, Agilla: A Mobile Agent
the definition of such methodology. Middleware for Sensor Networks, accepted to ACM Transactions on
Autonomous and Adaptive Systems Special Issue, 2011.
[20] G. Fortino, A. Garro, W. Russo, "An Integrated Approach for the Sensor Network Applications”. Wireless Design & Development, ISSN:
Development and Validation of Multi Agent Systems", in Computer Systems 1076-4240, Feb 2009.
Science & Engineering, 20(4), pp.94-107, Jul. 2005. [34] OSGi (Open Service Gateway initiative) Alliance, http://www.osgi.org
[21] G. Fortino, W. Russo, E. Zimeo, "A Statecharts-based Software (2011)
Development Process for Mobile Agents", in Information and Software [35] F. Österlind, A. Dunkels, J. Eriksson, N. Finne, and T. Voigt, “Cross-
Technology, 46(13), pp.907-921, Oct. 2004. level sensor network simulation with Cooja,” Proceedings of the First IEEE
[22] L. Gan, J. Liu, and X. Jin, “Agent-based, energy efficient routing in International Workshop on Practical Issues in Building Sensor Network
sensor networks,” In AAMAS ’04: Proc. of the Third International Joint Applications (SenseApp 2006), Tampa, Florida, USA, Nov. 2006.
Conference on Autonomous Agents and Multiagent Systems, pages 472–479, [36] A. Pantelopoulos, N.G. Bourbakis, “A Survey on Wearable Sensor-
Washington, DC, USA, 2004. Based Systems For Health Monitoring and Prognosis”, In IEEE Transactions
[23] S. González-Valenzuela, M. Chen, V. C. M. Leung, “Programmable on Systems, Man and Cybernetics, Part C, Vol. 40, No. 1, pp. 1-12, 2010.
Middleware for Wireless Sensor Networks Applications Using Mobile [37] J. Pavón, J. Gómez-Sanz, and R. Fuentes, "The INGENIAS
Agents,” MONET, 15(6):853-865, 2010. Methodology and Tools," In Agent-Oriented Methodologies, Eds. B.
[24] A. Guerrieri, A. Ruzzelli, G. Fortino and G. O’Hare, “A WSN-based Henderson-Sellers and P. Giorgini, Idea Group Publishing, 2005, pp.236-276.
Building Management Framework to Support Energy-Saving Applications in [38] H. Qi, Y. Xu, and X. Wang, “Mobile-Agent-Based Collaborative
Buildings,” In “Advancements in Distributed Computing and Internet Signal and Information Processing in Sensor Networks,” Proc. IEEE, vol. 91,
Technologies: Trends and Issues” (Al-Sakib Khan Pathan, Mukaddim Pathan, no. 8, Aug. 2003, pp. 1172–83.
Hae Young Lee, eds), Chapter 12, pp. 161-174, IGI Global, 2011. [39] A. Rogers, D. Corkill, and N.R. Jennings, N. R. “Agent technologies
[25] N.R. Jennings and M. Wooldridge, "Agent-Oriented Software for sensor networks,” IEEE Intelligent Systems, 24, pp. 13-17, 2009.
Engineering", in Handbook of Agent Technology, Bradshaw, J., Ed.: [40] K. Romer, O. Kasten, and F. Mattern, “Middleware challenges for
AAAI/MIT Press, 2001. wireless sensor networks,” Mobile Computing and Communications Review,
[26] K. Keutzer, S. Malik, A.R. Newton, J. M. Rabaey, and A. Sangiovanni- 6, 2002.
Vincentelli, “System-Level Design: Orthogonalization of Concerns and [41] Sentilla Developer Community,
Platform Based Design”, IEEE Trans. on Computer-Aided Design of http://www.sentilla.com/developer.html.
Integrated Circuits and Systems, 19(12), Dec 2000. [42] J. Steffan, L. Fiege, M. Cilia, A. Buchmann, "Towards Multi-Purpose
[27] Y. Kwon, S. Sundresh, K. Mechitov and G. Agha, ActorNet: An Actor Wireless Sensor Networks", In Proc. of IEEE Int'l Conf. on Sensor Networks
Platform for Wireless Sensor Networks, in Proc. of the 5th Int’l Joint (SENET'05), Montreal, Canada, Aug 2005.
Conference on Autonomous Agents and Multiagent Systems (AAMAS), [43] Sun™ Small Programmable Object Technology (Sun SPOT),
pages 1297-1300, 2006. http://www.sunspotworld.com/.
[28] M. Luck, P. McBurney, and C. Preist, “A manifesto for agent [44] Yu-Chee Tseng, Sheng-Po Kuo, Hung-Wei Lee and Chi-Fu Huang,
technology: towards next generation computing,” Autonomous Agents and “Location Tracking in a Wireless Sensor Network by Mobile Agents and Its
Multi-Agent Systems 9(3), pp.203-252, 2004. Data Fusion Strategies,” The Computer Journal,Vol.47, No.4, pp. 448-460,
[29] U. Maurer, A. Smailagic, D. P. Siewiorek, M. Deisher, “Activity July 2004.
recognition and monitoring using multiple sensors on different body [45] TinyOS, documentation and software, http://www.tinyos.net.
positions”, Proceedings of the International Workshop on Wearable and [46] M. Vinyals, J. A. Rodriguez-Aguilar, J. Cerquides, “A Survey on
Implantable Body Sensor Networks (BSN ’06), pages 113–116, Washington, Sensor Networks from a Multiagent Perspective,” The Computer Journal,
DC, USA, 2006. IEEE Computer Society. 54(3), pp. 455-470, 2010.
[30] Mobile Agent Platform for Sun SPOT (MAPS), documentation and [47] H. Wada, P. Boonma, J. Suzuki and K. Oba, "Modeling and Executing
software at: http://maps.deis.unical.it/. Adaptive Sensor Network Applications with the Matilda UML Virtual
[31] A. Mpitziopoulos, D. Gavalas, C. Konstantopoulos, and G. Pantziou, Machine," In Proc. of the 11th IASTED Int'l Conf. on Software Engineering
“Mobile agent middleware for autonomic data fusion in wireless sensor and Applications (SEA) Cambridge, MA, November 2007.
networks,” In M. K. Denko, L. T. Yang, & Y. Zhang (Eds.), Autonomic [48] Y. Yu, L. J. Rittle, V. Bhandari, J. B. LeBrun, “Supporting Concurrent
computing and networking, chapter 3 (pp. 57-81). USA: Springer. 2009. Applications in Wireless Sensor Networks,” In Proc. of ACM SenSys.
[32] C. Muldoon, G. M. P. O'Hare, M. J. O'Grady and R. Tynan, Agent November, 2006.
Migration and Communication in WSNs, in Proc. of the 9th International [49] F. Zambonelli, N.R. Jennings, and M. Wooldridge, "Developing
Conference on Parallel and Distributed Computing, Applications and multiagent systems: the Gaia Methodology", ACM Trans. on Software
Technologies (2008). Engineering and Methodology, 12(3), pp.317-370, 2003.
[33] S. Olivieri, M.M.R. Mozumdar, L. Lavagno, L. Vanzago (2009).
“Modeling, Simulation, and Automatic Code Generation Framework for