Journal of Computer Networks and Communications / 2016 / Article / Alg 4

Research Article

Replica Node Detection Using Enhanced Single Hop Detection with Clonal Selection Algorithm in Mobile Wireless Sensor Networks

Algorithm 4

Proposed enhanced Single Hop Detection using Clonal Selection Algorithm (CSSHD).
Set are neighbours of
For each node
   Send sign and add to neighbour list
   Beacon =  // neighbour list
   Claim = beacon // sign(beacon)
   Choose an antigen
   Add to where
   Vector affinity and antibodies in Ab
   Choose highest affinity antibodies from Ab
   Ab =  where subset of
   Chosen antibodies will be clones
    // where is the number of clones, is the number of antibodies
    = where represents set of clones and
   Assign clones to affinity maturation process
    = of matured clones
   Calculate of the matured clone
   For to
     Select within node = highest affinity ()
   Next
   If (node is witness node)
      Set flag = 1
       where is the witness node list
      Add claim of to local stored fingerprint claim
   Else
      Set flag = 0
   End if
   If (local verification)
      Neighbour_claim = fingerprint of
      Neighbour_PK = neighbour public key from ( (neighbour Id))
      Check public key of neighbour node
      If (neighbour_ claim ≠ true)
         Set signature = 0
      Else
         Signature = 1
      End if
      Claimed neighbours = extract neighbourlist from neighbour claim list
      If (id ≠ claimed neighbour)
         Set signature = 0
      Else
         Set signature = 1
      End if
   End if
   If (global verification)
      
      
      
      For each ID in
         Claim = ID of location from local stored claims
         Compare = ID from
         If (neighbour list (Claim) ≠ neighbourlist (compare))
            Add ID to
         End if
      Next
   End if
Next