# A Novel Routing Scheme for Creating Opportunistic Context-Virtual Networks in IoT Scenarios +
## 7 Performance Evaluation
### Experimental Results
#### 7.3.1 Evaluation of the Smart Office Scenario  
The first analysis we propose is to compare the outcomes of several network metrics when applying the proposed algorithms to the smart office scenario described in Section 7.1.1. As introduced in Section 7.1, we assumed a variation of \(\omega=\{1,\,30,\,60,\,90,\,1800,\,3600,\,14,400\}\) s to analyze the impact of the frequency of message generation on the network performance. Therefore, a total of \(|RA|*|\omega|\) simulations have been run varying the components of pairs of type \(E=\{RA,\omega\}\); where \(RA=\{SACAR-IR,SACAR-OCVN,SACAR-HC,SACAR-Hybrid,DDR,ER,MPR,PR,SWR,GSaR\}\) is the set of different routing algorithms. Moreover, four network metrics were examined in each simulation: (i) average delivery probability; (ii) overhead ratio; (iii) average latency; and (iv) average number of hops to reach the destination. In the following, the definition of each metric is provided. Let us define the number of messages that are created by node \(i\) and sent towards node \(j\) as \(c_{ij}\). Moreover, the number of delivered messages to node \(j\) starting from node \(i\) is given by \(d_{i,j}\). The average delivery probability \(d_{\text{prob}}\) in the network is given by Equation (2):  
\[d_{\text{prob}}=\frac{\sum_{i\in\mathcal{D}}\frac{d_{i,j}}{c_{ij}}}{|\mathcal{D }|},\forall i,j\in\mathcal{D} \tag{2}\]  
In order to determine the performance of a routing algorithm in terms of number of relayed messages, i.e., the number of times each message is received by an intermediate node and relayed to another node in its path towards the destination, the overhead ratio \(\theta\) defined by Equation (3) is considered:  
\[\theta=\frac{\sum_{i\in\mathcal{D}}\frac{r_{i,j}-d_{i,j}}{d_{i,j}}}{|\mathcal{D }|},\forall i,j\in\mathcal{D} \tag{3}\]  
where \(r_{i,j}\) represents the number of relayed messages during the process of sending a message from node \(i\) to node \(j\). Finally, the average latency, \(\tau\), and the average number of hops, \(\gamma\), were also considered in the performance analysis to evaluate the effectiveness of each algorithm in terms of response time. Once the different network metrics have been defined, we focus on analyzing them in the case of the smart office scenario. As previously introduced, the delivery probability \(d_{\text{prob}}\) evaluates the likelihood of a message to reach its destination. Since all the nodes in the scenario are able to send messages toward the rest of nodes, Figure 8 reports the values obtained for \(d_{\text{prob}}\) as a function of \(\omega\). By inspecting Figure 8, several considerations emerge. At first, it can be seen that SACAR-IR presents a 100% delivery probability regardless of the frequency of message generation. The explanation of this situation is that the logic of this algorithm is different in nature compared to the rest of the evaluated algorithms. In SACAR-IR, a source node will only send a message to a destination node that (i) is located within its action range and (ii) has the same interests (goals/skills matching). Since this solution [13] highly restricts the set of potential destinations, each created message will definitely reach its destination, with a resulting average delivery probability of \(d_{\text{prob}}=100\%\). Regarding both the rest of SACAR versions and the benchmark solutions, it is necessary to remark that all of them exploit the store-carry-and-forward technique on packet forwarding. In these cases, source and destination nodes are not required to be within the same range, allowing intermediate nodes to receive a packet, temporarily store it, and forward it to a node that will (potentially) be met along the path.