*Article* **Analysis of Malicious Node Identification Algorithm of Internet of Vehicles under Blockchain Technology: A Case Study of Intelligent Technology in Automotive Engineering**

**Jing Chen 1,\*, Tong Li <sup>2</sup> and Rui Zhu <sup>3</sup>**


**Abstract:** False messages sent by malicious or selfish vehicle nodes will reduce the operation efficiency of the Internet of Vehicles, and can even endanger drivers in serious cases. Therefore, it is very important to detect malicious vehicle nodes in the network in a timely manner. At present, the existing research on detecting malicious vehicle nodes in the Internet of Vehicles has some problems, such as difficulties with identification and a low detection efficiency. Blockchain technology cannot be tampered with or deleted and has open and transparent characteristics. Therefore, as a shared distributed ledger in decentralized networking, blockchain can promote collaboration between transactions, processing and interaction equipment, and help to establish a scalable, universal, private, secure and reliable car networking system. This paper puts forward a block-network-based malicious node detection mechanism. Using blockchain technology in a car network for malicious node identification algorithm could create a security scheme that can ensure smooth communication between network vehicles. A consensus on legal vehicle identification, message integrity verification, false message identification and malicious vehicle node identification form the four parts of the security scheme. Based on the public–private key mechanism and RSA encryption algorithm, combined with the malicious node identification algorithm in the Internet of Vehicles, the authenticity of the vehicle's identity and message is determined to protect the vehicle's security and privacy. First, a blockchain-based, malicious node detection architecture is constructed for the Internet of vehicles. We propose a malicious node identification algorithm based on the blockchain consensus mechanism. Combined the above detection architecture with the consensus mechanism, a comprehensive and accurate verification of vehicle identity and message authenticity is ensured, looking at the four aspects of vehicle identification, accounting node selection, verification of transmission message integrity and identification of the authenticity of transmission messages. Subsequently, the verification results will be globally broadcast in the Internet of Vehicles to suppress malicious behavior, further ensure that reliable event messages are provided for the driver, improve the VANET operation environment, and improve the operation efficiency of the Internet of Vehicles. Comparing the proposed detection mechanism using simulation software, the simulation results show that the proposed blockchainbased trust detection mechanism can effectively improve the accuracy of vehicle node authentication and identification of false messages, and improve network transmission performance in the Internet of Vehicles environment.

**Keywords:** blockchain technology; intelligent technology; internet of vehicles; malicious nodes; identification algorithm

#### **1. Introduction**

Establishing an intelligent transportation system using the Internet is a wise choice. This kind of intelligent system is used in the field of transportation: using the real-time

**Citation:** Chen, J.; Li, T.; Zhu, R. Analysis of Malicious Node Identification Algorithm of Internet of Vehicles under Blockchain Technology: A Case Study of Intelligent Technology in Automotive Engineering. *Appl. Sci.* **2022**, *12*, 8362. https://doi.org/10.3390/ app12168362

Academic Editors: Pijush Samui, Aydin Azizi, Ahmed Hussein Kamel Ahmed Elshafie, Yixia Zhang and Danial Jahed Armaghani

Received: 22 May 2022 Accepted: 8 August 2022 Published: 21 August 2022

**Publisher's Note:** MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

**Copyright:** © 2022 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https:// creativecommons.org/licenses/by/ 4.0/).

interactions between cars, trains and boat vehicles to coordinate data on their trajectory and running state can to help alleviate the frequent road safety accidents, improve the robustness of network security, etc. As a more advanced system in the field of transportation, the intelligent transportation system has good prospects for the future development of intelligent transportation. The intelligent transportation system could combine computer science, sensors, the Internet of Things and AI technology and be applied to the delivery of goods, service management and vehicle production. This would further strengthen the relationship between vehicles, roads and users, accelerate improvements in driving safety, reduce road jams and reduce the energy losses caused by the construction of a new transportation management system. The connection of the vehicle, the driver and the road is the core role of the intelligent transportation system. At the same time, the intelligent transportation system can also provide the corresponding service management agency. According to the analysis of relevant research conclusions, the use of intelligent transportation system can provide more intelligent road information for locomotives, and can also promote the vehicles can easily obtain the state information in front of any road, and make more effective use of road infrastructure and other resources. A large number of scholars in the field have shown that, with the use of intelligent transportation system technology, traffic jams in the next 20 years will be reduced to 40%, the existing road blockage problems will be effectively solved, the traffic accident rate could be reduced by 8%, and the resulting accident deaths would be reduced by 30~70%, which is of great significance for the healthy growth in domestic transportation and stable economic development. In recent years, the safety problems with Internet of Vehicles systems have gradually become a research hotspot. The Internet of Vehicles has the characteristics of complex dynamic topology changes, rapid vehicle movement, and unreliable transmission, which means that both the internal and external network are faced with security threats, such as malicious attacks. This means that solving the network security problems has become a great challenge. In recent years, VANET has been proposed as the basis of ITS to improve traffic efficiency and ensure the safety of vehicles and drivers. As VANET is characterized by its dynamic topology, high mobility, and variability, it is vulnerable to various attacks originating from malicious nodes. Malicious nodes in the Internet of Vehicles will broadcast and forward false traffic warning messages for selfish purposes, which will lead to traffic congestion, threaten people's lives, damage the entire VANET network function and affect its performance. They also discard received messages or refuse to help other vehicle nodes to forward messages. To enable the vehicle to operate normally and communicate on the road, it is necessary to detect false information in a timely fashion. Therefore, ensuring VANET security has become a pervasive area of research, and issues related to identifying malicious nodes and creating messages remain the focus of VANET security research.

#### **2. Application of Regional Chain Technology in the Internet of Vehicles**

The deep integration of the Internet of Things, computers, mobile communication and other technologies with intelligent transportation promotes the wide application of vehicular communication and computing equipment in vehicles. This also transforms vehicles from traditional vehicles to mobile devices with computing communication abilities. This makes communication between vehicles possible, leading to the birth and rapid rise of Internet of Vehicles technology. The Internet of Vehicles is essentially a dynamic communication system for communication between vehicles and mobile public networks. The Internet obtains the data that are shared with the vehicle, and analyzes data on the vehicle and road, vehicle and the driver, the driver and the driver, and the relationship between the driver and the third-party service providers. According to the analysis, the existence of the above relationship can be used to solve the urban traffic problems, and thus help to manage the urban intelligent transportation. In recent years, the safety problem of Internet of Vehicles systems has gradually become a research hotspot. The Internet of Vehicles has the characteristics of complex dynamic topology changes, fast vehicle movement, and unreliable transmission; therefore, both the internal and external network are faced with

security threats such as malicious attacks, which mean that solving the network security problems has become a great challenge.

The network environment of the Internet of Vehicles is very complex and changeable. The authentication and trust detection methods of on-board and network (VANET) technology are not applicable to the Internet of Vehicles network environment, because this can only handle a small number of simple event requirements, and cannot effectively store, query and trace big data on vehicles. With the development of blockchain technology as a new technology solution, the problems regarding storing and querying big data on the Internet of Vehicles can be solved. The blockchain core technology consensus mechanism can ensure the security and reliability of data transmission in the network. In actual intelligent transportation applications, recording transactions' traceability through the blockchain can effectively and strongly ensure behavior traceability and responsibility backtracking, achieve fairness and justice, and promote the efficient operation of various affairs. In practice, the security risks in the Internet of Vehicles are still very large, so we need to pay closer attention to the harm caused by malicious node attacks. The rational use of blockchain technology is of great significance to the process of detecting malicious nodes in the Internet of Vehicles. The vehicle status can be globally broadcast to fundamentally suppress malicious behavior, thus ensuring that the driver is provided with reliable event messages.

Therefore, to reduce the security threat problem and network security problems, and protect the security and privacy of vehicles, it is necessary to improve the malicious node identification of the Internet of Vehicles, as well as to reasonably determine vehicle identity and the authenticity of the information. Based on this, this research chose to use a malicious node identification algorithm, focusing on the implementation of malicious node identification algorithms in the Internet of Vehicles under regional chain technology, and judge the main value of malicious node identification algorithms in the Internet of Vehicles.

#### **3. Research Status Quo**

Many domestic and foreign researchers have put forward corresponding detection and identification methods to resolve network security problems in the Internet of Vehicles.

This paper applies blockchain technology to the Internet of Vehicles to detect and identify malicious nodes, and solve the problems in the traditional Internet of Vehicles trust model. Abboud, K., Omar, H.A., et al. [1] proposed a method using RFID technology, which is implemented by verifying the vehicle's interactions with the cloud while driving on the road. According to the statistics, the vehicle will use electronic tags to send the data requiring authentication to the cloud storage, and the cloud storage will authenticate the vehicle data after receiving the information, and broadcast the information in the cloud network. Lu Zhongmei, Chen Wei, et al. [2] proposed a vehicle privacy protection method that combines the certificates issued to a vehicle by a trusted agency and pseudonyms authorized by a trusted agency to build an intelligent privacy authentication system to jointly authenticate a vehicle's identity. However, due to the frequent communication problems in the Internet of vehicles, the certification requirements cannot be met efficiently and in a timely manner. These schemes enable the vehicle to communicate on the road according to the pseudonym produced by the authority, and authenticate the identity of the vehicle through interaction with the RSU. However, these schemes are relatively dependent on the RSU, which leads to the problem of excessive RSU workload [3–5].

The application of blockchain in the Internet of Vehicles derives from the following research conclusions. VANET traditional certification and trust detection methods have many problems, which make it difficult to adapt them to the complex networking network environment. Traditional security mechanisms can only deal with a few simple events, cannot store vehicle big data, and struggle with problems regarding queries and traceability. The rise of blockchain technology means that it could be a way to solve the problems with new technology for networking security [6]. Arushi A, Kumar YS, et al. [7] propose a certified and secure data transmission algorithm to ensure that real information is communicated between nodes. The authors also introduced blockchain to some of the connected car

services to improve efficiency. However, the vehicle needs to be registered at a centralized authority, and the system still has a single-point-of-failure problem. Wagner M, Mcmillin B, et al. [8] proposed a new blockchain architecture with local, physically verified transactions. With this new architecture, they proposed a protocol that protects vehicle self-organized networks (VANET) that do not regularly communicate with the RSU or other infrastructure components. In addition, they proposed a way to overcome the real-time challenges of applying Bitcoin's blockchain to disconnection by changing the transaction validation mechanism and blockchain management process, and adding a trusted CA.

In sum, the security risks in the Internet of Vehicles are great, and the harm caused by malicious node attacks cannot be ignored. Existing methods to reduces these risks in the Internet of Vehicles have been effective in their target applications, but they also face several technical challenges, including the need to improve detection accuracy and enhance privacy protection. Some scholars have applied blockchain technology to the Internet of Vehicles to solve these security and trust problems. Blockchain technology leads to decentralization and means that information cannot be tampered with, and the existing blockchain technology is used to detect malicious nodes. However, the accuracy of security messages and the malicious node detection rate need to be further improved. Therefore, the reasonable use of blockchain technology to detect malicious nodes in networks requires further research and exploration [8].

#### **4. Application of Blockchain Technology in the Internet of Vehicles**

#### *4.1. Blockchain Technology*

Blockchain technology is essentially a distributed database that stores a large amount of data, with specific transactions on each block, and notes the time when messages occur. They are connected in chronological order to form a chain structure [9]. A block in a blockchain is simply called a list of records, while a blockchain can be regarded as a record chain composed of many blocks, forming a public ledger that records a lot of encrypted data. The ledger is publicly shared among individual users. Each transaction is recorded into a new block, in which the recorded data are unchangeable and time-linked [10]. Finally, together, these new blocks form a complete blockchain in chronological order. The blockchain provides secure shared databases, ledgers, and transaction logs without being managed by central trusts [11–13]. The consistency and synchronization of the data in a blockchain are achieved through a consensus mechanism, in which a group of participants in a distrust peer network collaborate in a fully transparent way and only accept valid transactions [14]. However, Bitcoin was originally designed without taking privacy into consideration. By viewing the ledger, any public key can be used to trace back to one's real identity [15].

#### *4.2. Structure of the Malicious Node Identification Algorithm*

The ways in which vehicles communicate with each other using VANET can be divided into the following three main categories of message transmission: beacon messages, early warning messages, and entertainment messages [16–19]. Warning messages have the highest priority level among the three messages, mainly because they may threaten the performance of the Internet of Vehicles, and even affect the personal safety of drivers and passengers. In essence, the main function of early warning messages is to send road safety warning messages to the vehicle as soon as possible when an emergency occurs, making them is very important for safe driving [20]. This study mainly focuses on the authenticity of traffic early warning messages in VANET. The warning message report table is shown in Table 1.


**Table 1.** Warning message report form.

Emergencies are divided into the following four categories: traffic jams, traffic accidents, road construction, road icing [21]. The lifetime and transmission range of the alert message for each emergency are recorded. After the analysis, different types of early warning messages were found to have different life cycles and transmission ranges for the four categories of traffic jams, traffic accidents, road construction and road icing. The scheme structure diagram expression is shown in Figure 1.

**Figure 1.** Schematic structure diagram.

#### *4.3. Authentication Algorithm*

There are several authentication algorithms: authentication based on shared key, authentication based on biological features, and public key encryption algorithm. Different authentication methods also have different security levels. This paper adopted the authentication method based on the shared key, which means that the server side and the user share one or one set of passwords. When the user requires authentication, the user submits a password that is jointly owned by the user and the server, either by entering the password or through a device that holds the password.

A set of vehicles in the Internet of Vehicles are set to V, obtaining:

$$V = \left\{ V\_{1\prime} V\_{2\prime} V\_{3\prime} \dots V\_{1\prime} V\_{j} \dots V\_{n} \right\}$$

In the above formula, any vehicle source sending a message node is represented by *Vj* (source sending message node), and *Vi* (target receiving message node) represents the target receiving the message node. After *Vj* sends a message to *Vi*, *Vi* carefully verifies the integrity of the message, and then produces a series of interactive behaviors with other entities in the network [22,23]. If the alert message issued by *Vj* is acquired by *Vi*, then *V* sends out the collected messages. The information is sent to the nearest roadside unit (RSU) in the communication range, and the RSU must identify the information and determine whether the information is legal. After the data package sent by *Vi* is received by RSU, the first step in judging the message's credibility is make an accurate judgment of whether

*Vi* has a legal identity [24–29]. When combined with CA (authentication center in the network), the detailed authentication verification process is as follows:

Step 1. For the RSU within the vehicle communication range, vehicle *Vi* transmits the request, based on which the message received from vehicle *Vj* is recognized [30].

Step 2. After the RSU receives the request, a pseudonym containing vehicle *Vi* is sent with a PIDv instead. A random number (*L*) is reported to the nearest surrounding CA for authentication. *L* is randomly produced by a linear congruence generator (LCG). The LCG calculation is described as follows [30]:

$$\begin{cases} L\_0 = \mathbf{d} \\ L\_{\mathbf{r}+1} = (A \times L\_{\mathbf{r}} + Z) \text{mod}(M) \end{cases}$$

In this formula, d represents the seed value, the current system time is its set initial value, the increment value is *Z*, multiplier is *A*, modulus size is *M*, and *Z* and *M* are prime. Generally, *M* will take the power square of 2.

Step 3. If the CA receives information from the RSU, the RSU will conduct a traceability search of the real situation of vehicle *V*<sup>i</sup> using vehicle mapping, according to the pseudonym of vehicle *Vi* in the first step, and obtain the real vehicle identity information accordingly. An audit result (report) is produced after the search. In the audit results, if the false vehicle information is backed up in the results, then vehicle *V*<sup>i</sup> is legal; if there is no record, then vehicle *Vi* is an illegal vehicle. Then, a random key, L, is encrypted using a private key (PRCA) to generate a session key *Kn*. After the encryption of a random key L, a private key (PRCA) is used to generate a session key, *Kn*. After using *Kn* for report encryption, *EKn* [r*eport*] is obtained. After completing the above work, the RSU receives an encrypted message. By taking the result of the public key (PKj) encryption under the RSU, the corresponding generating encryption function is as follows (*E* represents the encryption function, and the encrypted ciphertext is *C*):

$$E: \mathcal{C} = E\_{PB\_{R\&\ell I}}[E\_{PB\_{R\&\ell I}}[K\_n] || E\_{k\_n}[report]],$$

Step 4. When the inspection results after CA encryption are transmitted to the RSU, the RSU uses the private key (PRRSU) to decrypt the generated ciphertext C, corresponding to *EPBR*su [*K*n] and *EKn* [r*eport*]. Based on the above, the RSU key is used to decrypt *EPBR*su [*K*n], and the obtained session key is *Kn*. After the same operation, the report views the audit results of CA, to make the final judgment on whether vehicle *Vi* is legal. The detailed decryption function is as follows (*D* represents the decryption function):

$$D: \left[E\_{PB\_{RSL}}\left|K\_n\right|\right] \left|E\_{k\_n}\left|report\right]\right| = D\_{PB\_{RSL}}\left|C\right|.$$

After completing the above four steps, the RSU can make an accurate judgment regarding the legitimacy of vehicle *Vi*.

#### *4.4. POS Consensus Algorithm Improvement*

Compared with other traditional consensus algorithms, the main purpose of the nodes in BCIR is to fake the message verification using computer technology. Therefore, this study set up a new consensus mechanism POS1 algorithm for VANET: (1) If RSU wants to participate in the selection of bookkeeping node, it will register with CA the first time the selection of a new bookkeeping node is initiated, and will submit a part of the deposit according to the standard. This can become a candidate and enter the next step of bookkeeping selection. (2) All RSU applications are accepted by the CA, and the full energy value of the RSU will be updated. The algorithm updates are as follows:

Part 1. No matter which RSU has its own initial energy value in the blockchain network, in VANET, the RUS performs the very diverse work. For example, it actively participates in campaign billing nodes; assists CA in verifying vehicle identity information; forwards packets and assists in verifying vehicle messages; broadcasts messages; etc. Due to the differences the behavior of the participating network, the energy value of the RSU will also change. For example, in VNAET, when RSU broadcasts information, the energy will undergo a changing consumption trend. To give RSU enough encouragement, RSU

needs to receive enough energy return, and the reward should be greater more than the amount of energy consumed to continue smoothly.

Part 2. The size of the RSU registration number needed to participate in the accounting node election is the variable, where any RSU corresponds to ITS own *k* value (energy value). If the number is 0, then *k* = 0.

Part 3. In the new round with several bookkeeping choices, CA records any registered RSU as *Rn*; the corresponding *k* is added 1 on the original basis to obtain the energy value of (*k* + 1).

Part 4. If the energy value before *Rn* registration is set to *Egy*0−*l*, then the deposit corresponding to *Rn* registration is Δ*Egy*0−*l*, corresponding to the energy value that is to be reduced. The calculation is as follows:

$$
\Delta E \text{g} y\_{0-I} = \frac{k}{2(k+1)} E \text{g} y\_{0-I}
$$

Part 5. The latest RSU energy value *Egyn*−<sup>1</sup> obtained after successful registration and deposit is as follows:

$$E\mathfrak{g}y\_{n-I} = E\mathfrak{g}y\_{0-I} - \Delta E\mathfrak{g}y\_{0-I}$$

Part 6. As long as the RSU is registered, the above steps should be followed before updating the latest energy value.

(3) For the latest energy values of all current RSU candidates, CA needs to create energy value statistics. According to the set threshold *T*h*Egy*, if the latest energy value *Egyn*−<sup>1</sup> is lower than *T*h*Egy*, then CA will eliminate the RSU that should have been *Egyn*−<sup>1</sup> the first time, and the RSU will withdraw from the election. If the latest energy value *Egyn*−<sup>1</sup> is greater than *T*h*Egy*, then the RSU continues and accepts the next election.

(4) The equity value corresponding to the RSU that is already owned in the election lineup should be calculated at this stage. The equity essentially refers to the assets or energy owned by the node. In other words, if the RSU behavior is very active, more interest will be obtained. If the behavior of the RSU is very negative, fewer benefits will arise.

Part 1. Based on the blockchain conditions, we set the exit time of the equity proof mechanism (POS) as Δ*TPOS*. At every period of exit time, the accounting function will be stimulated accordingly. If the RSU needs to select the accounting node but the interval Δ*TPOS* time has not met the standard, then, during this process, the RSU will submit the application to the CA the first time, and the application content will immediately trigger a bookkeeping election immediately. At this time, the CA in the network will be the first to elect a new accounting node.

Part 2. As there are obvious differences between the network behaviors in which each RSU participates, the corresponding energy values also show a constantly changing trend. CA needs to record each RSU, that is, to record the energy value corresponding to the RSU in each stage from the first round to the last round. The energy value corresponding to the RSU of each round is set to *Egy*x, and the energy value of the RSU differs at different moments. Therefore, the energy value of RSU cannot be uniformly estimated for a certain round, that is, the energy value does not have a certain value. In the current study, the energy value of the RSU in each round was considered as the energy value of the last moment corresponding to the RSU in this round.

Part 3. While participating in the election, each RSU is counted by CA from the first registration election. RSU participates in and initiates many elections in the latest election, and the number of elections is recorded as J. Following the above steps, CA will calculate the energy value corresponding to the RSU in round J. In addition, the corresponding equity value in each RSU election is recorded as *S*take*R*−l, and *S*take*R*−l's calculation formula is as follows (in the formula, a represents the return growth rate in the POS algorithm mechanism, and the constant a generally takes a value of 0.05; *Egy*x means the corresponding energy value for each round of RSU, which is set to *Egy*x):

$$\text{Stake}\_{R-1} = \sum\_{\mathbf{x}=1}^{I} E \mathbf{g} \mathbf{y}\_{\mathbf{x}} \times \left(\mathbf{1} + a \mathbf{\%} \right)^{I}$$

Part 4. If round F is set as a particular number, five rounds are generally selected during the calculation process, and the energy value of the corresponding RSU is in a stable state. Then, in the process of RSU equity value calculation, we the *J* value corresponding to RSU is chosen as zero. The corresponding *J* value should not be considered until the corresponding energy value of RSU changes. This is because, if the RSU does not participate in the network transaction for a very long time, the corresponding energy value will be in a stable and constant state; in other words, the energy value does not change. The F round is set as a specific round, and the equity value and *J* value are considered, aiming to stimulate RSU activity, and stimulate RSU to more actively participate in the election and network behavior.

Part 5. Following the above steps, CA calculates the equity value of all candidate RSU candidates and determines that the accounting node of this round is the maximum equity value corresponding to RSU. After determining the new accounting node, CA will immediately update the energy value corresponding to the RSU. By setting the energy value of the RSU after the J election as *Egy*J, the energy value of the RSU after the (J − 1) election is recorded as *Egy*J−1; the refund proportion of the deposit is expressed by *P*r; the reward issued by the successful RSU accounting node is recorded as Δ*Egy*reword; the attenuation

coefficient is e <sup>1</sup> <sup>Δ</sup>*TJ*−1<sup>−</sup> *<sup>J</sup>* . The correct update process is as follows:

$$E\text{\{\".\ $\!\_{\text{\%}}}}=E\text{\".\$ \!\_{\text{\%}}}\cdot \text{\text{\textdegree}}^{\text{\textdegree}} + \Delta E\text{\text{\textdegree}}y\_{\text{consume.\text{\textdegree}}}P\_r + \Delta E\text{\text{\textdegree}}y\_{\text{reword}}$$

To express the RSU revenue in the form of an increased energy value, the actual reward is calculated as follows:

$$
\Delta E \text{gy}\_{\text{reward}} = \frac{1 - \Delta E \text{gy}\_{I-1}}{2}
$$

CA will also reset the J value of the accounting function RSU. After this round, the J value of the RSU is counted again. When the RSU obtains the bookkeeping function, CA will also reset ITS J value, and the J value of the RSU will start counting again after this round. The following algorithm details the incentive consensus mechanism (see Algorithm 1).

**Algorithm 1** Consensus mechanism POS-I

**Input**: Egy0, k, ThEgy, ΔTPOS, a, J, Pr; **Output**: committer peer; 1: RSU sends a request to CA: 2: BCCA initializes an election for selecting committer peer; 3: **for** all RSU participating in the election do 4: *<sup>R</sup>*<sup>l</sup> submITS <sup>Δ</sup>*Egy*consume−<sup>l</sup> <sup>=</sup> *<sup>k</sup>* <sup>2</sup>(*k*+1) *Egyo*−*<sup>l</sup>* as deposit; 5: Calculate *Egy*e−<sup>l</sup> = *Egyo*−*<sup>l</sup>* − <sup>Δ</sup>*Egy*consume−l; 6: **if** *Egy*e−<sup>l</sup> < *<sup>T</sup>*h*Egy* Then; 7: *R*<sup>l</sup> cannot participate in the election; 8: **else** 9: *R*<sup>l</sup> is regarded as a candidate; 10: **end if** 11: Calculate StakeR−<sup>1</sup> <sup>=</sup> *<sup>J</sup>* ∑ *x*=1 *Egyx* <sup>×</sup> (<sup>1</sup> <sup>+</sup> a%)*<sup>J</sup>* ; 12: **end for** 13: Selecting the node whose has *M*axstake as the committer peer; 14: Calculate <sup>Δ</sup>*Egy*reword <sup>=</sup> <sup>1</sup>−*EgyJ*−*<sup>l</sup>* 2 15: Calculate *EgyJ* <sup>=</sup> *EgyJ*−<sup>1</sup> <sup>×</sup> <sup>e</sup> <sup>1</sup> <sup>Δ</sup>*TJ*−1−*<sup>J</sup>* + Δ*Egyconsume* × *P*r + Δ*Egyreword*, 16: Output committer peer.

#### **5. Results Analysis of the Malicious Node Identification Algorithm of Blockchain Technology**

#### *5.1. Simulation Software Setting*

The experimental simulation verifies the performance of the false message detection mechanism on the ONE simulation platform. ONE is a discrete-time engine open-source simulation platform written in the Java language. It is a simulation software that is mainly used to design and evaluate the routing mechanisms of data forwarding and message communication in the Internet of Vehicles. The ONE simulation platform contains a variety of simulation modules, which will be updated during each simulation process to realize the whole simulation function. The main functions of the ONE simulation platform include: mobile modeling of nodes, sending, receiving and processing routing messages, node communication, visual representation of results, etc. This platform has various different communication protocols to simulate the process of message transmission and generate the trajectory information during the transmission process. All ONE's components are independent of each other. ONE simulates the network simulation environment to test and optimize the security scheme performance. In the simulation experiments, a motion model based on the shortest path map was used in the ONE to simulate vehicle behavior on the road. The model initially places nodes in random locations, but selects a specific destination for all nodes in the map. Vehicle nodes are not arbitrary and include various types: emergency vehicles (police cars and ambulances), vehicles with fixed lines (buses and trams), and randomly distributed vehicles (private cars and taxis). There are two scenarios in the simulation experiments: low flow density and high flow density. Each simulation was run 20 times on average. In the experiment, the number of malicious vehicles that sent forged or forged messages in VANET ranged from 10% to 45%. When malicious vehicles exceed 45%, VANET's efficiency will dramatically decline, and it will be unable to provide any reliable services.


#### *5.2. Evaluating Indicator*

According to the requirements of the Internet of Vehicle malicious node identification algorithm, we selected the following indicators to verify the performance and results of the algorithm.

The first indicator is the false alarm rate (*FAR*), detecting the number of messages identified as false using the *Ni* representative, and detecting the number of false messages identified as true information using the *Nj* representative, from which *FAR* can be obtained:

$$FAR = \frac{N\_i}{N\_j}$$

The second indicator is the missed detection rate (*MDR*), where the number of detected true messages identified as false messages is replaced by *Nmiss*, while the number of detected messages identified as true messages is *N*. From this, the *MDR* is obtained:

$$MDR = \frac{N\_{\text{miss}}}{N}$$

Simulation experiments were carried out to verify the results of the malicious node identification algorithm of the Internet of Vehicles, and *FAR* and *MDR* were used to evaluate the results of the Internet of Vehicles' trust evaluation algorithm. The independent variable taken by the experiment is the proportion of malicious vehicle nodes in all vehicle networks, and the results of the malicious vehicle node identification algorithm are evaluated for low-traffic-density and high-traffic-density conditions.

Whether the traffic density is low or high, the malicious node identification algorithm is less than 20%, and the *FAR* decreases as the percentage increases. At the same time, a significant trend towards decreased *MDR* also occurs with increasing percentage. Details are shown below. In the presence of a false information attack and black hole attack, the anti-attack performance of the malicious message detection algorithm is analyzed using several details: delivery rate (*Dr*), average end-to-end delay (*Ad*), and network overhead (*Or*).

First, *Dr* is calculated. The actual meaning of *Dr* is the ratio of the number of messages that are successfully sent to the target node or the designated location to the total number of messages that are generated and sent by the source vehicle nodes in the network. The calculation formula is as follows:

$$Dr = \frac{N\_a}{N\_t}$$

In the formula, the total number of messages generated and sent by the source vehicle node is *Nt*, the number of messages successfully sent to the target vehicle or designated location is *Na*, and there is a proportional relationship between the communication quality between the nodes and *Dr*. In other words, the higher the *Dr*, the higher the communication quality, meaning that the overall network performance is very good. If the *Dr* is lower, then the communication quality is lower, meaning that the overall network performance is very poor.

Second, *Ad* is calculated. *Ad* is a very important indicator when evaluating the antiattack performance of malicious message detection algorithms; by using the Ad evaluation method, how the additional overhead of security measures increases latency in the routing process can be described. The actual meaning of *Ad* is the average time taken to pass a message between two nodes

$$Ad = \frac{\sum\_{n=1}^{N} T\_n}{N}$$

In this formula, the total number of sent messages is recorded as *N*; the total time taken to send each message during *<sup>N</sup>* messages is *<sup>N</sup>* ∑ *n*−1 *Tn*. After analysis, an inverse relationship was found between *Ad* and the overall simulation performance; that is, if *Ad* is shorter, the corresponding performance is better, and if *Ad* is longer, the corresponding performance is worse.

Finally, *Or* is calculated. *Or* is another very important indicator when evaluating the anti-attack performance of the malicious message detection algorithm. This refers to the ratio of the total number of nodes involved showing the target node the total number of nodes involved in forwarding the message to the nodes required for transmission. The calculation formula is as follows:

$$Or = \frac{Num\_{clay}}{Num\_{total}}$$

In the formula, the number of nodes involved in forwarding the packet is recorded as *Numrelay*; the number of all nodes required during the transmission is recorded as *Numtotal*. After analysis, an inverse relationship was found between *Or* and performance. That is, the smaller *Or*, the better the network performance of the corresponding algorithm, the fewer network resources that are occupied and the lower the number of additional nodes that are occupied. However, the larger the *Or*, the worse the corresponding algorithm network performance, indicating that more network resources are occupied and more additional nodes are occupied.

#### *5.3. Simulation Software and Simulation Environment*

#### 5.3.1. Simulation Software

Simulation software: the ONE

The ONE is a discrete-time engine open-source simulation platform written in the Java language. This is a simulation software, which is mainly used to design and evaluate the

routing mechanism of data forwarding and message communication in the Internet of Vehicles. The real-time interactive graphical interface of the ONE simulation is shown in Figure 2.

**Figure 2.** Interactive graphical interface of the emulator.

The emulator involves the classification and number of node types in the network, the path model of node movement, and the number of messages generated by the interaction, which are all displayed in real time in the interface. The ONE simulation platform contains a variety of simulation modules, which will be updated in each simulation process to realize the whole simulation function. The main functions of the ONE simulation platform include: mobile modeling of nodes, sending, receiving and processing routing messages, node communication, visual representation of results, etc. In this simulation platform, various different communication protocols simulate message transmission, and generate the trajectory information during the transmission process. All of ONE's components are independent of each other. The main structure and modules of the ONE simulation platform are shown in Figure 3.

**Figure 3.** Simulation platform architecture.

#### 5.3.2. Simulation Environment

ONE is used to simulate the network simulation environment to test and optimize the performance of the security scheme. In simulation experiments, a motion model based on the shortest map path was used in ONE to simulate vehicle behavior on the road. The model initially places nodes at random locations, but selects a specific destination for all nodes in the map and generates the shortest path from the start to end point using the Dijkstra algorithm. This experiment was implemented on the Helsinki city map, and a scene size of 4500 m × 3400 m was selected for the simulation experiments, as shown in Figure 4.

**Figure 4.** City map of Helsinki, Finland.

In the simulation experiment, the vehicle nodes communicate messages through the IEEE 802.11p communication protocol. The specific experimental simulation parameters are shown in Table 2.


**Table 2.** Experimental simulation parameters are set.

There are two scenarios in the simulation experiments: low flow density and high flow density. Each simulation was run 20 times on average. In the experiment, the number of the malicious vehicles that sent forged messages or forged messages in VANET ranged from 10% to 45%. When malicious vehicles exceed 45%, VANET's efficiency will dramatically

decline, and it will be unable to provide any reliable services. Therefore, this extreme case is not considered in this paper.

The locations of all nodes are shown in Figure 5.

**Figure 5.** The location of all nodes.

To smooth the simulation experiment, some necessary assumptions in the theoretical algorithm and simulation experiments are presented as the basis of the proposed scheme.


#### *5.4. Simulation Results*

To objectively and effectively analyze the malicious node detection mechanism algorithm based on blockchain, the simulation experiment is divided into two groups, looking at the number of vehicles for low-flow-density and high-flow-density scenarios. The results of each experiment are the average of the data obtained from 20 simulations. The simulation experiment takes the proportion of malicious vehicle nodes in the network as the independent variable and analyzes the algorithm's performance under low and high traffic flow densities. The experimental simulation results are as follows (See Table 3).

Overall, high-density scenarios outperform low-density scenarios using this algorithm. The proposed algorithm has a low *FAR* at both high and low densities. This is because this algorithm uses the blockchain to jointly verify the legitimacy of the sending nodes, determine the integrity and reliability of the VANET transmission messages, and greatly improve the identification rate of malicious messages.

*Dr*, *Ad* and *Or* were used to evaluate and analyze the performance, and each experiment was the average of the data obtained from 20 simulations. The simulation experiment

also takes the proportion of all vehicles of malicious vehicle nodes in the network as the independent variable and analyzes the algorithm's performance in the case of low traffic density and high flow density, respectively. The experimental simulation results are as follows (See Table 4).


**Table 3.** The *FAR* versus *MDR* comparison results.

**Table 4.** Comparative results of the D, A, and O.


In general, comprehensive experimental performance analysis can conclude with an increase in experimental simulation time and the gradual increase of malicious nodes in the network. If faced with the experimental simulation time and the high density of malicious vehicle nodes, the above algorithm can still play a significant role, and it has been verified by many scholars.

#### **6. Conclusions**

After a series of performance tests and verification of the results of the malicious node identification algorithm based on blockchain technology, the algorithm proposed in this paper can identify vehicle information in either low- or high-density vehicle scenarios. Based on the judgment of *FAR*, *MDR* and other indicators, the Internet of Vehicles' malicious node identification algorithm based on blockchain technology has a very significant false alarm rate and missing detection rate when identifying vehicle information. In this paper, *Dr*, *Ad*, *Or* and other indicators were selected to reveal malicious node identification algorithm's performance in the Internet of Vehicles. In general, the computing system based on blockchain technology is feasible, and ITS network performance is superior to other algorithms.

In the face of the increasingly prominent security needs and the complex diversity of malicious node attacks in the Internet of Vehicles, to further improve the detection of malicious nodes, the following perspectives could be the focus of future research work. First, the malicious node recognition algorithm model could be optimized to improve the system availability. The algorithm presented here is a result of the limited experimental conditions. A transportation service platform should be considered to evaluate the performance of this plan in real-world transportation networks. Second, the evaluation indicators should be

increased to improve system comprehensiveness. The application of blockchain technology in car networking applications is relatively low at present. Although the application of blockchain technology in the field of car networking has shown a good effect in this paper, the article used in the network evaluation index is not comprehensive. In future, other security metrics will need to be performance evaluated to integrate blockchain technology more comprehensively with automotive networks. Third, traffic scenarios should be enriched to improve the robustness of the system.

This blockchain, car networking, malicious-node-detection mechanism used a ONE simulation platform simulation experiment, looking at high-density and low-density scenario car scenarios to analyze the networking and malicious node identification algorithm performance. The malicious node detection performance of *FAR* and *MDR*, for algorithm models *Dr*, *Ad*, *Or* were also looked at, to conduct a comparative analysis of the algorithm performance. The final experimental results show that the proposed trust detection mechanism is feasible, and the ITS network performance is superior to that of other algorithms.

The blockchain-based malicious node detection mechanism proposed in this paper has a very significant application effect. The aim was build a model in more diversified traffic scenarios to test the security and trust mechanism, which can further improve the detection rate of malicious nodes and optimize the algorithm performance. In the future, this mechanism can be applied to richer traffic scenarios to improve its expansion and robustness.

**Author Contributions:** Conceptualization, J.C.; Project administration, T.L.; Resources, T.L.; Writing original draft, J.C.; Writing—review & editing, R.Z. All authors have read and agreed to the published version of the manuscript.

**Funding:** Authors received funding from Yunnan Province's major science and technology special plan project "Research and application demonstration of key technologies of blockchain serving key industries": 202002AD080002.

**Institutional Review Board Statement:** Not applicable.

**Informed Consent Statement:** Not applicable.

**Data Availability Statement:** Not applicable.

**Conflicts of Interest:** The authors declare no conflict of interest.

#### **References**

