Outline
@
Ichiro Satoh (National Institute of Informatics)

Abstract

This page presents a new framework for constructing mobile agents. The framework introduces the notion of agent hierarchy and inter-agent migration and thus allows a group of mobile agents to be dynamically assembled into a single mobile agent. It provides a powerful method to construct a distributed application, in particular a large-scale mobile application. To demonstrate how to exploit our framework, we construct an extensible and portable mobile agent system based on the framework. The system is implemented as a collection of mobile agents and thus can dynamically change and evolve its functions by migrating agents that offer the functions. Also, mobile agent-based applications running on the system can naturally inherit the extensibility and adaptability of the system.

from apaper on MobileSpaces system (presented in IEEE ICDCS'2000)

Introduction

Mobile agents are autonomous programs that can travel from computer to computer under their own control. They can provide a convenient, efficient, and robust framework for implementing distributed applications including mobile applications. On the other hand, component-based software development technology is being used widely as a powerful approach for the development of distributed applications. The technology allows us to combine a collection of subcomponents into an application or a large-scale component. However, existing mobile agent systems unfortunately lack any mechanism for structurally assembling more than one mobile agent. This is a serious limitation in the development of a mobile agent-based application which is large in scale and complicated.

Moreover, a mobile agent system often needs to be used in heterogeneous environments, for example PDAs, embedded computers, and wireless networks, and is often required to provide visiting agents with the services that they need and may not have been initially supported. However, most existing mobile agents systems are inherently dependent on particular environments and cannot dynamically evolve and adapt themselves to the requirements of visiting agents and the execution environments.

To solve the above problems, this paper proposes two concepts, agent hierarchy and inter-agent migration. The former means that each mobile agent can be a container of other mobile agents inside itself, and the latter allows mobile agents to move inside other mobile agents as well as inside other computers. These concepts enable us to organize more than one mobile agent into a single mobile agent and introduce agent migration as a meta mechanism of dynamically changing and extending mobile agent-based applications. We try to construct a extensible and portable mobile agent system built on the Java language. The system is characterized in that it allows a group of mobile agents to be composed hierarchically and its architecture itself is structured based on the concepts.

We should explain the reason our hierarchical mobile agent model is needed in the development of distributed applications. Although existing software development methodologies, including object orientation, construct large and complex mobile applications, such applications are essentially static and monolithic in the sense that they are not adaptable. Moreover, a large-scale application software program is often constructed as a collection of subcomponents. Consequently, a mobile application needs to be migrated as a whole with all its subcomponents. Our hierarchical model can naturally introduce mobile agents as mobile software components and can easily construct a large-scale and adaptable mobile application as a compound mobile agent.

Basic Concepts

Our mobile agents are computational entities like other mobile agents. When each agent migrates, not only the code of the agent but also its state can be transferred to the destination. Furthermore, our mobile agent framework has the following unique concepts:

Agent Hierarchy:
Each mobile agent can be contained within one mobile agent.
Inter-agent Migration:
Each mobile agent can migrate between mobile agents as a whole with all its inner agents.

Figure 1: Agent Hierarchy and Inter-agent Migration

Mobile agents are organized in a tree structure and migrated as shown Figure 1. When an agent contains other agents, we call the former agent a parent the latter agents children. We call the agents which are nested by an agent, the descendent agents of the agent, and conversely we call the agents which are nesting an agent, the ancestral agents of the agent. Parent agents are responsible for providing their own services and resources to their children, and can directly access services and resources offered by their children.

Mobile Agents as Mobile Components

The first concept enables us to construct a mobile application by organizing more than one mobile agent, instead of constructing a large and monolithic mobile agent. The second concept allows a group of mobile agents to be treated as a single mobile agent. This is needed for the development of a mobile application, because a large-scale mobile application is often composed of a collection of subcomponents. Consequently, our mobile agents can be viewed as the mobile software components that have been studied in component-based software development technology.

Extensibility and Adaptability

Our concepts can make use of agent migration as a meta mechanism for changing and evolving a system consisting of one or more mobile agents. Each parent agent gives its own services and resources to its children. Therefore, when a mobile agent wants different services, the agent can acquire those services by migrating to the agent providing those services.

Also, our framework allows a system to be constructed as a collection of mobile agents. Such a system can customize its structure and its functions by migrating agents into it, while the system is running. In this paper, we try to construct a mobile agent system whose runtime system itself is implemented based on the framework. The system is extensible in the sense that it can dynamically change and adapt itself to its environment and the requirements of its executing mobile agents.

MobileSpaces: A Mobile Agent System

This section presents a mobile agent system named MobileSpaces. The system can execute and migrate mobile agents that are incorporated with the framework presented in the previous section. Moreover, the architecture of the system is characterized in being based on the framework.

It is built on the Java virtual machine and mobile agents are given as Java objects. The structure of the system is similar to a micro-kernel architecture as shown in several operating systems. That is, it consists of two parts: a core system and subcomponents as shown in Figure 2. The former offers only minimal and common functions independent of the underlying environment. The latter is introduced as a collection of subcomponents outside the core system and provides the other functions. All the subcomponents are implemented as mobile agents so that these subcomponents can be dynamically added to and removed from the system by migrating and replacing the corresponding agents.

Figure 2: Architecture of MobileSpaces

The Core System

The core system is made as small as possible for the sake of portability and offers only the following minimal facilities:

  1. agent hierarchy management,
  2. agent execution management, and
  3. serialization and deserialization of agents.

Agent Hierarchy Management

Each agent hierarchy is given as a tree structure in which each node contains a mobile agent and its attributes. Agent migration in an agent hierarchy is performed as merely a transformation of the tree structure of the hierarchy. Since each agent hierarchy is basically maintained inside a computer, when an agent is moved in the same agent hierarchy, it and its descendent agents can still be running. Also, the core system corresponds to a stationary agent, called the base agent, at the root node of the tree structure. Consequently, agents can be viewed as the only constituent of our mobile agent system.

Each destination agent can judge whether it accepts a new visitor or not beforehand, whereas a visiting agent can know the available methods provided by the destination agent by using the class introspector mechanism of JDK 1.1. Also, an agent can be dynamically replaced by a new agent which is equipped with all the public methods supported by the original one, but the current implementation of our system does not allow the new agent to inherit any internal state of the old agent.

Agent Execution Management

The core system can control all the agents in its agent hierarchy, under the protection of the JDK1.1 security manager.

Each agent has direct control of its descendent agents. That is, an agent can instruct its descendent agents to move to other agents, serialize and destroy them. Moreover, each agent can directly invoke all the public methods of its descendent agents. The current implementation of MobileSpaces permits a parent agent to obtain references to the Java objects corresponding to its descendants.

In contrast, each agent has no direct control over its ancestral agents. Instead, each agent can have a collection of service methods which can be accessed by its children, instead of its descendant. A child agent can invoke the service methods provided by its parent under the control of the parent. In addition, each agent can access the service methods provided by its ancestral stationary agents, including the base agent.

Each agent can have one or more activities which are implemented by using the Java thread library. Furthermore, the core system maintains the life-cycle of agents: initialization, execution, suspension, and termination. When the life-cycle state of an agent is changed, the core system issues certain events to the agent and its descendent agents. The system can impose specified time constraints on all method invocations between agents in order to avoid being blocked forever.

It is worth mentioning why we have imposed the restriction that a mobile agent may not access any services supported by ancestral agents other than their parent and stationary agents. This restriction is a key idea for allowing successful migration to occur. If it were not imposed, then migrating an agent could mean that the descendants of that agent might suddenly find they could no longer access services upon which they relied.

Serialization and Deserialization of Agents

When an agent is transferred, it has to be marshaled into a bit-stream and then unmarshaled from it later. The core system provides a mechanism for marshaling and unmarshaling the states of agents. The reader may wonder why the mechanism is provided by the core system instead of subcomponents. This is because the core system has to check whether the serialized agent is valid or not in order to protect the whole system against invalid or malicious agents. The current implementation of our system uses the standard JAR file format for passing agents that can support digital signatures, allowing for authentication.

Our system uses the Java object serialization package for marshaling agents. The package does not support the capturing of stack frames of threads. Consequently, our system cannot serialize the execution states of any thread objects. This limitation is not serious in the development of real mobile agent-based applications. Instead, when an agent is serialized, the core system propagates certain events to its descendent agents in order to instruct the agent to stop its active threads, and then automatically stops and serializes them after a given time period.

@

@