## 3 Intelligent Cluster-Based Routing Approach
### Cluster Formation
### Model Loss

Figure 12 visually portrays the model's loss concerning the proposed BHT dataset, and the associated accuracy results are briefly elaborated in Table 3. This graphic presentation encapsulates the loss experienced by the suggested system across the designated dataset. System performance evaluation hinges on utilizing training and test datasets, focusing on the model's loss metrics. These metrics align with the predefined dataset, thus enabling the iterative training and testing of the proposed model. The graphical representation of the model's loss is visually depicted in Figure 12.

In this configuration, the vehicles within the system employed UDP to transmit data packets, with the transmission rate varying from 0.5 Mbps to 5 Mbps. In contrast, each

Figure 11: Model accuracy graph comparison with other techniques [40; 41; 42]. Figure 12: Model loss for the BHT dataset. packet was approximately 512 bytes in size. The key parameters assessed for performance evaluation encompassed end-to-end delay, packet delay, and network throughput. Additionally, we carefully monitored the occurrences of packet drops and inter-vehicle communication. Each simulation scenario was rigorously executed 150 times to ensure comprehensive and reliable results. Table 5 shows the prediction performance of the BHT model with vehicle speed in m/s and simulation time in the simulation environment. The table content shows the number of vehicles with speed under different simulation times to capture the malicious nodes effectively. Implementing ML is a pivotal tool to enhance routing efficiency. ML primarily manages traffic flow, endeavors to minimize packet transmission delays, and enhances the system's ability to detect malicious attacks. In black hole attacks, there is a discernible impact on the packet transmission ratio, resulting in increased hop counts for network transmission and ensuing delays. By introducing machine learning into the routing process, we sought to augment the overall performance and refine the criteria for detecting and mitigating malicious attacks within the network. ### End-to-End Delay

In the context of vehicular ad hoc networks (VANET), end-to-end delay pertains explicitly to measuring the time it takes for a packet to be transmitted from the source node and successfully received at the destination node during the black hole attack scenario. The behavior of a black hole attack depends on the routing procedure, protocols, and the number of involved nodes. The results in Figure 13 compared existing techniques with the minimum number of times the under-attack scenario was observed. The less time shown here effectively affects the network routing performance less than existing techniques. This metric is paramount during routing, reflecting data transfer efficiency in the VANET environment. This dynamic capability of nodes to send and receive packets directly influences the end-to-end delay, representing the culmination of packet delivery and transmission ratios. We maintained detailed records concerning the specific setup characteristics and network assumptions, which are pivotal in estimating end-to-end delays. The observed delay was a valuable indicator of various aspects, including the spatial positioning of neighboring vehicles and any routing alterations caused by malicious nodes. Furthermore, the count of hops required for data transmission between the sender and receiver nodes provided insights into the effectiveness of data transmission, especially given the evolving nature of the network. In Figure 13, we graphically illustrate the end-to-end delay in the network, comparing the results achieved by our proposed technique with those of existing approaches. \begin{table}
\begin{tabular}{c c} \hline \hline
**Vehicle Speed (m/s)** & **Simulation End Time** \\ \hline
15 & 56 \\
14 & 57 \\
13 & 59 \\
12 & 61 \\
11 & 64 \\
10 & 67 \\
9 & 70 \\
8 & 75 \\
7 & 80 \\
6 & 88 \\
5 & 99 \\
4 & 115 \\
3 & 141 \\ \hline \hline \end{tabular}
\end{table} 
Table 5: Prediction performance for the BHT model.