Research Article

Development and Performance Evaluation of a New Energy-Efficient Double Cluster-Head Routing (EEDCR) Protocol for Wireless Sensor Networks

Algorithm 2

CN intimation.
Assumption: The data is sent from CM to CN via a multi-hop routing route
Input: CN_INT, SN_ID //CN and CNH selected intimation to SNs
Output: CN_INTACK, updating of routing table (RT)
Var: ACK, NXT_NEI, CN_INTUPDATE
Begin
Every node receives the CN_INT message with their SN_ID of the sender and SN_ID of CN
      CN_INT: < CN_INT, SN_IDb, SN_IDCN>
      If (SN_IDCN = SN_IDa) then
      Begin
Send info (ACK, SN_IDa, NXT_NEI);
//Sent the ACK packet to CNH
End
Else if (CN_INTUPDATE = false)
Begin
Update the RT (a) by adding SN_IDCN as CN ID and next hop as SN_IDb;
//broadcast CN_INT packet
Broadcast (CN_INT, SN_IDa, SN_IDCN);
End
   Else
Packet drop
   End if
ACK: < ACK, SN_IDb, NXT_NEI >
   If (NXT_NEI == SN_IDa) then
If (SN_IDa == SN_IDCN) then
Time out false;
Else
Check RT (SN_IDa) and find the next hop of SN_IDb;
//Transfer that ACK packet to the CNH
Forward (ACK, SN_IDb, NXT_NEI);
End if
If (SN_IDa == SN_IDCNH) then
Time out false;
Else
Check RT (SN_IDa) and find the next hop of SN_IDb;
/Forward the ACK packet towards the CNH/
Forward (ACK, SN_IDb, NXT_NEI);
   End if
Else
Packet drop;
End if
End