Introducing Agent Evictions to Improve Application Placement in Wireless Distributed Systems Nikos Tziritas 1,6 , Petros Lampsas 2,6 , Spyros Lalis 3,6 , Thanasis Loukopoulos 2 , Samee Ullah Khan 1,4 , Cheng-Zhong Xu 1,5 1 Shenzhen Institutes of Advanced Technology, Chinese Academy of Sciences, Shenzhen, 518067, China {nikolaos, cz.xu}@siat.ac.cn 2 Dept. of Informatics and Computer Technology, Technological Educational Institute of Lamia, Lamia, Greece {plam, luke}@teilam.gr 3 Computer and Communication Engineering Dept., University of Thessaly, Volos, Greece lalis@inf.uth.gr 4 Department of Electrical and Computer Engineering, North Dakota State University, Fargo, ND 58108-6050, USA samee.khan@ndsu.edu 5 Department of Electrical and Computer Engineering, Wayne State University, Detroit, MI, 48202, USA czxu@wayne.edu 6 Center for Research and Technology, Institute of Thessaly, Volos, Greece Abstract—With the development of mobile code frameworks for embedded systems, an application can be structured as a set of cooperating components (agents) that are placed on the nodes of the system in a flexible way. Reducing the network traffic caused by the application components is a crucial issue for the increase in the lifetime of wireless embedded systems, since it is widely known that the communication cost plays the most significant role in the energy consumption of embedded devices. To this end, most placement algorithms place or move an agent towards the center of gravity of the communication workload. However, if the target node does not have enough capacity, the attempt is usually aborted. In this paper, we introduce eviction-enabled algorithms that allow nodes to free capacity by forcing a locally hosted agent to move to another node, even at a loss, to accept a new and potentially more beneficial agent. To the best of our knowledge, this is the first time that agents are evicted by local hosts to enable beneficial agent migrations and eventually improve the total network cost. In this paper, we provide algorithms tackling the aforementioned problem in a fully distributed manner. We also present and discuss the results of extensive simulations, showing that eviction-enabled algorithms can outperform their counterparts by up to 300%. Keywords - distributed systems; placement algorithms; mobile agents; wireless sensor networks I. INTRODUCTION Mobile code technologies for embedded systems, like Agilla [1], SmartMessages [3], MagnetOS [8], DFuse [7] and POBICOS [12], allow the programmer to structure an application as a set of mobile components (also referred to as agents) that can be placed on different nodes of a wireless sensor and actuator network. From a system perspective, one of the key challenges is to optimize the placement of the application taking into account the communication between the components to minimize the load of the wireless network. Given that wireless communication typically consumes (far) more energy than local processing, reducing the network load is especially important on battery-powered nodes because of the increase in the lifetime of nodes. To reduce the amount of traffic between nodes, placement algorithms usually try to move a component (agent) towards the center of gravity of the communication load ([7], [8], [15]). In most cases, it is assumed that nodes have abundant hosting capacity, thus algorithms either do not take into account aforementioned constraints or simply abort the placement if the target node does not have enough capacity. However, this may lead to a bad placement of the application components (in terms of the traffic generated over the wireless network), even though a better placement is feasible. In this paper, we address the problem by introducing so- called eviction-enabled algorithms, that consider migrations that are not beneficial on their own, but free space is used to enable additional (beneficial) migrations. Of course, the ultimate goal is to reduce the network load, so the total benefit of the migrations must be greater than the cost of the non- beneficial ones, leading in that way to an overall better placement. Our contributions boil down to the following: (a) we prove that the agent migration problem is NP-hard in the case of