Documente Academic
Documente Profesional
Documente Cultură
4, 2004
Martin TOMÁEK
Department of Computers and Informatics, Faculty of Electrical Engineering and Informatics,
Technical University of Koice, Letná 9, 042 00 Koice, Slovak Republic, phone: +421 55 6023178,
E-mail: martin.tomasek@tuke.sk
SUMMARY
Presented process calculus for agent communication and mobility can be used to express distributed systems based on
agent technology and mobile code applications in general. Agents are abstraction of the functional part of the system
architecture and they are modeled as process terms. Agent actions model interactions within the distributed system:
local/remote communication and mobility. Places are abstraction of the computational environment where the agents are
evaluated and where interactions take place. Distributed system is modeled as a parallel composition of places where each
place is evolving asynchronously. Formal operational semantics defines rules to describe behavior within the distributed
system and provides a guideline for implementations. Via a series of examples we show that mobile code applications can be
naturally modeled.
1
This paper was supported by the grant Nr. 1/0176/03 of the Slovak Grant Agency.
Acta Electrotechnica et Informatica No. 3, Vol. 4, 2004 57
P
m p (Q )
P The rule (C1) shows the operator || is
(S1) commutative and rule (C2) shows the the operator ||
[ P] p [ P | Q] p
is associative.
m p2 ( Q )
P1 P1
(S2) 5. SPECIFICATION OF MOBILE CODE
[ P1 ] p1 || [ P2 ] p2 [ P1 ] p1 || [ P2 | Q ] p2
APPLICATIONS
rp ( x ) w ( y)
P1 P1 P2 p
P2 According to the classification proposed in [8],
(S3)
[ P1 | P2 ] p [ P1 | P2 ] p we can single out three paradigms, apart from the
traditional client-server paradigm, which are largely
r
p1 ( x) p1 w ( y)
P1 P1 P2 P2 used to build mobile code applications:
(S4)
[ P1 ] p1 || [ P2 ] p2 [ P1{ y / x}] p1 || [ P2 ] p2
remote evaluation,
[ P1 ] p [ P1 ] p code on demand and
(S5) mobile agent.
[ P1 | P2 ] p [ P1 | P2 ] p
Reduction rules clearly distinct between local 5.1 Expressing Mobile Code Paradigms
and remote interactions performed by located agents
and provide a formal model to guide the Remote evaluation is performed when a client
implementation. sends a piece of code to the server and server
Rule (S1) describes movement and evaluation of evaluates the code and client can get the results back
an agent. Agent P evaluates the agent Q at the from the server.
same place. Agent Q is running in parallel with We define term Client that sends a request for
remote evaluation to the Server s place s . Request
agents located at place p . Rule (S2) is very similar
consists of a code P and a name of the Client s
to the rule (S1) while agent P moves the agent Q
place c . Then the Client reads the result into the
to another place p2 where it is evaluated in parallel name y and continues as C .
with existing agents ( P2 ) there. Term Server reads the request from his local
Rule (S3) describes synchronous communication place s . The received code is stored in name x and
between two agents located at the same place. The the name of Client s place is stored in name p .
communication is synchronized when both peers Then the code in x is evaluated and the result r is
want to interact (read or write) within the same
sent back to the Client s place. The Server is
place. It means two communication actions rp ( x)
performing an independent work in S .
and w p ( y ) will interact when p p and then the We define the following terms where the whole
name y will be substituted for all occurrences of system defined by term System is a parallel
name x in term followed by rp ( x) prefix. Rule composition of Server s place and Client s place:
(S4) is very similar to rule (S3) while def
communicating agents are located on different Client w s ( P, c ).rc ( y ).C
places. def
Rule (S5) describes asynchronous evolution of Server rs ( x, p).x.w p ( r ) | S
subcomponents of the place. It means each site of System [Client ]c || [ Server ]s
the system is working autonomously.
How the reduction behaves in presence of
operator of parallel composition of places is defined Code on demand describes the situation where a
by rule (S6). client wants to perform a code that is presented by
The reduction behaves with respect to structural the server. Client asks for a code and server sends it
congruence as we can see in rule (S7). Structural to the client where it can be evaluated.
congruence is defined following way: We define term Client that sends a request to the
Server s place s . The request consists of a name of
S1 || S 2 S 2 || S1 (C1) the Client s place c Then the Client reads the
code from local place into the name x . Finally the
( S1 || S2 ) || S3 S1 || ( S 2 || S3 ) (C2)
code is evaluated and Client continues as C .
Acta Electrotechnica et Informatica No. 3, Vol. 4, 2004 59
Term Server reads the request from his local the result r is sent back to the Client s place which
place s . The received name of Client s place is name is stored in p .
stored in p . Then the Server sends a code P to The whole distributed system is defined in term
the Client s place. The Server is performing an System where Client s place and Server s place
independent work in S . are computed in parallel:
We define the following terms where the whole
system defined by term System is a parallel def
Proc ( x) P
composition of Server s place and Client s place:
def
Client w s ( Proc, z, c).rc ( y ).C
def
def
Client w s (c).rc ( x).x.C Server rs ( x, y, p).( Server | x y .w p ( r ))
def
Server rs ( p).w p ( P ) | S System [Client ]c || [ Server ]s
Mobile agent is a paradigm where an This example shows the model of simple mobile
autonomous code (agent) is sent from the client to agent system. We define a mobile agent, which
the server. By autonomous we mean that the client travels from place to place and searches for an
and server do not need to synchronize the agent information.
invocation and the agent is running independently A user defined by term User needs additional
and concurrently within the servers place. information on a data represented by name z . User
We define an abstraction Agent ( x) of a mobile launches mobile agent Seeker that dynamically
agent and term Client is moving the agent to the travels among nodes looking for result information
Server s place s . r in distributed database and stores it in y . If the
Term Server is performing its independent information is found it is sent back to the User
work S and it is able to receive the agent which is otherwise the Seeker continues in next place. User is
then running in parallel with other Server s actions waiting for the result and in parallel it continues
in its local place s . with other independent work U .
We define the following terms where the whole Agent Seeker ( x, h, l ) , where x is searched
system defined by term System is a parallel information, h is home place of the User and l is
composition of Server s place and Client s place: local place of the agent, is reading the data from the
def local place l . It reads either searching result or the
Agent ( x) P name of the next place where to search. In the first
def case it sends the result stored in y back to the
Client m s ( Agent z ).C User . In he second case it moves a new instance of
def
the agent to the new place p and ends
Server S
The whole system is defined in term System
System [Client ]c || [ Server ]s
where each independent place is sending either
result information or the next place for searching:
5.2 Example: Remote Procedure Call
def
This example show that we are able to model User m p1 ( Seeker z , u, p1 ).(ru ( y ) | U )
very traditional mobile code application that is def
performing remote procedure call. Seeker ( x, h, l ) rl ( x, y ).w h ( y)
A client sends a request to a server and waits for rl ( x, p).m p ( Seeker x, h, p )
response. The request consists of procedure name System [User ]u || [ w p1 ( z , r ) w p1 ( z , pi )] p1 ||
and its real parameters that should be performed by
a server and the address of the clients place where || [ w pn ( z , r ) w pn ( x, pi )] pn
to send a result.
Term Client sends the request with name of the
procedure Proc , its real parameters z and the name 6. CONCLUSIONS AND FUTURE WORK
of the Client s place c to the Server s place s .
term Server reads from its local place s the request Modeling rules presented in the paper seem to be
into the x (name of the procedure), y (parameters very suitable tool for formal description of
distributed systems based on agent technology and
of the procedure) and p (name of the Client s technology of mobile code. The formal semantics is
place). Then in parallel it runs the Server useful for discussing the design of modeled
recursively and continues as procedure stored in x application and provides guidelines for its
with y parameters. When procedure x is finished implementations in programming languages.
60 Specification Issues of Communication and Code Mobility
Primitive actions defined in the model present [8] Fuggetta, A. Picco, G. P. Vigna, G.:
communication and mobility as key interactions for Understanding Code Mobility. Software
mobile agents. Abstraction of places, their parallel Engineering, 24(5), May 1998, pp. 342 361
composition and performing interactions within [9] Cardeli, L. Gordon, A. D.: Mobile ambients.
places are very natural for distributed system Theoretical Computer Science 240, 2000, pp.
architectures. These approaches in our model differ 177 213
from very general -calculus and ambient calculus [10] Pierce, B. Sangiorgi, D.: Typing and
[9]. Subtyping for Mobile Processes. In
Security properties of distributed system are also Proceedings of LICS 93, IEEE Press, 1993
very important area and research on presented [11] Kobayashi, N. Pierce, B. Turner, D.:
apparatus continues in this field. For example, Linearity and the -Calculus. In Proceedings
presence of typing information [10, 11] within the of POPL 96, 1996
names can provide privacy and security properties. [12] Adabi, M. Gordon, A. D.: A Calculus for
In addition implementation of spi-calculus [12] Cryptographic Protocols: the Spi-Calculus. In
primitives can add usage of secure communication Proceedings of the Fourth ACM Conference
protocols to the model. on Computer and Communications Security,
We also work on multi-agent system platform ACM Press, April 1997, pp. 36 47
[13] where mobile agents can work together to solve [13] Parali , M.: Mobile Agents Based on
the common tasks. We use these models to define Concurrent Constraint Programming. In:
and to make verification of communication schemes Lecture Notes in Computer Science, Vol.
[14, 15] for mobile agents coordination and 1897, Zurich, 2000, pp. 62 75
cooperation within the multi-agent environment. [14] Tomáek, M.: Concepts for Mobile Agents
Interaction. In M. Jelina, J. Kollar (eds.):
REFERENCES Proceedings of Scientific Conference with
International Participation Computer
[1] Jennings, N. R. Wooldridge, M. J.: Engeneering and Informatics 99 (CEI 99),
Applications of Intelligent Agents. In N. R. Koice Her any, Slovakia, October 14 15,
Jennings, M. J. Wooldridge (eds.): Agent 1999, pp. 259 264
Technology: Foundations, Applications, and [15] Tomáek, M.: Distributed System Based on
Markets, Springer, Berlin, Heidelberg, New Technology of Mobile Agents. Acta
York, 1998, pp. 3 28 Electrotechnica et Informatica, Vol. 1, No. 1,
[2] Harrison, C. G. Chess, D. M. Koice, 2001, pp. 55 60
Kershenbaum, A.: Mobile Agents: Are They a
Good Idea? Technical report, IBM Research BIOGRAPHY
Division, T. J. Watson Research Center,
March 1995 Martin Tomáek was born 1975 in Koice,
[3] Baeten, J. C. M. Weijland, W. P.: Process Slovakia. He received the master degree in computer
Algebra. Cambridge University Press, science in 1998 at the Faculty of Electrical
Cambridge, New York, Port Chester, Engineering and Informatics of the Technical
Melbourne, Sydney, 1990 University of Koice, Slovakia. He is presently a
[4] imo ák, S. Hudák, .: Petri Net Semantics assistant professor at the Department of Computers
for ACP Terms. Vol. 4, No. 1, Koice, 2004, and Informatics of the Faculty of Electrical
pp. 55 59 Engineering and Informatics of the Technical
[5] Milner, R.: Communication and Concurrency. University of Koice, Slovakia and his study field is
Prentice Hall, 1989 software and information systems. The subject of his
[6] Milner, R. Parrow, J. Walker, D.: A PhD dissertation focuses on formal expressing
Calculus of Mobile Processes, Part I and II. dynamics of mobile programs. He authored several
Information and Computation, 100, 1992, pp. publications on mobile agents, distributed systems
1 77 and he participates in research and educational
[7] Milner, R.: Communicating and Mobile projects of the university. His research interests
Systems: the -Calculus. Cambridge include mobile code, software agents, distributed
University Press, Cambridge, New York, systems and formal description of communication
Melbourne, 1999 and code mobility.