Constructing Locally Centralized Applications by Mobile Agents in Wireless Sensor Networks Shunichiro Suenaga
Shinichi Honiden
Nihon Unisys Ltd. / The Graduate University for Advanced Studies
The University of Tokyo / National Institute of Informatics
[email protected]
[email protected]
ABSTRACT In this paper, we propose a middleware which allows multiple simultaneous applications where each application operates central to some human or object. When multiple applications exist on the same WSN, the method of adding and deleting applications within the WSN is a significant concern. Existing works have problems managing the lifecycle of applications, hence they are not practical enough. Therefore, we introduce a solution to address this problem and construct locally centralized applications which satisfy system user requirements. There are two contributions in this paper: The first contribution is the proposal of a model of agent groups, the second is showing how the group can migrate around the WSN as a whole.
Categories and Subject Descriptors C.2.1 [Network communication
Architecture
and
Design]:
Wireless
General Terms Design, Performance, Experimentation
Keywords Wireless Sensor Networks, Mobile Agents, Reprogramming, Group of Agents
1. INTRODUCTION Wireless sensor networks (WSN) are progressing towards technical maturity and their widespread utilization will soon be a reality. WSNs consist of many nodes connected via an ad-hoc network and equipped with a various array of sensors: thermometers, photometers, magnetometers, etc. For an application to run on a WSN, the program must be installed on each node, and the nodes must exist in a particular physical location. WSNs are expected to be widely utilized for keeping track of the physical world, i.e. applications like monitoring the natural environment or object tracking [1]. Existing middleware for WSNs are not practical enough to run multiple business applications on the same WSN. For example, assume a WSN set up in a warehouse, where the system user wants to manage the status of each stored container to ensure they are in good preservation. In this environment, containers are delivered to the warehouse, get moved around the inside of the warehouse and are eventually shipped out of the warehouse. Therefore, applications monitoring the status of a container must
be dynamically added when the container arrives, move around with the container and be deleted when the container is shipped out. To overcome this problem, two general solutions to deploy and update software by radio wave have been introduced: network reprogramming [2] and mobile agent technology. However, each technology has problems that make them not practical in WSNs. Network reprogramming places undue stress on the battery nodes located near the base station. In the case of mobile agents, when the monitoring agent loses track of its container, the agent may never find the new location of the container in the warehouse. In this paper, we introduce a middleware that addresses the problems listed above and allows for the creation of practical applications in the assumed environment. We propose a model of a group of multiple agents, which together form what we call a “locally centralized application”. We also propose a group migration model which is suitable to WSNs. Section 2 discusses related work, while Sections 3 and 4 describe current problems and our approach. Section 5 and 6 show an implementation and evaluation of our approach. In Section 7 we enter into some discussion of the limitations and implications of our method and finish off with a discussion of possible directions for future work.
2. Related Work Deluge [3] and Mate [4] are representative works in network reprogramming. In Deluge, to update the programs located in the WSN nodes, each node occasionally advertises the most recent version of the program it has available to whatever nodes that can hear its local broadcast. In addition, Deluge allows programmers to update the program located in a specific node by specifying the identification number of that node. This updated program code is sent from the base station; hence, the batteries of the nodes deployed near the base station become strained when programmers frequently update their programs, because sending the updated program to the necessary nodes requires relaying messages back and forth with the base station. In addition, Deluge only allows for two programs to coexist on a node. Mate [4] allows for more lightweight agents, but does not actually resolve the problem of energy consumption being focused on nodes near the base station. Mobile agent technologies (Agilla [5], ActorNet [6], SensorWare [7]) allow agents to migrate within a WSN, enabling the update of a program on any node without consuming the energy of one specific node. In addition, multiple applications can be
constructed using mobile agents. However, there is one problem that makes mobile agents impractical. As an example, assume we have an agent (on one node) that monitors a specific container, if that container were to move out of the sensing range of the node the agent is on, it is difficult for the agent to know the new location of the container. In this situation, there are two general, naive approaches for the agent to figure out where the container is: random move/search and message passing. The former approach introduces a potentially significant number of migrations, causing undesirable levels of energy consumption as the agent searches blindly. The latter approach also has an energy problem when obtaining the new location, but, more than that, message passing using multi-hop communication in WSNs is not as reliable as that of wired networks (Figure 11). This problem may also be resolved by organizing a group of agents. However, this group must be able to migrate together, thus raising problems of group migration. Group migration of agents are not supported in Agilla , ActorNet and SensorWare, hence, a programmer must coordinate message passing between agents and synchronization their migration in the application logic. As a consequence, this approach introduces unreliable message passing and complex coding work. Hierarchical mobile agent groups and their migration are proposed in wired networks [8], [9]. These works assume a reliable, broadband network, and rely heavily on message passing to manage the group and its hierarchy. Thus these approaches are not applicable for WSNs.
report any undesirable conditions. The operator also employs an intruder tracking application, which detects humans without proper identification, to watch over the art container. This example requires that a specific service for each container must be available around the container, we call this kind of application a locally centralized application. Each container sometimes moves, hence the problem of network reprogramming described in Section 2 gets in the way of system operation. Therefore mobile agents are more suitable for this kind of environment than network reprogramming. However adoption of mobile agents is not practical enough because of the problems listed in Section 2. The requirements for agents to form a locally centralized application are A) Obtaining the location When the monitored object moves, agents must efficiently obtain the new location of the object. B)
Migration
Agents can migrate to the new location smoothly. C)
Sensing
Agents can sense the specified data around the object. D) Management of the lifecycle Agents must be added and deleted in accordance with the shipment and receipt of objects, hence agents must manage their own lifecycle.
4. Solution
Figure 1: Success rate of event notification by message passing
3. Example and Requirements As an example, we take a WSN in a single story warehouse. In this warehouse, the system user wants to manage the status of each stored container to ensure they are kept in good preservation. These containers are shipped from the warehouse, moved around inside the warehouse and delivered from external sources to the warehouse. We assume the mapping between location and identification of each container is managed by other location management systems (RFID, barcode). For example, take a container with a dozen bottles of expensive wine that the owner wants kept between 10 and 15 degrees. Another container has some paintings which must be kept safe. The system operator of the warehouse thus deploys a monitoring application which can obtain the average temperature around the wine container and 1
Figure 1 is the result evaluated in TOSSIM's [10] lossy model (10-feet) which makes it possible to carry out a simulation of the asymmetrical link between nodes and the packet loss in WSN.
We propose a group of agents to meet requirements A through D. The agent functionality and its relation to the requirements are described in Table 1. The management of the lifecycle is usually executed at base-station in existing works, however, message loss between the nodes and base-station can cause problems in largescale WSNs. Thus we introduce the Master agent to execute lifecycle management of the application in a WSN. Master then deploys other agents (Slaves) which form a part of the locally centralized application. In this example, Slave-S executes the sensing of the object and reports the sensed data to the Master. Deploying multiple Slave-Ss around Master allows programmers to obtain some statistical data (i.e. average, max, min). Slave-T is a light-weight agent with small code size that can move around easily, allowing it to track the object (searching for it in different locations) and enabling communication between Master and basestation. Table1: Agent
Group of agents Functionality
Rel.
Master
lifecycle management of agents, data aggregation, deployment of Slaves
D
Slave-S
sensing and reporting
C
Slave-T
object tracking, searching the location, communication between base-station and Master
A
Using a grouped architecture, however, forces us to resolve the problem of group migration in WSNs. Approaches that highly depend on message passing are not reliable in WSNs, because message passing is not always reliable. Hierarchical approaches proposed in wired networks are also not suitable for WSNs, because agents needs message passing to manage the group. We introduce a group migration model which is suitable for WSNs. The Master agent code includes the code of both of SlaveS and Slave-T, allowing Master to generate Slave-S and Slave-T at will. Figure 2 shows the overview of initialization, Master arrives at the new location, Slave-S and Slave-T are generated. Then, Master deploys four Slave-Ss and a Slave-T on surrounding nodes according to the deployment pattern2. After that, the Slave-Ss start sensing and report their results to Master. When a Slave-S can not obtain the object’s data, it notifies Master. Slave-T is dispatched by a Master on a mission to look for the new location of the object. Slave-T which has the result comes back on one of the surrounding nodes and reports it to Master. Master skills currently deployed slaves, migrates to the new location, and generates new slaves at the destination. The group can migrate with minimum message passing between agents in this fashion.
5. Implementation We extended Agilla to implement the functionalities described in Section 4. Figure 3 shows that the Instruction Set Handler covers the extended and basic Agilla functionalities. In the case a node receives a new agent from another node, GroupMgr interprets the agent’s ISA to judge whether it is a group or not. When it is a group, SlaveCodeMgr generates the codes of Slave-S and Slave-T and stores them into the SlaveCode store. After that, GroupMgr sends Slave-S and Slave-T to the nodes according to the deployment pattern. The relationship between Master and SlaveS,T are simultaneously recorded in the Mapping Table. The identification of agents and the location of nodes managed in the Mapping Table are used when communication is carried out between Master and Slave-S,T. Communication is done via the distributed tuple space implemented in Agilla.
Figure 3: Architecture
6. Evaluation We use TOSSIM’s lossy model (10-feet) in a preliminary evaluation of the success rate of group migration with our method. Communication between nodes was performed by simple greedy forwarding, using geographic routing as the routing protocol. Moreover, only adjoining nodes and nodes adjoining each other can communicate. For reasons of simplicity, Master only contains Slave-S in this experiment. Figure 4 shows the success rate between group migration and Slave-S deployment (averaged over 20 runs).
Figure 4: Success rate of group migration and slave deployment
Figure 4 shows that our approach can assure a 70% success rate even if the agent travels 9hops during migration. We have yet to compare this result with base Agilla and see that as necessary future work. Agilla does not support group migration, which introduces two drawbacks; the first is message passing dependent, the second is complexity of code. Table 2 shows the code complexity of both approaches, a message passing dependent approach makes the code complex. Therefore, using the results of Figure 4 to simply say that our method is viable, we believe the other qualitative properties make our approach better than of Agilla. Figure 2: Master-Slave Migration Model
2
Locations where Slaves-S and Slave-T are specified in this deployment pattern.
With that said, we are planning a full evaluation consisting of -
Comparing energy consumption with reprogramming (compared with Deluge)
-
Reliability and the number of messages of group migration (compared with Agilla)
-
Feasibility check of the group architecture through implementation of a prototype application. Energy consumption and success rate when obtaining new location of a moving object
Table 2: Agent
Code Size Agent-A
Agent-B
Agilla
79
62
This Approach
102
23
(Master)
(Slave-S)
7. Discussion We proposed an approach to migrate groups of agents, in which Master has all code of Master and Slave-S,T. This approach seems to have a limitation that Slave-S and Slave-T can not maintain executing state (pc, state, etc.) during migration. However, the sensing and tracking modules do not have complex state and hence this limitation is not critical. Yet, adaptation of this model can sometimes cause orphans (i.e. slaves who have no master). The middleware resolves this by helping slaves commit suicide when they can find no master. Hence, our model can be said to be a Master-driven model. The deployment pattern is one of the most important factors to organize locally centralized applications. We give some static deployment pattern for the middleware and assume Slave-S are stationary agents. To make more adaptive applications and cover wider requirements, we will add some freedom and adaptability for Slave-S. The full quantitative evaluation, proto-type implementation of application and deployment pattern are future work.
8. Conclusion We introduce a practical approach to realize multiple applications which require agent introduction and deletion from a WSN. Our method is central around the idea of grouped agents and group migration suitable for WSNs, which enable us to realize locally centralized applications. We have just finished implementation and started our evaluation.
9. REFERENCES [1] M. Kuorilehto, M. Hannikainen and T. D. Hamalainen:“A survey of application distribution in wireless sensor networks”, EURASIP J. Wirel. Commun. Netw., 5, 5, pp. 774–788 (2005).
[2] J. Jeong, S. Kim and A. Broad.: “Network reprogramming”. http://www.tinyos.net/tinyos1.x/doc/NetworkReprogramming.pdf. [3] J. W. Hui and D. Culler: “The dynamic behavior of a data dissemination protocol for network programming at scale”, SenSys ’04: Proceedings of the 2nd international conference on Embedded networked sensor systems, New York, NY, USA, ACM Press, pp.81– 94 (2004). [4] P. Levis and D. Culler: “Mate: a tiny virtual machine for sensor networks”, ASPLOS-X: Proceedings of the 10th international conference on Architectural support for programming languages and operating systems, New York, NY, USA, ACM Press, pp. 85– 95 (2002). [5] C.-L. Fok, G.-C. Roman and C. Lu: “Rapid development and flexible deployment of adaptive wireless sensor network applications”, ICDCS ’05: Proceedings of the 25th IEEE International Conference on Distributed Computing Systems (ICDCS’05), Washington, DC, USA, IEEE Computer Society, pp. 653– 662 (2005). [6] Y. Kwon, S. Sundresh, K. Mechitov and G. Agha:“Actornet: an actor platform for wireless sensor networks”, AAMAS ’06: Proceedings of the fifth international joint conference on Autonomous agents and multiagent systems, New York, NY, USA, ACM Press, pp. 1297– 1300 (2006). [7] A. Boulis, C.-C. Han and M. B. Srivastava: “Design and implementation of a framework for efficient and programmable sensor networks”, MobiSys ’03: Proceedings of the 1st international conference on Mobile systems, applications and services, New York, NY, USA, ACM Press, pp. 187– 200 (2003) [8] I. Satoh: “Mobilespaces: A framework for building adaptive distributed applications using a hierarchical mobile agent system”, ICDCS ’00: Proceedings of the The 20th International Conference on Distributed Computing Systems ( ICDCS 2000), Washington, DC, USA, IEEE Computer Society, p. 161 (2000). [9] F. Ishikawa, N. Yoshioka, Y. Tahara and S. Honiden: “Mobile and cooperative compounds of multimedia services”, scc, 1, pp. 129– 138 (2005). [10] P. Levis, N. Lee, M. Welsh, and D. Culler. Tossim: accurate and scalable simulation of entire tinyos applications. In SenSys '03: Proceedings of the 1st international conference on Embedded networked sensor systems, pages 126_137, New York, NY, USA,2003. ACM Press.