# A Deep-Learning-Based Secure Routing Protocol to Avoid Blackhole Attacks in VANETs +
## 1 Introduction  
Vehicular ad-hoc networks (VANETs) have emerged as an important component in the intelligent transportation system (ITS) field [1, 2]. In a VANET, vehicles are equipped with devices that enable wireless communication, effectively turning each vehicle into a mobile node within the network. This allows them to communicate with each other (vehicle-to-vehicle or V2V communication) and with infrastructure such as traffic signals or roadside units (vehicle-to-infrastructure or V2I communication) [3, 4]. Routing in VANETs pertains to the process of finding and maintaining efficient routes for data transmission between these mobile nodes. Due to the high mobility and dynamic nature of the network, it can lead to frequent route disconnection and network topology changing [5]. Therefore,the routing protocol is essential for efficient data transmission between the source node and the destination node.  
In VANETs, the clustering protocol is considered as one of the possible approaches to enhance network stability and node connectivity by forming similar node characteristics [6; 7; 8]. In detail, the cluster consists of three types of nodes: the cluster head (CH), cluster member (CM), and gateway (GW) [9; 10]. The CH works as the central node in a cluster and is responsible for managing communication among its CMs. It gathers data from CMs and forwards it to other CHs or the GW. CMs are regular nodes within the cluster, associated with a CH, and follow the CH's decisions to efficiently use network resources and save energy. The GW is a special node that connects different clusters or extends the communication range beyond a single cluster. It acts as a bridge forwarding data between clusters when CHs need to communicate or when a CH is out of range from other CHs, ensuring that messages reach their intended destinations.  
Security is a critical issue in VANETs due to the potential for serious accidents. A blackhole attack that disrupts the data transmission process by dropping all the packets instead of forwarding them is especially serious [11; 12]. When other nodes try to communicate with the destination, the blackhole node sends fake route replies (fake-RREP) by having the freshest and shortest or most efficient route towards the destination node [13; 14]. However, instead of forwarding the packets to the actual destination, the blackhole node intentionally drops or discards the packets. As a result, the data packets are lost, and the source nodes never receive any response from the destination node. This interruption in data transmission can lead to a significant disruption in communication within the network and causes an increase in the end-to-end delay and low packet delivery ratio (PDR).  
To address the problem above, we use a deep neural network (DNN) model for detecting blackhole attacks in VANETs. Deep learning (DL) is a powerful machine learning technique that can analyze complex data patterns through DNN [15]. This approach offers advantages over conventional methods, especially in identifying the distinguishing features between normal and malicious network behavior. DL efficiently processes high-dimensional data leading to more accurate detection [16]. According to the authors in [17], we can actively avoid blackhole nodes by using DL to select the optimal route based on fitness function values and improve the optimization speed, thereby reducing delays and enhancing network performance. Additionally, since DL is one of the compact mapping functions, the trained DL can find the relation between input data and output data without additional processes. Thus, it can be adapted to detect whether the next node is a blackhole attack node or not. Usually, an iteration-based algorithm is used to optimize fitness values but it spends so much time finding the optimal value than the DNN model. Therefore, by using the DNN model, we can reduce delays in the optimization process and ultimately improve the performance of the overall system.