## 6 Simulation-Based Implementation, Experimental Results and Discussion
### Impact of an Increasing Number of Malicious Nodes  
Attacks on the network layer strongly impact the data routing performance. By considering an increasing number of non-self nodes in a WSN, the effect of such attacks is studied in this section. In the simulation, 49 nodes were arranged in a region of 80 m \(\times\) 80 m, similar to the topology used by [PERSON] and [PERSON] [PERSON] and [PERSON] (2016). The packet rate was fixed at 9.6 packets/s, and the number of malicious nodes was varied from 4 to 20. The worst-case scenario with 20 malicious nodes is illustrated in Figure 7.  
\begin{table}
\begin{tabular}{l l} \hline \hline Low-rate WPAN & IEEE 802.15.4 \\ Physical type & Phy/WirelessPhy/802\_15\_4 \\ MAC type & Mac/802\_15\_4 \\ Propagation model & Shadowing \\ Acknowledgment & Yes \\ Operation mode & Unslotted Non Beacon \\ Frequency & 2.4 GHz \\ Initial energy & 3.3 J \\ Power transmission & 1 mW \\ CSThresh\_ & 1.10765 \(\times\) 10\({}^{-11}\) Hz \\ RXThresh\_ & 1.10765 \(\times\) 10\({}^{-11}\) Hz \\ Traffic utilized & Constant Bit Rate (CBR) with Packet Size 70 bytes \\ Transport layer & User Datagram Protocol (UDP) \\ Simulation duration & 100 s \\ \hline \hline \end{tabular}
\end{table}
Table 3: Network parameters used to simulate the security mechanism.  
The performance of E-BIOSARP in terms of data throughput was reasonably maintained, even as the number of malicious nodes increased. E-BIOSARP treats malicious nodes as the hole problem [44]. The hole problem occurs when the nodes in a certain region cannot forward data packets toward their destination. Table 4 shows that as soon as the number of malicious nodes reaches 20, the delivery ratio declines because of communication disruption between the sink and nodes 43, 31 and 37, which are generating the data packets, as demonstrated in Figure 7. At the same time, the energy consumption increases because the transmitting nodes must use considerable power to transmit bits over large distances, as shown in Table 4.  
In Table 5, the detection rate and accuracy of E-BIOSARP and SRTLD are compared for the same scenario, as described earlier in this section and shown in Figure 7. The detection rate is defined as the number of illegitimate packets that are detected by the security mechanism at all self-nodes divided by the total number of illegitimate packets received, and this quantity, expressed as a percentage, is the detection accuracy. The detection rate and accuracy are measured as follows:  
\[\text{Detection rate is X}/(\text{X}\,+\,\text{Y}),\text{ and Accuracy is }(\text{X}/(\text{X}\,+\,\text{Y}))\times 100\%\]  
where:  
X is the number of illegitimate packets detected and dropped at all nodes andY is the number of illegitimate packets that are received from adversary nodes and are not detected.  
\begin{table}
\begin{tabular}{c c c} \hline
**Adversary Nodes** & **Delivery Ratio** & **Energy per Packet (J/Packet)** \\ \hline
4 & 0.5322 & 0.0893563 \\
8 & 0.4963 & 0.089909 \\
12 & 0.54358 & 0.14805 \\
16 & 0.5163 & 0.0891 \\
20 & 0.251497 & 0.26612 \\ \hline \end{tabular}
\end{table}
Table 4: Influence of malicious nodes on network performance.  
Figure 7: Worst-case scenario with 20 malicious nodes, as indicated in red.