CS Addisalem Negash
CS Addisalem Negash
FACULTY OF INFORMATICS
DEPARTMENT OF COMPUTER SCIENCE
By
ADDISALEM NEGASH
JULY 2004
Abstract
Mobile software agent systems have becomes an important tool for developing distributed applications.
The use of mobile software agents is recommended in environment where network connection is not
reliable and where there is low bandwidth. This is because mobile agents can perform the work with
limited communication with the system that has created them. One important feature of mobile
software agents is their ability to communicate to each other. Providing communication mechanism
that guarantees delivery of message is that mobile software agent systems developer has to solve. A
number of algorithms have been proposed to guarantee message delivery to highly mobile
agents [13,8], but in our knowledge only one of them considers the existence of fault [8] and
even that algorithm give responsibility transmitting message to a mailbox. In this thesis we
have developed an algorithm that provides guaranteed delivery of message in the existence of
fault particularly without assuming the location of mobile agent and without inhibiting
This thesis could not be completed without the help of many people. First and foremost, I
would like to thank my advisor, Dr. Dawit Bekele, for his guidance and help. His support, his
gentle way of teaching, his generosity and kindness, and his high standards of integrity have
I would like to thank Dr. Yirsaw Ayalew, Dr. Solomon Atnafu, Mr. Jacob Eliosoff, Ato Girma
All friends, colleagues and my families also play an important role in the accomplishment of
the study and I thank them for their suggestions and advice. Most of all I have to thank my
friends Ato Berhanu Tekle, W/t Helen Ayele, W/t Rahel Kifle and Ato Taddesse Tareke for
their constant help. I would like to express my special thanks to my family. It is their love,
I think that no list of acknowledgments can ever be complete, and this will not be an
exception. So if you feel that I should have acknowledged you as well as the others, please
1. Introduction.....................................................................................................................1
2.2. Assumptions............................................................................................................7
2.4. OBJECTIVES.........................................................................................................8
3. Background...................................................................................................................10
5.1. Introduction...........................................................................................................27
5.2. Overview of Murphy’s algorithm .........................................................................28
5.5. Summary...........................................................................................................47
6. Implementation .............................................................................................................48
6.6 Discussion.........................................................................................................60
7. Conclusions...................................................................................................................62
7.1 Conclusions...........................................................................................................62
References.............................................................................................................................64
List Of Figures
Figure 5-10 The effect of constructing the network graph dynamically ..........................44
Figure 6-1 User interface used to create and send message ...........................................57
The emergence of computers significantly extends human being’s computing ability, and
employees need to share data. In addition, they also need to share resources. For sharing
Distributed systems are interesting for providing much higher processing power than a
single computer can provide. For instance, calculating some astrophysics problem may
need several of Pico Hz of processing power that even the most powerful computer
cannot provide. Distributed systems organized as a grid of computer can easily provide
this power.
procedure calls has been accepted as the best model to cope up with distributed. In
addition, large applications have built using this technology. The conventional client
server model has been adapted to object-oriented technology, giving rise to systems such
as CORBA where objects are used as both client and server, and where RPC’s are
replaced by object invocations. Although both the traditional client/server model and the
1
distributed object-oriented model perform well in a controlled, high-bandwidth office
environment, they are not adapted to face challenges of slow and unreliable networks like
The other technique used in distributed system to access recourses of other computers, is
by using mobile code. In its simplest form, the concept of mobile code involves
dynamically installing code on a remote host. In Web applications, applets and servlets
are a common form of mobile code. The mobile code concept also appears in systems
that extend the notion of remote procedure calls to transport the procedure to the server
Many researchers extend the mobile code concept to remote evaluation, in which an
object (code and data) moves from one host to another. The mobile agent abstraction
extends this notion further by moving code, data, and state from one host to another. A
mobile agent runs in one location, moves to another host, and continues at that host.
A mobile software agent usually differs from other forms of mobile code in that mobile
agents have migration autonomy. By autonomy we mean that the agent can decide when
moving the computation to host, which holds the data, it results to high throughput and
low latency access to that data. Compared to more traditional client server approaches,
mobile agents can avoid transmitting a large amount of data across the network, which is
of particular value when the network is slow or unreliable. In addition to speed and
reliability improvements, mobile agents can also help structure distributed applications. A
2
service designed to relocate itself in the network to accommodate changing network
conditions or the changing location of its clients can easily be written as a mobile agent.
Mobile software agents are suitable to develop distributed Internet application [19,31,32].
Since a mobile software agent is autonomous, it can tolerate the unreliable condition that
may exist in the Internet. Distributed Internet applications are particularly important for
developing countries like Ethiopia where it is too expensive By using application that use
mobile software agents, it is possible to limit the effect of the unreliable Internet
connection. Therefore developing countries like Ethiopia can benefit from Mobile
In last few years, several systems and programming environments have appeared to
there are still several open research issues to make the mobile agent technology widely
appropriate. Among several technical problems that remain open, one is related to
One of the basic properties of an agent is, its ability to communicate with other agents. At
first glance, remote communication seems a contradiction with the goal of code mobility,
helpful with conjunction with mobile software agent for monitoring mobile software
agent’s activity.
Many Mobile Software Agent systems seem to give a great emphasis on local
communication, either using some sort of meeting abstraction, events for group
communication or tuple space [13]. On the other hand remote communication is handled
3
by conventional mechanisms like RPC, Java RMI and message passing, that either do not
give guarantee for the delivery of messages, or enforce continuous connectivity with the
message source, which in many cases defeats the very purpose of using mobile agents
[13]. The attachment of message and message source becomes more problematic in the
This study deals with communication mechanism of mobile software agent, which
provides guaranteed message delivery in the existence of fault. In this study, only
problem to be solved and the methods that are employed for the research.
software agents and the communication used by current mobile software agent
system.
− Chapter 4, RELATED WORK, reviews some of the related works done in the
4
− Chapter 6, IMPLEMENTATION, presents a prototype developed in order to
5
2. Problem Statement and Methodology
The problem we are interested in is the delivery of messages between two mobile
software agents in the existence of fault. Amy L. Murphy has studied the problem of
the network where network connection is not reliable. We will try to address this problem
In various situations, mobile agents need to communicate with each other but the free
movement of mobile agents makes determining the location of mobile software agent a
difficult task and makes in delivering of messages to mobile agent a difficult problem
[8,12,13,14,15,16,32].
Many Mobile Software Agent systems seem to give a great emphasis on local
communication, either using some sort of meeting abstraction, events for group
conventional mechanisms like RPC, Java RMI and message passing, that either do not
give guarantee to the delivery of messages, or enforce continuous connectivity with the
message source, which in many cases defeats the very purpose of using mobile agents
[13]. The attachment of message and message source becomes more problematic in the
6
context of unstable network connection [11]. Since in such kind of network it is possible
that the connection between the node containing the message and message source fail,
either the application fails because of this or it should be slowed down by waiting until
the nature of Mobile Software Agent. That is communication mechanize that doesn’t
assume mobile software agent location and inhibit mobile software agent’s movement is
needed. Therefore, this thesis deals on finding communication mechanism which provide
guaranteed message delivery in the presence of fault with out inhibiting mobile agent
2.2. Assumptions
Time and cost constraints have limited this study to the indicated issue.
7
2.4. OBJECTIVES
General objectives
The objective of the study is to investigate the mobile software agent communication
mechanism that insures delivery of messages without changing the nature of Mobile
Specific objectives
The specific objectives of this study are to investigate mobile software agents
8
2.5. Methodology Used
• Different related researches and background theory have been revised through
literature review.
mechanism has been selected and it has been adapted to work in the existence
of disconnection.
9
3. Background
behalf of the user [7]. In order to support the agent mobility, the infrastructure should
provide a language-level primitive that an agent can call to move itself to another node.
An agent is able to cooperate with other agents in order to perform complex and dynamic
tasks. It is also capable of identifying and using resources specific to any node on which
it finds itself.
The mobile agent paradigm differs from the traditional client/server approach in the
following ways [31,32]. In the client-server paradigm, resource owners (servers) are
physically distant from their clients (users). The communication among these parts (client
and server) occurs through a network of computers, being mediated by mechanisms such
paradigm, the reliability of the communication links and the synchronicity of the remote
contrast, in the mobile agent paradigm, the agents migrate to interact locally, at the same
host as the resources. By moving from one location to another, agents can dynamically
change the interaction quality, reducing the communication cost and the overhead added
to maintain the reliability of communication [5]. In short, the mobile agent paradigm
10
differs from client-server paradigm since in mobile software paradigm; code is moved to
where data is stored rather than moving data is moved where the code is stored. Moving
code to data is more reliable than moving data to code in low bandwidth and unreliable
Mobile agents differ from other mobile code or program in that they provide autonomy,
that is, they themselves can decide dynamically where and when to travel to a particular
destination [9].
• The agent data part that is corresponds to the value of the agent’s global
variable.
perspective, and preserves all of its state when it moves from one network node to
another.
11
The mobile software agent travels between execution environments called places. A place
agent can execute [2]. It provides an infrastructure for managing mobile agents, enforcing
• Support agent communication with other agent and with the server and
Mobile software agent system usually provide one or more of the following services:
on all of the agent’s destination hosts. Thus, most agent systems provide a
means for transferring the code of the agent either by transferring it from a
centralized location (code base) or from the host, where the agent was
previously executed.
that they can address each other and to register themselves at a naming server
if necessary.
12
3.3. Communication Model of Mobile Software Agent
One of the basic abilities of an agent is its ability to communicate with other agents[12].
During its nomadic life, an agent needs to communicate with other entities. For example,
communication is needed to control the child agent, to coordinate agents’ activities with
Communication mechanisms of mobile software agent can be seen along with two
communication and their respective location [34]. Hence, the first dimension partitions
the space of mechanism into point-to-point and multi-point mechanisms while the second
Point-to-point mechanisms enable communication between two mobile agents. The more
actually use it for communication between agents moving arbitrarily. Usually, some form
of remote procedure call (RPC) is provided instead. This may involve invocation of bare
agents at a time. Shared memory is by far the mechanism most frequently used to achieve
multi-point communication. Most of the existing mobile agent uses this method for local
Communication mechanisms of mobile agent can also be divided into two groups [34]:
13
and anonymous communication, where the sender does not know the identity of the
recipients. Direct communication can involve either only two peers or a sender and a set
partners involved. In the case of inter-agent coordination, two agents must agree on a
client-server coordination, since a hosting environment usually provides local servers for
Most Java-based agent systems—like Sumatra, Aglet and Odyssey-adopt the client-server
style typical of object systems, and can also exploit low-level message passing via
TCP/IP [7,33,34]. Agent Tcl [18] provides direct communication between two agents,
based on message passing, and also provides asynchronous communication modes. Thus,
they still rely on direct communications based on remote procedure calls for their
services. Although middleware systems can facilitate the use of independently developed
components, using them to enable direct mobile-agent coordination will cause latency
In meeting oriented communication model, an agent can interact with no need of explicit
naming of the involved partner [12,34]. Agents join either explicitly or implicitly known
meeting points; afterward, they can communicate and synchronize with the other agents
that participate in such meetings. Ever-open meetings abstract the role of servers in an
execution environment; application agents can open further meeting points as needed. To
14
avoid the problems related to non-local communication, such as unpredictable delay and
unreliability, meetings often take place in a given execution environment, which allows
synchronization, defined by the Object Management Group and implemented in the Mole
Specific synchronization objects, which agents must share the reference to, assume the
identifying the partners involved, although they cannot achieve the anonymity of full
spatial uncoupling: Agents must share at least the common knowledge of the meeting
names. The major drawbacks of the models derive from there enforcing synchronization
among interacting agents[12,34]. Since the schedule and the position of agents cannot be
predicted in many applications, the models run a high risk of missing interactions.
Furthermore, if the meetings are not locally constrained, they must be implemented by
message passing, thus inheriting the efficiency and reliability problems of direct
coordination models.
In blackbox-based model, agents interact via shared data spaces [12,34]. The data are
used as common repositories to store and retrieve messages. In this sense, interactions are
fully temporally uncoupled, but, because agents must agree on a common message
15
identifier to communicate and exchange data via a blackboard, they remain spatially
Several systems propose and implement blackboard- based communication models for
agents can attach messages to a blackboard on a given site; another agent can retrieve and
Linda-like coordination model [35], uses local tuple spaces as message containers similar
to blackboards. In addition, a tuple space bases its access on associative mechanisms. The
system organizes information in tuples and retrieves it using associative pattern matching.
This approach enforces full uncoupling, requiring neither temporal nor spatial agreement.
16
4. Related work
In this chapter we will discussed algorithms developed to deliver messages for mobile
agents. Since the characteristics of mobile software agents are similar to mobile devices,
in this chapter, those works done related to delivery of messages to mobile devices will
be included as well.
Basically, the complexity of message delivery problem in Mobile Software Agent System
(the agent or the mobile unit) [8]. Various approaches like central server, forwarding
pointer, broadcasting, hierarchical location directory have been proposed to overcome the
agents\devices
Central server
There are three types of central servers called central forwarding server, central query
server and home server. Central forwarding server and central query server hold the
current address of all agents in the network. However home server only holds the current
In central forwarding server approach, before an agent migrates, it should inform the
server about its migration and when the agent arrives, it should tell the server that it has
17
finished its migration. If agent wants to send message to another agent, it sends the
message to central server and the central server forward the message to the agent to
Central query server approach is similar to the central forwarding approach. However, in
central query server; the server will give an address of the agent (to which the message
will be send to) to the agent which wants to send a message, instead of forwarding the
message.
Home server approach works in the same way as central Forwarding approach except that
few of agents’ address are stored. Meaning every agent has a home server and agent’s
name contains its home address. Whenever an agent moves at some node in the network,
the agent registers its current address in its home server. When an agent wants to
communicate with another agent, it sends a message to the home server of the agent to
which the message is sent. Upon accepting a request, the home server forwards the
Central server approach will be a bottleneck for mobile environment particularly for
highly mobile once. This is because informing central server will be an overhead and also
Forwarding Pointer
In the forwarding of pointer scheme, before an agent migrates, it leaves a pointer which
points to the target host in its current location. When a message is sent to an obsolete
address of the recipient, the message is routed along the forwarding pointer.
18
The disadvantages of using forwarding pointers are:
• The link way becomes too long, which results in loss of performance.
• If the recipient migrates frequently, the message may keep chasing the
Broadcasting
A simple broadcast scheme assumes a spanning tree of nodes through which a message
sent by any node. This node then broadcast the message to it neighbors, which broadcast
the message to their neighbors, and so on until the leaf nodes are reached. This, however,
doesn’t guarantee delivery of message. This is because an agent traveling in the reverse
direction with respect to the propagation of the message may not be able to get the
message. If the agent is being transferred at same instance the message is propagating in
the other direction, the agent and the message will cross in the channel and message
There are other types of broadcast approach called query broadcast and notification
broadcast. In query broadcast, when an agent wants to send a message to another agent,
the host sends a query asking an address of that agent to all nodes. When the host gets the
address, the message will be send by using that address. In notification broadcast,
whenever an agent reached at a site, it will broadcast its current address to all nodes of
the network. In this approach all nodes will have a guess address of all agent and use that
address to send message to an agent. When a node receives a message to an agent which
19
is not in the node, it keeps the message until the new location of the agent is broadcasted
The cost of communication of query broadcast seems better than the other broadcasting
approach for large messages. However, this is not appropriate for highly mobile agents
since their address will be changed frequently. For the same reason, notification approach
The simple broadcast schemes have less reliance on the agent home for, agent tracking or
message forwarding, thus it can used to deliver messages for highly mobile agents. It can
Hierarchical Schemes
In the hierarchical schemes, a tree like hierarch of servers forms a location directory
(similar to DNS). Each server in the directory maintains a current guess about the site of
some agents. Site belong to regions, each region corresponds to a sub-tree in the directory
(in the extreme cases the sub-tree is simply a leaf-server for the smallest region, or the
whole tree for the entire network). Each region corresponds to a sub-tree in the directory.
For each agent there is a unique path of forwarding pointers that starts from the root and ends
at the leaf that knows the actual address of the agent. Messages to agents are forwarded along
this path.
The hierarchical scheme scales better than forwarding pointers and central servers. It
supports locality of mobile object migration and communication. However, the hierarchy
20
is not always easy to construct, especially in the Internet environment. The hierarchical
scheme itself cannot guarantee message delivery since messages might also chase their
In the previous section, we discussed about various approaches for delivering messages
for mobile agents. None of them provide guaranteed delivery of message by themselves
In our knowledge, there are only few algorithm designed to guarantee delivery of
message to mobile software agents. One of the algorithms is designed by Murphy [13],
which uses ideas of distributed snapshot and diffusion computation to guarantee delivery
of message for highly mobile agent in the absence of fault. There is also another
algorithm designed by Cao, Feng, Lu, and Das [8], which tries to attach mobile agents to
environment in the absence of fault. Physical mobility deals with the mobility of physical
components and logical mobility deals with mobility of mobile software. One of the
21
4.2.1.1. Using Distributed Snapshot for Physical mobility
Murphy adapts the snapshot algorithm to message delivery. In order to avoid confusion in
terminology between the control traffic generated by the snapshot algorithms and the data
traffic containing the information being communicated to the mobile unit, they use the
term announcement to refer specifically to the data message being delivered while a
The snapshot algorithms were developed to detect stable properties such as termination or
deadlock by creating and analyzing a consistent view of the distributed state. The
snapshot algorithm is used to record the state of the message in the network graph having
FIFO channels.
The snapshot algorithm consists of two main localized actions to collect the local
snapshot: the processing of the control messages (markers) and the arrival of the
messages to be recorded. The marker arrival rule states that when a marker arrives at a
node not involved in a snapshot, the node begins its local snapshot by recording the
processor state, and then sends the marker on all outgoing channels.
The message arrival rule of the snapshot states that if the message arrives at a node from
channel C before the marker arrives on channel C, and the node is in the middle of the
local snapshot, the message is to be recorded as on the channel during the snapshot The
local snapshot is complete when the marker has arrived from all incoming channels
Murphy adapts the snapshot algorithm to perform message delivery in the dynamic,
22
(the mobile unit is assumed to be somewhere in the network) and the message to be
Since the mobile unit is considered as a message, and the snapshot records the location of
messages; the global snapshot of the mobile system will show the location of the mobile
unit. Therefore, one option is to simply deliver the announcement directly to this location;
however, it is possible (and likely in systems with rapidly moving mobile units) that the
mobile unit will move between the time its position is recorded and when the
announcement arrives at the recorded position. Therefore, they alter the snapshot
recording to delivery of the message by augmenting the control messages with the
announcements.
As the one done for physical mobility, this algorithm is also based on distributed snapshot
algorithm (The Chandy-Lamport algorithm). Here also mobile unit are considered as
This algorithm differs from the one for physical mobility in that here, the algorithm
allowed for concurrent delivery of message. Concurrent message delivery is done in the
way that message delivered before the end of the delivery of another message will be
stored in the buffer of the node and when the snapshot of the previous message at the
node is cleared, the message stored in the buffer is assumed as newly arrived one.
23
This algorithm has also version, which allow the graph to grow as the mobile agent
moves. This version has also another responsibility of constructing the graph while the
agent moves.
message delivery [13]. By equating the root node of the computation to the concept of a
home agent from Mobil IP and by replacing the messages of the computation with mobile
units, the result is an algorithm which instead of tracking a computation as messages are
passed through a system of processing nodes, tracks a movement of mobile unit as it visit
various base stations in the system. Essentially, the graph of the Dijkstra-Scholten
algorithm defines a region within which the mobile unit is always located. Although this
Diffusing computations have the property that the computation initiates at a single root
node, while all other nodes are idle. The computation spreads as messages are sent from
active nodes. The basic idea of the algorithm is maintaining a spanning tree that includes
This diffusion computation helps to track the mobile unit. Here they consider the mobile
unit in place of message. When a mobile unit is sent from an active node to an idle node,
the idle node will added as a child of the former in the tree. Mobile unit migrates among
tree nodes have no effect on the structure but may activate idle nodes still in the tree. An
24
idle leaf node can leave the tree at any time by notifying its parent. Termination is
Since the sender of the message cannot know whether or not the destination node already
in the tree, maintaining the tree from parent to child is difficult. As the result, the tree for
For message delivery is assume that the message (the data message to be delivered)
originates at the root and it is relied on the property that there is always a path from the
root to the mobile unit along edges in the tree. It is only necessary to send the message
along edges in the spanning tree. But, because this tree is maintained with pointers from
child to parent, the message must be propagated along the successor edges, from parent to
child. When a message arrives from a source other than the parent, the message is
rejected. In this manner, the message is only processed along the tree paths
To cope up with the migration of mobile unit, each node stores a copy of the message
until delivery is complete or the node is removed from the tree. Storing the message in
this manner ensures that the mobile unit cannot leave a region without receiving a copy of
the message.
In this approach, each mobile agent has mailbox. When an agent wants to communicate
with another agent, it sends message to that agent’s mailbox. An agent can get a message
from the mailbox by using push and pull technique. In the push technique the mailbox
sends the message to mobile agent. Here the mobile agent must send its address to its
25
mailbox and the mailbox will forward any message send to the agent. In pull technique,
the mobile agent keeps the mailbox address and retrieves messages from it.
In the mailbox-based scheme, the mailbox is detached from its owner agent. Before
migration the agent can decide to take its mailbox with it. It is possible to make mailbox
stationary, to migrate with owner agent or to follow the owner agent with some distance.
the home server of the owner agent and message is sent to that server. In the forwarding
pointer protocol, before a mailbox migrates, it leaves a pointer which points to the target
host, in its current location. When a message is sent to an obsolete address of the
mailbox, the message is routed along the forwarding pointer. In distributed registration
based protocol, before the mailbox migrates, it deregisters itself from all hosts visited by
it and wait an acknowledgment from them. After arriving to the new host, it register the
Guaranteed delivery of message can be provided by the protocol used to track mobile
agent and mailbox. Distributed protocol can be used to guarantee delivery of message to
the mailbox. Synchronous message communication between the mailbox and owner agent
Mailbox based message delivery can guarantee message delivery but will be bottleneck
for highly mobile agent since an agent should synchronize with mailbox. Since mobile
agent system should manage both the mailbox and the mobile agent, the implementation
26
5. Message Delivery To Highly Mobile
Software Agent
5.1. Introduction
The objective of this chapter is to present an algorithm that provides guaranteed message
disconnection as a fault; however we believe that the algorithm can be easily modified to
The algorithm adapts the Algorithm developed by A. Murphy [13], which provides
guaranteed delivery in the absence of fault. Our algorithm modifies the Murphy’s
Our algorithm provides guaranteed delivery of message in static and dynamic network
graphs. In the case of static network graph, it is assumed that the graph is pre-established
before the algorithm runs and the algorithm doesn’t worry about the construction of the
network graph. In the case of dynamic network graph, the graph should be constructed
dynamically and the algorithm has additional responsibility of constructing the network
In section (5.2) we will discuss Murphy’s algorithm on which our algorithm is based on,
and in sections (5.3) and (5.4), we will discuss the algorithm that we designed in the
27
study. In the last section, we will summarize the chapter and will discuss how the
algorithm can be modified to work in the existence of faults other than disconnection.
In this section we will discuss an algorithm, which is developed by Amy L. Murphy [13],
which provides guaranteed message delivery in the absence of fault to a highly mobile
software agents. Murphy’s basic algorithm deals with a single message delivery in a
static (predefined) network and its subsequent enhancements that allow multiple
messages delivery and construction of the network graph dynamically while the agent
moves.
The logical model used in Murphy’s algorithm is a typical network graph of nodes and
channels, where the nodes represent the server willing to host the agents, and the
channels represent links between nodes that can be used for transporting messages as well
The main objective of the algorithm is to guaranty the delivery of message to highly
authors may create situations where the message never reaches the agent. This happens
when the broadcasted messages and the agent travels in reverse direction in the case of
broadcast scheme (figure 5.2), and when the agent moves as fast as the message in the
28
sender
Message
Agent
Forwarding path
sender
Message
Agent
Link
The basic algorithm considers that channels are predetermined and assumes only a single
message is transmitted at a time. The main ideas of the algorithm are to broadcast the
message through the network as a broadcast scheme and, to store the message at each
node, so that the agent that arrives at the node from a direction opposite to the broadcast
29
sender
Message
Agent
Link
In figure 5.3, the agent reaches the node after the message has passed. However, unlike
the simple broadcast scheme, since the node keeps a copy of the message, the agent will
find the message at the destination node even after the wave of the broadcast has passed.
A major problem here is to know for how long the node keeps a copy of the message,
because it is not realistic to keep the copy of the message indefinitely. To determine the
length of time that a message is kept at a given node, Murphy uses a technique based on
The main goal of the technique is to insure that all agents in transit on incoming channels
while the message is broadcasted on outgoing channels get the message before it is
deleted, in order to avoid problems such as the one shown in Figure 5.2. For this purpose,
at each node, a state that can be FLUSHED or OPEN is associated with each incoming
channel. Initially all channels are OPEN. When a message arrives by a channel the state
of the channel is changed to FLUSHED and the message is stored locally. At this point,
30
the situation where the message and the agent miss each other while in transit (figure 5.2)
cannot occur since the message will be copied at a node before broadcasted.
The copy of the message is kept on the source node until it is sure that all agents in transit
and in opposite direction with the message broadcast have reached the node, i.e. until all
incoming channels have the state FLUSHED. All incoming channels of a node are
FLUSHED means that the message has arrived from all incoming channels. Therefore,
since the channel is FIFO, any agent that comes from these channels has already obtained
the message from it source node. For example, in figure 5.4 Agent 1 and Agent 2 should
necessarily receive the message at Node 2 and Node 3 respectively this is because, the
agents received the message prior to the moment the agents have left Node 1. It is
therefore, no more necessary to keep the copy of the message at Node 2 and Node 3.
Agent 1
Node 2
Node 1
Agent2
Node 3
31
5.2.2. The Enhanced Algorithm for Multiple message delivery
important to have the possibility to deliver multiple messages. The Murphy’s basic
algorithm can be used to deliver more than one message. However it requires checking
the termination of delivery of one message before starting to deliver another message. In
Murphy extended the basic algorithm to provide multiple and concurrent message
delivery. This algorithm works for messages sent by the same source. However it can be
The main goal of the enhanced algorithm is to insure the delivery of messages by keeping
only one message active at a time. For this purpose, the channels can have another state
called BUFFERED (figure 5.5). As in the case of single message delivery the channels
have OPEN state initially. When a channel transports a message, that message is
considered to be the active message and the state of the channel becomes FLUSHED. The
node give the active message to all agents hosted and broadcasts the message in all
outgoing channel. When an agent arrives at the node, it will be given the active message.
When a channel that is FLUSHED delivers a message, the message will be stored in a
buffer queue and the state of the channel will be changed to BUFFERED.
32
Message
M3
M2
Agent
M3 M2
M1
Link
Active
message
M3
M2
M1
M1
The messages in the buffer queue remain there until the active message is removed. The
active message is removed when all channels becomes FLUSHED or BUFFERED, since
storing the active message is no more necessary after that. At this point, Murphy’s
algorithm clears the active message and makes the state of all channels OPEN. Messages
in buffer queues are then considered as newly arrived. Here, changing the channels
having BUFFERED channels to OPEN will not create a problem since the messages
33
5.2.3. The Enhanced Algorithm for Dynamic Network
Up to now the discussion considers that channels are pre-established. However Murphy
has also designed an algorithm for dynamic network graph, which is constructed
dynamically, while the agent moves. This algorithm has one additional responsibility that
is network graph construction. The algorithm is done for agents and messages of the
same sources. However, running the algorithm concurrently can provide guaranteed
The network graph is constructed as follows. Initially only the node on which an agent is
created is considered as active. When an agent moves from an active node to another
node, which is not active, the node that the agent arrived at and channel that the agent has
This algorithm works as the one for static graph but sometimes the agent may be forced
to stay at a node until some messages arrive or delay the activation of construction of an
incoming channel of a node until some messages are arrived and cleared from the node.
This is done to handle difficulties caused by the free movement of mobile agents and the
fact that the graph is constructed by considering all agents as explained below.
One of the difficulties caused by the free movement of mobile agent is called destination
ahead of source. This difficulty occurs when mobile agents migrate to a node which have
example, we assume that there are three nodes called X, Y and Z in the network and X is
active initially. When X sends an agent a1 to Y, both Y and channel connecting X and Y
becomes active. Assume that X sends message 1 and 2 and then sends another agent
34
called a2 to Z. At this time, node Z and the channel connecting X and Z will be active. If
a1 leaves Y before message 1 and 2 are arrived, a situation called destination ahead of
source will occur (figure 5.6). At this point, if the messages are forwarded blindly,
message order is possibly lost and messages can possibly keep propagating in the
network without ever being deleted. The solution they use to solve this difficulty is to
hold the agent at Z until the message 1 and 2 is received and, when these messages are
arrived, the messages will be deleted after they are delivered to the detained agent (a1).
This action inhibits the movement of agent but Murphy argues that this is taken place
X
M2
M1
a2
a1 Z
Y
There is also other potential problem called source ahead destination. This is caused
when a new incoming channel has been constructed while the node or the old incoming
channels of the node holds messages To discuss this difficulty, we use the above example
except instead of X sends another agent to Z, assumes that Z sends an agent to Y. Here a
situation in which Y waits the channel coming from Z to be FLUSHED, before deleting
message 1 and starting to process message 2. However, the channel coming from Z
cannot transport message 1(figure 5.7). This situation is called source ahead of
destination. To solve source ahead of destination problem, the activation of the channel
35
connecting Z with Y will be delayed until Y catch up with Z. In this example, the channel
M2
a1
M1
Y a2 Z
In this section, we are going to modify Murphy’s algorithm which is presented in the
present the logical model used in the algorithm and in section 5.3.2 and 5.3.3, we will
present our algorithm for static network. In the last section, we will present our algorithm
5.3.1. Model
The logical model (architecture) that is used for the algorithm is a typical network graph
of nodes and directed channels. The nodes in the logical model represent servers willing
to host agents and channels that represent links used to connect nodes and that can
transport both agents and messages. In the algorithm, the channels are assumed to be
36
E
B
D
C
A G
The algorithm considers both static and dynamic network graphs. In static network graph,
the channels are assumed to be established before the algorithm starts in contrast in
dynamic network graph, channels will be constructed while the agent moves.
In static network graph, we assume that there is always a path between two pair of nodes.
This doesn’t mean that a full connection should exist but a node should be reachable from
any other node. For example in figure 5.8, there is no direct link between node B and
Node A but node B can get node A through node D and node C.
The algorithm assumes that agents have global name, which identify them uniquely, and
messages have IDs, which are always increasing. It is assumed that the agent name holds
also assumed that, it is possible to know whether the message which is sent, is delivered
37
5.3.2. Delivery of Message with Static Network Graph
We start describing our algorithm with the simplest case where the network graph is
static that is it is fully constructed prior to delivery of message and one message is
assumed in the network. We also discuss the algorithm to deliver multiple messages.
As discussed in the problem statement, the main objective of this study is to provide an
algorithm that delivers message to a highly mobile software agent even in the existence
of fault.
We adapt Murphy’s algorithm discussed in the previous section that does not work with
the existence of fault. We believe that making assumption on the absence of fault
Assume that Murphy’s algorithm is applied in the network where the connection is not
reliable. When a channel is disconnected the message in the channel will be lost, and the
node to which the channel is an outgoing one can’t send the message through the channel
(Figure 5.9a, b). In addition, some node may not be able to clear the copy of the message
stored at node, if one of its incoming channel is disconnected (Figure 5.9c). It seems that
transportation layer can handle this but this depends on time required to reconnect the
channel. For example, if the network is established using TCP, their established TCP
connections can abort during periods of disconnection and many TCP implementations
default to timeout values of a few minutes [28]. Therefore Murphy’s algorithm can’t
extended disconnection.
38
M M M Damaged message
Node 1 Node 2
M
M
M
Node 1 Node 2
M
M
Node 1 Node 2
a. Node may be unable to clear the messages if one of its incoming channels is disconnected
way of message broadcasting. When a message is broadcasted in every channel, the node
identifies the channel for which the channel is disconnected while transporting the
message and resend the message when they are reconnected. The broadcasting of
message will be finished when all channels transports the message. Here we are sure that
39
message in the node will not be cleared before the successor of the node have it, since
Since Murphy extends the algorithm that she designed for single message delivery to
provide guaranteed delivery of multiple message, the algorithm does not provide
messages of a single source. However running this algorithm concurrently will provide
As in the case of single message delivery, disconnection can be handled by changing the
way of message broadcasting. That is, if some of the channel is disconnected during
broadcasting, the message will be sent after the channel is reconnected and message
broadcasting will be end after the message sent by all channels. However, delaying the
node work until the successor is reconnected is not reasonable, since other messages may
channels don’t have an effect on the node which broadcasts the message but have effect
We modify our algorithm in the way that it doesn’t affect the work of a node as follows.
The node broadcasts the message to all connected outgoing channels and then identifies
the disconnected channels before broadcasting and while broadcasting. If there are
disconnected channels, the node stores the message broadcasted with the channel ID in
40
the temporary store. The broadcasting is finished after sending the message in all
connected channels and recording the message with IDs of disconnected channels.
When reconnection of an outgoing channel is sensed, a node sends the messages which
are stored in temporary store with the ID of the channel. After insuring that the message
reached at the destination of the channel, the ID of the channel is removed from all
records of temporary store. Since storing messages in temporary store is not realistic, our
algorithm deletes records containing one channel ID when that channel ID is removed
Although the solution proposed so far provides guaranteed delivery of message in the
Furthermore, dealing with all nodes including nodes which may not be visited by mobile
software agent, will make the algorithm somewhat complex. Particularly, in the existence
of disconnection, the time to update nodes which may not be visited by the agent, will
As in the case of the algorithm for static Network graph, our algorithm for dynamic
network graph adapts Murphy’s algorithm. However, the adaptation is not only on
handling disconnection but also on the construction of the network and the way messages
are delivered and sent. These modifications is needed to remove the following drawbacks
of Murphy’s algorithm
41
• Murphy’s algorithm for dynamic network graph can’t be used to guarantee
• The algorithm sometimes inhibits mobile agent from movement and delay the
Removing the two problems discussed above will make the algorithm to work without
discussed on section 5.2 the two difficulties result from the fact that the network is
Considering different network graphs for each agent will solve the problem.
The algorithm that we develop considers different network graphs for each agent. As
Murphy’s algorithm, our algorithm assumes messages as well as the agent are from the
same source. However running the algorithm concurrently will provide guaranteed
In the next section, we present first the algorithm by assuming the existence of only one
agent exists in the network and the extended algorithm that doesn’t make such
42
Basic Algorithm For Single agent
The algorithm presented in this section, works in the same way as Murphy’s algorithm
except that it assumes only one agent in the network and handles disconnection. Here the
two difficulties, source ahead of destination and destination ahead of source cannot occur.
This is because there is only one agent in the network and the graph is only constructed
by it.
There are problems resulting from the fact that the network is constructed dynamically.
One of the difficulties is, the node doesn’t know all the incoming as well as the outgoing
channels before the agent is destroyed. For example, in figure 5.10, at time t1, node 1 had
three incoming channels and at t2, it has three incoming channels. The other difficulty is
all the channels couldn’t be constructed at the same time; so it is not possible for some
messages to be transported by all channels. For example, in figure 5.10, the channel that
connects node 2 and node 1 cannot transport m1. The third difficulty is it is very difficult
to delete a message from the node. For example in figure 5.10, if the message at node 2
were cleared at t1, agent 1 can’t get m1 at t2. This problem mainly affects the clearing of
messages at a node since clearing of message depends on the state of the incoming
channels. Therefore, modifying the way messaged cleared at the node will removes the
43
A
M1 M1
A A
1 1 2 1 2
t0 t1 t2
• the network graph to start from the home of the agent which can be extracted from
sequential ID.
In our algorithm for dynamic network when the message arrives at a node while the node
holds another message, the message will also be considered as active message in the node
44
Message delivery in this algorithm is done as follow; When a message arrives at a node,
the node delivers it to the agent, to which the network graph is constructed, and the
message broadcast in all outgoing channels of the network graph. When an agent arrives
Since message is broadcasted with all outgoing channel that has been already constructed,
some node may not contain all messages (figure 5.11). In this algorithm, since the agent
constructs the channels, this will not create problem. This is because the agent will get the
A M1
M1 M2
M2 A A
t0 t1
Figure 5-11 Message content at different node is different
Clearing the message at the node is important because storing the message indefinitely is
not a realistic solution. In addition, storing the message after the agent is destroyed is not
necessary. Therefore, clearing of messages on the node should be done after the agent is
destroyed. The network graph is no more important after the agent to which it is
constructed is destroyed. Therefore the algorithm should remove the network graph,
45
when the agent to which the graph is constructed, is destroyed. Clearing of the message
Messages stored at a node will be removed when the network graph is removed. The
network graph is removed when the agent for which the network graph is constructed, is
destroyed. When a node destroys the agent, it informs the node that creates the agent. The
node, which creates the agent, deletes the messages at the node, removes itself and sends
the information to its successors and the successors do the same as their predecessor.
As in the case of the static network graph, in dynamic network graph disconnection may
occur at any time. Therefore handling disconnection is important. Our algorithm for
dynamic network handles disconnection in the same way as in the case of static network
graph, on which multiple messages are assumed in the network graph. This means, by
The algorithm for single agent can be run concurrently to guarantee delivery of message
for each agent. Here, one node can be a part of more than one network graph. Since
message source node can be a part of two network graphs, it may be difficult to the node
to know which network graph to use to broadcast the message. Since our algorithm deals
with delivery of message to a single agent, it is possible to know to which agent the
message is sent. Therefore, in our algorithm message source node will use the network
46
5.5. Summary
in the existence of disconnection. The algorithm adapts Murphy’s algorithm and works
The algorithm that we have designed, assumes the channels are FIFO. Even if in reality,
physical channels are not usually FIFO channels, there are protocols like TCP, which can
47
6. Implementation
In this chapter, the prototype and the components needed to implement the prototype will
be presented. The prototype has two major components (subsystems). One of the
implementing the algorithm presented in chapter 5, and the other subsystem simulates a
mobile software agent system. Simulation of mobile software agent is needed because
developing the mobile software agent system is beyond the scope of the study.
Experimental settings to test the prototype and analysis of the experiment will be
In section 6.1, we will discuss about the subsystem that implements the algorithm
presented in chapter 5. In section 6.2, we discuss about the mobile software agent
simulator. In sections 6.3, 6.4 and 6.5, the implementation details of the prototype, the
experimental settings and analysis of the result will be presented. Finally, we will discuss
The algorithm discussed in the previous chapter can be applied to develop a subsystem
that can provide a guaranteed message delivery to mobile software agents. The objectives
48
and the requirements of the subsystem that implements the algorithm presented in chapter
5 are discussed below. From now wards, we will refer the subsystem as CommSystem.
Objectives
The objectives of developing a communication system for mobile software agents are:
Requirements
the study
49
Data Flow Diagram (DFD) of CommSystem
Actors
Subsystems
FIFO
FIFO channel
channel
Channel Manager
50
Description of the DFD of CommSystem
Actors
Mobile Software Agent: agents, which use the system to send and receive messages.
Physical Component
FIFO-Channel: it is a channel used to send and receive messages from the neighboring
Subsystems
Message Manager is used to manage the active message. In other words, it is used to
keep copies of messages in the node and to remove the messages from the node as
discussed in the study. This subsystem will also enable nodes to broadcast messages
accordingly.
Agent Manager is used to manage agents. It delivers messages to the agent by using
Channel manager is used to manage channels. It keeps track of the state of the channels.
The channels can be used to transport messages and agents. The channel manager passes
the agent transported to agent manager and the message transported to message manager.
Node Manager is used to setup channel and create active message storage, temporary
As discussed in the beginning of the chapter, we need to develop the system that
simulates mobile software agent system. To simulate the mobile software agent system,
we tried to identify the important characteristics of the mobile software agent system for
the study. Accordingly, the following key characteristics of the mobile software agent
• The mobile software agent should give names to agents such that each agent has
unique name and the name should contain the name of the node that has created
the agent
We have simulated the agent as a message. It is represented by its name which is a text.
The message sent by the agent will have a name (ID), content, the name of the sender
agent and the name of the receiver agent. The creator node gives a name to the agent and
to achieve uniqueness throughout the network, the agent name will contain the node
name.
Each node can register, deregister and search mobile software agent hosted. When an
agent arrives at a node, it will be registered at a node and when it migrates from the node,
it should be deregistered from the node. In addition, the node should be able to search an
− movement :-a hosting node decides randomly which agent should move
to which node and sends the selected agent to the selected node.
the agent previously and currently hosted and the user composes the
message and decides to which agent the message should be sent to.
− message delivery: the system will display the message and the agent
Generally, the mobile agent simulator which is needed to demonstrate the developed
algorithm on the previous chapter, should simulate the agent, the free movement of the
Actor
User
Subsystems
Naming Communication
External Creator
System
CommSystem
Hosting
Migration
Description of the DFD of Mobile Software Agent System Simulator
In the DFD the actor, the external system and, the subsystems of the system, which
simulate the mobile software agent, are shown. The user is an actor, which involves on
system, which is presented on the above chapter. The subsystems shown in the DFD as
commands,
− Migration subsystem: is used to decide when and where the agent leaves
the node.
deregister them when they leave. This subsystem will also provide
searching service.
agent.
6.3 The prototype
According the requirements discussed in the above section, a prototype for static network
graph is developed. The prototype implements the CommSystem and the system which
The prototype has two versions. The first version doesn’t assume disconnection and have
channel.
As discussed in the previous section, channels are implemented by TCP socket. Using
get the connection status of the channel from TCP, since TCP does not provide any
notification when a network link is lost. Therefore the successor made to send a special
message (we call it heartbeat), to the predecessor periodically. Period will be set by the
messages to an agent and display the messages that are sent to hosted agent. The
In figure 6.1 the interface that can be used by the user to create an agent and send a
message to an agent in the network without specifying the location of the agent is
displayed. When the user clicks the create button the agent will be created and it becomes
active and when the user click the send message, the dialog box shown in figure 6.2 will
When a message arrives at a node and if it is sent to an agent, the hosting node will post
agent name and message content by using the dialog box displayed in figure 6.3
6.4 Languages, Tools and Experimental settings
In the previous sections, we have described the prototype used to demonstrate the study.
In this section, we will describe the programming language and the tools in the
development of the prototype, and the excremental settings to test the prototype.
The choice of the programming language is one of the important issues in system
development. To that end, we have selected java to develop the prototype. This is
because of the experience of the researcher, free availability of java and easiness of
The other important issue, that determines the efficiency of the system development is the
selection of development tools. Some of the tools that we use to develop the prototype are
We have used three computers in the local area network of the department of computer
science, AAU. These computers can have any capacity. Since the prototype is
demonstrated in wired local area network and disconnection is rare there, we have
By using the prototype, we were able to demonstrate that the developed algorithm for
static network graph works. The demonstration is done into three steps. In the first step,
the prototype that implements Murphy’s algorithm is tested, in the second step, the same
prototype is tested in the presence of disconnection and in the third step, the prototype
fully achieved in the absence of disconnection (i.e., all messages that are sent are
broadcasted in every node in the network, and the messages are delivered to all agents).
The test results of the prototype that implements our algorithm (have a disconnection
manager to tolerate disconnection) are the following. All messages that are sent, was
successfully broadcasted in every node in the network graph. However, some agents
didn’t get all the messages broadcasted, because they are damaged by the disconnections.
We can conclude that an agent is damaged if it is not displayed in any node. This is
because the prototype will display the agent in the node. The failure of message delivery
due to damage of the agent cannot be counted as a failure of the algorithm, since in the
algorithm; it is assumed that the channels should not fail while transporting the agent.
6.6 Discussion
Form the demonstration of the developed algorithm, we have arrived at the following
implementing the mobile software system since the algorithm requires that the agent and
requires the development of a mobile software agent system, which is beyond the scope
of this study. However, we are able to demonstrate the algorithm works by using a
agent that uses FIFO channel to transport message and agent. Since most of java mobile
agents like Aglet develop agent migration on top of socket, using FIFO channel to
transport the message is not difficult. In addition the mobile software agent should
provide a naming service, which gives unique name to each agent. Since this is also
already provided most of mobile agent, this is also not difficult. Lastly to implement the
algorithm, the mobile software agent system needs to have a mechanism to deliver
message to the agent. This also can be achieved by using Java space.
7. Conclusions
7.1 Conclusions
Mobile software agents are becoming an important tool to develop distributed
low bandwidth. Mobile Software agent technology is emerging as an important area for
In this thesis we have developed an algorithm that guarantees the delivery of message to
highly mobile agents in the existence of fault, more specifically disconnection. We also
presented the implementation issues of the algorithm and demonstrated the algorithm for
transport the agent and the message together in a FIFO channel, we were unable to use
the existing mobile software agent system to develop the prototype. However, we
developed a system that simulate mobile software agent to demonstrate the algorithm that
The contributions of the study are: (1) Murphy’s algorithm is extended to work in the
agents and delays of activation of channels.) (3) The implementation issues of the
The algorithm is tested on the available wired local area network. Thus, further validation
should be made on the effectiveness of the algorithm on different LANs and WANs. In
addition, since only the version the algorithm for static network graph has been
Since the algorithm correctness is not proved in this thesis, it should be formally proved.
References
[2] Mikael Berg “Software agent frame work technology” Linkoping University
2000
[3] Roberto Silveira Silva Filho “The Mobile Agents Paradigm” Department of
[4] T. Middelkoop and A. Deshmukh "Mobile Agents for Collaborative Design and
[5] L. Levison, W. Thies, and S. Amarasinghe, “Providing web search capability for
[6] Freeman Yufei Huang “Communication Infrastructures and Protocols for Mobile
[7] Anand R. Tripathi Neeran M. Karnik Manish K. Vora Tanvir Ahmed Ram D.
[9] DavidWong, Noemi Paciorek, and Dana Moore, “Java-based mobile agent”,
[14] Joachim Baumann, Fritz Hohl, Nikolaos Radouniklis, Kurt Rothermel, and
Combridge” 1999
[16] Flávio Morais de Assis Silva, Raimundo José de Araújo Macêdo “Reliability
on Tests and Fault Tolerance (II WTF 2000), 15th-16th july 2000
[18] Robert S. Gray “Agent Tcl: A flexible and secure mobile agent system”, 30 June
1997
[19] Yolande Berbers, Bart De Decker, Wouter Joosen “Infrastructure for mobile
[20] V. Roth. “Scalable and secure global name services for mobile agents” 6th
[21] Jonathan Dale, David C. DeRoure “A Mobile Agent Architecture for Distributed
[26] Antonio Carzaniga, Gian Pietro Picco, Giovanni Vigna “Designing distributed
[28] L. Eggert “TCP Abort Timeout Option” The Internet Society (2004), 2004,
1997
[31] David Kotz, Robert S. Gray “Mobile Agents and the Future of the Internet” In
[33] Clements, P. E., Papaiannou, T. and Edwards, J. M., "AGLETS: Enabling the
[35] Carriero & D. Gelernter, "Linda in Context", Communications of the ACM, 1989