• 沒有找到結果。

Consensus-Based Cluster-Head Election Algorithm

Chapter 3 V2V Communications Model

3.3 Cluster Formation

3.3.2 Consensus-Based Cluster-Head Election Algorithm

Cluster-head election is an influential problem for clustering in VANETs. A cluster-head plays an important role in coordinating and maintaining the cluster.

Therefore, we proposed a consensus-based cluster-head election algorithm which is based on Bully [22] and Paxos [27],[28] algorithms. The proposed algorithm guarantees to reach consensus, fault-tolerant and reduce the number of message passing in the cluster-head election process. The proposed consensus-based cluster-head election algorithm has the following three steps:

1. Calculating the cluster-head election criteria;

2. Cluster-head election algorithm 3. New cluster-head announcing 3.3.2.1 Cluster-Head Election Criteria

In the Bully algorithm, the identity number (ID), will be the weight of each node in the election process which is generated by the system. For this reason, we generate a new ID method by node degree and signal strength as the cluster-head election

24

criteria. We propose node degree and signal strength to compute a specific ID that will be used as Vote in the cluster-head election process. The highest voted node will be elected as the CH.

 Node Degree (ND): The overall node degree is the maximum number of vehicles that are directly connected to vehicle i in time t. It expresses asi(t) and defined as Eq. (3.1). connection between i and j exists at time t, and is equal to 0 otherwise.

We use node degree as a benefit criterion in order to make the CH with most connectivity in the cluster. V2V refers to the direct or multi-hop communications among vehicles. So every vehicle has more connected node degree would have less packet loss and better radio coverage. Therefore, the CH will be with the highest node degree to have less maintained cost when it is elected.

 Average RSSI: The Receive Signal Strength Indicator (RSSI)[41] is the value of the received packet signal. The CH with higher average RSSI will have less chance to lose the connection with other CMs. It expresses as i(t)and Where j is the neighboring vehicle that sends package to vehicle i. TheARS( ji, )

is the RSSI between vehicle i and vehicle j. TheNijis the number of the packet signal of vehicle i received from vehicle j.

Every SN received ELECTION message would reply the Vote in OK message to the finder, who is the first detector finding the CH is disconnected. The Vote of

25

vehicle n is calculated as Eq.(3.3):

)

1(n) (t

Voten i (3.3)

The Vote ranking also represents the priority in the cluster. With the highest n Vote in the cluster-head election process, the SN/QCM/CM will be elected as the

CH.

3.3.2.2 Cluster-Head Election Algorithm

The proposed consensus-based cluster-head election algorithm is depicted as follows. When a QCM detects the CH has left its cluster or joined to other cluster, it will send out the ELECTION messages to the higher priority CMs and start the cluster-head election process as shown in Figure 14. The scenario shows that the CM3 is the finder who detects the CH has left the cluster and sends out ELECTION messages to superiors (CM4-CM6) immediately. When every superior CM receives the ELECTION message will also send CHECK_EXIST message to make sure the existence of the CH (Figure 15).

Figure 14: Detecting the CH is disconnect with the cluster

26

Figure 15: The CHECK_EXIST message

After waiting a period time without any response from the CH, all of received ELECTION message CMs will reply OK message to the QCM (Figure 16). As

receiving the OK messages from the superior CMs, the QCM is responsible for sending the GRANT message to the superior CM whose priority number is the highest at present (Figure 17). The message delivery process of the cluster-head election algorithm is shown in Figure 18.

Figure 16: The OK message

Figure 17: The GRANT message

27

CT CH CM3 CM4

CHECK_EXIST CLS_INFO

CLS_INFO CLS_INFO

CHECK_EXIST CHECK_EXIST

CM5

CHECK_EXIST

CHECK_EXIST QCM

CM6

CLS_INFO

CLS_INFO

CHECK_EXIST

OK

OK

OK GRANT

New CH ELECTION

ELECTION

ELECTION

Figure 18: The message delivery of the cluster-head election algorithm Figure 19 shows the granted CH (CM6) broadcasts the PROPOSAL message to remaining CMs in the cluster. Every CM receives the PROPOSAL message has to reply ACCEPT message to recognize the new CH (Figure 20) When more than half remaining CMs reply the ACCEPT messages to the new CH, it will broadcast the COORDINATOR messages to declare himself to be the new CH (Figure 21).

28

Figure 19: The PROPOSAL message

Figure 20: The ACCEPT message

Figure 21: The COORDINATOR message

29

The pseudo code of the cluster-head election process is presented as Pseudo Code 1.

Pseudo Code 1: The cluster-head election process

There are two possible cases may occur during the cluster-head election process.

The detail descriptions are as follow.

(1) The CH is still alive when one SN/QCM starts cluster-head election process When a CM changes its state to the QCM state, or a QCM changes its state to the SN state, it sends the ELECTION message to the SNs/CMs with higher priority number. In VANETs, the package lost or radio coverage might affect the connection between the CH and CMs. When a CM/QCM receives the ELECTION message, it will send CHECK_EXIST message to the CH. If the CH is connecting, the OK message will be sent to the sender. When the node receives OK message from CH, it will send an ELECTION_STOP message to the QCM which starts group reelection protocol. Once the node gets an ELECTION_STOP message, it will recover from the CM state.

If the CH is indeed left, all the nodes received the ELETCION messages will reply OK messages to the finder node. The CM replied OK message will change to be

A node finds that cluster-head is crashed Start the cluster-head election process New CH_ is null

For each node in the network/system Send out ELECTION

Wait for nodes reply For each reply in the group {

Get the highest priority and set node to be New_CH;

}

Send the GRANT to the New_CH

Wait for CH PROPOSAL and COORDINATOR

30

SN and send out ELECTION message to the QCM. The QCM will wait for 3 average times to grant the highest priority one to start the CH announcing protocol. Because the node received the ELECTION message will send out a CHECK_EXIST message and wait for an average time. The QCM wait for 3 average times is more reliable way to send the GRANT message. The SN had replied the OK message to the QCM and will wait for a GRANT message. When it receives the GRANT message, it will start a consensus CH announcing protocol. In VANETs, the consensus will be achieved and reduce many maintain cost in this unreliable environment.

(2) More than one CM detects the CH has left

When more than one CM changes its state to QCMs, they will send the ELECTION message to the node with higher priority. If a QCM sends out ELECTION

message and receive the ELECTION message from other nodes at the same time. The higher priority QCM will send ELECTION_STOP message to ask the lower priority one to stop cluster-head election process. The node received the ELECTION_STOP message will stop the cluster-head election protocol immediately.

31

3.3.2.3 CH Announcing Process

When a SN received the GRANT message will be the nwe CH. The CH is going to be the proposer. The proposer will send its new proposal and announce that he is going to be the CH in this cluster. All the rest SNs will be an acceptor and wait for the PROPOSAL message. The acceptors agree the proposal and reply to proposer. When

more than half nodes in the group reply to proposer, the proposer will make announce to all the nodes to be the CH. After the announce sending, the cluster-head election protocol is done. The message delivery of the new leader announcing is shown in Figure 22.

CM4

CM3 CM5 New CH

CT

PROPOSAL

PROPOSAL PROPOSAL

ACCEPT ACCEPT

ACCEPT

ACCEPT

COORDINATOR COORDINATOR

COORDINATOR

CLS_INFO CLS_INFO

CLS_INFO CLS_INFO

PROPOSAL

COORDINATOR

Figure 22: The message delivery of the new leader announcing

When more than one node send out the PROPOSAL messages at the same process time, each acceptor will accept the PROPOSAL message with higher priority

32

number than itself. For example, one acceptor receives a PROPOSAL message with priority 6. It will reply an ACCEPT message to the proposer. In the meantime, it receives another PROPOSAL message with priority 5. The acceptor will reply a message to sender with priority 5 and say: " There is a SN to be the CH. His priority is higher than you, please stop sending the message." Moreover, the acceptor receives the other PROPOSAL message with higher priority 8, it will accept the PROPOSAL message and send a message with priority 7 to sender to stop the CH announcing.

The Pesudo Code 2 shows the new CH announcing process:

Pseudo Code 2: The new CH announcing process Receive PROPOSAL:

If( Current_Proposal is null)

Reply APPROVE message and set Current_Proposal as sender;

Else {

If(Current_Proposal is higher than sender)

Reply DENY message to sender with the Current_Proposal;

Else {

Reply APPROVE message to sender;

Reply DENY message to Current_Proposal;

Set Current_Proposal to be sender;

} }

Receive ACCEPT:

Increase TOTOAL_ACCEPT_NUMBER;

If(TOTOAL_ACCEPT_NUMBER > (TOTAL_MEMBER_NUMBER/2)) {

For each node in the network/system;

Send the COORINDATOR message;

} Else

Wait for other reply;

33

3.4 V2V Message Dissemination

There are two main working roles, the CH and the CT, in our proposed V2V message dissemination model. The CH is responsible for broadcasting messages to CMs and choosing a CT at the tail of the cluster. The information of which the node is chosen to be CT is included in CLS_INFO message. When the CT receives a message from the CH, it is responsible transferring messages to the back cluster if it receives a broadcasting message from the front cluster. The real-time traffic information, which includes traffic speed, traffic flow, traffic density, traffic accidents/incidents, and other information, can be referenced by road users. In this V2V communications mode, the real-time traffic data is focus on the traffic accident information dissemination. When a car accident event had occurred, an alert message can be warning out from that accident car and transfer to the CH as shown in Figure 23a)(b).

Figure 23:(a) A safety alert message is warming out and; (b) The alert message has transmitted to the CH.

The CH will broadcast the safety alter message to CMs to help the on-coming vehicles avoid the congestion. The proposed safety alert message dissemination model is to propagate adequate and effective message inter-cluster. In our proposed

34

message dissemination model, the CH and CT are responsible for the message dissemination inter the cluster. For inter-cluster communication, the Figure 24a)(b) show that the CT transfers message to the neighboring cluster. In our design, the CT is predefined by the CH and noticed by broadcasting in CLS_INFO message. The proposed safety alert message dissemination process in V2V mode improves the efficiency of inter-cluster communication.

Figure 24:(a)The CH sends the message to the CT in cluster n; (b)The inter-cluster communication via CT

Figure 25 and Pesudo Code 3 display the message dissemination process and pseudo code in V2V communications mode respectively.

35

Figure 25: The message dissemination process in V2V communications mode

Pseudo Code 3: The message dissemination in V2V communications mode Receive Message:

Transfer received message to the hind cluster;

Break;

36

We will use mathematic analysis to calculate the number of message dissemination and the message deliver time in this proposed mode. There areJ clusters to transmit and receive message in the same driving direction. In addition, each vehicle is within the transmission rage of its forwarder. When an accident occurred in the first cluster, Msg is expressed as the total number of this safety alert message dissemination from accident spot to the J cluster. The CTs take th (J 1) times to transfer message to its hind cluster.

In a well-connected environment, we assume that every CT could disseminate message to the CH of its hind cluster. The total number of the safety message dissemination in well-connected environment could be expressed as the following:

M s g1J(J1)2J

In a discrete environment, CT will broadcast the message to the hind cluster.

There is a probability of the next cluster member received the message from front cluster, Pn. The number of the cluster member could be express asMn. The CM who receives message from CT could be expressed as Pn*Mn. The total number of the safety message dissemination in the environment could be expressed as the following:

j-1 delivery time D(t) would be included: the first message sends out from the accident vehicle to the CH, the CH broadcasts to all CMs, (J 1)times of CT sends to the hind cluster. In a well-connected environment, the D(t) is as below.

B

37

B J t

J t

t

D( ) m2h ( 1)(t2c)( )

When in a discrete environment, the message deliver time is as below:

) )(

1 ( ) )(

1 ( )

(t tm2h B J tt2c J B tm2h

D         

) )(

1 ( ) ( ) ( )

(t J tm2h J B J tt2c

D       

38

相關文件