## 4 Experimental Implementation and Performance Evaluation
### Performance Analysis with CCR set at 8 Hz  
The overall network energy consumption (in logarithmic scale for the sake of visualization clarity) during the three different phases of the proposed discovery mechanism is shown in Figure 4. As expected, the highest energy consumption is due to the RD/SD activity (phase SCR-RES): this corresponds, as previously introduced, to a confirmable CoAP request to the /.well-known/core resource of the LEN. As shown in Figure 5, EN-SCR-RES is a quadratically increasing function of the number of nodes in the network (i.e., the network depth with a linear topology). This is because the number of packets/fragments is a quadratically increasing function of the number of traversed nodes. In Figure 5, it is also shown how the energy consumption distributes at different nodes: blue bars are associated with the BR's energy consumption, whereas yellow ones are associated with the overall energy consumption of CoAP nodes. From the results in Figure 4, it can be concluded that the Join phase is, from an energetic point of view, the least demanding task. In fact, this energy consumption turns out to be constant, i.e., it does not depend on the number of nodes \(N\). This is expected, as the consumed energy depends only on a LEN and its parent. In Figure 6, the energy consumed during the DAO-EBR phase (i.e., the metric EN-DAO-EBR) is shown as a function of the number of nodes \(N\), highlighting the energy partitioning among BR and CoAP nodes. It can be observed that EN-DAO-EBR is a linearly increasing function of \(N\). By comparing the numerical values of the energies in Figure 6 with those in Figure 5, it can be concluded that the energy consumption in the second phase is much lower than in the first one. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Metric** & **Description** & **Unit** \\ \hline T-Join & Joining Time: time needed by the LEN to receive information about the DODAG from its parent & (ms) \\ \hline EN-Join & Joining Energy: energy spent by the LEN and its parent during the joining phase & (ml) \\ \hline T-DAO-EBR & Time DAO-EBR: time interval between the generation instant of the DAO packet & (ms) \\ \hline EN-DAO-EBR & Energy DAO-EBR: overall energy spent by the network during the propagation & (ml) \\ \hline T-SCR-RES & Time SCR-RES: time needed for a RD/SD on the LEN originated by the BR & (s) \\ \hline EN-SCR-RES & Energy SCR-RES: overall energy spent by the network during a RD/SD from the LEN to the BR & (ml) \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Performance metrics. Another important performance metric is the time required by each phase of the discovery mechanism. In Figure 7, a comparison among these times during different phases is carried out. In particular, the times replicate the same behaviors of energies: the time required by the Join phase (metric T-Join) is constant with respect to the number of nodes; it grows linearly (metric T-DAO-EBR) and quadratically (metric T-SCR-RES) during the DAO-EBR (Figure 8) and SCR-RES (Figure 9) phases, respectively. Figure 4: Comparison among energies (log scale) spent by the overall network during different phases of the proposed discovery approach, with CCR set to 8 Hz. Figure 5: Energy spent by the overall network during the SCR-RES phase with CCR set to 8 Hz (metric EN-SCR-RES). Bars show the amount of energy spent by BR and nodes. Figure 6: Energy spent by the overall network during the DAO-EBR phase with CCR set to 8 Hz (metric EN-DAO-EBR). Bars show the amount of energy spent by BR and Nodes. As underlined above, the results shown in Figures 7-9 have been obtained deploying various numbers of nodes in networks with linear topologies. This kind of topologies allows to extract the distance (in terms of number of hops or node depth) between the BR and the LEN in a very simple way. In a network with a generic topology, the distance between BR and LEN may not be constant (as it depends on the position where the LEN attaches) and may change over time.