## 3 Intelligent Cluster-Based Routing Approach
### Cluster Formation  
In this approach, the roadside unit (RSU) is pivotal in guiding the formation of clusters, as detailed in Algorithm 1. Initially, each vehicle node enters the simulation environment, represented as a lane on the highway, and broadcasts a timestamp. Cluster's C are transformed after setting, causing range through \(\mathrm{C_{i}^{Range}}\). After setting the cluster with range, each cluster is assigned an identity using \(\mathrm{C_{i}^{identity}}\). In each cluster, the number of neighbors is setup through \(\mathrm{C_{neighbour}}\). These vehicles initially establish communication with all RSUs within their operational range. To achieve robust and stable cluster formation, we employ four critical conditions. These conditions consider the relative change in speed (denoted as \(\mathrm{V_{cl}^{val}}\)), the distance (D) covered by the vehicle during the timestamp, and the number of neighboring vehicles within the range of cluster nodes. The distance between an RSU and a new vehicular node is computed upon entering the system. According to Algorithm 1, the vehicular node is affiliated with the RSU if this distance is below a certain threshold. The RSU plays a central role in cluster formation, managing content distribution, message requests, and responses. Initially, vehicles broadcast timestamps to RSUs, initiating the formation of clusters using  
Figure 8: Flow diagram for optimal path prediction and packet transformation of the proposed approach. Algorithm 1. The RSU oversees the establishment of connections, employing conditions based on speed, distance, and neighboring vehicles. The RSU monitors vehicular nodes' behavior, employing a deep learning model (Algorithm 2) for malicious node detection. Secure nodes are connected to the RSU, forming clusters, and each RSU within a cluster assigns authentication keys to cluster members. The RSU is responsible for optimizing communication paths, detecting and handling malicious nodes, and ensuring secure clusters through key assignments. The RSU, through Algorithms 1 and 2, orchestrates the entire process. It evaluates vehicle speed, direction, and neighboring nodes, forming clusters and facilitating secure connections. The RSU efficiently utilizes a deep learning model to detect and exclude malicious nodes, ensuring the integrity of the clusters. It manages content distribution and facilitates message requests and responses within the formed clusters. The RSU's continuous monitoring of vehicular nodes and dynamic adjustments to connectivity parameters contribute to a robust and adaptive communication framework. This comprehensive approach ensures efficient content delivery, robust cluster formation, and resilient communication architecture, which is crucial for the proposed system's success in vehicular networks. ```
Input:\(V_{cl}^{vel}\), \(V_{cl}^{loc(x,y)}\), map_lans, tim_span, \(RSU_{i}\), \(N_{neighbor}\) Output: Cluster, Number of Clusters
```  
**Steps:**  
1. While t \(\leftarrow\) 1 to tim_span
2. While i \(\leftarrow\) 1 to map_lans
3. if (detect (\(RSU_{i}\)) )
4. \(D_{RSU_{i}}^{Node}\)\(\leftarrow\) (\(V_{cl}^{loc(x,y)}\), \(RSU_{cl}^{loc(x,y)}\), \(N_{Neighbor}^{Node}\)):
5. \(V_{cl}^{vol}\)\(\leftarrow\) vehicle speed
6. \(if((D<D_{threshold})\)\(||\) (\(V_{cl}^{vol}<V_{cl}^{vol(threshold)})||\) (\(N_{Neighbor}^{Node}<N_{Neighbor}^{threshold}\)))||(V_{N}\(\leftarrow\) Algorithm 2)
7. \(RSU_{i}\)\(\leftarrow\)\(ID\)
8. End if
9. \(C_{i}\)\(\leftarrow\)\(RSU_{i}\)(\(\forall ID\))
10. End if
11. End
12. End
13. set(\(C_{i}^{Range}\))
14. \(Set(C_{i}^{identity}\))
15. \(C_{i}^{N}\)\(\leftarrow\)\(\forall C_{i}\) :- where \(C_{i}\)\(\
eq\)\(0\) ```
**Algorithm 1** Cluster formation  
This continual process involves connecting and influencing vehicles and ensures a steady data flow and an efficient, reliable communication framework. It is important to note that we assume all vehicles move in the same direction.