144
Views
0
CrossRef citations to date
0
Altmetric
Original Articles

CONNECTING MIGRATION METHOD IN A MOBILE AGENT SYSTEM

, , , &
Pages 772-780 | Published online: 05 Oct 2009

Abstract

Connecting migration in mobile agent systems is to support continuous and transparent communication operations between mobile agents. This article presents the design and implementation of a reliable connecting migration mechanism that provides exactly one delivery for all transmitted data during agent migration. We implemented this mechanism and named it AgentSocket in a VPNAgent system used in the VPN security mechanism. It is a pure middleware implementation, without requiring modification of Java virtual machines.

Communication is one of the core technologies in the mobile agent research area so it is one of the infrastructures in mobile agent systems. Communication makes it possible for the mobile agent systems to cooperate with each other and with other distributed systems. Transferring messages in mobile agent systems is similar to that in mobile communication systems. The Mobile IP (Hu and Wang, Citation2005; Perkins, Citation2002) is a solution in mobile communication systems. It adopts registering, addressing, and transmitting by the router. But the Mobile IP is on the IP layer; it cannot ensure reliable message transmission.

Communication between mobile agents usually adopts an asynchronous method (Solomon, Citation1998) which is similar to e-mail. That is, a mobile agent sends messages to other agents regardless of the existing link between them. Although the asynchronous method is very important and widely used in mobile agent systems, it is not suitable for some applications in which mobile agents need to closely cooperate with each other. For example, the mobile agents in parallel computing environments need to be continually synchronized in their life cycle. A transitory synchronous communication can make an effective work among mobile agents. So in this article, the connecting migration mechanism is presented. In this mechanism, two mobile agents can migrate, respectively, in uninterrupted communication. From the point of the user, the uninterrupted communication migrates with the mobile agents.

The connecting migration mechanism comprises two problems, reliability and security. A reliable connecting migration mechanism must ensure that all transmitted messages in the procedure of the mobile agents migration are accurately. A secure connecting migration mechanism must also ensure that the transaction is not done attacked in the mobile agent migration.

The connecting migration mechanism presented in this article is reliable and secure. It provides a socket programming interface oriented to mobile agent systems. The interface is realized by a socket controller which ensures that the messages can be accurately transmitted at one time even when the mobile agents migrate. To ensure security, a secret key is created when establishing a connection between the mobile agents. The prototype of the socket controller is called AgentSocket which is realized in our mobile agent systems – VPNAgent.

THE AGENTSOCKE DESIGN

The AgentSocket Architecture

The AgentSocket is composed of two parts, the AgentSocket and the AgentServerSocket. Their functions are similar to that of the socket and the ServerSocket in Java, but they are mobile agent-oriented. In order to realize the connecting migration,, the AgentSocket provides two methods, suspend() and resume(). These two methods can be directly called to realize the connecting migration. The architecture of the AgentSocket is shown in Figure .

FIGURE 1 The architecture of the AgentSocket.

FIGURE 1 The architecture of the AgentSocket.

The architecture of the AgentSocket comprises three parts—data socket, controller, and redirector. The data socket is composed of the actual data channel and a buffer used to keep some data that has not been received. The controller is used to manage the connection and operation of the socket. The redirector is used to redirect a socket connection from a remote agent to a local agent. A pair of AgentSockets identified by the SocketID is created in order to ensure the correct communication between the two mobile agents. The controller and the redirector provide the services for all local AgentSockets.

When a mobile agent at client wants to connect to another mobile agent at server, its controller first sends a request for a connection to the server. After a response is received, the client redirector connects with the server redirector. Then the server redirector gives the connection to the mobile agent. To this end, the connection is established. The two mobile agents communicate with each other regardless of their physical location. If a mobile agent wants to migrate, it requests for suspending the connection. The AgentSocket closes the data socket. When the mobile agent finishes its migration, the AgentSocket will resume the connection by communicating with the server redirector. Then the data socket between the client and the server is refreshed and the input/output stream is recreated.

The State Transformation

The AgentSocket can be described as a finite-state machine extended from the TCP (Transmission Control Protocol). The 12 kinds of states are shown in Table . Among them, the bold faced are new states added to the TCP.

TABLE 1 The AgentSocket State

When an event occurs, the AgentSocket responds to it according to the current state. There are two kinds of events: the event called by a local agent or the event called by the remote agent. Correspondingly, there are two kinds of responses: calling the local methods or sending messages to the remote agent. The state transformation of the AgentSocket is shown in Figure . The real line describes the state transformation at client and the dashed describes the state transformation at server. Then the state transformation is described in detail. Assuming that mobile agent A wants to connect with mobile agent B, that is, A is the client and B is the server.

FIGURE 2 AgentSocket state transformation.

FIGURE 2 AgentSocket state transformation.

Open a connection: The initial connection state of A and B is CLOSED. When A wants to connect with B, A sends a CONNECT message to the server and its AgentSocket's state is set to CONNECT_SENT. After A receives an ACK message and a SocketID from the server, it sends a corresponding ID to the server and its AgentSocket's state is set to ESTABLISHED.

Let's look at the server. If B is intercepting, its AgentSocket's state is set to LISTEN. When B gets a CONNECT message from A, it's response is an ACK message and a SocketID to the client and its AgentSocket's state is set to CONNECT_ACKED. After B receives a SocketID from the client, its AgentSocket's state is also set to ESTABLISHED. To this end, the connection between the A's and the B's AgentSocket is established and data can be transmitted between A and B just like using general socket.

Suspend/resume a connection: After a connection is established, both A and B can suspend the connection. Assume A wants to migrate. It calls suspend() method and sends a SUS message to B. When A receives an ACK message from B, the A's AgentSocket closes the input/output stream and its state is set to SUSPENDED.

Look at the server. When B receives the SUS message, it sends an ACK message back and the B's AgentSocket closes the input/output stream. The B's AgentSocket's state is set to SUSPENDED. To this end, the AgentSockets of A and B are suspended. In this state, there is no data to be transmitted.

After A finishes its migration, it calls the resume() method to resume its AgentSocket. Its AgentSocket firstly establishes a new connection with the global redirector on the server and sends a RES message to B. After receiving an ACK message from B, the A's AgentSocket's state is set to ESTABLISHED and the connection is estabished. On the server point, after receiving a RES message from A, the B's AgentSocket firstly sends an ACK message to A and then gets the new connection from the global redirector and the B's AgentSocket's state changes from SUSPENDED to ESTABLISHED. To this end, the connection is established again.

Close a connection: If mobile agent A decides to close a connection, it can call the close() method regardless of its AgentSocket in ESTABLISHED state or in SUSPENDED state. Its AgentSocket sends a CLS message to B. After receiving an ACK message, the connection is closed. At the server point, after receiving a CLS message, the B's AgentSocket send an ACK message back and then closes the connection. To this end, the connection is closed and both A's and B's AgentSocket's state are set to CLOSED.

THE AGENTSOCKET REALIZATION

In this section, some critical problems are explained.

Establish the AgentSocket

When an agent on client A wants to connect with an agent on server B, it uses the B's AgentID to indicate which server is to be connected. So the server's name and the port number have to be found in the B's AgentID. The server name can be obtained by keeping the migrating path of B. Then A sends a socket to the redirector of the B's server. The redirector can find the A's socket port according to the socket sent by A and it wakes up the B's AgentServerSocket. The AgentServerSocket sends the AgentSocket back to A. Now the AgentSocket is established; A and B can communicate with each other. In this way, it is unnecessary to keep the map of an agent with its port. The sequential figure of establishing the AgentSocket in UML is shown in Figure .

FIGURE 3 The sequential figure of establishing the AgentSocket.

FIGURE 3 The sequential figure of establishing the AgentSocket.

The procedure of waking up a connection is similar to that previously described. When an agent A wants to wake up the connection with an agent B, A first connects with the redirector of B. The redirector wakes up the B's AgentSocket. Then the AgentSocket updates the data socket.

The Control Channels

It is necessary to exchange some control messages when an AgentSocket changes its connecting state. A special channel is used to transmit the control messages in order to get high performance. The channels use the UDP protocol. Since the UDP protocol is not reliable, a relay mechanism is used above the UDP protocol to provide the reliable communication. The main procedure is as follows. After a control message is sent, the sender starts a relay timer and waits for the ACK message from the receiver. If the sender gets the ACK message in limited time, it will stop the timer. Otherwise, it will send the control message again and start a relay timer again.

THE TEST

In this section, we do some experiments to test the AgentSocket's performance and compare it with that of the Java Socket. The test is done on the 100 M Ethernet. The criterion is mainly the delay and the throughput.

Open/Close a Connection

An opening/closing connection delay is tested in the first experiment. There is a start/stop security check option in opening connection. The connection of the AgentSocket is opened and closed 100 times and then the average delay is computed. The result is shown in Table . In order to compare it with that of the Java Socket, we also test the opening/closing connection delay of the Java Socket.

TABLE 2 Open/Close a Connection Delay

Opening a connection includes a series of operations such as validating, granting, exchanging key, shaking hands, and establishing the socket. The detail analysis of the opening connection delay is shown in Figure .

FIGURE 4 Detail Analysis of the Opening Connection. JS, JavaSocket; AS(prohibit), no security check; AS(permit), a security check for the AgentSocket.

FIGURE 4 Detail Analysis of the Opening Connection. JS, JavaSocket; AS(prohibit), no security check; AS(permit), a security check for the AgentSocket.

From Table , it can be found that the time to open a connection with migration and security check is nearly 40 times longer than that of a Java socket. From the Figure , it can be found that 80% of the time is spent on validating, granting, and exchanging key. Hence there is some delay in opening the connection of the AgentSocket. But it can also be found that opening the connection of the AgentSocket is only one time. Once the connection is opened, it is kept all along in the life cycle of the mobile agent, that is, the cost of opening the connection of the AgentSocket is counteracted in the mobile agent migration.

Suspend/Resume a Connection

It is also found that the suspending/resuming connection delay is, respectively, 27.8 ms and 16.9 ms. The delay is mainly spent for exchanging the control messages. As in suspending a connection, it is necessary to check if there is some data in the input stream which is not transmitted, and in resuming, it is necessary to open a socket and get the input/output stream.

By comparing, we can find that suspending/resuming a connection delay is much shorter than that of opening/closing a connection ((27.8 + 16.9)/(134.4 + 12.6) ≈ 0.3). Much time can be saved when an agent is traveling on the network.

In summary, these two operations bring some delay. But as they can provide a continuous connection, the time delay is reasonable and is acceptable.

Throughput

The throughput of the AgentSocket is tested in the second experiment. The experiment is supported by the TTCP[1] (Test TCP). The TTCP is a program that can test the TCP throughput by using the IP route. We test the throughput of both the AgentSocket and the Java Socket. We can get the throughput in different conditions in which the number and the size of the message package are different.

The result is shown in Figure . From the figure, we can see that the throughput of the AgentSocket is less than that of the JavaSocket, but the disparity of the throughput is very little—less than 5%. The main cause of the disparity is synchronously accessing to the input stream and the output stream. With the message package becoming larger and larger, the throughput disparity between the AgentSocket and the JavaSocket is smaller and smaller and can be ignored.

FIGURE 5 The comparison between the JavaSocket and the AgentSocket.

FIGURE 5 The comparison between the JavaSocket and the AgentSocket.

CONCLUSION AND FUTURE WORK

The asynchronous communication is not suitable for some applications in which mobile agents need to closely cooperate with each other. A transitory synchronous communication provides a complementary service that can effectively work among mobile agents. In this article, the connecting migration, mechanism is presented. In this mechanism, two mobile agents can migrate, respectively, in uninterrupted communication. It ensures that the messages can be accurately transmitted between mobile agents. In this mechanism, the agent-oriented access control and the key are used to solve the security problems. This mechanism has been used in a mobile agent system – VPNAgent System [1] to verify the reasonability of the mechanism.

Now we can only realize the connecting migration mechanism when a client agent or a server agent migrates but not both. Future work will explore the connecting migration mechanism when both the client agent and the server agent migrate.

Supported by the Postdoctoral Best-Choose Fund (ID 200602005) and the Natural Science Fund (ID Y0227G18) of ShanDong Province, and the National Natural Science Fund (ID 60573169).

REFERENCES

  • Hu , B. F. and H. Wang . 2005 . The Virtual Private Network system based on mobile agents . Computer Application 1756 – 1759 .
  • Perkins , C. E. 2002 . IP mobility support . Request For Comments 6 – 10 .
  • Solomon , J. D. 1998 . Mobile IP: The Internet Unplugged . Prentice Hall , 1 – 10 .

Reprints and Corporate Permissions

Please note: Selecting permissions does not provide access to the full text of the article, please see our help page How do I view content?

To request a reprint or corporate permissions for this article, please click on the relevant link below:

Academic Permissions

Please note: Selecting permissions does not provide access to the full text of the article, please see our help page How do I view content?

Obtain permissions instantly via Rightslink by clicking on the button below:

If you are unable to obtain permissions via Rightslink, please complete and submit this Permissions form. For more information, please visit our Permissions help page.