The novel FMSFO protocol has been proposed in this paper to give better energy consumption and secured transmission of data in WSNs by means of efficient clustering method. The proposed FMSFO algorithm includes five major modules such as initialization of system and key generation phase, intelligent rule based fuzzy clustering phase, trust calculation phase, intelligent optimal route discovery phase by MSFO, Data transmission and reception phase by modified elgammal digital signature.
5.1 System Initialization and Key generation phase
The first phase of the proposed system is system initialization and key generation phase. The major goal of this phase to make the public key and private key for all legitimate deployed nodes in the network. The generated public key and private key are used for encryption and decryption of transmitted data which ensures the integrity of the data which is transmitted from sensor node to BS. In this proposed protocol, BS generates the keys and these keys are installed into corresponding sensor nodes during pre-deployment phase. Algorithm1 gives the steps to be followed for the making of the private key by BS.
Algorithm1
Generation of Private keys
Step1: Begin
Step2: Choose the random prime numbers p,q,α by using Pseudo random integer
function. Compute\(?=\left(p-1\right)(q-1)\)
Step3: Compute XA= (P α) mod q
Step4: Compute XB = (q α) mod\(⋋\)
Step5: Compute XC = (pq) α mod pq
Step6: choose two random integer prime number Xg, Xf from z*(P)
where z*(p) is a cyclic Group
Step7: Compute\({X}_{d}={\left({X}_{A}\right)}^{{X}^{g}}mod p\)
Step8: Compute\({X}_{C}={{(X}_{B})}^{{X}_{f}} mod pq\)
Step9: Compute\({X}_{f}={\left({X}_{d}{.X}_{C}\right)}^{?} mod p\)
Return Private key\(\left\{ {X}_{C},{X}_{f}\right\}\)
Algorithm2
Generation of Public keys
Step1: Begin
Step2: Choose the random prime integer numbers β,\({X}_{C},{X}_{f}\)
Step3: Compute\({Y}_{a}= {P}^{\beta }. {X}_{C} mod P\)
Step4: Compute\({Y}_{b}={q}^{p}.{X}_{f} mod q\)
Step5: Compute\({Y}_{C}= {Y}_{b}^{p}.{Y}_{a}^{q} mod pq\)
Step6: choose the two random prime integer\({Y}_{g},{Y}_{f} from {Z}^{*}P\)
Step7: Compute\({Y}_{d}=\left({{Y}_{a}}^{{Y}_{g}} mod pq\right)\)
Step8: Compute\({Y}_{C}=\left({{Y}_{d}}^{{Y}_{b}} mod \left(p-1\right)\right)\)
Step9: Compute \({Y}_{f}=({{Y}_{c}}^{{Y}_{d}} mod {Y}_{b}\))
Return Public PuK= {Yc, Yf }
The generated public key is transmitted to the all the designated nodes in the network by means of secured multiparty key exchange. The proposed protocol employs the generated pair of Asymmetric keys for encryption and decryption purpose secured data transmission in WSNs.
5.2 Intelligent rule based fuzzy clustering phase
The next phase of the proposed system is intelligent rule based fuzzy clustering phase. This phase which sensor nodes have more remaining energy and less hop distance is elected as cluster head (CH) and other remaining nodes acts cluster member (CM). In the proposed protocol the inter and intra-cluster communication are most preferred modes of communication for the nodes of WSNs. in intra-clustering, communication takes place between CM to CH via single hop, and in inter-cluster, the communication takes place between CH to BS via multi-hop. The proposed intelligent rule based fuzzy clustering, works on two phases namely cluster head selection by rule based fuzzy algorithm and cluster formation phase.
5.2.1 Cluster head selection by rule based fuzzy algorithm
In the proposed protocol, for clustering of nodes it considers three input factor parameters such as remaining energy of node, degree of nodes, and distance from nodes to base station are the input variable to generate the fuzzy rules. For lingual version of node residual power has 3 levels namely low, medium, High and for node degree it represented as three levels namely large, moderate, small respectively, and for node distance to BS it is represented as close, approximate and far, respectively. The fuzzy rules outcome of node which is elected as a cluster-head is represented as 7 levels namely very small, small, rather minor, medium, rather heavy, large, and very large. Table 2 gives the output of fuzzy rules for the nodes to elect as the cluster head.
Algorithm3
Election of Cluster head
Input
Fuzzy input variable (R.E, node_degree, dist_to_BS)
Output
Election of efficient CH based on chance value (CH1, CH2, CH3, ……….CHn)
1: { List_CH = 0, CV = 0, count_CH = 0, CM = NULL} //Parameter initialization
2: i = 0,1,2…..n //number of sensor devices in the network
3: vice_CH = FALSE
4: for each node do
5:\(\mu =rand\left(\text{0,1}\right)\)
6: Node_state = CM
7: if (\(\mu <th) then\)
8: vice_CH = TRUE
9: CV = fuzzy(R.E,node_degree,dist_to_BS) //calculate CV using fuzzy if rule.
10: End if.
11: End for.
12: Broadcast CH_msg (id,CV,R.E) to its neighbors
13: Each node j receives the CH_msg from node i
14: If( i(R.E) > j(R.E)) then
15: Vice_CH = FALSE
16: Quit the broadcast CH_msg.
17: End if.
18: If(vice_CH = = TRUE) then
19: Node_state = CH
20: ADD i node as cluster member list (CH_list)
21: CH_list = CH_list + 1
22: End if
23: If(node_state = = CM) then
24: If (CH = = TRUE)
25: Broadcast CH_msg with ID.
26: Node_status = CH
27: CH broadcast node status with ID
28: Ci={CM1, CM2, ………CMn}
29: Else
30: On receiving all CH_msg
31: My_CH = nearest_CH
32: Send join CH_msg(id) to nearest CH
33: End if
34: Exit.
Based on the fuzzy rule generated, the node which has low residual energy, high degree of connectivity, and minimum distance between BS to CM elected as CH. In Algorithm 3 gives the intelligent rule based fuzzy clustering process in the proposed protocol.
Table 2
Chance value for Fuzzy rule based algorithm
Residual Energy
|
Node degree
|
Dist. BS to CH
|
Chance value
|
Low
|
Small
|
Close
|
Small
|
Low
|
Small
|
Approximate
|
Small
|
Low
|
Small
|
Far
|
Very small
|
Low
|
Moderate
|
Close
|
Small
|
Low
|
Moderate
|
Approximate
|
Small
|
Low
|
Moderate
|
Far
|
Small
|
Low
|
Large
|
Close
|
Rather minor
|
Low
|
Large
|
Approximate
|
Small
|
Low
|
Large
|
Far
|
Very small
|
Medium
|
Small
|
Close
|
Rather minor
|
Medium
|
Small
|
Approximate
|
Medium
|
Medium
|
Small
|
Far
|
Small
|
Medium
|
Moderate
|
Close
|
Large
|
Medium
|
Moderate
|
Approximate
|
Medium
|
Medium
|
Moderate
|
Far
|
Rather minor
|
Medium
|
Large
|
Close
|
Large
|
Medium
|
Large
|
Approximate
|
Rather minor
|
Medium
|
Large
|
Far
|
Rather minor
|
High
|
Small
|
Close
|
Rather heavy
|
High
|
Small
|
Approximate
|
Medium
|
High
|
Small
|
Far
|
Rather low
|
High
|
Moderate
|
Close
|
Large
|
High
|
Moderate
|
Approximate
|
Rather heavy
|
High
|
Moderate
|
Far
|
Medium
|
High
|
Large
|
Close
|
Very large
|
High
|
Large
|
Approximate
|
Rather heavy
|
High
|
Large
|
Far
|
Medium
|
5.2.2 Cluster Formation Phase
Once the cluster head has been elected in the network, the next phase is cluster formation phase. In this phase, each node communicates to small set of nodes within its transmission range to form a clustering. BS randomly selects the CH by applying the rule based fuzzy algorithm, to broadcasts the CH_msg with the nodes within the transmission range. Which id’s to all the members for example if the nodes j wants to join the node i cluster member. The node j receives more CH_msg with its id connecting the recently joined ids. Only the remaining nodes that received CH_msg are removed from the node j Cluster member. Once the cluster was formed each CM transmit the sensed information to CH via multi-hop communication by TDMA (Time Division Multiple Access) schedule for transmitting the sensed data. In the proposed system, CH is rotated by applying the intelligent rule based fuzzy clustering algorithm by selecting threshold TH value with time T exceeds then the reduction of cluster head had take place by following algorithm3.
5.3 Trust computation.
The next module of the proposed system is trust computation phase. The proposed protocol employs modified Sun flower optimization algorithm for routing and the trust parameters are include in MSFO. The modified SFO algorithm includes the trust parameters for discovering the optimal path during data transmission. In the proposed protocol the trust model has been coagulated with SFO algorithm to prevent the intruders to perform the various malicious attacks during optimal route discovery process. In the proposed system, for inter-cluster communication MSFO algorithm is employs for discovering the optimal path between CH and BS via multi-hop secure communication.
5.3.1 Point to point trust
Every node x directly interacts with the other node y, by calculating the direct trust by Eq. (7) where PT stands for point to point trust, \({P}_{rv}\left(x\right)\) represent node y that receives packets from node x and \({P}_{fd}\left(y\right)\) represents node y forwarding packets to other node.
$$PT=\frac{{P}_{rv}\left(x\right)}{{P}_{fd}\left(y\right)}$$
7
5.3.2 Indirect trust
Node x must determine the trustworthiness of node y in order to relay a packet, but it has no prior contact history of node y. In this example, node x obtains node y's trust degree from its neighbours, which is determined using Eq. (8)
$$IT=\frac{1}{K}\underset{m=1}{\overset{k}{?}}PT \left(m\right)$$
8
Where IT is the indirect trust, PT(m) is the point to point trust for the message m.
5.3.3 Packet drop trust
The packet drop trust by the way of previous packet drop history with neighboring nodes is computed by employing the Eq. (9)
$$PDT=\frac{1}{k}\underset{m=1}{\overset{k}{?}}\frac{{PD}_{k}}{{PS}_{i,k}}$$
9
Where PDT is the packet drop trust, PDk packet drop in k number of nodes, PSi,k Packet successful ratio in between the node i to k.
5.3.4 Total trust
In the proposed protocol the overall trust score is computed by using Eq. (10). The trust score is 0 to 0.5 indicates low trust score and the trust score in between 0.6 to 1 indicates high trust score. Where (\(\alpha +\beta +\gamma )=1\)
$$Tot Trust=\alpha PT+\beta IT+\gamma PDT$$
10
5.3.5 Malicious node detection and isolation
The proposed protocol computes three level of trust namely point to point trust, indirect trust, and packet drop trust. Based on their computed trust scores, the total trust score is computed by combining the point to point trust score, indirect trust score, and packet drop trust score by Eq. (10).
5.4 Intelligent optimal route discovery MSFO algorithm phase
In the proposed system for an efficient inter-cluster communication, the MSFO is employed to discover the optimal path between CH to BS via multi-hop communication. The MSFO is swarm intelligence algorithm, all the moment are based on the orientation towards the sun, where the sun is the BS. The MSFO algorithm includes the trust value in order to locate the network's rogue node
Algorithm 4
MSFO based optimal route discovery.
Input
Total_trust,dist_to_BS, R.E.
Output
Optimal secure Path selection (CH to BS)
1: Start
2: Parameter initialization
3: {Init_value = 0, X* =0, t = 0, n, max}
4: Generate population
5: Xi(t) i = 0,1,2,3……..n
6: f(Xi(t)) = high(Total_trust) + close(dist_to_BS) + max(R.E)
7: if(Total_trust = = 0) then
8: Find out malicious node inform to BS
9: BS broadcast the malicious node id break the connection from safe node to
antinode.
10: End if
11: Evaluate new CH or Vice_CH fitness function.
12: X*= f(Xi(t)).
13: update the new CH route if their fitness are better than the current values
14: If( t > max) then
15: Repeat calculate fitness function
16: Until condition satisfied
17: t = t + 1
18: End if.
19: Exit.
During the optimal route discovery process, the proposed MSFO identifies the node which has low trust score between 0 to 0.5 and it immediately report to the BS. In return the BS black list the corresponding nodes based on their nodes ids and prevent them to participate in the packet routing process during inter-cluster communication. Then it broadcast the information of the compromised nodes ids to all the legitimate nodes in the network. By doing so, the nodes communicate only with the other nodes which have low trust score are separated from the nodes which has high trust score for efficient identification of malicious network nodes. The proposed Modified SFO protocol chooses alternate optimal path from the malicious nodes for providing secure data transmission by detecting the malicious nodes during the route discovery process.
5.5 Modified Elgammal DS Data transmission
The next method of the proposed algorithm is modified elgammal based digital signature data transmission phase. Moreover, the digital signature algorithm employed provides high security during data transmission phase. Here, the original message (M) digest with hash function using H(M) and encrypts the hash message with sender private key as signature and the transmit the cipher text to receiver. Algorithm 4 gives modified elgammal based digital signature algorithm gives the steps
Algorithm 4
Modified elgammal based digital signature algorithm
Step 1
Begin
Step 2
Choose plain text message M
Step 3
Apply hash function using SHA1 algorithm H(M)
Step 4
select {q, α, XA, YA}
Step 5
select (M) 0 < M < q-1
Step 6
calculate {K,K-1}
Step 7
Compute gcd(K,q-1) = 1
Step 8
Compute S1& S2
$${S}_{1}={a}^{K} mod q$$
Step 9:\({K}^{-1}= {K}^{-1} mod (q-1)\)
$${S}_{2}={K}^{-1}\left(M-{{X}_{A}}^{S1}\right)mod (q-1)$$
Step 10
signature pair as (S1, S2)
5.6 Data Reception and verification
The next module of the proposed system is information reception and verification, in this phase once receiver receives the cipher text it performs decryption by senders public key, then apply hash algorithm to separate the signature and H(M). Then the receiver verifies the packets by validating the sender digital signature and by verification algorithm. When both hash messages are same, then the message is valid otherwise sender discards the message from the network.
Step 1
Choose the prime number {α, q}
Step 2
Compute {V1,V2} using public key of YA
Step 3:\({V}_{1}= {a}^{M} mod q\)
$${V}_{2}= {\left({Y}_{A}\right)}^{{S}_{1}}{\left({S}_{1}\right)}^{{S}_{2}} mod q$$
Step 4
V1 = V2 message is verified
If(V1 = = V2) then
Accept the message
else
Ignore the message
Step 5
end