## 2 Background--Related Work
### Overlay Networking in WSNs and DHTs  
Autonomic functionalities in sensor networks may be facilitated by the creation of virtual overlay topologies [41]. The creation of p2p overlay topologies was proposed in order to treat the underlying heterogeneous WSNs as a single unified network, in which interacting sensors can exchange information (store and retrieve data) without considering the details of the infrastructure underneath. P2p protocols are selected since they rely on decentralized algorithms, such as Distributed Hash Tables (DHTs). P2p overlays over (traditional) sensor networks eliminate the need for centralized proxies and provide easy publication and search for the sensed data [4]. They provide efficient data lookup, guarantees on lookup times and location independence. The overhead of building applications is distributed amongst participating nodes with no central point of failures and without global broadcasts [10, 42, 43].  
Several approaches have been proposed for p2p overlay networking in sensor networks. In [44], a DHT-based service discovery protocol that constructs topology- aware overlay networks in large-scale WSNs is proposed. In [4], a Chord-based P2P protocol, called Tiered Chord (TChord) that can seamlessly integrate sensor networks with IP networks is described in detail. In [45], CSN, a novel DHT based network protocol for sensor networks is proposed where bounded times for data lookup -in the order of O(logN) messages- may be achieved in an energy efficient manner. CSN follows a hierarchical clustering approach where each cluster is formed in a logical ring. CSN makes system lifetime of the sensor network proportional to its effective use and scales well to large-scale sensor networks.  
However, a generic mapping of DHT based protocols to sensor networks is considered challenging for various reasons [45]. These protocols interconnect nodes independently of their physical location and are not able to handle dynamic changes in the sensor network topology. In addition, they prerequisite the maintenance of routing information among all nodes and require unique identifiers for each node. Most of these challenges may be addressed given the existence of an overlay topology formulation and maintenance mechanism and its cooperation with the existing routing and clustering mechanisms.  
Several algorithms have been proposed for overlay topology formulation and maintenance that range from gossiping techniques [46] to exhaustive techniques [47]. The common characteristic of these mechanisms is that they presume guaranteed communication among the network nodes. However their principles are diverse. Gossiping techniques attempt to identify the relative position of one node in the overlay topology by consulting adjacent nodes. Alternatively, exhaustive techniques attempt to pass through all nodes periodically in order to identify their relative position in the overlay topology. The topology formulation mechanism has to cooperate with the routing protocol due to the mentioned requisite that any two nodes be able to communicate.  
In our approach, as described in detail in Section 4, we propose the exploitation of routing information that is maintained by NEURON via the overlay topology formulation mechanism. In NEURON, routing information is updated continuously in each node's routing cache and may be consulted from upper layer mechanisms. Given the existence and maintenance of the overlay network, DHT functionality may be applied--using the 6 LowPAN address of each sensor as its unique identifier--and advanced services may be provided in an autonomous manner.