# A Deep-Learning-Based Secure Routing Protocol to Avoid Blackhole Attacks in VANETs +
## 1 Introduction
### Related Works and Motivation  
Routing in VANETs is an active area of research due to the dynamic and distributed nature of these networks. To manage the challenges of routing in networks on a large scale, clustering has emerged as a commonly used approach. Clustering plays a crucial role in ensuring high stability and reducing control overhead within a network. One of the first and most referenced protocols in this area is LEACH [18], which used a randomized rotation of nodes as CH to evenly distribute the energy load among the sensors in the network. However, the cluster is randomly selected from all sensor nodes, regardless of their energy levels, affecting network longevity. Deterministic algorithms such as the highest-degree algorithm [19] or the lowest-ID algorithm [20] use static node properties such as node ID or degree (number of neighbors) to select CH. These are simpler but may not adapt well to network changes. In addition, the authors in [19] do not consider other important metrics such as energy levels, which can impact the network's overall performance, while the authors in [20] do not take into account any metric other than the ID itself. The authors in [21] introduce a particle swarm optimization (PSO)-based clustering algorithm for VANETs. This algorithm not only establishes the rules for clustering but also designs a routing algorithm within the cluster and among different clusters to improve routing efficiency in V2V communication. More recent studies have proposed the use of artificial intelligence techniques for CH selection. For example, some of the research leverages fuzzy logic [22] and genetic algorithms [23] to optimize cluster head selection. However, the iteration-based algorithm, as mentioned above spends so much time finding the optimal cost or fitness function. Hence, using a machine learning technique such as DL can provide a more efficient and accurate solution compared to iteration-based algorithms, especially when dealing with large-scale, high-dimensional, and complex problems. In addition to the clustering process, security stands as another important aspect of routing, ensuring the safe transmission of data in VANETs. One of the most common attacks that has a negative impact on network performance is the blackhole attack. A variety of methods were suggested to prevent and identify blackhole attacks. The authors in [24] used a modification to the AODV protocol to prevent blackhole attacks in mobile ad hoc networks (MANETs). This protocol used an intrusion detection system to detect the blackhole attacks. However, the false-positive detection of blackhole nodes in a harsh environment may occur. The authors in [25] proposed the detection and prevention of blackhole attacks in VANETs. The authors made the algorithm to scan all the existing routes for the chance blackhole attacks exist. If the route with a blackhole node is found, then the route is ignored and another route is searched for. This algorithm exhibits the capability to identify and mitigate the effects of black hole attacks within highly mobile VANETs. Despite this, the processing time required by this algorithm is significant, leading to an increased end-to-end delay. The authors in [12] proposed SVODR to avoid blackhole attacks in VANETs. An encrypted random number field is introduced into the RREQ packet, which is then broadcast to all adjacent nodes. When the source node receives the RREP, it validates the destination sequence number in its own routing table against the destination sequence number and the encrypted or decrypted random numbers in the RREP. If the RREP's destination sequence number exceeds the destination sequence number in the source vehicle's routing table and the random numbers from both operations match, the node is considered a legitimate node. If not, the vehicle is flagged as malicious. A potential limitation of this approach is that it necessitates additional fields in control packets for cryptography algorithms, which require more resources.