Towards Efficient Range Queries in Mobile Ad Hoc Networks using DHTs Thomas Zahn 1,2 zahn@inf.fu-berlin.de Georg Wittenburg 2 wittenbu@inf.fu-berlin.de Jochen Schiller 2 schiller@inf.fu-berlin.de INRIA 1 Rocquencourt, France Institute of Computer Science 2 Freie Universität Berlin ABSTRACT Recently, Distributed Hash Tables (DHT) explicitly designed for the use in MANETs have been proposed. Thus, many DHT-based distributed network applications from the domain of the Internet can be expected to be efficiently ported to MANETs. While the exact key lookups provided by such DHTs might be sufficient for many applications, range queries are often a desirable feature in wireless ad hoc networks (e.g. in sensor networks). However, the implementation of range queries using DHTs is a non-trivial task. In this paper we present a straight-forward implementation of Distributed Segment Trees as proposed in [4] on top of MADPastry [3] to provide DHT-based range queries for MANETs. The main goal of this work is to gain a first insight into the question whether DHT-based approaches for range queries are feasible in MANETs. First experimental results indicate that DHTs can indeed enable efficient range queries in MANETs. Categories and Subject Descriptors C.2.4 [Distributed Systems] General Terms Design, Algorithms, Experimentation Keywords DHTs, MANETs, range queries, Distributed Segment Trees 1. INTRODUCTION With the continuous proliferation of ever more powerful mobile devices, larger (> 50 nodes) mobile ad hoc networks (MANETs), in which nodes communicate with each other wirelessly and without any pre-existing, central infrastructure, are becoming realistic. Having such larger MANETs, it would certainly be interesting to implement distributed network applications as they are known from the Internet such as name services, messaging systems or storage systems for MANETs as well. In the domain of the Internet, a large number of those distributed network applications have been efficiently built on top of Distributed Hash Tables (DHTs, e.g. [2]). However, conventional DHTs have been designed primarily for the Internet and their dependency on reliable physical routing renders a direct deployment in MANETs unlikely to be successful (see e.g. [3]). For this reason, several systems have been most recently designed that provide DHT-like routing explicitly for MANETs (e.g. [1, 3]). With these DHT substrates, many of the aforementioned distributed network applications can be expected to be ported for the use in MANETs in a straight-forward way. The general concept of a DHT is to enable efficient key-based routing. For this purpose, both participating nodes and the objects stored in the network are assigned hash keys from the same key space by hashing, for example, a node's MAC address and an object's name. A packet is then routed by the DHT based on a key (e.g. the key of an object that is to be inserted into the network) until it is eventually delivered to the node that is responsible for the packet's key. A node responsible for a given key is typically defined as the node whose own hash key is numerically closest to the given key among all live nodes in the network. With their efficient key-based routing, DHTs represent a very suitable building block for numerous distributed applications. Nonetheless, DHTs exhibit a key weakness: they require exact key lookups. While this is sufficient for applications that, for example, store and retrieve resources under their names (or, more accurately, under the hash keys of their respective resource names), it is a non-trivial task to implement range queries – i.e. queries that return all values within a certain interval – with DHTs. In the case of a discrete query interval [a, b], the greedy approach using a DHT would be to generate the hash key for each value in [a, b] and issue a request for each such key (note that two succeeding values will hardly ever also have succeeding hash keys). Especially for larger query ranges, the traffic incurred by this greedy approach can easily outweigh that produced by a simple network-wide query broadcast. For non-discrete query intervals, the greedy approach would fail altogether. Range queries, however, are often a desirable feature in distributed applications. Consider, e.g., a MANET in which the nodes use a DHT to advertise the number of resources they are sharing. Participating nodes might be interested in finding those nodes that share at least 100 but no more than 1,000 resources. In the context of wireless ad hoc networks, another conceivable example are wireless sensor networks (WSNs). In a large WSN, the sensor nodes could use a DHT to publish their current sensor readings and an application might, for instance, be interested in all current temperature readings between 0°C and 30°C. Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. MobiShare’06, September 25, 2006, Los Angeles, California, USA Copyright 2006 ACM 1-59593-558- 4/06/0009...$5.00. To address this shortcoming, we present a DHT-based approach for range queries in MANETs that uses a Distributed Segment Tree as proposed in [4] on top of MADPastry [3], a locality-aware DHT substrate explicitly designed for MANETs. To the best of our knowledge, DHTs have not been previously used to enable