Fault Tolerance in Spatial Query Processing for Wireless Sensor Networks* Rone Il´ ıdio da Silva ∗¶ , Daniel Fernandes Macedo ¶ and Jos´ e Marcos Silva Nogueira ¶ ∗ Universidade Federal de S˜ ao Jo˜ ao del-Rei Campus Alto Paraopeba, Ouro Branco-MG, Brazil Email: rone@ufsj.edu.br ¶ Universidade Federal de Minas Gerais Belo Horizonte-MG, Brazil Email: damacedo,jmarcos@dcc.ufmg.br Abstract—Several applications of Wireless Sensor Networks (WSN) demand information only from sub-regions of the mon- itored area. The user establishes the region of interest (RoI) and requires the WSN to collect data only inside this region. This kind of query is called spatial query. The state of the art of spatial query processing considers, in general, that nodes do not fail. However, nodes can be destroyed, interference can deny the communication and nodes can go to sleep mode (turn off the radio in duty cycles) in order to save energy. This work proposes a fault-tolerant energy efficient in-network spatial query processing mechanism for WSN. The proposed mechanism employs failure detection algorithms in order to avoid failed neighbors when forwarding and processing spatial queries. Our contributions are lightweight and resilient because they operate on demand and avoid the use of routing tables. I. I NTRODUCTION The literature presents several works that model WSN as a distributed database and define energy-aware mechanisms for in-network query processing, such as TinyDB [1] and Cougar [2]. These mechanisms use location information to answer a special type of query, called spatial query. In these queries the users’ interests are expressed by geographical predicates. An example of spatial queries is “collect the average temperature inside the region defined by the user”. Failures are much more frequent in WSN than in classic wireless networks due to the harsh and highly dynamic environment. Hence, spatial query processing algorithms should be fault tolerant. Most existing algorithms, however, do not employ techniques to overcome link and node failures. This work fits in the autonomic network domain, more specifically in the “fault” functional area of FCAPS (Fault, Configuration, Accounting, Performance, Security). The main contribution of the paper is the proposition of an energy efficient fault-tolerant mechanism for in-network spatial query processing in WSN. Query dissemination avoids failed nodes by requesting candidates to forward the query, thus considering only the nodes that responded to the request. This strategy *The authors would like to thank CNPq, CAPES and FAPEMIG for their financial support in this work. increases the robustness and energy efficiency of the mech- anism, since there is no need of node monitoring for failure detection. The proposed mechanism is composed of three new algorithms. The first is a fault tolerant geographic routing protocol to forward queries to the region of interest (RoI). We also propose two failure resilient algorithms to disseminate queries within the RoI, collect environmental data and aggre- gate them. The proposal is evaluated by simulation against the state of the art of spatial query processing mechanisms. Results show that the proposed mechanism presents acceptable performance even in networks with a very high percentage of nodes experiencing transient and permanent failures. The remaining of this paper is organized as follows. Section II describes in-network query processing, dividing it in six stages. Section 3 presents a review of the literature of fault tolerance and spatial query processing in WSN. Section 4 and 5 describe the proposed algorithms used by the mechanism. Section 6 presents the performance studies and analysis. Finally, Section 7 presents the conclusions. II. I N- NETWORK SPATIAL QUERY PROCESSING There are two types of spatial queries in WSN: window and KNN. In window queries, the user defines the RoI inside the area monitored by a WSN and nodes inside this region collect environmental data [3]. Another type of query is called KNN (K Nearest Neighbor). The user defines a point inside the monitored area (called query point) and the value of K. The data is collected by the K nodes closest to the query point [4]. In this work we focus on window query processing. Spatial query processing can be divided into six stages [3], as illustrated by Figure 1. The user, represented by the computer, defines the RoI. The Pre-Processing stage is performed in the user’s computer. It prepares queries to be sent to the WSN. The first sensor node to receive the query is named Originator. In the Forwarding stage, the query is forwarded from the Originator to a node within the RoI. This last node in the Forwarding stage is called Coordinator. In the Dissemination stage, the query is disseminated from the Coordinator to all nodes inside the region of interest. These nodes sense environmental data in the Sensing stage and send 978-1-4673-0269-2/12/$31.00 c 2012 IEEE 97