# Efficient Intrusion Detection Algorithms for Smart Cities-Based Wireless Sensing Technologies
## 5 Simulation and Analysis
### Simulation Results
#### 5.2.1 Detection Accuracy  
For a single sink node and a single sinkhole, Figure 6 shows that the detection accuracy of ABC, MBIDS, and TBIDS are comparable. However, the detection accuracy of S-LEACH and MS-LEACH is zero percent. The reason behind that is S-LEACH and MS_LEACH depend on a secret key shared between the \(CH\) and the sink node; once the key is compromised, the sinkhole cannot be detected. So, as long as the \(CH\) is not compromised, S-LEACH and MS-LEACH have a higher percentage not to practice the sinkhole attack. On the other hand, ABC, MBIDS, and TBIDS have higher detection percentage. On average, ABC and MBIDS have a very close percentage of detection accuracy with a small number of nodes. When the number of nodes increases, MBIDS shows better accuracy, up to 95%. At the same time, TBIDS shows excellent detection performance, up to 99%, especially with a small number of nodes.  
For a single sink node and two sinkholes, again, Figure 7 shows the detection accuracy for the five algorithms. Since there are two sinkholes, the detection accuracy, on average, of TBIDS overperforms the ABC and MBIDS by 3% in the case of a small number of nodes and overperforms MBIDS by 5% and ABC by 7% in case of a large number of nodes are used.  
Figure 6: Single sink node and a single sinkhole.  
Figure 8 shows the detection accuracy for two sink nodes and two sinkholes. As can be seen in the figure, the detection accuracy of the proposed algorithms is slightly increased, almost by 1%. However, the detection percentage of ABC is still the same, and it is getting worse when the number of nodes increases. The difference between ABC and MBIDS and TBIDS is 7% and 9%, respectively. By investigating the experiments, it has been found that ABC is not designed to handle a network with multi-sink nodes. At the same time, ABC needs too much time to stabilize.  
For large-scale networks, a different set of experiments with a range of nodes from 500 to 15,000 nodes is designed. In addition, MBIDS, TBIDS, and ABC algorithms with a single sinkhole are examined. As shown in Figure 9, the detection performance of ABC and MBIDS decreases with the increasing number of nodes. However, MBIDS still overperforms the ABC algorithm with, on average, 12%. At the same time, TBIDS performs almost the same with the increasing number of nodes with a small decreasing performance from the previous experiments. However, its accuracy, on average, is still 99%.  
Figure 8: Two sink nodes and two sinkholes.  
Figure 7: Single sink node and two sinkholes.  
Figure 10 shows the detection performance with different sink nodes. In these experiments, the number of sink nodes changes as one, two, three, and five, while the number of nodes, 15,000 nodes, stays fixed, and the number of sinkholes is set to five. As can be seen, the detection accuracy of TBIDS is almost 100% in the three cases, where MBIDS is decreased to almost 84%. On the other hand, ABC is slightly reduced to 74% when three sink nodes are used.  
Due to a large number of nodes, experimenting with a large number of sink nodes is not possible due to the limitations of the running environment. Therefore, different sets of experiments are conducted with 8000 sensor nodes, 5 sinkholes, and variable sink nodes (10, 20, and 30). Figure 11 shows the detection accuracy for the three algorithms. It has been noticed that the performance of the three algorithms increases with the increase in the number of sink nodes. Besides, it is worth mentioning that the detection performance of MBIDS and ABC algorithms has been increased to reach, on average, 91% and 72%, respectively. So, it confirms that handling a fewer number of nodes by the sink node increases the detection accuracy. However, setting the required thresholds becomes harder, and the detection performance becomes more sensitive to small changes in those threshold values.  
Figure 10: Detection accuracy for a large-scale network with 2, 3, and 5 sink nodes.  
Figure 9: Detection accuracy for the large-scale network.