Logic for Multi-Path Message Forwarding Networks for Mobile Agents Masahito Kurihara1 and Masanobu Numazawa2 1
2
Hokkaido University, Sapporo, 060-8628, JAPAN
[email protected] Otaru University of Commerce, Otaru, 047-8501, JAPAN
[email protected]
Abstract. We discuss how mobile agents, moving in the Internet from node to node, can communicate with each other by forwarding messages in a robust way. As a solution, we present the general idea of a class of communication networks called the multi-path message forwarding networks (MMFNs), which can transmit the messages to mobile agents at the current location in a robust way based on multiple paths between the nodes and the target. The networks are formally defined in terms of graph theory, and the dynamic nature of the networks (i.e., how they evolve) is represented by a logical system, named Ln , consisting of six inference rules. It is shown that the system is sound in the sense that it generates only MMFNs. A computational interpretation of Ln is also discussed.
1 Introduction The notion of agents can be described in terms of various attributes such as intelligence, autonomy, mobility, communication ability, etc. In this paper we focus on mobility and discuss how mobile agents [1–4], moving in the Internet from node to node, can communicate with each other in a robust way. In particular, we are interested in location transparent mobile agent systems, in which the agents need not be aware of the actual locations of peer agents, the agents with which they wish to communicate. Three basic models for implementing location transparency have been identified [5, 6]: searching, registering, and forwarding. In this paper our focus is on the forwarding (also called logging), in which the (target) agents store in the current node the pointer to the next destination before they move there. The future messages are forwarded to the target agents along the path defined by the chain of those pointers. However, the weakness of the forwarding is its lack of robustness, because the messages will never reach the target if a single node on the chain is broken. In this paper, we solve this problem by proposing a class of networks called multipath message forwarding networks (MMFNs), which can transmit the messages to the targets in a robust way based on multiple paths between the nodes and the target. More precisely, each MMFN is associated with an integer n called its degree and ensures the existence of a path from every node to the target if the number of broken nodes is at most n. The remaining of this paper is organized as follows. Section 2 presents a formal definition of MMFNs in terms of graph theory, and proves their robustness. In Section
3, the dynamic nature of the networks (i.e., how they evolve) is represented by a logical system, named Ln , consisting of six inference rules. It is shown that Ln is sound in the sense that it generates only MMFNs. A computational interpretation of Ln and related work are also discussed. The final section provides our brief conclusion.
2 Multi-path Message Forwarding Networks 2.1
Preliminary
Before describing our main idea, we present a brief review of graph theory. A (directed) graph G = (V, E) consists of a set V of nodes (or vertices) and a set E of links (or directed edges). If V and E are finite sets, then G is finite. A link is conventionally denoted by an ordered pair (v, w) of nodes but in this paper we denote it by v → w, where v is called the start node of the link and w the end node. In this case, we say that v → w is outgoing from v. The outdegree, od(v), of a node v is the number of the links outgoing from v. Links with the same start node and the same end node are parallel. Graphs with no parallel links are simple. A (directed) path is a sequence v0 → v1 → . . . → vp of links vi → vi+1 , 0 ≤ i < p, from v0 to vp passing through v1 , . . . , vp−1 . If v0 = vp , it is a (directed) circuit. Graphs with no circuits are acyclic. In this paper, we deal with only finite, simple, acyclic graphs. 2.2
Definition of MMFN
We present the graph-theoretical, formal definition of MMFNs. Definition 1. A multi-path message forwarding network (MMFN) of degree n (where n is a nonnegative integer) is a finite, simple, acyclic graph G = (V, E) such that – for all node v ∈ V , od(v) ≤ n + 1, and – for each i, 0 ≤ i ≤ n, there exists the unique node v ∈ V with od(v) = i. The unique node si with od(si ) = i, 0 ≤ i ≤ n, is called the special node of degree i. In particular, the special node s0 of degree 0 is called the target and often written as t. The rest of the nodes r, satisfying od(r) = n + 1, are called the residual nodes. Based on this classification, we often split V into two disjoint sets S = {sn , sn−1 , . . . , s0 } and R = V \S, and write G = (R, S; E; n) for a MMFN G = (R + S, E) of degree n, where, in general, the union of two disjoint sets X and Y is denoted by X + Y and their difference by X\Y = X ∩ Y in this paper. Instances of MMFNs of degrees 0, 1, and 2 are depicted in Fig. 1. From the definition, we can derive the following fact. Proposition 1. If G = (R, S; E; n) is a MMFN, then for every special node si ∈ S, it holds that si → sj ∈ E for all j, 0 ≤ j < i.
n=0 t n=1
n=2 s1
t
s2
s1
t
Fig. 1. Instances of MMFNs of degree n
Proof. Since G is acyclic, we can topologically sort the nodes V and associate each node v with an integer label lab(v) by a one-to-one mapping lab from V to {0, 1, . . . , |V |− 1} such that if v → w ∈ E then lab(v) > lab(w). To prove the proposition, we need to verify the following claim. C LAIM . For each i ∈ {0, 1, . . . , n}, there exists the unique special node v ∈ S such that lab(v) = od(v) = i. (Indeed, v = si .) The claim is proved by induction on i, but the complete proof is omitted because of the space limitation. It is clear that the main proposition follows from this claim. Indeed, the special node si has the label i and as many as i outgoing links connecting to nodes {v | 0 ≤ lab(v) < i}. 2.3
Robustness of MMFN
Suppose that a message received by a node v should be forwarded to the target t along a path from v to t of the MMFN of degree n. We show that if at most n nodes are abnormal, messages can be forwarded to the target. We say that MMFNs are robust in this sense. The idea is graph-theoretically formalized as the following theorem. Theorem 1. Let G = (V, E) be a MMFN of degree n and let t be its target. Then for every node v ∈ V and every set A ⊆ V − {v, t} with |A| ≤ n, there exists a path from v to t without passing through any nodes of A. Proof. We reuse the labeling function lab(v) : V → {0, 1, . . . , |V | − 1} introduced in the proof of Proposition 1 and prove the theorem by induction on lab(v). The base case lab(v) = 0 is trivial, because by Proposition 1 we see v = t, thus there exists a required path of length 0. Consider the case lab(v) = k > 0, assuming, as the induction hypothesis, that the theorem holds for lab(v) < k. We can identify two cases. If v is a special node, then by Proposition 1 there exists a link v → t ∈ E directly connecting to the target, thus a required path. Otherwise, v is a residual node. Let W = {w | v → w ∈ E} be the set of end nodes of the links outgoing from v. Since od(v) = n + 1 and G is simple, those end nodes are mutually distinct, i.e. |W | = n + 1. This is compared with |A| ≤ n to deduce that there exists a node w ∈ W such that w ∈ A. Since lab(w) < lab(v) = k, we
can use the induction hypothesis to show that there exists a path from w to t without passing through any nodes of A. Concatenation of the edge v → w and this path yields a required path.
3 Evolution of MMFN In this section we discuss the dynamic nature (evolution) of MMFNs. We present our design as a form of a logical system consisting of six inference rules, and then prove its soundness. 3.1
Logical System Ln
We have introduced the notation (R, S; E; n) for representing a MMFN in the previous section. In this section we call it a configuration and interpret it as a logical expression that means that the graph G = (R + S, E) is a MMFN of degree n with the special nodes S and the residual nodes R. Since S contains exactly one special node si of degree i for each i ∈ {0, 1, . . . , n}, we regard it as an ordered set, arranging the elements in the descending order of i, and write it as a sequence sn .sn−1 . · · · .s0 delimiting the elements by the concatenation operator dot(.). In addition, we use lower case letters for denoting a node and upper case letters for a sequence; thus, for example, s.S denotes the sequence consisting of the first (leftmost) element s followed by the sequence S. The empty set or sequence is denoted by ∅. Every time the mobile agent moves from node to node, the configuration should be changed so that the resultant network preserves the properties required for MMFNs. Let us formally represent such a dynamic mechanism of the network by the following logical system consisting of six inference rules, where the letters s, S, etc. are variables denoting arbitrary elements or sequences except that n is fixed to a constant. Definition 2. Let n be a nonnegative integer. Then the logical system Ln is defined by the following six inference rules. S TART a (∅, a; ∅; 0) E XTEND BY u (∅, S; E; k) u ∈ S k < n (∅, S.u; E ∪ {v → u | v ∈ S}; k + 1) M OVE TO NEW u (R, s.S; E; n) u ∈ R + s.S (R + {s}, S.u; E + {v → u | v ∈ s.S}; n)
M OVE TO SPECIAL s (R, S.s.S ; E + {s → v | v ∈ S }; k) S = ∅ (R, S.S .s; E + {v → s | v ∈ S }; k) M OVE TO RESIDUAL r (R + {r}, s.S; E; n) (R + {s}, S.r; E\E1 + E2 ; n) where E1 = {r → v ∈ E} E2 = {v → r | v ∈ s.S} B YPASS v (R, S; E + {u → v, v → w}; n) u → w ∈ E (R, S; E + {u → w, v → w}; n) Each inference rule I of the form
G C1 · · · Cm G proclaims that the configuration G is inferred from the configuration G if all the conditions C1 · · · Cm are true (under the ordinary arithmetic and the set calculus). In this case, we write G[I]G . (For the first rule, S TART , we simply write [Start a]G .) If Gi [Ii ]Gi+1 for all i, 0 ≤ i < d, d ≥ 0, we write G0 [I0 ]G1 [I1 ]G2 . . . [Id−1 ]Gd and say that the configuration Gd is derived from the configuration G0 . In this case, we may also write G0 [I0 ; I1 ; . . . ; Id−1 ]Gd by leaving out the intermediate configurations. Note that this looks like a pseudo program code with the pre- and post-conditions G0 and Gd . If we are not interested in the inference rules in the derivation, we write G0 Gd . In particular, if I0 is the S TART rule, we leave out G0 and write Gd . The intended meaning of the inference rules will be described in illustrations in the following example and in words in the proof of Theorem 2. Example 1. Let n = 1. We can verify that the following sequence is a valid derivation in L1 . See Fig. 2.
Move to new d
Start a a
a
a
b
b
d
b
c
d
c
d
Move to residual a
Move to new c a
c
Move to special c
Extend by b a
b
c
a
b
Fig. 2. An example of derivation
[S TART a] (∅, a; ∅; 0) [E XTEND BY b] (∅, a.b; {a → b}; 1) [M OVE TO NEW c] ({a}, b.c; {a → b, a → c, b → c}; 1) [M OVE TO NEW d] ({a, b}, c.d; {a → b, a → c, b → c, b → d, c → d}; 1) [M OVE TO SPECIAL c] ({a, b}, d.c; {a → b, a → c, b → c, b → d, d → c}; 1) [M OVE TO RESIDUAL a] ({b, d}, c.a; {b → c, b → d, d → c, c → a, d → a}; 1)
3.2
Soundness
In the previous section we introduced a notation G to mean that the configuration G is derived (or generated) by our logical system Ln . Let us introduce a similar notation |= G to mean that the logical expression G is true under the interpretation given in the previous section, i.e., G is a MMFN satisfying all the conditions of Definition 1. The following theorem shows the soundness of Ln in the sense that all the expressions it generates are true. Theorem 2. If G, then |= G. Proof. First of all, it is clear that the network G = (∅, a; ∅; 0), consisting of the single node a and no links, generated by the inference rule S TART is a MMFN of degree 0. Therefore, it is sufficient to show that for each of the remaining rules I, if G = (R, S; E; k) is a MMFN of degree k and G[I]G , then G = (R , S ; E ; k ) is a MMFN of degree k . This involves verifying that G is a finite, simple, acyclic graph such that od(v) ≤ k + 1 for all node v and for each i ≤ k , there exists the unique node v with od(v) = i. Since the finiteness is clear, we only show the other properties for each inference rule, one by one. Because of the space limitation, we only present the arguments for E XTEND BY and M OVE TO NEW , skipping the remaining three cases.
E XTEND BY u: This inference rule generates G by introducing a fresh node u and adding the links which connect each of the special nodes S to u. Clearly, G is a simple graph, because G is simple and contains no edges added by the inference rule. Also clear is the acyclicity of G , because the acyclicity of G ensures that if G contained a circuit, the circuit would involve at least one newly added link v → u. However, there is no links outgoing from u. Consider the outdegrees of the nodes of G . Since G is a MMFN of degree k, we can write S = sk .sk−1 . · · · .s0 , with od(si ) = i. By adding the links, the outdegrees of the nodes S are increased by one, and thus we can write S.u = sk .sk−1 . · · · .s0 .u, with od(si ) = i + 1 and od(u) = 0. Therefore, G is a MMFN with degree k + 1. M OVE TO NEW u: This rule is similar to the previous one in that it introduces a fresh node u. The difference is that it may be used only when the network has the full degree n (thus the degree is not increased any more) and the leftmost special node s, with od(s) = n, of G now becomes a residual node, with od(s) = n + 1, in G . The arguments for the previous inference rule can be reused here to verify that G is a MMFN of degree n. 3.3
Computational Interpretation
It is clear that the inference rules of Ln can be interpreted computationally. More precisely, each graphical node may be interpreted as a computational node which has computational resources such as processors, memory, and communication ports. Each link v → w can be interpreted as a pointer (or reference) to the node w, stored in the node v. The entire set of such pointers define a communication network in a natural way so that the current location of the mobile agent is at the target t and messages received by a node v are forwarded to t along a path from v to t. (Instead of messages, we may think of queries for locating the mobile agent.) Theorem 1 ensures that even if there are n abnormal nodes other than v and t, there exists a path from v to t without passing through those abnormal nodes. For each inference rule, we can think of a remote operation (or a procedure or a command) that modifies the pointers of appropriate nodes to update the configuration of the networks. We start with the initial, trivial network consisting of a single node, defined by the S TART operation. When the agent has moved to a fresh node, we can use either the E XTEND operation (if the degree of the network, k, is smaller than n) or the M OVE TO NEW operation (if k = n). When it has moved to a special node, the M OVE TO SPECIAL operation is used. Similarly, move to a residual node is implemented by the M OVE TO RESIDUAL operation, but this can be used only when k = n. The B YPASS operation can be used to reduce the number of hops (from u to w via v) by one and gain efficiency of message delivery by shortening paths that involve those hops. A possible implementation involves having the mobile agents carry with themselves the locations of the special nodes including where they reside now. This only requires the additional memory space proportional to n + 1 for each agent. Let us denote this location information by S.t, as suggested by the notation of the inference rules. For example, after the M OVE TO NEW u operation has completed, the agent can send to each agent at S the remote command that request the addition of the pointer to u. Then
it can update its own S information by removing the leftmost element and adding u as the rightmost element, as specified by the inference rule. Let us discuss the computational complexity of the system. We measure the time complexity of Ln by the number of links added or removed for each operation. The space complexity is defined by the total number of links (or pointers) of the network for each agent. Let V = R + S be the set of nodes of the network (R, S; E; n). It is easy to verify the following theorem, which states that, given fixed n, the time complexity is constant (independent of |V |) and the space complexity is linear in |V |. Theorem 3. The time complexity of Ln is bounded by 2(n + 1). The space complexity of Ln is bounded by (n + 1)|V |. Proof. For the time complexity, the worst case is the M OVE TO RESIDUAL operation, which requires removal of n + 1 links and addition of n + 1 links. For the space complexity, each node of V contains at most n + 1 pointers. Note that the agents can have mutually different degrees (n’s) and network sizes (|V |’s). The space requirement for the overall system can be obtained by summing up the spaces required for each agent. 3.4
Related Work
Our work is concerned with the location transparency of mobile agent systems. In location transparent systems, every agent can communicate with other (peer) agents without knowing where they actually reside. For attaining this property, two general problems must be solved. First, the peer agent must be located by some mechanism that maps an agent’s unique name onto its current location. Second, messages must be sent to the peer. (This can be difficult because mobile agents might “run away” from messages, making the location information outdated.) Based on [5, 6], we identify three basic models for location transparency: searching, registering, and forwarding. In the searching model, the agents should have a priori knowledge of the locations where their peers possibly reside, and before sending messages to a mobile peer, they find its current location by broadcasting search queries to all of those locations [7]. When the number of those locations is huge, it causes a serious inefficiency, but if we have knowledge on the probability distribution of the current location of the peer, we can improve the performance by sending the query messages in an appropriate way [8]. The registering is a classic server-based model. The agents need to update their location in a predefined directory server, which can be either a central node or the agent’s home host [9]. The single directory server may become the bottleneck of the system performance and the reliability. One approach to overcome this problem is a distributed directory to share the load [10]. The model developed in [11] is scalable to the Internet and accounts for security issues. The MMFN model developed in this paper is basically classified as the forwarding model, where locating a peer and delivering a message are both done in a single phase. Every time the agents move to a node, they put in the previous node the pointer to
the new node as the trace information so that future messages can be forwarded along the extended path. A closely-related model is a locate-and-transfer, where the target is located in the first phase, and in the second phase the messages are transferred to it directly. The theory of MMFNs in this paper is relevant to both models, because it discusses only the network configuration. In [12, 13], the network is assumed to be a tree, so there is exactly one path from every node to the root node where the target agent resides. This causes the lack of robustness, because a single broken node makes the target agent unreachable. Our previous work in [14] defines a network where at most one broken node is allowed. It can be seen as a MMFN of degree n = 1. This paper extends this theoretical framework to n = 0 and n ≥ 2. Note that MMFNs of degree n = 0 are trees, which are common to existing forwarding models. To the best of our knowledge, no models equivalent to MMFNs of degree n ≥ 2 have been proposed in the literature. Another disadvantage of the forwarding model is the degrading of the system performance when messages are large in size and take multi-hops before they reach the target. A well-known solution to this problem is dynamically shortening the paths contained in the network as, for example, in [15]. The inference rule B YPASS in this paper incorporates this technique in a basic way. There exist combinations of basic models. A combination of registering and forwarding is proposed in [16], where the central directory server is asked to deliver the message only when the forwarding fails. Another hybrid model combining registering and forwarding is proposed in [17], where the mailbox-based algorithm decentralizes the role of the directory server and forwards each message at most once. The choice of models depends on the application domains and the environments. Our work is not intended to replace any of the existing sophisticated models, but can be incorporated into some models to improve the robustness to arbitrary degree.
4 Conclusion We have proposed the multi-path message forwarding networks for location transparent communications between mobile agents. We believe that we have provided the foundations for studying this kind of networks and their possible extensions by introducing rigorous formalisms based on graph theory and the logical system Ln as well as the mathematical results of the robustness, the soundness, and the computational complexity. A natural theoretical question is whether or not the system Ln is complete. By completeness, we mean the converse of the soundness: if |= G, then G. If the system is complete, it provides a universal mechanism for creating all MMFNs. This is currently an open question, but we have a conjecture that the answer is affirmative, because we have recently obtained an informal proof of the completeness for the case of degree n = 1. For practical side, an interesting engineering problem is how to determine the degree n. This will depend on the nature and goals of the environments and applications, but a basic guideline should be sought.
There are a lot of notable ideas for location transparency proposed in the literature. It would be our pleasure if our work would be combined with some of them to improve the state-of-the-art architectures of mobile agent systems.
References 1. S. Appleby and S. Steward: Mobile software agents for control in telecommunication networks. in A.L.G. Hayzelden, et al. (ed.), Software Agents for Future Communication Systems, Springer-Verlag (1999) 270–286 2. W.R. Cockayne and M. Zyda: Mobile Agents. Manning Publications (1998) 3. D. Kotz, el al.: Mobile agents for mobile Internet computing. IEEE Internet Computing, 1, 4 (1997) 58–67. 4. A. Pham and A. Karmouch,: Mobile software agents: an overview. IEEE Communications magazine, 36, 7 (1998) 26–37 5. Y. Aridor and M. Oshima: Infrastructure for mobile agents: requirements and design. Proc. 2nd Intern. Workshop on Mobile Agents, Stuttgart, Germany, Lecture Notes in Comp. Sci. 1477, Springer-Verlag (1998) 38–49 6. D. Milojicic, W. LaForge, and D. Chauhan: Mobile objects and agents. Proc. 4th USENIX Conf. on Object-Oriented Technologies and Systems (1998) 7. A.L. Murphy and G.P. Picco: Reliable communication for highly mobile agents. Proc. 1st Intern. Symposium on Agent Systems and Applications, and 3rd Intern. Symposium on Mobile Agents, IEEE Computer Society Press (1999) 141–150 8. W.-S.E. Chen and C.-W. R. Leng: A novel mobile agent search algorithm. Proc. 1st Intern. Workshop on Mobile Agents, Berlin, Germany, Lecture Notes in Comp. Sci. 1219, SpringerVerlag (1997) 162–173 9. T. Xianping, J. Lu, et al.: Communication mechanism in Mogent system. Journal of Software 2000, 11, 8 (2000) 1060–1065 10. M. van Steen, F.J. Hauck, P. Homburg, and A.S. Tanenbaum: Locating objects in wide-area systems. IEEE Communications Magazine, 36, 7 (1998) 104–109 11. V. Roth and J. Peters: A scalable and secure global tracking service for mobile agents. Proc. 5th Intern. Conf. on Mobile Agents, Atlanta, USA, Lecture Notes in Comp. Sci. 2240, Springer-Verlag (2001) 169–181 12. S. Lazar, I. Weerakoon, and D. Sidhu: A scalable location tracking and message delivery scheme for mobile agents. Proc. 7th IEEE Intern. Workshop on Enabling Technologies: Infrastructure for Collaborative Enterprises, IEEE Computer Society Press (1998) 243–248 13. W. van Belle, K. Verelst, and T. D’Hondt: Location transparent routing in mobile agent systems merging name lookups with routing. Proc. 7th IEEE Workshop on Future Trends of Distributed Computing Systems (1999) 207–212 14. M. Kurihara and M. Numazawa: Evolution and maintenance of proxy networks for location transparent mobile agents and formal representation by graph transformation rules. Proc. Pacific Asian Conf. on Intelligent Systems (2001) 151–155 15. L. Moreau: Distributed directory service and message routing for mobile agents. Technical Report ECSTR M99/3, Department of Electronics and Computer Science, Univ. Southampton (1999) 16. P. Wojciechowski and P. Sewell: Nomadic Pict: Language and infrastructure design for mobile agents. Proc. 1st Intern. Symposium on Agent Systems and Applications, and 3rd Intern. Symposium on Mobile Agents, IEEE Computer Society Press (1999) 821–826 17. X. Feng, J. Cao, J. L¨u, and H. Chan: An efficient mailbox-based algorithm for message delivery in mobile agent systems. Proc. 5th Intern. Conf. on Mobile Agents, Atlanta, USA, Lecture Notes in Comp. Sci. 2240, Springer-Verlag (2001) 135–151