This web page provides details on configuring a Mobile Agent System (MAS) using the Mobile Code Toolkit v1.6.2. This version of the toolkit relies heavily upon java RMI. A running MAS consists of a set of mobile code daemons running on one or more java-enabled devices with logical migration pathways defined between them. Each mobile code daemon is run using the command:
java [-classpath path] mct.RMINetletDaemon properties-file
The -classpath command line argument is optional. If omitted, the java interpreter will use the value of the CLASSPATH environment variable. The properties-file is an ASCII file stored in the local file system that can be read by the mobile code daemon and contains "variable=value" statements that can be parsed by the load(java.io.InputStream) method of the java.util.Properties class. The variables that can be used are defined here.
From the point of view of configuring a MAS, migration pathways must be configured and it recommended that they form a ring in order that using default migration for an agent will ensure that the agent ultimately traverses all devices in the MAS. Migration pathways are set up by pointing the migration facilitator of one mobile code daemon at the migration facilitator of another mobile code daemon. The migration facilitator and RMI migration sections of the mobile code daemon properties file are, therefore, linked.
The mediator is run using the command:
java [-classpath path] mct.mediator.RemoteMediator mediator-properties-file
The -classpath command line argument is optional. If omitted, the java interpreter will use the value of the CLASSPATH environment variable. The mediator-properties-file is an ASCII file stored in the local file system that can be read by the mobile code daemon and contains "variable=value" statements that can be parsed by the load(java.io.InputStream) method of the java.util.Properties class. The variables that can be used are defined here.
It is important to note that the RMI registry (rmiregistry) must be running on each device for the MAS to function correctly. The rmiregistry process is not shown in the two figures below.
Consider three mobile code daemons, linked as shown in the figure below. In this example, three daemons are running in three separate java virtual machines (JVMs), the ovals representing the daemons with id's ND01, ND02 and ND03. Each mobile code daemon has a single migration facilty running, MF01, MF02 and MF03 respectively, and a communication facilitator CF01, CF02, and CF03. The full identifiers associated with these pieces of mobile code have not been included for reasons of clarity. A fourth JVM is running the mediator; the region-wide mobile agent location directory. The lines with arrows in the above figure represent the default migration paths. Assuming that the three mobile code daemons run on devices named host01, host02 and host03 respectively, with no startup code installed, and that the mediator is running on host04, example properties files might look like:
netletdaemon.facilitator.enable=true
netletdaemon.facilitator.mobilecode=CF01@mct.mediator.CommunicationFacilitator
netletdaemon.facilitator.properties=/mct/configuration/fac.prop
netletdaemon.migrator.enable=true
netletdaemon.migrator.mobilecode=MF01@mct.admin.RemoteMigrationFacilitator
netletdaemon.migration.rmi.host.0=host02
netletdaemon.migration.rmi.name.0=MF02@mct.admin.RemoteMigrationFacilitator
netletdaemon.security.enable=false
netletdaemon.facilitator.enable=true
netletdaemon.facilitator.mobilecode=CF02@mct.mediator.CommunicationFacilitator
netletdaemon.facilitator.properties=/mct/configuration/fac.prop
netletdaemon.migrator.enable=true
netletdaemon.migrator.mobilecode=MF02@mct.admin.RemoteMigrationFacilitator
netletdaemon.migration.rmi.host.0=host03
netletdaemon.migration.rmi.name.0=MF03@mct.admin.RemoteMigrationFacilitator
netletdaemon.security.enable=false
netletdaemon.facilitator.enable=true
netletdaemon.facilitator.mobilecode=CF03@mct.mediator.CommunicationFacilitator
netletdaemon.facilitator.properties=/mct/configuration/fac.prop
netletdaemon.migrator.enable=true
netletdaemon.migrator.mobilecode=MF03@mct.admin.RemoteMigrationFacilitator
netletdaemon.migration.rmi.host.0=host01
netletdaemon.migration.rmi.name.0=MF01@mct.admin.RemoteMigrationFacilitator
netletdaemon.security.enable=false
fac.directory.mobilecode=LMCD@mct.mediator.LocalMCDirectory
fac.directory.properties=/mct/configuration/dir.prop
fac.port=6666
fac.mediator.ip=host04
fac.mediator.listener=RML@mct.mediator.RemoteMediatorListener
fac.mediator.name=Mediator
directory.display.enable=true
Note that with the numbering scheme chosen for the migration paths defined in the above example, the blue links become the default migration paths and the black links the backup.