Research Article

Vampire Attack Mitigation and Network Performance Improvement Using Probabilistic Fuzzy Chain Set with Authentication Routing Protocol and Hybrid Clustering-Based Optimization in Wireless Sensor Network

Algorithm 4

PFCS.
Input:n_round, deployment area, p, sing_p, initial_e, c_range, n_node, t_node
Output:R_VALUE = [CHs,alive_n]
(1)Initialization;
(2)For r = 1 to n_round
(3)For I = 1 to n
(4)If(mod(r,3) = = 1)
(5)If (S(i).energy ≤ 0)
(6)Alive = alive-1;
(7)SAY_HI_MESSAGE (ID,CR,SE)
(8)If r = 1
(9)Apply PFCS method to choose initial tentative CHs
(10)End if
(11)S(i).channel = evalfis([S(i).energy S(i).cound_tch],z)
(12)If r > 1
(13)End if
(14)If S(i) = best (channel])
(15)S(i).t_node = TCH;
(16)If (S(i).E < S(j).E)
(17)CONFIRM_TCH_MESSAGE(ID)
(18)S(i).type = N;
(19)MEMBER_JOIN_CH_MESSAGE(ID)
(20)Nodes with S(i).t_node = TCH will be confirmed final CH
(21)Transmit data ti the CH
(22)If (mod(r,3) = = 2) and previous CHs are alive
(23)Else choose best chance CH
(24)If (mode(r,3) = = 0)
(25)If (S(i).energy ≤ 0)
(26)For I = 1 to n
(27)Alive = alive-1;
(28)End if
(29)S(i).chance2 = evalfis([S(i).energy S(i).mch],z;
(30)SAY_HI_MESSAGE(ID,CR,SE)
(31)If (S(i).E < S(j).E)
(32)S(i).type = N;
(33)S(i).t.node = TCH;
(34)If (S(i) = best(chance2)
(35)AUTHORIZE_TCH_MESSAGE(ID)
(36)MEMBER_JOIN_CH_MESSAGE(ID)
(37)Nodes with S(i).t_node = TCH will be confirmed final CH
(38)End if
(39)Return R_VALUE