## 5 Result and Discussion  
Figure 2 presents a comparison of the detection accuracy (%) for black hole and gray hole attacks. The analysis comprises three methodologies: Watchdog, DSR, and a proposed hybrid approach. The results show that each approach is effective in detecting these two types of attacks. The watchdog demonstrated a moderate level of accuracy, with detection rates of 85% for black hole attacks and 78% for gray hole attacks. DSR achieved results with an accuracy of 90% for black hole attacks and 82% for gray hole attacks. The hybridapproach achieved a detection accuracy of 97% for black hole attacks and 93% for gray hole attacks. The findings suggest that the hybrid approach outperforms Watchdog and DSR in accurately detecting both types of attacks. This solution shows promise in enhancing network security against such threats. Figure 3 presents the false positive rates (%) for black hole and gray hole attacks, as measured via the Watchdog, DSR, and proposed hybrid-approach methodologies. False positives are instances where legitimate nodes are wrongly identified as attackers. The results show the effectiveness of each method in minimizing incorrect identifications. The false positive rates for Watchdog were higher, with 12% for black hole attacks and 15% for gray hole attacks. DSR demonstrated improved performance with decreased rates of 9% for black hole attacks and 11% for gray hole attacks. The hybrid approach effectively reduced false positives, with rates as low as 3% for black hole attacks and 2% for gray hole attacks. The hybrid approach was found to effectively reduce false positives, thereby enhancing the accuracy and reliability of attack detection compared to the Watchdog and DSR methods. Figure 3: False positive rates among Watchdog, DSR, and our hybrid approach. Figure 2: Detection accuracy among Watchdog, DSR, and our hybrid approach. Figure 4 shows the packet delivery ratio (PDR) (%) for three scenarios: black hole attack, gray hole attack, and no attack. The PDR was measured using Watchdog, DSR, and the proposed hybrid approach. The PDR, also known as the packet delivery ratio, is a metric used to determine the percentage of packets that successfully reach their intended destination out of the total number of packets sent. In the black hole attack scenario Watchdog achieved a packet delivery ratio (PDR) of 72%. DSR achieved higher performance of 78%, while the hybrid approach exhibited the highest success rate of 88%. In a gray hole attack, Watchdog records a PDR of 75%. DSR enhances it to 79%, and the hybrid approach maintains a PDR of 87%. In the absence of attacks, the no-attack scenario demonstrated higher PDRs when all three methodologies were employed. Watchdog had a PDR of 91%, DSR had a PDR of 93%, and the hybrid approach had a PDR of 97%. The results indicate that the hybrid approach is effective in maintaining a high PDR even during attack scenarios. This suggests that it has the potential to ensure successful packet delivery in the presence of network threats when compared to other methods. Figure 5 displays the network latency (in milliseconds, ms) for three scenarios: black hole attack, gray hole attack, and no attack. The data are presented using three methodologies: Watchdog, DSR, and the proposed hybrid approach. Network latency refers to the time it takes for a packet to travel from its source to its destination. Lower values are preferred, as they suggest quicker data transmission. The latency of Watchdog in the case of a black hole attack was 220 ms, which was reduced to 205 ms via DSR. The hybrid approach achieved the lowest latency at 180 ms. During a gray hole attack, Watchdog records a latency of 210 ms. DSR lowers it to 200 ms, and the hybrid approach maintains a latency of 175 ms. In the absence of attacks, the no-attack scenario demonstrated reduced latencies according to all three methodologies. The latency of Watchdog was 100 ms, DSR had a latency of 95 ms, and the hybrid approach had a lower latency of 90 ms.