| Algorithm 3. Head_Selection (), implemented in member nodes, selects the closest SH based on the rank calculated using Equation (22). |
Input: rank, SHInfo 1: sort SHInfo in descending order based on rank 2: create network layer packet joinCntrlPacket 3: SHD ← pop top element from SHInfo.SHS 4: set SELF_NET_ADDR as source, SHD as destination and Packet Type = 4 to joinCntrlPacket 5: //Unicast joining request to the closest head node. 6: toMacLayer (joinCntrlPacket, SHD) |