# A Novel Routing Scheme for Creating Opportunistic Context-Virtual Networks in IoT Scenarios +
## 6 Resource Consumption Analysis  
Energy and data consumption are two important characteristics driving the success or failure of any deployment [35]. In fact, some of the authors of this paper proposed a conceptual framework to analyze during the early development stages the resource consumption of mobile devices [36]. When selecting a network architecture, it is also necessary to take into account the node's resource consumption.  
Applying the defined conceptual framework [36] to the OCVN virtual network and the SACAR algorithms, we can identify the resource consumption of each version and when each specific algorithm reduces or preserves the energy consumption. Please note that only the results of applying the conceptual framework are detailed in this section in order to improve its readability and comprehension. The resource consumption of a specific node highly depends on the following operations:* Receiving a message (_get(size)_).
* Storing a message until it is forwarded to other nodes (_store(size)_).
* Posting or forwarding the message (_post(size)_).  
The consumption of each specific operation highly depends on the size of the message. This size is the contextual information that should be exchanged among nodes, and it is subordinated to the specific domain and case study to which this concept is applied. In order to evaluate the consumption, we assumed that this size was around 768 KB. However, any change in this size would be proportional to all algorithms, so that the consumption trends would remain. The specific consumption of each operation for different sizes can be seen in the conceptual framework.  
Concretely, the consumption of each node \(d_{i}\in\mathcal{D}\) also depends on the number of nodes with which it is in contact (\(c\)) at a specific moment (\(t\)) and the frequency of messages generation \(\omega\). Therefore, the consumption of each node can be calculated using the following equation (Equation (1)).  
\[d_{i}=(receive(size)+store(size))\cdot(\omega\cdot c_{t})+(post(size))\cdot( \omega\cdot c_{t+1}) \tag{1}\]  
Figure 4 shows the total battery and data traffic consumption per hour of the proposed algorithms for different frequencies of message generation. We assumed a variation of \(\omega=\{1,\) 30, 60, 90, 1800, 3600, 14,400\(\}\) s and that the total number of nodes was seven.  
As can be seen, both SACAR-HC and SACAR-Hybrid are the versions that consumed the most because they spread the message to a higher number of nodes. Obviously, SACAR-IR was the approach consuming the least since it does not implement the store-carry-and-forward technique; therefore, the received messages were not forwarded. Finally, SACAR-OCVN obtained very good results regarding resource consumption since the contextual information is forwarded, but the different nodes are not overloaded. Concretely, during one hour, this algorithm only consumed 586 \(\upmu\)AH, which is 0.02% of the battery capacity of a normal mobile device.  
Finally, Figure 5 shows the storage required to deploy the defined algorithms. Again, SACAR-HC and SACAR-Hybrid were the most voracious algorithms regarding storage requirements. SACAR-IR was the one that presented less stringent requirements, since the messages do not have to be stored. Finally, SACAR-OCVN was the most efficient one since the received messages are stored and forwarded, but it does not require large storage capacities. Concretely, it required 1914 KB per node to store the generated messages.  
Figure 4: Resource consumption of SACAR algorithms.