1 INTRODUCTION

Over the last few years, IoV has appeared as a new class of efficient information dissemination technology among communities of users primarily because of their large uses in different fields such as Intelligent Transport Systems (ITS) [1]. A vehicle in IoV behaves as a smart machine that provides various services to the end users with or without the help of the existing infrastructures [2]. IoV environment is characterized by the high number of nodes, the high dynamicity and the random distribution of vehicles on the road [3]. Hence, routing messages to their final destination becomes a very challenging task. In the case of an emergency situation with people’s lives at risk, time of alert sharing is a critical factor, where the messages have to be broadcasted as quickly as possible to prevent injuries and damages from happening. This can be guaranteed only if one ensures a reliable connectivity and fast distribution of messages. For this, clustering techniques have been widely used in various existing proposals to guarantee network connectivity, network security, low network overhead [46] and so on. By definition, clustering algorithms are defined as mechanisms of gathering vehicles and other intelligent machines based on some selected parameters like position, density, speed, direction of nodes, among others [7]. The majority of the proposed clustering algorithms focused on minimal network overhead or minimal number of cluster heads. We believe that all these metrics have less importance compared to the primary goal of providing stable connectivity between nodes, even at the cost of higher network overhead. In this paper we propose a new weight-based clustering algorithm for vehicles environment based on three parameters namely: node safety, node density and node mobility in order to guarantee reliable network connectivity and minimize network overhead. The rest of paper is organized as follows: The precedent proposed works are presented in section two. Section three presents our proposed work. The network architecture is presented in section four. Simulation results and performance evaluation are presented in section five and in the last section we conclude our proposal.

2 RELATED WORK

Several algorithms have been proposed to address clustering issue based on different selected metrics. The authors in [8] proposed a new passive multi-hop for clustering algorithm (PMC) in VANETs, where they used a priority function based on three factors such as: vehicle node degree, the expected transmission count and link lifetime. The link lifetime parameter is calculated based on speed, direction and distance in order to group vehicles and form clusters. Authors assumed that the vehicle node with the highest degree, smallest expected transmission count and longest link life time is selected to be a cluster head with multi-hop strategy. The parameters used in their proposed work show to be important and prominent in improving the quality of service. All the parameters used in this algorithm indicate the quality of link in term of stability but no factor between them indicates the quality of link in term of security of transmission. Authors in [9] suggest to use Bus Node (BN) routes as a reference to collect the moving tracks of nodes such as buses and vehicles and then select suitable CHs. These tracks are used to calculate the contact time between a node and a BN based on time of entering to BN zone radius (meet time) and time of departure of BN. The contact time represents spatial and time dependence within the region of use in increasing cluster stability. Based on this reasoning, the authors proposed a new idea by using BN routes and assuming that cluster stability depends on the calculated contact time. Overall, the cluster head election process is based only on meet time and departure time and no other parameters are used. However, these two parameters are not enough to guarantee a stable clustering schema especially in vehicles network. Authors in [10] proposed a new clustering algorithm named MADCCA that considers two factors to select Cluster Heads, which are: density and mobility. The Cluster Heads (CHs) are selected by calculating the standard deviation of average relative velocity and density matrices in their neighborhood. As such, vehicles that have more homogeneous environments will be elected as Cluster Heads and the rest of vehicles in their communication range will be Cluster Members (CMs). The proposed work in [11] CAVDO is based on the dragonflies algorithm taking direction and velocity of participating nodes in the whole network. Through these basic parameters, the basic network is constructed. Initially all dragonflies have not food and enemy. Then, each dragonfly calculates radius neighboring, food and enemy weights for the entire population. After nodes grouping, each time when CHs are selected, dragonflies will be aligned based on speed, velocity, and direction according to CH. To evaluate the fitness of dragonflies, the authors used a multi-objective function. Overall, the proposals cited above are implemented by some of incomplete and insufficient parameters to select the best CHs in a network. In our work we choose to employ three different metrics in order to elect cluster heads with high QoS, namely: node safety, node density and node mobility.

3 PROPOSED WORK

Internet of Vehicles is represented by a directed or undirected graph, depending on the nature of the links, G(t) = (V(t), E(t)) where V(t) represents the set of nodes at time t and E(t) represents the set of links between nodes at time t.

Definition 1. Set n = |V(t)|, s = |E(t)|, eijE(t), eij = (vi, vj) represents a link between two nodes vi and vj at time t, (vi, vj) ∈ V(t), i, j = 1, 2, …., n.

Definition 2. For any node v, set 𝒩(v) is the neighbor nodes set of v; E(v) is the list of links connecting node v with its neighbor nodes.

Definition 3. Non-overlapping clusters are clusters where each node belongs to a single cluster. Set Ci is the cluster i and Cj is the cluster j with (Ci , Cj) ⊂ V; Ci and Cj are non-overlapping clusters if CiCj = Φ, (i ≠ j).

Definition 4. Set dv the node degree that represents the number of neighbor nodes in a k-neighborhood.

In order to ensure a robust connectivity in IoV environment, we use three metrics that have relationship with nodes connectivity in IoV, each parameter is defined below:

Node Safety (S). Safety parameter is an essential factor to guarantee a certain level of safeness. The safety value calculation (Sv) of a node vi is done in the goal of detecting the level of safety of a node vi with its neighboring node vj depending on the performance evaluation of the assigned task. In our work we used the method described in [12], which is used to calculate safety metric in mobile networks. Each node in the network has to calculate its own safety value which is based on two computed variables: direct safety value (1-hop neighbors) and indirect safety value (k-hop neighbors).

The direct safety (DS) of any node vi is the geometric mean of all safety metrics of various actions that occurred on that specific node. Direct safety \(\left( {{{\mathbf{DS}}_{{{{{v}}_{i}}}}}\left( {{{{v}}_{j}}} \right)} \right)\) of a node vi on node vj is calculated as:

$$D{{S}_{{{{{v}}_{i}}}}}\left( {{{{v}}_{j}}} \right) = {{\left[ {\mathop \prod \limits_k \left( {{{p}_{k}}} \right)} \right]}^{{\frac{1}{k}}}},$$
(1)

\({{p}_{k}}\) is a set of k safety parameters as mentioned in [12].

The indirect safety (IS) of node \({{{v}}_{i}}\) on node \({{{v}}_{j}}\) is based on the DS of neighbor node \({{{v}}_{j}}\), and it is calculated as:

$$I{{S}_{{{{{v}}_{i}}}}}\left( {{{{v}}_{j}}} \right) = {{\left[ {\mathop \prod \limits_m \left( {D{{S}_{m}}({{{v}}_{j}}} \right))} \right]}^{{\frac{1}{m}}}},$$
(2)

\(D{{S}_{m}}({{{v}}_{j}})\) is the calculated DS of neighbor node \({{{v}}_{{j~}}}\) and m represents the IDs of neighbor nodes.

The total safety value of each node vi is calculated based on direct and indirect safety values. Total Safety \(T{{S}_{{{{{v}}_{i}}}}}\left( {{{{v}}_{j}}} \right)~\)of node \({{{v}}_{i}}\) on node \({{{v}}_{j}}\)is given by:

$$T{{S}_{{{v}i}}} = {{\omega }_{1}}D{{S}_{{{{{v}}_{i}}}}}\left( {{{{v}}_{j}}} \right) + {{\;}}{{\omega }_{2}}I{{S}_{{{{{v}}_{i}}}}}\left( {{{{v}}_{j}}} \right),$$
(3)

where ω1, ω2 are the weight factors for DS and IS, respectively, with the constraint that ω1 + ω2 = 1.

In our algorithm, we propose to calculate the general Safety value \({{S}_{{{{{v}}_{i}}}}}\) of node vi that represents the sum of total Safety values on node vi. The general Safety value (\({{S}_{{{{{v}}_{i}}}}}\)) of node vi is calculated as:

$${{S}_{{{{{v}}_{i}}}}} = \mathop \sum \limits_{j = 1}^n T{{S}_{{{{{v}}_{j}}}}}\left( {{{{v}}_{i}}} \right),$$
(4)

where n is the number of k-hop neighbor nodes of vi.

Node Density (D). The density (\({{D}_{{{{{v}}_{i}}}}}\)) of node vi is defined as the ratio between the number of links and the number of nodes in a k-neighborhood. To calculate the density parameter (D) we used Eq. (5):

$${\mathbf{D}_{{{{v}_{i}}}}} = \frac{{\left| {\mathbf{e} = \left( \mathbf{u,w} \right) \in \mathbf{E},{{\;}}\mathbf{u}{{\;}} \in \left\{ {\mathbf{v},\mathcal{N}\mathbf{K}\left( {{\mathbf{v}_{i}}} \right)} \right\}{{\;}}w~ \in \mathcal{N}\mathbf{K}\left( {{\mathbf{v}_{i}}} \right)} \right|}}{{\mathbf{d{{v}}_{i}}}},$$
(5)

where \(\mathcal{N}\mathbf{K}\left( {{\mathbf{v}_{i}}} \right)~\) denotes the set of \({{{v}}_{i}}\) neighbors and \(d{{{v}}_{i}}~\) is the number of \({{{v}}_{i}}\) neighbors.

Node Mobility (M). Vehicles moving on the road have different speeds. Furthermore, the speed of a car changes with time. We assume that the node that has the most homogenous speed with its neighbor nodes speeds should take the highest priority to be elected as a CH. By doing so, we can guarantee a long cluster stability. To calculate the priority of each node we use the method described in [13].

$$\mathbf{K}_{{{{{v}}_{i}}}}^{\mathbf{n}} = \left( {1 - \boldsymbol{\alpha }} \right)\mathbf{K}_{{{{{v}}_{i}}}}^{{\mathbf{n} - 1}} + \boldsymbol{\alpha} \mathbf{F}_{{{{{v}}_{i}}}}^{\mathbf{n}},$$
(6)

where \(\mathbf{F}_{{{{{v}}_{i}}}}^{\mathbf{n}}\) denotes the new value of speed and \(\mathbf{K}_{{{{{v}}_{i}}}}^{{\mathbf{n} - 1}}\) the previous exponential-weighted average speed of node vi ; \({\mathbf{\alpha }}\) is a factor \(0 \leqslant {\mathbf{\alpha }} \leqslant 1\), we set its value to 0.5.

In order to determine the convergence of any node’s (v) speed to the average speed of its neighbors. Each node v calculates its effective average relative speed based on the average speeds of its neighbors. For a node vi we denote \({{u}_{{{{{v}}_{i}}}}}\) the average speed of its neighbors. Then, \({{u}_{{{{{v}}_{i}}}}}\) is calculated as

$${\mathbf{V}_{{{{{v}}_{i}}}}} = \frac{{\sum\limits_{j = 1}^N {{\mathbf{K}_{{{{{v}}_{j}}}}}} {{\;}}}}{N},$$
(7)

where \({\mathbf{S}_{{{{{v}}_{j}}}}}\) is the speed of each neighbor of node vi; N is the number of the neighbors of node vi. Then, the speed difference between node vi and the average speed of its neighbors can be calculated as:

$${\mathbf{M}_{{{{{v}}_{i}}}}} = \left| {\frac{{{\mathbf{k}_{{{{{v}}_{i}}}}} - {\mathbf{V}_{{{{s}_{{{{{v}}_{i}}}}}}}}}}{{{\mathbf{k}_{{{\text{ma}}{{{\text{x}}}_{{{{{v}}_{i}}}}}}}} - {\mathbf{V}_{{{{s}_{{{{{v}}_{i}}}}}}}}}}} \right|,$$
(8)

where \({\mathbf{K}_{{{\text{ma}}{{{\text{x}}}_{{{{{v}}_{i}}}}}}}}\) denotes the maximum speed of its neighbors.

After the calculation of the three metrics (S, D, M), the weight value Wv of a node v is calculated as:

$${\mathbf{W}_{{v}}} = {\boldsymbol{\omega }_{1}}\frac{1}{{{\mathbf{S}_{{v}}}}} + {\boldsymbol{\omega }_{2}}\frac{1}{{{\mathbf{D}_{v}}}} + {\boldsymbol{\omega }_{3}}{\mathbf{M}_{{v}}},$$
(9)

where \({{{\mathbf{\omega }}}_{i}}\) are the weighting factors for the corresponding metrics and \(\sum {{{\boldsymbol{\omega }}}_{i}} = \) 1.

4 OUR NETWORK ARCHITECTURE

Our network topology is organized in clusters (Fig. 1); each node can take one of the following states: Cluster head, core member, margin member, not-decided and gateway node. Initially all nodes are in the not-decided state, as time progress each node attempts to join a cluster by being in one of the three states CH, member or gateway.

Fig. 1.
figure 1

General structure of our network topology.

Cluster Head (CH): it is the coordinator of the group (cluster). It has additional functions such as: channel access, routing data, bandwidth and channel allocation, forwarding inter-cluster packets, among many.

Gateway: is a node (not CH) which works as the common access point for two or more cluster heads, when a node remains within the transmission range of two cluster heads.

Core Member (COM): is an ordinary node (not a gateway or CH). The cluster-head is one of the core members of the cluster. All members of the core are 1-hop neighbors to the cluster-head.

Margin Member (CAM): is an ordinary node but it is the k-hop neighbors of the cluster-head with k ≥ 2.

(1) Neighbor nodes detection. Initially, all nodes take the not-decided state. Over time, the network nodes exchange periodically HELLO messages in order to share their states and information. The HELLO message includes: the source node address, the node state, weight value, neighbor nodes list, the cluster head address and neighbor clusters addresses. Through such information each node can establish, record and update its neighbors list (keep local topology).

(2) Cluster heads selection process. Once all network nodes detect themselves, we apply the cluster head selection process. In this phase, each node has to calculate its weight value (W) as presented above and shares it by broadcasting a weight-val (my-id, my-weight) massage to its k-neighbors. After receiving the weight-val message, each node is responsible of updating its table of neighbors. Once all information about k-neighbors is available, the node that has the lowest (W) value, is elected as Cluster Head. If there is more than one node that has the same lowest (W) value, in this case we compare by Safety value (S), where the node that has the highest Safety value is selected as cluster head. In the case where the problem is not solved the node with highest density (D) is elected. After selecting the Cluster Head, the elected CH shares its state to its k-neighbors by sending a CH_elect (my-id, my-ch-id) message to all network nodes.

(3) Cluster node join process. At the reception of the CH_elect messages from different CH, each node sends a Join Request (my_id, my_Safety_value) message to its different Cluster Heads. The corresponding Cluster Head responses with an acceptance message, the node updates its state to either core member or margin member.

(4) Gateway election. Each Cluster Head is responsible of selecting its gateway nodes. The nodes that have margin member states and they belong to different clusters are candidates to be gateway nodes. The selection of gateway node process is based on the Safety value received in Join Request message. The node that has the highest Safety value S is selected as gateway node. If there are several nodes that have the same highest Safety value S, then the gateway candidate with the lowest (W) value is selected.

(5) Cluster Maintenance Phase. The clusters maintenance phase attempts to update and adapt with topology changes that can be caused by the different movements of nodes. In our proposal there are three distinct kinds of events to apply cluster maintenance algorithm: the node movement, the Safety value change in getaway nodes and the weight value change in the cluster head. In each event, each node updates the information required.

(a) Node Movement

A node in the network has two types of movement. The first one when it enters a range of a new cluster, in this case the new node sends Join Request message to the corresponding cluster head and waits for the response. The second type when a node stays away from its cluster, in this case, the concerned node modifies its state to not-decided and tries to find another cluster to join. For either type, the state of the node should be updated.

(b) Safety Value Change

The parameters values change over time based on interactions between nodes. In our algorithm, all parameters values of each node are verified periodically. When a node acquires new neighbors or loses some due to its movement, the Safety value of this node changes. In the case where Safety value changes, cluster maintenance algorithm should be applied. If the malicious node is the CH, the member nodes have to change their cluster head locally to avoid the re-clustering (more overhead) of the whole network. The nodes seeking to change their malicious cluster head, find the node with lowest weight value amongst the k-hop neighbors to be their CH. In the case where the malicious node is a member node or gateway then, the CH eliminates this node from its cluster.

(c) Weight Value Change

The nodes movement changes the weight value of nodes by changing their own (safety, mobility, density). In our proposal, the weight value of each node is verified periodically. In the case where the weight value of a member node becomes lower than the weight value of its cluster head then the re-election process of a new cluster head is applied locally. The precedent CH becomes a member node and the member node that has the lowest weight value becomes a CH.

Algorithm 1. Cluster Heads Election Algorithm

Algorithm 2. Gateways Election Algorithm

Input: G = (V,E), vi ∈ V

Output: CHs = Cluster Heads

\({\mathbf{S}_{{{{v}_{i}}}}}\) = \({\mathbf{D}_{{{{v}_{i}}}}}\) = \({\mathbf{M}_{{{{v}_{i}}}}}\) = 0 // initialization

W(vi) = 0, Cid- vi = 0

K = 5

For (All vi ∈ V) Do

\({\mathbf{S}_{{{{v}_{i}}}}}\) = Safety_calculation (vi)

\({\mathbf{D}_{{{{v}_{i}}}}}\) = Density_calulation (vi)

\({\mathbf{M}_{{{{v}_{i}}}}}\) = Mobility_calculation (vi)

W(vi) = ω1\(\frac{1}{{{{S}_{{{{{v}}_{i}}}}}}}\)+ ω2\(\frac{1}{{{{D}_{{{{{v}}_{i}}}}}}}\) + ω3\({{M}_{{{{{v}}_{i}}}}}\)

Distribute Neighbors (weight-val-msg (W(vi)))

For ((All vj 𝒩(vi)) And (vi ≠ vj)) Do

  —Extract and Store the information received from the    weight-val messages in its neighbors table.

  —Compares the received weights of all its k-hop    neighbors with its own weight value.

If (W(vj) is the Minimum) then

  CH vj = vj // vj elected as CH

  Status (vj) = Cluster Head

  Cid- vj = CH vj

  Broadcast_K-Neighbors (CH_elect(vj))

Else

   vj waits reception of CH_elect message sends by the node   that has the highest weight value in its k-neighborhood

End If

End For

End For

Input: G = (V,E), vi ∈ 𝒩(CH vi), vi = margin member

Output: gi = Gateway node

For (each neighbor cluster) Do

For ((All vi ∈𝒩(CH vi)) And (state(vi)=

   margin member)) Do

   If (\({\mathbf{S}_{{{{v}_{i}}}}}\) is the Maximum) Then

   gi = vi

   State (vi) = Gateway.

  Else

   For (((All vj 𝒩(CH vi))And (state (vj)

    = margin member)And(vi ≠ vj)) Do

     If (\({\mathbf{S}_{{{{v}_{i}}}}}\) = \({\mathbf{S}_{{{{v}_{j}}}}}\)) Then

      CH vi chose the gateway node with

      the lowest weight.

     End If

    End For

End If

End For

End For

Algorithm 3. Local Cluster Maintenance Algorithm

Algorithm 4. Node Join Cluster Algorithm

For (All active viV) Do

If (state (vi) = Cluster Head) Then

  vi distributes an abandon role message to

   its cluster members.

  —vi changes its state to not-decided and looks

   for a new cluster to join it (algorithm 4).

For (All vj ∈ 𝒩(vi)) Do

  vj changes its cluster information.

  vj calls the CH election algorithm to reselect a new CH.

End For

Else

If (state (vi) = core member Or state (vi) =

  margin member Or state (vi) = gateway)

  Then

  vi sends a moving message to its CH.

  vi changes its state to not-decided and

   looks for a new cluster to join it (Algorithm 4).

  For (All vj ∈ 𝒩(vi))Do

   If (state(vj) = Cluster Head)Then

   changes information about the moving node.

   informing member nodes of the moving node by     sending an information message to them.

   If (state (vi) = gateways) Then

    CH node calls the gateway election

     Algorithm to re-elect a new gateway.

   End If

  Else

   Updates information related to the moving node.

  End If

  End For

End if

End if

End For

For (All moving viV) And (state (vi) = notdecided) Do

vi sends a request message to the corresponding   Cluster Head to join the cluster and waits a T period   of for response.

If (no response arrives after time T) Then

  vi increases its transmission power to reach more    CHs.

  vi sends a request message to other Cluster Head

Else

  If (vi receives one Join Accept message)

  Then

  vi joins the corresponding Cluster and updates its    state to member node (Core or Margin) and all    important information.

  Else

   vi joins the Cluster that has the highest weight     value among all CHs that have replied with Join     Accept message.

   vi changes its state to member node (Core or     Margin) and all important information.

  End If

End If

End For

5 SIMULATION AND PERFORMANCES EVALUATION

In this section we performed different simulation scenarios and comparison between our proposed work and the recent existing proposals MADCCA [10] and CAVDO [11]. We used a combination of simulation tools in order to obtain a realistic vehicular environment where we used Network simulator NS3 [14] for network nodes interaction, SUMO [15] was used to simulate vehicles mobility. We generated realistic scenarios using MOVE [16], where speed of vehicles varies between 60 to 120 km/h, we used the IEEE 802.11p as a media access type with setting 300 m as the transmission range for nodes with data rate of 1 Mbps.

Average Number of Clusters: It is defined as the number of clusters that are already formed in the network since inception to any instance of time with different number of nodes. As shown in Fig. 2, each time the number of nodes increases, the average number of clusters also increases for all algorithms which is logical. The high number of nodes makes network more divisible into several clusters. However, our proposal approach creates continuously fewer clusters compared to other simulated clustering algorithms, this is owed to density metric used in our proposed algorithm that allows to select the CHs that have a high number of neighbors. Moreover, our proposed approach used the concept of k-hops distance to form clusters that allows to create less clusters comparing to 1-hop gathering process.

Fig. 2.
figure 2

Average number of CHs vs. number of nodes.

Average Cluster Duration: It is the time duration between a vehicle becoming a CH and the moment it discharges the responsibility of CH. Figure 3 shows the period of time that clusters can resist with different number of nodes. As shown, when having less than 800 nodes, the MADCCA [9] and CAVDO [10] algorithms perform better than our algorithm, and this can be explained by the small number of nodes that form clusters which led to fast disconnections. Otherwise, when the number of nodes increases to more than 800, our proposal shows better clusters stability compared to other clustering algorithms. Such a good performance is owed to the mobility metric used during CHs election process that keeps connection between neighbors.

Fig. 3.
figure 3

Average CHs duration vs. number of nodes.

Average Rate of CH Change: Average Rate of CH Change is defined as the total number of CH changes per second with variation of nodes numbers. Average Rate of CH Change shows the level of cluster’s stability, low Average Rate of CH change means that the selected CH has a robust connection with its cluster members. As depicted in Fig. 4, our proposed algorithm shows the most stable changes and the least variation compared to the other two clustering algorithms. The good behavior of our algorithm is related to the use of mobility metric in CHs selection process, where the node that has a close velocity to its neighbors is selected as CH. Moreover, Safety metric used in our proposal to calculate weight value allows to choose the trusted nodes to be CHs which in turn ensures stable connection.

Fig. 4.
figure 4

Average rate of CH change vs. number of nodes.

6 CONCLUSIONS

Clustering can provide large-scale networks like IoV with a hierarchical network structure to facilitate routing operations and network management. In this paper we proposed a new clustering algorithm for IoV environments, where we used a combination of three metrics, namely: node safety, node density and node mobility. For each group of nodes, a Cluster Head must be elected based on the three metrics previously cited. The variety of metrics used to select Cluster Heads may guarantee a high level of Quality of Service in IoV environment such as: high security, long connectivity, links stability and so on. The performance evaluation phase showed a good behavior of our proposed work when compared to other clustering algorithms in different terms and demonstrate that we achieved 95% of our goals to make IoV network more manageable and stable. As future perspectives to improve our solution in the short and long term, we expect:

—Adding more metrics to fit with other road applications like multimedia applications.

—Analyzing the proposed protocol with analytical methods.