## 4 Experimental Implementation and Performance Evaluation
### Implementation Details
Furthermore, linear topologies allow to reduce the simulation time of DiRPL without limiting the applicability to other topologies. We remark that the simulation time required to generate the results presented in this paper is approximately 240 hours. Moreover, regardless of the complete network topology, each multi-hop path (e.g., toward the BR) can be modeled as a linear \"subnetwork,\" making the obtained results applicable (as a theoretical performance benchmark) to a general case. In the following, topologies with various values of the number of nodes \(N\), from 1 to 12, have been considered. In particular, node \(n_{1}\) corresponds to the 6 LoWPAN Border Router (6 LBR), acting as root of the RPL DODAG and notifying the admission of new LENs in the RPL-based network. The other nodes represent resource owners exposed to external CoAP requests through CoAP servers built with the Erbium library [29]. For each performance evaluation campaign, the distance between consecutive nodes is selected so that packets are forced to follow a multi-hop path, in which the number of hops is equal to the number of LENs. This forces each constrained node to communicate only with its direct neighbors. The simulation-based investigation aims at evaluating the time and overall network energy consumption needed to perform an RD/SD campaign using the proposed RPL-oriented approach. All the results shown in the following have been obtained by performing 100 discovery runs for each configuration. The performance metrics are the time required and the energy consumed for: (i) joining the RPL DODAG; (ii) propagating a DAO message from the LEN up to the BR; and (iii) transmitting a CoAP request for RD/SD from the BR to the LEN. A brief description of the employed performance metrics is provided in Table 1.  
Figure 3: Network with linear topology (\(N=8\) nodes) modeled in the Cooja simulator. Being the proposed experimental analysis based on several simulation rounds, the energy consumption has been calculated as follows. The output logging messages provided by Cooja during simulation execution contain several informations. In particular, among the available data, there is the energy harvested in four different phases of the constrained device's life cycles: transmission phase--TX; reception phase--RX; processing phase--textttCPU; waiting phase--IDLE. These data are recorded every 125 ms and used to estimate the values of the performance metrics, as explained in the following. Our results could be compared with those obtained with a RD-oriented architecture similar to the one proposed in this work, as the one proposed in [12]. However, this is out of the scope of the proposed work and we leave it to future investigations. The performance results depend on the Channel Check Ratio (CCR), which corresponds to the rate (dimension: [Hz]) at which a node switches on the radio transceiver to check the activity over the channel. The higher the CCR, the finer the channel state monitoring, but the higher the energy wasted in useless channel checks. The value of the CCR should be properly optimized, taking into account the inherent trade-off between energy consumption and desired performance. Usually, small values of CCR are adopted in LLNs, with the default value set to 8 Hz. In our analysis, two different values are considered: 8 Hz and 16 Hz: the first value has been chosen because it is the default and mostly used one in Contiki-based networks; the second value has been selected to further validate the proposed DiRPL approach.