You are on page 1of 9

Journal of Parallel and Distributed Computing 151 (2021) 61–69

Contents lists available at ScienceDirect

J. Parallel Distrib. Comput.


journal homepage: www.elsevier.com/locate/jpdc

Behavior analysis and blockchain based trust management in VANETs✩



Han Liu, Dezhi Han , Dun Li
Shanghai Maritime University, College of Information Engineering, China

article info a b s t r a c t

Article history: The development of vehicular ad hoc networks (VANETs) is facing great challenges. Due to the open
Received 26 August 2020 environment in VANETs, the false information sent by malicious vehicles not only affects the fairness
Received in revised form 13 December 2020 of information interaction but also seriously threatens the driving safety of normal vehicles. Therefore,
Accepted 4 February 2021
the study of trust evaluation and management in VANETs has become hot topics in recent years. In
Available online 15 February 2021
this paper, we propose a trust management model of VANETs based on blockchain. In this model, a
Keywords: hidden markov model (HMM) based vehicle trust evaluation method that improve the accuracy on
Blockchain the detection of malicious behavior is proposed. Besides, a trust management method based on the
VANETs alliance chain is designed, which greatly improves the efficiency of trust updating and querying on
Trust management the premise of security. Simulation results show that the model is promising and feasible, effective in
Behavior analysis the aspects of trust evaluation and trust management.
© 2021 Elsevier Inc. All rights reserved.

1. Introduction VANETs. Besides, RSUs are semi-credible, since they are usually
distributed around the roadside, the lack of reliable security mea-
With the development of IoT and the progress of wireless sures makes it easy for attackers to hijack them. Therefore, the
communication technology, vehicles establish diverse types of way how to effectively evaluate and manage the trust between
VANETs by DSRC [2]. It provides three kinds of services for ve- vehicle and RSU is an essential problem that should be resolved.
hicles: driving safety, traffic efficiency, and information enter- Generally, by collecting and analyzing the historical behavior
tainment [18], in which significantly improves the driving ex- of messages sent by vehicles, the change of trust in vehicles is
perience of users and becomes an essential part of the smart evaluated, and its credibility is calculated. Vehicle behavior can
city. Unfortunately, vehicles cannot support mass data storage be divided into two types, positive and negative. The positive
and large-scale data sharing under the limitation of comput- behavior can increase the credibility value, while negative behav-
ing and energy, so therefore, VANETs transfer computing tasks ior can reduce the credibility value. The added value is generally
to Roadside Units (RSUs) to alleviate the workload and storage less than the reduced value to punish the negative behavior. In
through edge technologies. The RSUs are a number of servers most cases, trust is maintained by a trusted third-party inter-
with strong computing and processing capabilities in roadside, mediary, but there is a single point of failure in this way, as
which can take the computing tasks for vehicles and assist them well as low scalability and throughput with it. In order to solve
transfer information efficiently. RSUs play essential role in dealing
the problems of centralized service, some researches use RSU to
with massive vehicle data, as it provides application services for
manage trust. However, RSUs are usually located in unreliable
vehicles, shares the calculation work of vehicles, and supports the
environments, they are easy to be hijacked. It will cause troubles
efficient and reliable communication among vehicles [22].
such as inconsistent information and untrustworthy services in
Vehicles in VANETs compete with each other for lanes, pas-
trust management services. Moreover, RSUs cannot effectively
sengers, traffic light resources, and other facilities or resources.
evaluate each other’s trust, resulting in huge cost of data sharing.
Nevertheless, there may have some dishonest vehicles in the net-
Blockchain is a public distributed ledger proposed in 2008
work that seek personal benefits by tracking information about
[16]. It ensures data privacy through asymmetric encryption, and
other vehicles and broadcasting them fake information, and any
third party may initiate dishonest action due to the openness of uses consistency algorithms such as PoW to maintain data con-
sistency. The remarkable features of the blockchain make it ideal
to build a trust model in VANETs [1]. With the deployment of the
✩ This document is supported by NSFC under Grant 61672338 and Grant
blockchain to the RSU, the behavior of vehicle broadcasting and
61873160.
∗ Corresponding author. the activity record of RSU are recorded in the non-repudiation
E-mail addresses: liuhanshmtu@163.com (H. Liu), dzhan@shmtu.edu.cn ledger of the blockchain. That is, each entity in the network
(D. Han). can verify and audit the transaction in the ledger. Even if the

https://doi.org/10.1016/j.jpdc.2021.02.011
0743-7315/© 2021 Elsevier Inc. All rights reserved.
H. Liu, D. Han and D. Li Journal of Parallel and Distributed Computing 151 (2021) 61–69

RSU is invaded and its data is tampered with, the integrity and an efficient and scalable blockchain assisted privacy protection
correctness of entire dataset will not be affected. authentication system (BPAS) based on the Hyperledger Fabric
Based on the above considerations, it is proposed in this paper platform that provides automatic authentication in VANETs, pro-
a design of a trust management model for VANETs based on tect the vehicle privacy, and allow the conditional tracking and
alliance blockchain. The main contributions are as follows: effective revocation for misbehaving vehicles. Z. Lu et al. [13,
14] proposed a blockchain-based anonymous reputation system
(1) We analyze the issues associated to the problem stated,
(BARS) to establish the privacy protection model of VANETs.
and put forward the system model, attack model, and
It used the public key as a pseudonym in communication and
assumptions of the VANETs, as also theoretical supports,
used a reputation evaluation algorithm based on direct historical
(2) We propose a vehicle trust evaluation algorithm based on
interaction and indirect evaluation of vehicles to prevent the
the HMM model applied to the vehicle trust evaluation on
spread of forged information. Besides, it used Merkle Patricia Tree
the RSU network. Such an algorithm has higher accuracy
(MPT) to extend the blockchain structure, encrypted and stored
than previous design and has better application value in the
the corresponding relationship between the certificate and the
current environment of extreme computing performance,
real identity in the tree, which can only be decrypted in cases of
(3) We propose a trust management method based on Hyper-
dispute, thus conditional privacy is achieved. In [6,21], the impact
ledger Fabric and then applies smart contract to trust value
of the node mobility on the consensus algorithm is evaluated, and
query and updates, which improves the overall efficiency of
a consensus algorithm suitable for VANETs is proposed to solve
the trust management and ensures better security.
the speed and efficiency problem for the PoW or PoS consensus
The remaining of this paper is organized as follows. In Sec- algorithm on the public chain.
tion 2, related works are presented, while the problem definition The application of blockchain in the mutual authentication
and model design are depicted in Section 3. The HMM-based mechanism between vehicle and RSU are presented in [5,17,23],
vehicle trust evaluation method and alliance chain based trust maintaining the anonymity of vehicles and preventing RSU from
management method are presented in Section 4, the comparison being tampered with. Some of recent researches were inspired
and analysis of the experimental results are shown in Section 5, by the incentive mechanism in Bitcoin and attempted to issue
and finally, concluding remarks and future directions of this paper ’energy currency’ and ’information currency’ in VANETs to boost
in Section 6. information exchange and energy sharing between vehicles as
well as between vehicles and RSUs [12,19].
2. Related work The above research provides an effective solution and refer-
ence for trust management in VANETs. However, there are still
Existing authentication schemes based on the public key in- some deficiencies or defects in these studies. Firstly, most of
frastructure (PKI) system can provide a relatively safe guarantee these studies use probability and statistics as trust evaluation
for the VANETs, although it can still be further improved in methods, which need to be improved in efficiency and accu-
terms of efficiency, balance of safety, and performance. Partic- racy. Secondly, most of these systems use public chain as the
ularly, the traditional centralized service mode has two short- technology selection of blockchain. However, as we all know,
comings, which are single-point failure and flow bottleneck. On the public chain has great defects in consensus efficiency and
the other hand, there is one contradiction between the anony- throughput performance. In the Internet of vehicles, the com-
mous communication of vehicles and the supervision of malicious munication between vehicles is more and more frequent, and
nodes. the amount of data is huge, which requires high timeliness of
In the field of VANETs, trust management, limited vehicle transmission. The traditional public chain is generally based on
privacy, and malicious node detection are hot research topics. The the consensus algorithm such as PoW and PoS, which sacrifice
continuous development of blockchain technology brings new performance in order to ensure making consensus. In addition,
ideas to distributed data storage and management, as it is an most of the trust evaluation models proposed in the above works
effective method to solve the aforementioned problems. are based on simple statistical models, in which the predicted
A. Patel et al. [15] proposed a data transmission scheme called results are often quite different from the actual results. In the real
Vehicle Chain that combines blockchain with elliptic curve cryp- environment, due to the malicious behavior of vehicles, the basic
tography (ECC) to improve the security level of VANETs without assumptions of these models cannot be established. Therefore,
increasing the computing cost. With the distributed characteris- there are still great challenges in the application of public chain in
tics of blockchain, it replaced the trust agent (TA) of VANETs with the trust management of VANETs. In this paper, we build a HMM-
the cluster of authorization servers (AS), to overcome the limita- based model according to the historical behavior of vehicles,
tions of single point fault for TA. According to J. Kang et al. [4], which can detect abnormal behavior and realize the evaluation of
the RSU cannot be fully trusted as a vehicle edge computing trust. Besides, a trust management system based on the alliance
server, and the attack or hijacking of a RSU will cause serious chain is proposed, which has great advantages in throughput and
security and privacy challenges to the platform. Thus, this paper efficiency than the traditional public chain.
applies alliance blockchain and smart contract technologies to
data storage and sharing in vehicle Edge networks to improve 3. Definition and model design
security. It also proposed a threeweight subjective logic model to
precisely manage the trust degree of vehicles, and demonstrate In this section, it is defined and analyzed the trust-related
its high efficiency in vector data sharing through experiments. problems of VANETs, and then design and build models overcom-
W. Liang et al. [7–10] proposed a DRL-based virtual IP detection ing the issues encountered.
algorithm and a deep reinforcement learning based algorithms
to ensure the security and circuit copyright of IoT hardware. Z. 3.1. System model
Yang et al. [22] proposed a distributed vehicle network trust man-
agement system based on the blockchain technology in which The system model proposed and designed is composed of
vehicles used the Bayesian reasoning model to verify the infor- three layers: Vehicular Network Layer, Edge-Blockchain Layer,
mation received from adjacent vehicles and generating ratings and CA Layer, as shown in Fig. 1. Each of these layers will be
next, then uploading it to the RSU. Q. Feng et al. [3] proposed discussed separately below.
62
H. Liu, D. Han and D. Li Journal of Parallel and Distributed Computing 151 (2021) 61–69

3.2. Attack model

Based on the brief analysis of the first section, there may


happen potential malicious behavior in both vehicles and RSU
in VANETs. Vehicles can send fake messages to neighbor nodes
and RSUs to compete for resources, or attacked by hackers than
do that actively. The malicious behavior of RSU is usually due
to illegal hijacking by hackers, which will lead to the disclosure
of user privacy data and the tampering of vehicle information.
Specific analysis of malicious behaviors of vehicles and RSUs
follows next.
Malicious Vehicle: The malicious behavior of vehicles is ex-
tremely harmful. Without supervision and punishment, once
some of vehicles in the system acquire the advantage of infor-
mation or road resources through deception, other vehicles will
follow this behavior. This paper attributes the malicious behavior
of vehicles to two types of attacks.
(a) message spoofing attack: For self-interest, the attacker may
Fig. 1. System Model in VANETs. deliberately broadcast false information to occupy more traffic
and information resources. For example, a malicious vehicle may
deliberately broadcast a red light message to seize a lane when
passing a green light intersection. Besides, attackers may broad-
Vehicular Network Layer: As the perception and application
cast harmful messages to disrupt traffic order and threaten the
layer of the VANETs, vehicles play dual roles — as producer
safety of other vehicles.
and consumer, and continuously collect external factors as road
conditions, traffic accidents, and other information that may in- broadcast
Vehicle −→ {MSGfake |MSGdanger } (6)
fluence the motion of a vehicle, then broadcast them to the
neighbor vehicles or RSUs. Concurrently, each vehicle receives (b) reject cooperative attack: All the vehicles participating in
information from other vehicles or RSUs, making and returning the VANETs intend to retrieve more information, but they tend
with response actions. to broadcast less information collected by themselves due to the
MSG consideration of fuel consumption, flow, battery, and other costs.
VehicleA ⇐⇒ VehicleB (1) This kind of behavior will damage the fairness in VANETs. (b)
reject cooperative attack: All the vehicles participating in the
MSG VANETs intend to retrieve more information, but they tend to
Vehicle ⇐⇒ RSU (2) broadcast less information collected by themselves due to the
Edge-Blockchain Layer: RSU relies on Edge computing ser- consideration of fuel consumption, flow, battery, and other costs.
vices and acts as a blockchain implementation layer (EB). In this This kind of behavior will damage the fairness in VANETs.
paper, an alliance chain is proposed to select and make use of
Receiv e{MSGoutside } >> Prov ide{MSGown } (7)
blockchain technology and the reasons are threefold. First, RSU
belongs to different operators, so blockchain needs to support Malicious RSU: RSU is located along the road and in a complex
organization crossing. Next, RSUs are not open to the public, and and changeable environment, which results in limited protection
only authorized RSUs can join the network. As the latter one, the by network operators. Because of this unavoidable risk, RSU is
alliance chain’s efficiency is much higher than the public chain, considered to be semi-credible. Once the RSU is intruded, the
which can meet the basic throughput needs of VANETs. attacker can tamper with and delete the privacy data stored in
In this layer, RSU verifies the messages broadcast by vehicles, it. In this paper, the malicious behavior of RSU is classified into
evaluates the trust by analyzing the historical behavior of vehi- two types of attacks.
cles, and stores their trust values in the blockchain. As the peer (a) Denial of service attack: The hijacked RSU cannot provide
node in the blockchain, RSU can store complete data copies as normal services.
redundant backups of other RSUs. Even if a part of the RSUs is
hijacked or down, the data’s consistency cannot be changed. Rate(RSUAv ailability ) << 100% (8)

EB = {RSU1 , RSU2 , . . . , RSU3 } (3) (b) Data consistency attack: Attackers tamper with and delete
the local data of RSUs, which leads to data inconsistency between
different RSUs.
endorse endorse endorse
RSU1 ↔ RSU2 ↔ ... ↔ RSUn (4)
DataRSU1 {...} ̸ = DataRSU2 {...} (9)
CA Layer: As a trusted organization, Certificate Authority (CA)
is mainly used to issue certificates and private keys for RSU, 3.3. Assumptions
store public keys and provide authentication services for other
entities. CA is strictly protected, ensuring reliable serviceability. In order to realize the system model proposed above, this
CA only provides authorization service for RSUs when they join paper puts forward the following 4 assumptions according to the
the network, so even if it has a single point of failure, it will not actual situation and general experience.
cause serious impact on the system. In addition, CA receives strict
protection and monitoring, once it fails, which can be recovered Assumption 1. Because the attacker’s ability is not enough to
in a short time. In the actual distributed system, CA can be backed control the whole RSU cluster (less than 50%), the possibility of
up by multiple computers. a large-scale intrusion of RSU is very low. In addition, due to the
Sign PK &Certs regular security inspection of network operators, hijacked RSUs
Vehicle ⇀
↽ CA → RSU (5) can be found and recovered in time. Based on these facts, it is
63
H. Liu, D. Han and D. Li Journal of Parallel and Distributed Computing 151 (2021) 61–69

assumed that an attacker can only invade a small number of


RSUs in a short time. This assumption is a prerequisite for the
successful implementation of blockchain on RSU (the solution of
Byzantine problem).

Assumption 2. The existing PKI encryption system (such as RSA)


cannot be brutally cracked. Assumption 2 is the theoretical guar-
antee of RSU authentication and blockchain data security.

Assumption 3. The computing power of RSU is excessive, and the


memory and storage can be expanded as needed, which is enough
to meet the diverse computing requirements. This assumption Fig. 2. Hidden Markov Model.
eliminates the limitation of RSU on computing performance and
storage space, provides physical support for the proposed model
and method in this paper.

Assumption 4. CA is trusted and well protected. It can store the


certificate and public key of RSU completely. Assumption 4 is a
necessary condition for building alliance blockchain in the RSU
network. The conditions for this assumption have been given in
the previous section.

4. Proposed algorithms

This section describes the theory and algorithm in detail,


which is divided into two parts: trust evaluation and trust stor-
age.
Fig. 3. HMM in trust assessment of VANETs.
4.1. HMM-based trust evaluation algorithm

4.1.1. Hidden Markov model


that case, we calculate the probability of observation sequence
The HMM is an extension of the markov model. For the markov
according to the given model.
model, the given observation sequence can determine the state
Problem 2, prediction problems. Given the model λ = (A, B, π )
transition sequence. However, in practice, given an observation
and a sequence of observations O, find Q .
sequence, it is often impossible to directly determine the se-
Problem 3, learning (training) problems. Given a sequence of
quence of state transition (for example, take out small balls of
observations O, the dimensions N and M, find the model λ =
different colors from each jar, but it is impossible to know the
sequence of jars), in which the process of a state transition is hid- (A, B, π ) that maximizes the probability of O.
den. This kind of stochastic process is called the hidden Markov
process, as shown in Fig. 2. HMM has one more sequence than 4.1.2. HMM-based trust evaluation algorithm
markov model, and can be expressed as: λ = (I , Q , O, V , A, B, π ). Inspired by HMM, we propose a HMM-based trust evaluation
I = {i1 , i2 , i3 , . . . , iT , iT ∈ Q }, represents state sequence algorithm, which combines the behavior of sending messages by
(hidden). The state sequence is generated by Hidden Markov vehicles with the intrinsic authenticity of messages.
random chain, which is not observable. In the above example, it Next, we will consider the issue of vehicle trust assessment in
is the sequence of jars. VANETs, as shown in Fig. 3.
Q = {q1 , q2 , q3 , . . . , qN } represents possible states of the Vehicle continuously collect traffic accidents, road conditions
Markov process, N is number of states in the model. It is different and other information in the process of driving, and broadcast it
number for the jar in the example. to the neighbor vehicle or RSUs. We use the category of events in
O = {o1 , o2 , . . . , oT , oT ∈ V } represents observation sequence, the message as observation set Oi . All event categories form the
T is the length of sequence. Each state outputs one observation, status set V . The authenticity of information is the hidden value.
and one state can correspond to multiple observations. It is a Here, we use a set of discrete values [−k, +k] as Q . The history
sequence of the colors of the ball in the example. of messages sent by the vehicle can be used as O. According
V = {v1 , v2 , v3 , . . . , vM } stands for a set of possible observa- to the practical experience, the behavior of vehicles is regular,
tions, M is number of observation symbols. In the example, it is honest, and positive in most cases. The description of Trust-HMM
the kind of color that the ball may appear. is shown in Table 1.
A = [aij ]N ×N represents state transition probabilities. aij = Based on the above analysis, we can establish a HMM-based
P(qj at t + 1|qi at t), 1≤i, j≤N represents the probability of tran- vehicle trust evaluation method. This algorithm has the following
sition from time t + 1 to state Q when time t is in state Q . 4 main steps, as shown in Fig. 4.
B = [bj (k)]N ×M represents observation probability matrix. Step 1: This step is the initialization phase, the RSU will set
bj (k) = P(vk |j), 1≤k≤M , 1≤j≤N indicates the probability of out- the initial parameters for the vehicle. RSU sets the trust value to
putting the symbol vk in the state j. the initial value of 100 for the vehicle. The HMM-based model
π represents initial state distribution. parameters are also set to initial values.
There are three fundamental problems that we can solve using
VTi ← 100 (10)
HMM.
Problem 1, probability calculation problems. Given the model Step 2: Vehicles sent msg to RSU. Then, the RSU collects the
λ = (A, B, π ) and a sequence of observations O, find P {O|λ}. In history of messages sent by each vehicle. Messages are divided
64
H. Liu, D. Han and D. Li Journal of Parallel and Distributed Computing 151 (2021) 61–69

Table 1
Description of Trust-HMM.
Symbol Description
I Behavior history of vehicles sending message.
Q Authenticity of message.
The hidden value, ∈ [−k, +k].
V Event category:
Accident, Communication, Multimedia.
The value of observations, ∈ {1, 2, 3}.
O Message history, the observation set.
Stands for the behavior of vehicles.
A State of behavior transition probabilities, need
training.
B Observation probability matrix, need training.
≈ Initial state distribution, need training.

into three classes according to the event category: traffic accident,


communication and multimedia. According to the problem3 in
HMM, the RSU trains the vehicle’s trust assessment HMM model
through the event category history. Here we use unsupervised
learning method to train the model, because the behavior of the
vehicle is not marked in advance.
RSU train
MSG −→ History −→ HMM (11)

Step 3: When the model tends to be stable, the hidden value


of the new message is calculated according to problem 2, then
iterate the model use this message.

q ← HMM(MSGnew ) (12)

Step 4: RSU uses the hidden value to update the trust value,
then write it to blockchain system. This step needs to interact
with the blockchain. Once trust value of the vehicle is written
into the database, all the update operations will be written into
the ledger and cannot be tampered with. Fig. 4. Steps of HMM-based vehicle trust evaluation method.

VTi ← VTi + q (13)

The trust threshold coefficient is k, 0 < k < 1: cannot be affected. Other RSUs can also verify the authentic-
ity of the message through the hash traceability feature of the
1, VT ≥ k · 100
{
isTrust = (14) blockchain. The system can generate multiple pseudonyms for the
0, VT < k · 100 vehicle and store their corresponding relationship with the real ID
into the blockchain to protect the privacy of the vehicle.
When the RSU finds that isTrust = 0 (standards for untrustwor-
In this paper, all RSUs are regarded as peer nodes to build a
thy), the vehicle will be warned or punished.
blockchain network to jointly maintain blockchain data. RSUs of
different operators can be divided into different channels (chan-
4.2. Hyperledger based trust storage nel is a special concept in hyperledger, in the alliance chain,
each channel maintains an independent ledger, and channels are
Hyperledger Fabric is an open source project supported by isolated from each other).
Linux foundation, which aims to provide a modular platform for
blockchain solutions. It has the following advantages. Channeln ← {RSU1 , RSU2 , . . . , RSUm} (15)
(1) Alliance chain, with complete authority control, members There are three types of data to be stored in the blockchain
can only join the network by authentication, with good data system. The first is the relationship between vehicle’s real ID and
sharing and privacy protection. pseudonym.
(2) Modular design, consensus mechanism and encryption
algorithm are pluggable. Data1 = ({pse1 , pse2 , . . . , psek }, ID) (16)
(3) Container technology, each node and chain code runs in The second is the history messages of vehicle.
the docker, as a result, the environment between containers is
isolated, that ensures the security of the smart contract to the Data2 = (ID, {VH1 , VH2 , . . . , VHn }) (17)
greatest extent. The third is the vehicle’s trust value.
In short, it overcomes the shortcomings of public chain, such
as low throughput, low consensus efficiency and easy branching. Data3 = (ID, VT ) (18)
RSU can store privacy information, and keep a complete copy Data in Hyperledger Fabric can be modified by using chaincode
of other RSUs by blockchain. When some RSUs halt, other RSUs transactions, it provides the ability to query or update data. As
can provide services as backup immediately. In addition, the RSUs shown in Fig. 5.
in the system endorse each other. Even if there are hijacked RSUs Unlike bitcoin transactions in blocks, data in Hyperledger Fab-
tampering with local data, the data security of the whole network ric is not linked to each other directly by chains, but stored in
65
H. Liu, D. Han and D. Li Journal of Parallel and Distributed Computing 151 (2021) 61–69

Algorithm 1 Query Vehicle’s Trust Value.


Input: ID
Output: VT or Error
1: @implement SmartContractInterface
2: while Invoke() do
3: CStub = ChaincodeStub
4: State, err = CStub.GetState(ID)
5: if err != null then
6: return Error(err.Text)
7: else
8: VT = GetVTBy(State)
9: return VT
10: end if
11: end while

Algorithm 2 Add Vehicle’s Trust Value.


Input: ID, VT
Output: OK or Error
1: @implement SmartContractInterface
2: while Invoke() do
3: CStub = ChaincodeStub
4: State, err = CStub.GetState(ID)
5: if err != null then
6: return Error(err)
7: end if
8: err = CStub.PutState(ID,VT)
9: if err != null then
10: return Error(err.Text)
Fig. 5. Data storage in Hyperledger Fabric.
11: else
12: return OK
13: end if
the database as key–value pairs, which state changes are recorded 14: end while
as transactions in a ledger of different channels. In Hyperledger
Fabric, real data is called ‘‘Word State’’ that can be modified,
while all modification records of data are written into the ledger Algorithm 3 Update Vehicle’s Trust Value.
(blockchain), which is immutable. In addition, it puts forward
Input: ID, VTnew
an index for the ledger to speed up the query. Compared with
Output: OK or Error
bitcoin’s single data type (number), data in Hyperledger can
1: @implement SmartContractInterface
be represented in binary, JSON, XML and other forms, which
2: while Invoke() do
makes data more extensible to meet the needs of more business
3: CStub = ChaincodeStub
scenarios.
4: State, err = CStub.GetState(ID)
We use CouchDB (an open-source K-V database) as the
5: if State == null then
blockchain database. The key (K) is the ID of a vehicle, and the
6: return Error(’Vehicle ID Not Exist’)
value (V) is the trust value. All the operations on the trust value,
7: end if
such as querying or modifying, will be recorded as a transaction
8: err = CStub.PutState(ID,VT)
in a block. After a consensus has been reached, the block will be
9: if err != null then
written into the blockchain (ledger).
10: return Error(err.Text)
From the above steps, we can see that there are three main
11: else
operations in interaction with blockchain: add, update and query.
12: return OK
We implements three kinds of APIs with the smart contracts. One
13: end if
is the query function, which can query the vehicle’s trust value
14: end while
according to the vehicle’s pseudonym (ID). The implementation
of the smart contract is shown in Algorithm 1.
query(ID) → VT (19)
5. Experiment and analysis
The other is the add function, which can add the vehicle’s
trust value with the vehicle ID. The implementation of the smart
In order to verify the effectiveness and performance of the
contract is shown in Algorithm 2.
trust management model proposed in this paper, we design two
add(ID) ← VT (20) groups of comparative experiments. The first group is between
our HMM-based and distance-based Bayesian inference algo-
The last is the update function, which can modify the vehicle’s
rithms on VANETs trust evaluation. The second comparison is
trust value according to the vehicle ID. The implementation of the
smart contract is shown in Algorithm 3. between our alliance chain based and public chain based methods
on VANETs trust management. The experimental environments of
update(ID) ← VTnew (21) this paper are shown in Table 2.
66
H. Liu, D. Han and D. Li Journal of Parallel and Distributed Computing 151 (2021) 61–69

Table 2
Hardware and software environment of the experiments.
Type Content
CPU i7 7500u 2.9 GHz
Memory 8G
Hard Disk 256G
OS Mac OS 10.14
docker v19.03
docker-compose v1.24
node v12
golang v1.12
Hyperledger Fabric v1.4.3

Fig. 10. Comparison of the accuracy between proposed method and


distance-based Bayesian inference method.

as ‘‘AddTrust’’, this action will also be written to the block. As


shown in Fig. 9, outsider can query the trust value of a vehicle by
‘‘QueryTrust’’ function.

5.2. Comparative experiments of trust evaluation methods

Fig. 6. All system nodes in blockchain system.


In some existing studies [20,22], the reliabilities of the vehicles
are calculated by Bayesian inference. In their model, the distance
between the vehicle and the receiver is the criterion to evaluate
the authenticity of messages: the farther the distance, the lower
the message credibility, and the closer the distance, the higher
Fig. 7. Process of AddTrust in TrustContract. the message credibility. Nevertheless, we believe that this kind of
evaluation method is highly subjective, since vehicles with close
or far distance have equal possibilities for malicious behavior in
reality. We compare the HMM-based method we proposed to the
distance-based Bayesian inference method. In the experiment, 12
groups of simulation data are used to test the two methods, and
Fig. 8. Process of UpdateTrust in TrustContract. their accuracy is calculated. These different groups of data are
randomly generated to simulate the actual situation, so there are
some differences between the data sets, which purpose is to test
the robustness and real effect of the two methods under different
conditions. The comparison results are shown in Fig. 10.
It can be seen from the figure that the method proposed
Fig. 9. Process of QueryTrust in TrustContract. in this paper performs well and stably on different data sets.
However, the performance of distance-based Bayesian inference
method is unstable, which shows that this kind of model is not
5.1. Experimental process of blockchain platform universal. The result just proves our previous judgment that the
behavior of vehicles can reflect the real trust value more, while
We use an open-source IoT blockchain experimental platform the distance-based Bayesian inference has more randomness —
based on Fabric-iot [11] to do experiments. This project is de- in other words, the method we proposed can adequately reflect
veloped by the author, which allows users to quickly build an different situations and has a better practical value.
alliance blockchain with simplest shell scripts. In particular, it
has implemented several smart contracts of access control in IoT 5.3. Comparative experiments of trust management model
as examples that can be reused. 3-6. The blockchain system we
built mainly includes: 4 peer nodes, 2 CA nodes, 1 order node, 4 Most of the existing blockchain-based trust management sys-
CouchDB nodes and 1 client node, as shown in Fig. 6. tems in VANETs choose the public chain as the underlying tech-
We implement the trust management model proposed by nology. As we all know, the consensus mechanism selection of
deploying ‘‘TrustContract’’. The calling process and brief steps a blockchain will directly affect its throughput. We believe that
of ‘‘TrustContract’’ are shown in Figs. 7–9, detailed description the throughput of the public chain cannot meet the vehicle net-
of these steps are as follows. As shown in Fig. 7, in process of work’s basic requirements. To prove the QoS (Quality of Service)
‘‘AddTrust’’, a trust value will be save to DB according to the ID advantage of our proposed model, we design an experiment that
of the vehicle as a K-V pair. This action will be written to the block compares ours with the public chain (represented by the PoW
as a transaction. In general, the default value of 100 is added the consensus algorithm). The experiment simulates the time cost of
first time. As shown in Fig. 8, in process of ‘‘UpdateTrust’’, the two blockchain systems to reach consensus on data under the
trust value of a vehicle will be updated according to its ID. If the different number of RSUs ([5, 100]). The experimental results are
value that queried by ID is ‘‘NULL’’, an error is returned. Same shown in Fig. 11.
67
H. Liu, D. Han and D. Li Journal of Parallel and Distributed Computing 151 (2021) 61–69

[3] Q. Feng, D. He, S. Zeadally, K. Liang, BPAS: Blockchain-assisted privacy-


preserving authentication system for vehicular ad hoc networks, IEEE
Trans. Ind. Inf. 16 (6) (2020) 4146–4155.
[4] J. Kang, R. Yu, X. Huang, M. Wu, S. Maharjan, S. Xie, Y. Zhang, Blockchain
for secure and efficient data sharing in vehicular edge computing and
networks, IEEE Internet Things J. 6 (3) (2019) 4660–4670.
[5] K. Kaur, S. Garg, G. Kaddoum, F. Gagnon, S.H. Ahmed, Blockchain-based
lightweight authentication mechanism for vehicular fog infrastructure, in:
2019 IEEE International Conference on Communications Workshops, ICC
Workshops, 2019, pp. 1–6.
[6] S. Kim, Impacts of mobility on performance of blockchain in VANET, IEEE
Access 7 (2019) 68646–68655.
[7] W. Liang, W. Huang, J. Long, K. Zhang, K. Li, D. Zhang, Deep reinforce-
ment learning for resource protection and real-time detection in IoT
environment, IEEE Internet Things J. 7 (7) (2020) 6392–6401.
[8] W. Liang, J. Long, K.C. Li, J. Xu, X. Lei, A fast defogging image recognition
algorithm based on bilateral hybrid filtering, ACM Trans. Multimedia
Comput. Commun. Appl. (2020).
Fig. 11. Comparison of the consensus costs between proposed and public chain.
[9] W. Liang, S. Xie, J. Long, K.C. Li, K. Li, A double PUF-based RFID identity
authentication protocol in service-centric internet of things environments,
Inf. Sci. 503 (2019).
It can be seen from the figure that with the increase in the [10] W. Liang, D. Zhang, X. Lei, M. Tang, K. Li, A. Zomaya, Circuit copy-
right blockchain: Blockchain-based homomorphic encryption for IP circuit
number of RSUs, the time consumed by the public chain to
protection, IEEE Trans. Emerg. Top. Comput. (2020) 1.
reach a consensus (to the premise of ensuring security) increas-
[11] H. Liu, D. Han, D. Li, Fabric-iot: A blockchain-based access control system
ing geometrically, while the method we proposed tends to take in IoT, IEEE Access 8 (2020) 18207–18218.
less time. It is proved that the trust management model based [12] H. Liu, Z. Yan, Y. Tao, Blockchain-enabled security in electric vehicles cloud
on the alliance chain proposed in this paper is more efficient and edge computing, IEEE Netw., 32 (3) 78–83.
than the general public chain, which could meet the needs for [13] Z. Lu, Q. Wang, G. Qu, Z. Liu, BARS: A blockchain-based anonymous
corresponding speed in VANETs. reputation system for trust management in VANETs, in: 2018 17th IEEE
International Conference on Trust, Security and Privacy in Computing and
Communications/ 12th IEEE International Conference on Big Data Science
6. Conclusion and future work
and Engineering, TrustCom/BigDataSE, 2018, pp. 98–103.
[14] Z. Lu, Q. Wang, G. Qu, H. Zhang, Z. Liu, A blockchain-based privacy-
To address the issue that the fake information sent by mali- preserving authentication scheme for VANETs, IEEE Trans. Very Large Scale
cious vehicles threatens the fairness of information sharing and Integr. (VLSI) Syst. 27 (12) (2019) 2792–2801.
the driving safety of normal vehicles, this paper proposes a trust [15] A. Patel, N. Shah, T. Limbasiya, D. Das, Vehiclechain: Blockchain-based
management model in VANETs. In this model, a HMM-based vehicular data transmission scheme for smart city, in: 2019 IEEE Inter-
vehicle trust evaluation method is proposed, which improves national Conference on Systems, Man and Cybernetics, SMC, IEEE, 2019,
pp. 661–667.
the accuracy on the detection of malicious behavior. Besides,
an alliance-based trust management method is designed, and it [16] N. Satoshi, Bitcoin—Open source P2P money, 2019, Accessed, URL https:
//bitcoin.org/en/.
greatly improves the efficiency of trust updating and querying on
[17] R. Sharma, S. Chakraborty, B2VDM: Blockchain based vehicular data man-
the premise of security. Simulation results show that the model is agement, in: 2018 International Conference on Advances in Computing,
promising and feasible, effective in the aspects of trust evaluation Communications and Informatics, ICACCI, 2018, pp. 2337–2343.
and trust management. [18] S. Sun, J. Hu, Y. Peng, X. Pan, L. Zhao, J. Fang, Support for vehicle-to-
The future research can focus on the selection and improve- everything services based on LTE, IEEE Wirel. Commun. 23 (3) (2016)
ment to HMM training model. In addition, testing and training 4–8.
combined with the data in production environment will make [19] Y. Wang, Z. Su, N. Zhang, BSIS: Blockchain-based secure incentive scheme
better results. Finally, blockchain technology is booming, espe- for energy delivery in vehicular energy network, IEEE Trans. Ind. Inf. 15
(6) (2019) 3620–3631.
cially the alliance chain, it is worth updating in time in the
[20] T. Wang, G. Zhang, A. Liu, M.Z.A. Bhuiyan, Q. Jin, A secure IoT service
future. architecture with an efficient balance dynamics based on cloud and edge
computing, IEEE Internet Things J. 6 (3) (2019) 4831–4843.
CRediT authorship contribution statement [21] Y. Yang, L. Chou, C. Tseng, F. Tseng, C. Liu, Blockchain-based traffic
event validation and trust verification for VANETs, IEEE Access 7 (2019)
Han Liu: Conceptualization, Methodology, Software, Writing - 30868–30877.
original draft. Dezhi Han: Validation, Writing - review & editing. [22] Z. Yang, K. Yang, L. Lei, K. Zheng, V.C.M. Leung, Blockchain-based decen-
Dun Li: Visualization. tralized trust management in vehicular networks, IEEE Internet Things J.
6 (2) (2019) 1495–1505.
[23] D. Zheng, C. Jing, R. Guo, S. Gao, L. Wang, A traceable blockchain-based
Declaration of competing interest
access authentication system with privacy preservation in VANETs, IEEE
Access 7 (2019) 117716–117726.
The authors declare that they have no known competing finan-
cial interests or personal relationships that could have appeared
Han Liu received the M.S. degree from the Shanghai
to influence the work reported in this paper. Maritime University, where he is currently pursuing the
Ph.D. degree. His main research interests include big
References data, cloud computing, distributed computing, cloud
security, machine learning, IoT, and blockchain.
[1] M. Atzori, Blockchain-based architectures for the internet of things: A
survey, Soc. Sci. Electron. Publ. (2017).
[2] S. Chen, J. Hu, Y. Shi, Y. Peng, J. Fang, R. Zhao, L. Zhao, Vehicle-to-everything
(v2x) services supported by LTE-based systems and 5g, IEEE Commun.
Stand. Mag. 1 (2) (2017) 70–76.

68
H. Liu, D. Han and D. Li Journal of Parallel and Distributed Computing 151 (2021) 61–69

Dezhi Han received the Ph.D. degree from the Dun Li received the M.S. degree from the Macau
Huazhong University of Science and Technology. He is University of science and technology, and he is
currently a Professor of computer science and engineer- currently doing the Ph.D. degree in the Shanghai Mar-
ing with Shanghai Maritime University. His research itime University. His main research interests include
interests include Cloud computing, Mobile networking, Smart Finance, big data, machine learning, IoT, and
Wireless communication, and Cloud security. blockchain.

69

You might also like