Mobile Agent Platform for Sun SPOTs

MAPS at a glance

MAPS is an innovative Java-based framework purposely developed on Sun SPOT technology for enabling agent-oriented programming of WSN applications. It has been defined according to the following requirements:

  • Component-based lightweight agent server architecture to avoid heavy concurrency and agents cooperation models;
  • Lightweight agent architecture to efficiently execute and migrate agents;
  • Minimal core services involving agent migration, agent naming, agent communication, timing and sensor node resources access (sensors, actuators, flash memory, switches and battery);
  • Plug-in-based architecture extensions through which any other service can be defined in terms of one or more dynamically installable components implemented as single or cooperating (mobile) agent/s;
  • Java language for programming mobile agents;

The MAPS architecture is based on components that interact through events and offer a set of services to mobile agents including message transmission, agent creation, agent cloning, agent migration, timer handling, and easy access to the sensor node resources.

In particular, the main components are:

  • Mobile Agent (MA), which is the basic high-level component defined by user for constituting agent-based applications;
  • Mobile Agent Execution Engine (MAEE), which manages the execution of MAs by means of an event-based scheduler enabling lightweight concurrency. MAEE also interacts with the other service-provider components to fulfill service requests (message transmission, sensor reading, timer setting, etc) issued by MAs;
  • Mobile Agent Migration Manager (MAMM), which supports agents migration through the Isolate hibernation/dehibernation feature provided by the Sun SPOT environment. The MAs hibernation and serialization involve data and execution state whereas the code should already reside at the destination node (this is a current limitation of the Sun SPOTs which do not support dynamic class loading and code migration);
  • MMobile Agent Communication Channel (MACC), which enables inter-agent communications based on asynchronous messages (unicast or broadcast) supported by the radiogram protocol;
  • Mobile Agent Naming (MAN), which provides agent naming based on proxies for supporting MAMM and MACC in their operations. MAN also manages the (dynamic) list of the neighbor sensor nodes that is updated through a beaconing mechanism based on broadcast messages;
  • Timer Manager (TM), which manages the timer service for timing MA operations;
  • Resource Manager (RM), which enables access to the resources of the Sun SPOT node: sensors (3-axial accelerometer, temperature, light), switches, leds, battery, and flash memory;

The Mobile Agent model is depicted below.

The dynamic behavior of MA is modeled as a multi-plane state machine (MPSM). The GV component represents the global variables, namely, the data inside an MA whereas the GF is a set of global supporting functions. Each plane may represent the behavior of the MA in a specific role, so enabling role-based programming, and is composed of local variables (LV), local functions (LF), and an ECA-based automaton (ECAA). This automaton is composed of states and mutually exclusive transitions among states. Transitions are labeled by Event-Condition-Action (E[C]/A) rules, where E is the event name, [C] is a boolean expression based on global and local variables, and A is an atomic action. MAs interact through events that are asynchronously delivered by the MAEE and dispatched, through the Event Dispatcher component, to one or more planes according to the events the planes are able to handle. It is worth noting that the MPSM-based agent behavior programming allows exploiting the benefits deriving from three main paradigms for WSN programming: event-driven programming, state-based programming and mobile agent-based programming.