## 4 Experimental Implementation and Performance Evaluation  
### Implementation Details  
To demonstrate the applicability of the approach presented in Section 3, real application scenarios of interest refer to use cases in which the overall resulting 6 LoWPAN needs to be energy efficient and/or self-adapting. In particular, a first use case is a smart home scenario with battery-powered sensing nodes. This scenario may be characterized by different devices (e.g., fans, light bulbs, etc.) and resources (e.g., remote control, appliance status, etc.) that should be discovered without any human intervention, with, in principle, various possible topologies. Another interesting use case is a smart city lighting scenario, which can be inherently modeled as a tree, thus being characterized by large coverage areas (compared to the smart home scenario), device homogeneity (street lamps), and with the need for a human intervention in the presence of a faulty lamp. In particular, the possibility of avoiding a reconfiguration by the technician on each repaired lamp is an attractive feature of DiRPL. In fact, each new lamp is self-discovered by the BR managing the street lighting architecture, while faulty lamps can be removed from the resource directory after a fixed inactivity period. A third interesting use case is given by a smart city water consumption monitoring system, which can be composed by both (i) networks federating domestic users and (ii) urban networks. In the case of domestic users, due to the possibly large distance among houses, the water meter can be battery-powered (this being a constraint) or it may directly use water flow as power source (exploiting small actuators converting the flow into energy). In both these cases, the possibility to limit the energy consumption and to exploit self-discovery mechanisms in the presence of a water meter fault is a strict requirement. In the case of an urban monitoring network, the density of water meters could be higher than in the domestic use case, and the need to minimize technician interventions supports the adoption of a DODAG-oriented approach which exploits resource and service's self-discovery. Hence, the proposed mechanism is preferable with respect to systems in which a centralized admission control (for a particular area) is required. In fact, the latter requires a manual intervention in updating the system status in the presence  
Figure 2: Resource identification procedure embedded in the RPL discovery handshake. The numbers in the figure refer to the resource identification phases. of system changes, whereas DiRPL allows to automatically maintain the overall infrastructure status updated. Hence, these considerations motivate the applicability of the proposed mechanism to various practical scenarios. On the basis of these use cases, in order to test the behavior of the proposed discovery technique, being able to collect performance indicators prior to really deploy such scenarios in real world, a Contiki-based implementation has been developed, with performance evaluation carried out by simulating WisMote nodes [27] in the Cooja simulator [28]. In detail, WisMote devices are equipped with 16 KB RAM and, depending on the specific type of platform, with 128 KB, 192 KB or 256 KB ROM. All the experiments have been performed on an Ubuntu 12.04-based virtual machine, equipped with a 2.2 GHz Intel i7-3632 QM processor and with 4 GB RAM. Finally, the Contiki OS software stack (Contiki OS, uIPv6, RPL, and ContikiMAC) running on each node has been configured to fit memory constraints required by the adopted nodes. DiRPL has been tested on 6 LoWPANs composed by Contiki-enabled nodes and arranged in linear topologies, as shown in Figure 3 in an illustrative case with \(N=8\) nodes. Besides being representative of relevant use cases (e.g., smart lighting and water consumption monitoring), the choice of evaluating the performance of the proposed RPL-based RD/SD algorithm on linear topologies is due to the simulation implementation efficiency of this type of topologies.