# Energy-Aware Security Adaptation for Low-Power IoT Applications
## 4 Dynamic Security and Energy Adaptation
### Analytical Evaluation in the Context of LoRaWAN
#### 5.2.2 Results and Analysis  
In Table 8, we present the results obtained for each of the tests performed, considering the energy impact of data transmission and security, as previously discussed. Each combination of scenario and initial configuration setup was analyzed to determine the battery percentage intervals where each security level would be suggested, presented in the fifth and sixth columns of Table 8. With this division, it was possible to calculate the different energy cost over time for the life of the battery and thus obtain the time of execution of each test. \begin{table}
\begin{tabular}{c c c c c c c c c c c c} \hline \hline \multirow{2}{*}{**Scenarios**} & \multicolumn{3}{c}{**Initial Settings**} & \multirow{2}{*}{**Initial Level**} & \multirow{2}{*}{**Range**} & \multirow{2}{*}{**Security**} & \multirow{2}{*}{**Energy Cost**} & \multirow{2}{*}{**Energy Cost**} & \multirow{2}{*}{**Total Number**} & \multirow{2}{*}{**Total Time**} & \multirow{2}{*}{**Converted Total Time**} \\  & **Preference** & **Threshold** & & & & & & & & & **(minutes)** \\ \cline{2-10}  & Not & Not & & & & & & & & & & & \\ \hline Fixed & Not & Not & & & & & & & & & & & \\ Security & Applicable & Applicable & & & & & & & & & & \\ \cline{2-10}  & & & & & & & & & & & & \\ \cline{2-10}  & & & & & & & & & & & & \\ \cline{2-10}  & & & & & & & & & & & & \\ \cline{2-10}  & & & & & & & & & & & & \\ \cline{2-10}  & & & & & & & & & & & & \\ \cline{2-10}  & Constant & attacks & & & & & & & & & & \\ \cline{2-10}  & with 80\% & & & & & & & & & & & \\ \cline{2-10}  & impact each & & & & & & & & & & & \\ \cline{2-10}  & & & & & & & & & & & & \\ \cline{2-10}  & & & & & & & & & & & & \\ \cline{2-10}  & & & & & & & & & & & & \\ \cline{2-10}  & & & & & & & & & & & & \\ \cline{2-10}  & & & & & & & & & & & & \\ \cline{2-10}  & & & & & & & & & & & & \\ \cline{2-10}  & & & & & & & & & & & & \\ \cline{2-10}  & & & & & & & & & & & & \\ \cline{2-10}  & & & & & & & & & & & & \\ \cline{2-10}  & & & & & & & & & & & & \\ \hline Without & & & & & & & & & & & & \\ \cline{2-10}  & & & & & & & & & & & & \\ \cline{2-10}  & & & & & & & & & & & & \\ \cline{2-10}  & & & & & & & & & & & & \\ \hline \multirow{2}{*}{
\begin{tabular}{c} Without \\ attacks \\ \end{tabular} } & \multirow{2}{*}{Indifferent} & \multirow{2}{*}{2} & \multirow{2}{*}{1} & \multirow{2}{*}{100-0\%} & \multirow{2}{*}{2} & \multirow{2}{*}{0.002} & \multirow{2}{*}{1,614,618} & \multirow{2}{*}{807,308} & \multirow{2}{*}{560.419 h} \\  & & & & & & & & & & & \\ \cline{2-10}  & & & & & & & & & & \\ \hline \hline \end{tabular}
\end{table} 
Table 8: Results for the analytical evaluation of the Controller in the context of LoRaWAN, * (number of cycles and total time for tests). Table 9 presents a comparison, in percentage value, between the values obtained in the tests made for the different scenarios and an environment in which the security scheme employed is fixed. The positive percentage values represent a gain in the lifetime of the sensor, and the negative values represent a loss in the execution time. It is possible to notice that only two tests out of six revealed negative percentage values, and in this situation, we may consider that the controller plays an important role in the dynamic adaptation of energy and security, in the context of a LoRaWAN infrastructure. This is because, on the one hand, the proposed architecture is very helpful in saving energy, in situations where the conditions of the network allow it, given the limited or no existence of external attacks. On the other hand, when the network is put to the test given the severity of the intrusion, this algorithm allows the infrastructure to achieve the necessary additional protection, something that would not be possible in a LoRaWAN network using a fixed security scheme. Observing the initial configurations and the scenario of the two tests, it is noticeable why these negative values were obtained, since in this case, we have a scenario with constant attacks and consequently with a high impact in data protection.