FTS Framework for JADE

Introduction | Framework Overview | Instructions and Examples | Java Package API | Technical Issues | Download | Contact | Acknowledgements | References

Introduction

Objective

Over the last few years, the concept of mobile agents has drawn a lot of attention in both academia and industry. However, only few "real" applications based on mobile agents exist today. The rather early stage of currently available agent platforms might be one reason for that. Furthermore, security mechanisms or mechanisms for fault-tolerant execution of mobile agents are often incomplete or missing entirely. The purpose of this project is to investigate into these mechanisms and to come up with a framework suitable for deployment in real-world applications.

Fault-tolerance

One of the essential prerequisites for the use of mobile agent technology is the fault- tolerant execution of mobile agents. For example, assume that a user has launched a mobile agent to make a flight and hotel reservation for a forthcoming business trip. The agent is expected to make both reservations if possible and in any case to return a status message back to the user. Of course, the user will only delegate this job to an agent if it is guaranteed that the agent does it exactly-once and cannot be caught by a network partitioning or node failure. Therefore, mechanisms for the fault-tolerant execution of agents have to be provided. Flexible Monitor Chain is designed and implemented in this framework.

In most of the proposed application areas for mobile agents, the jobs an agent has to fulfill are rather long-lived activities. Therefore, if the program logic of an agent detects that the current strategy does not lead to the agent's goal (e.g. because a resource is suddenly unavailable), it is not desirable that the agent aborts its job (losing all work done up to this moment) and starts the job from anew. Instead, the agent should be able to omit only some of its most recent actions and continue its job from this point using another strategy. Of course, this possibility to rollback the agent¡¦s actions could be implemented by every agent developer. However, this is a very tedious and error-prone task, so that it is desirable that generic mechanisms for the partial rollback of mobile agent execution are provided. Dependent Parital Rollback is designed and implemented in this framework.

Security

In mobile agent systems, mobile agents migrate from a home host to remote hosts. The malicious hosts problem is generally considered as a critical problem, and the main issues to be addressed are agent integrity. Mechanisms that are aimed at either prevention or detection of attacks to agent integrity must be provided.Execution Tracing with Randomly-Selected Hosts is designed and implemented in this framework.

Jade

Jade is a Java agent platform which allows the agent developer to develop and deploy a multi-agent system. It is a popular agent platform because it follows the FIPA standards and it shares the advantages of Java. The FTS Framework has been implemented in Jade to provide fault-tolerance and security for the agent application.

Framework Overview

Characteristics

In this package, we treat each step on a host is a transaction. Step is the basic unit for recovery and rollback. This package is able to

Assumptions

Involved Parties

The whole system, usually, involves three parties

Agents

Click to enlarge

p.s. FTSLayer and FTSLayerRE are embedded into Worker and Checker for internal functions.

Instructions and Examples

Installation

This package is constructed based on Jade 3.4 and Java 1.5. It is assumed that you have installed these components correctly. In the following, $jade is used to represent the root directory of Jade installed. Windows platform assumed in this instruction.

Download the ftsFramework.jar and put it into $jade/lib

If you haven't set $jade/lib into the path variable, you may use the following command to compile the examples used here

javac -classpath .;lib/Base64.jar;lib/iiop.jar;lib/jade.jar;lib/jadeTools.jar;lib/ftsFramework.jar [classes]

In the following example, it is assumed the reader is experienced to Jade

Example 1

This example shows how to create a simple worker which migrates to a remote host and back to the home host. It also demostrates the ability to protect Worker from attack and recover from failure.

Coding

  • ExampleCreater (codes)
  • ExampleWorker (codes)
  • ExampleChecker (codes)
  • ExampleTAgent (codes)
  • ExampleServer (codes)

    Running

    1. put the ftsFramework.jar into $jade/lib and .java files into $jade/example
    2. compile all java files
    3. start the Jade main container, Container-1 and Container-2
    4. start the ExampleTAgent and ExampleChecker, called TAgent and Checker, at Container-2
    5. start the ExampleServer, called Server, at Container-1
    6. start the ExampleCreater, called Creater, at the main conatiner

    Example 2

    In this example, the usage of dependent partial rollback is shown. As mentioned before, step is a basic unit and treated as a transaction. In the Dependent Partial Rollback approach, a step of an agent is a transaction (step, stage and transaction are used interchangeably in this page). Hence, the life of an agent can be treated as a chained-transaction. In a more complicated case, there may be several chained-transactions mixed together. When an agent needs to rollback to the target transaction (the earliest transaction that should be rolled back to), all affected transactions should also be rolled back in the reverse order of their execution. The selection of transactions to be rolled back based on monitored variables and chained-transaction. The state of the monitored variables are guaranteed to be consistent. Moreover, all transactions in the same chained-transaction and after the rollback point will be rolled back.

    Basic Flow

    There are four containers in this example. Main-Container (called host 0) is used as the home host. Worker migrates from home host to Container-1 and Container-2 alternatively. Totally, it carries out 8 steps on them. On the odd step, it writes on the monitored variable. On the even step, it read from monitored variable. Also, steps 1 to 4 belong to chained-transaction 1 and steps 5 to 8 belong to chained-transaction 2. After step 8, it determines the step to rollback. After rollback, it migrates back to home host.

    Coding

  • ExampleWorker2 codes
  • ExampleChecker2 codes
  • ExampleCreater2 codes
  • ExampleTAgent2 codes

    Running

    1. put the ftsFramework.jar into $jade/lib and .java files into $jade/example
    2. compile all java files
    3. start the Jade main container, Container-1, Container-2 and Container-3
    4. start the ExampleTAgent2 and ExampleChecker2, called TAgent and Checker, at Container-3
    5. start the ExampleCreater2, called Creater, at the main conatiner

    Technical Issues

    Execution flow in Worker

    Useful Methods
    setupFTS()The entry point of the newly created Worker
    restoreState()The entry point of the re-created Worker
    setupRecovery()For housekeeping task after re-create
    initiator()For housekeeping task after rollback
    normalExecution()Normal execution
    determinant()Determining if rollback is necessary and make it down in RBList
    compensation()Compensating action
    nextHost()Returning the identity of the next host

    Execution flow in Checker

    Messaging in the FTS Framework

    Further Information

    For further information about Flexible Monitor Chain, Dependent Partial Rollback and Execution Tracing with Randomly Selected Hosts, please refer to the references

    Download

    ftsFramework.jar
    ftsFramework.zip (containing source codes)
    example.zip (consists of examples)

    Contact

    Acknowledgements

    The work described in this web page was partially supported by the RGC Research Grant Competitive Bids (Project ID: 2150348, Reference:4187/03E).

    References