## 6 Simulation-Based Implementation, Experimental Results and Discussion
### Processing Time Comparison  
In Section 5, we analyzed the performance of the security schemes in terms of the processing time required to perform cryptographic operations. The simplest way to monitor this metric is to record the system times immediately before and after the execution of the security mechanism. The problem with this approach is that the system clock in a sensor is not precise. To address this issue, we used the clock of the host PC (_i.e._, the sink node) and measured another metric equivalent to the processing time, called the security processing time per hop. This metric is defined by [PERSON] _et al._[45] as follows:  
\[\Delta T_{1}=T_{end}^{sec}-T_{start}^{sec}\]  
\[\Delta T_{2}=T_{end}-T_{start}\]  
where:  
\(T_{end}^{sec}\): time of packet dispatch from the sending node with the security scheme.  
\(T_{start}^{sec}\): time of packet reception at the receiving node with the security scheme.  
\(T_{start}\): time of packet dispatch from the sending node without the security scheme.  
\(T_{end}\): time of packet reception at the receiving node without the security scheme.  
Thus, the time period required for the operating system to execute the security scheme on a node (_i.e._, the security processing time per hop) is given by the following:  
\[\Delta T_{\text{sec}}=\Delta T_{1}-\Delta T_{2}\]  
The processing time is a very important parameter in the routing protocol because it affects the overall performance of the network in terms of data throughput and battery power consumption. In [26], the authors showed that compared with LBRS-Auth, TinySec-Auth, EBSS, TinyHash, and TinySec-AE, SRTLD requires the least processing time.  
The network topology was configured as in [26] to acquire ns-2-based simulation results. Figure 8 shows the times for the transfer of an encrypted data packet; the transfer time for data packet 4747 was 9.9701 ms, and similarly, from Figure 9, we calculate a transfer time without encryption of 5.17005 ms. The results were generated for both BIOSARP and E-BIOSARP as shown in Figures 8 and 9. Moreover, 100 samples were acquired from different parts of both the result files (approximately 140,000 lines) to calculate the average time difference (_i.e._, the average time added by the encryption mechanism).  
In Figure 10, the processing time values used for TinyHash, TinySec-AE, TinySec-Auth, EBSS, and LBRS-Auth were obtained from [PERSON] and [PERSON] [26]. The experimental results confirm the rankings obtained in Section 5. Although LBRS-Auth and EBSS were found to incur the same processing time in the previous analysis, EBSS was superior to LBRS-Auth in the experiments because EBSS uses a smaller data payload size than that of LBRS-Auth. Furthermore, the results demonstrate that the average processing time per hop incurred by the E-BIOSARP encryption mechanism is less than that of SRTLD although they have the same complexity level, as described in Section 5.  
The shorter processing time per hop of E-BIOSARP is primarily attributable to the efficiency, reduced complexity and better performance provided by the enhanced ACO-based routing algorithm that assists in the cost-effective encryption process. The proposed mechanism is also beneficial for network-based applications that require long durations for the transfer of data packets from a source to a destination, _i.e._, in which the route contains numerous hops. In Section 5, we assumed that the routing functionalities, such as packet processing, packet buffering, channel access contention, and packet transfer, take the same time for all nodes and for all types of implementation (_i.e._, with and without a security scheme). This assumption does not hold when measuring \(\Delta T_{\text{sec}}\). The routing decision scheme adopted by E-BIOSARP, which is based on end-to-end delay and link quality, reduces packet transfer time and further reduces the security processing time per hop.