Spider monkey optimization routing protocol for wireless sensor networks

Received Sep 3, 2020 Revised Oct 2, 2020 Accepted Oct 21, 2020 Uneven energy consumption (UEC) is latent trouble in wireless sensor networks (WSNs) that feature a multiple motion pattern and a multi-hop routing. UEC often splits the network, reduces network life, and leads to performance degradation. Sometimes, improving energy consumption is more complicated because it does not reduce energy consumption only, but it also extends network life. This makes energy consumption balancing critical to WSN design calling for energy-efficient routing protocols that increase network life. Some energy-saving protocols have been applied to make the energy consumption among all nodes inside the network equilibrate in the expectancy and end power in almost all nodes simultaneously. This work has suggested a protocol of energy-saving routing named spider monkey optimization routing protocol (SMORP), which aims to probe the issue of network life in WSNs. The proposed protocol reduces excessive routing messages that may lead to the wastage of significant energy by recycling frequent information from the source node into the sink. This routing protocol can choose the optimal routing path. That is the preferable node can be chosen from nodes of the candidate in the sending ways by preferring the energy of maximum residual, the minimum traffic load, and the least distance to the sink. Simulation results have proved the effectiveness of the proposed protocol in terms of decreasing end-to-end delay, reducing energy consumption compared to well-known routing protocols.


INTRODUCTION
A wireless sensor network (WSN) is a basic structure made up of sensor nodes. These nodes are usually densely spread to serve in sensation and the process of data, capabilities of communication, and computing. WSNs include a series of functions, applications, and capabilities, i.e., any operation demands information communicating and sensing, like "video surveillance" and "atmospheric monitoring". WSNs can be installed through open areas, such as parks, roads, battlegrounds, some machinery, "commercial buildings", and even on the body of human beings [1].
In general, these nodes of the sensor within the networks of "large-scale" processes of gathering data are supplied with power by cheap and small batteries. Such batteries are usually of low energy; nevertheless, they are expected to work for some time [2]. WSNs have a deep-seated problem in the "uneven energy" consumption, which is "the multi-hop routing and many-to-one traffic pattern". Such an uneven energy waste may considerably shorten the period of network life. Normally, in the routing methods, the most excellent route between the source and the destination is chosen to transmit the data [3,4] In WSN, each sensor node consists of many parts; namely, a power unit, a sensing unit, a transmission unit, a processing unit. There are also optional parts such as a position finding system, and a mobilizer. Figure 1 clarifies the sensor structure. The sensors work on their tasks, the current information, the computation data, the communication, and the sources of energy [5].
The sensor can perform two actions. It either sends its sensed data or serves just like a relay to transmit data gathered by another sensor in a network. Consequently, the matter of energy saving is very essential to solve the problem of the sensor networks with limited power that are used in sensing data. Thence, the fact of energy waste has to be highly regarded and counted to lengthen the period of a network lifetime [2]. Some algorithms of routing have the same behavior to challenge minimizing the entire consumption of energy in the network concerning the drainage of the normal energy of the networks [6]. Such behaviors result in the matter of network partition; because the nodes that are connected to more than one network parts consume battery energy quickly when compared to the case of the one-part-connection nodes [5,7]. Therefore, the delay of transmission is usually lessened through choosing the same route in a protocol for the other coming communications. Then, the energy of the nodes in this route is drained quickly [8][9][10]. These algorithms often make different energy consumption of WSNs as they reduce the aggregate of the energy drained. That is why this kind of algorithm has the case of a network partition that corrupts the benefits of the WSN [5,8]. The network partition problem is clarified in Figure 2 when some sensor nodes are impossible to reach. As a result, the sensing network lifetime is consumed immediately when the energy of the "critical nodes" batteries is consumed. Critical nodes normally exist on several routes. The perfect behavior of routes is to slow down the energy consumption and to distribute the energy over the nodes comparatively so that all the nodes in a network would be depleted simultaneously [2]. As soon as the battery energy of the nodes which relays for a division of a WSN is spent, the life of this WSN is over. So, the problem is to propose a set of steps to build a path for every node so that it can send the signals relying on certain parameters, or to configure a good path for these signals by increasing the period of the WSNs life [11,12]. Then, the "optimization problem" is to lengthen this period, and route parameters are the variables in such optimization. Therefore, the suggested method in this study endeavors to solve the conundrum of energy consumption balance, minimizing the "end-to-end delay" which is resulted from routes planning, and maximizing the network's lifetimes in WSNs. This method utilizes the algorithm of spider monkey optimization (SMO) to obtain the best route between the source and the destination. This is done via choosing the longest lifetime of battery energy with high power, and the least load of passing the data. For this reason, the delay that is resulted from planning the route of the data for every time would be minimized by such clever network behavior. Meanwhile, energy consumption is held balanced among the newly detected paths. This paper steps on to organize its contents by presenting Section 2 tackles the related works and related concepts. The SMO algorithm is summarized in section 3. In section 4, the researchers raise the potential utility of implementing the suggested method of the route. Section 5 offers a description of the simulation results. As the last step, the conclusions are listed in section 6.

RELATED WORKS
In the WSNs field, it is usual to deploy a lot of sensor nods over wide spots. Such nodes are usually supplied with power by having small and cheap batteries that are not intended to be replaced or recharged in the future, due to the difficult circumstances in which these networks are placed in the common applications. Besides, these batteries are not easy to access. Thus, the sensor nodes stop routing when their batteries' energy dies out. Consequently, this kind of network does not route any longer then, or at least, its performance will not be full. Therefore, the factor of a lifetime in these networks is of high consideration to count their performance in routing behavior [5]. Nowadays, all researchers are concentrating on the methods of consumption reduction in network energy by suggesting many kinds of routing protocols for WSNs. Hence these protocols are proposed to obtain the best route for receiving and forwarding the sensed data in the network. Tsai et al. [8] recommended the reduction of the hop distance of any route. By doing so, the proportion of this hop distance to that of the shortest route has reduced. Then, this ratio reduction helped to reduce the energy wasted in data receiving and forwarding within a network. Rana et al. [13] suggested a transmission technique to get the maximum lifetime of the energy in a WSN. In this technique, WSN is prearranged in paring of tiers having the support of an A-star search algorithm to obtain an optimized path beginning at the resource node and ending at the destination one, with the help of a previously determined level of the least existing nodes energy, so that they would be a part of the resending route. In [14], the authors got the benefit of a "high-weight genetic algorithm (GA)" in an approach of transmission, where sensor nodes monitor and control the magnitude of passing data so that it can follow and solve the network overcrowding. Alshawi et al. [5] presented a completely new behavior of transmission. This behavior endeavored to prolong the energy lifetime in a WSN and control the energy consumption within the network when considering the traffic heaviness factor. Depending on the model of "binary detection", Wang et al. [15] attempted to deal with the problem of "dynamic deployment" through the two types of sensor nodes within a WSN, the mobile and fixed. By doing so, they employed what is so-called the "biogeography-based optimization (BBO) algorithm". Huang et al. [16] presented a new "energy-aware geographic routing protocol" in the field of WSN. This approach is considered as an endeavor to reduce the consumption of energy during the "end-to-end" routing. This protocol adapts itself with another geographic protocol to meet an anchor list which depends on the nodes' projection distance to steer the resending of data. Every node that sends the message depends on three things to decide the routing: "geographic information", the features of how the energy is spent, and the measurement system of counting the "advanced energy cost". Then, it adapts the cost of conveyance energy to get the determined node. The authors [17] presented a routing method as well. This method is considered as incorporation between the algorithm "artificial bee colony (ABC)" of optimization and "Fuzzy Logic". These two directions are employed in this protocol to calculate the best route by identifying the optimal next node to make the best path between the source and the sink. In [18], L. Shi et al. suggested an effective system called the protocol of data-driven routing. It investigated the problems of mobility in the networks of mobile sinks. Data-driven Routing strategy endeavored to lessen the overheads of the path planning, which has resulted from the sink mobility. Then it keeps the high performance of delivering the packet. C. Hsu et al. [19] presented the so-called ASSORT, which stands for "asynchronous sleep-wake scheduling opportunistic routing technology". This technology suggested a certain type of design, which merged the utility of "asynchronous sleep-wake scheduling" with the utility of "opportunistic routing"; namely, the enhanced transmission reliability over diverting route. Consequently, such a behavior improves the transmission way by lengthening the WSNs lifetime.
In [6], the authors developed a routing method called "Fuzzy-Gossip" which is classified as "energy-efficient" in using the fuzzy logic to modify the protocol of gossip. In this protocol, the best sending path from the source into the sink is verified by choosing the optimal nodes within a path. This is accomplished when selecting the highest energy nodes with the least distance, to achieve the "minimum number of hops" during the routing path from the source into the sink. The authors [20] presented the routing method and specifically in the WSNs spreading. This routing protocol is the so-called "fast simple flooding strategy". It concentrates on the efficiency of energy as a target to the "crucial design" of the routing methods working in the WSNs. Then, it must give no considerations to the other aspects of designation. It also decreases the "end-to-end latency". Furthermore, this new approach is classified as very simple and fast in routing the data into the sink. Additionally, it does not demand more tools and can work with a simple mathematical process. This protocol occurs within the list of flat protocols. It is worthy to mention that this protocol deals well with the principal obstacles of traditional gossiping and flooding.

SPIDER MONKEY OPTIMIZATION (SMO)
Nowadays, monkey-inspired optimization (MO) is considered as the last version of the Swarm Intelligence (SI). There are more than two hundred and sixty (260) ways proposed to define monkey. One of them is that there are several perspectives of the human brain governing the processes of thinking. These processes are considered near to those of the monkey brain. In the field of ethology, there is what is called a "fission-fusion society". In this society, animals are put to live together and are changed with time. They are divided into sub-groups for the period of the daylight to get the status of fission, and they are re-mingled again to make the status of fusion during the period of the night. Observing such a kind of society, spider monkeys are noticeably a considerable sample. It is noticed that the male monkeys in such a kind of society are in a lower rank, i.e., not controlling, they have more activeness though, whereas the female monkeys are observed to be at a higher level of leadership over their partners in the same society [21]. Chand B. et al. suggested spider monkey optimization (SMO) as a sub-division of SI. SMO is considered as a protocol that depends upon the principle so-called "food foraging"; for the nature of spider monkey and their social behavioral conventions. The traditions of this fission-fusion society are governed as the social configurationally of a spider monkey. SMO method has been subject to several studies. Although these attempts demonstrate that SMO is great in "exploration and exploitation", still there are aspects to be counted for more optimization. Figure 3 shows the flow chart of the SMO algorithm. Densely populated female-governed monkey groups are sub-divided into mini-groups of forty (40) or fifty (50) partners. The main task of these small groups is to find the food. When the female does not succeed in its aim, (i.e., food-finding), the attempt is retried by a further female-governed sub-group, and so forth until the task is accomplished. Nonetheless, recently, different modifications are implemented as attempts of updates, like examination of search large spots and electing the best outcomes [22]. Comprising seven phases, the SMO method relies upon "population repetitive methodology". These phases are explained below [22][23][24]: a. Initialization phase In the beginning, N random solutions have to be identified. The population of the spider monkey then is to be divided into a certain number of groups, and this number is referred to as n. After that, a local leader to each group is determined, and a global leader that governs all the groups is determined as well. This optimization algorithm initializes four parameters to start: local-leader-limit, global-leader-limit, the size of maximum-group (MG), and perturbation-rate (pr).
where, min and max are limits of M i in the j th vector. R (0, 1) is an arbitrary number (0, 1). b. Local leader phase (LLP) In this step, the SMs will have the information from both their local leader and their neighbor. By doing so, their location will be updated. This procedure is clarified as follows: where, and is the updated and previous location of i th SM. The local leader of the k th group in the j th dimension represents itself by LL kj . M rj stands for the neighbor which is taken arbitrarily. c. Global leader phase (GLP) In this phase, another opportunity is available for the SMs to update their locations and to get to the "global optima" relying upon "fitness". Having their persistence, neighbors, and global leader of the group, the SMs can be inspired. The following equation clarifies the behavior of updating the location in this phase: where GL i means the location of the global leader in j th dimension and j=1,2,3,..., D identifies the index which is selected randomly. M i modifies its position regarding the probabilities. Fitness is utilized to count the likelihood of a certain solution, with many deferent ways, like: d. Local leader learning (LLL) phase As the global optimal is known, the algorithm uncovers the local leader of the subgroups and identifies the local optima. Through examining the counter of the threshold, whether or not the local leaders update themselves is defined here in this phase. e. Global leader learning (GLL) phase Simply from the name of this phase, it knows that the global leader is there in the bevy, as well as it examines whether or not the leader updates its location to a specific threshold for more activities. In this phase, when the local leaders are not updated to a specific threshold, SMs in the bevy will entirely update the positions by the order of the global leader or by arbitrary initializing according to the rate of perturbation. However, the order of the update is calculated by (5): g. Global leader decision (GLD) phase In this phase, the fission and fusion of the bevy, as a whole, occur; in the case of "limit global leader", that is to say, global leaders do not update themselves to a certain threshold.

SPIDER MONKEY OPTIMIZATION ROUTING PROTOCOL (SMORP) FOR WSNS
The WSN topology was designed as a G guided graph (N, A) in this paper, where N is the nodes set, and A is the direct links set between nodes. The node of the sink holds the responsibility for collecting data from every other node in its range of transmission [5]. By the base station, the table of routing is counted. Broadcasts and calculates the optimal table of routing. This table is followed by each node. The finding process of the optimal path is frequent broadcast inside the network, and to send data from every node to the base station via following this table of routing in every round. Dynamically, the table of routing is counted taking into consideration the level of current for some parameters in every node. Therefore, the nodes are required to submit periodic reports on their parameters to the base station. The base station could thereafter select the schedule of routing depending upon this updated information. The lifetime of the network is a significant metric for WSN. Links of communication between the varied nodes of the sensor and the base station will break when any node of the sensor depletes energy concerning the suggested model. This is deemed to the network's lifetime end. As the lifetime of every sensor node is dependent on the consumption of energy, it is significant to conserve the remaining energy for these nodes in a way that extends the total lifetime of the network. The method of suggested routing supposes the following: i) all nodes of the sensor are randomly divided into the area and every node of the sensor is supposed to define its location in addition to the sink and its neighbors; ii) all nodes of the sensor have the same range of maximal transmission and the same initial energy amount; iii) every node has a specific amount of traffic outstanding in the queue of the node. The queue of the node contains the traffic of application and the traffic also that a node has obliged to forward already.
The main aim of this paper is to create a protocol of energy-sufficient routing named spider monkey optimization routing protocol (SMORP). The suggested method can extend the WSNs lifetime by placing a limit on the cost of energy in addition to equitable distribution for the consumption of energy. SMORP uses three routing criteria to select the optimum path from the node of the source to the sink. Node criteria are the highest remaining energy (RE), the minimal number of hops to the sink (MH), and the lowest traffic load (TL). The suggested method computes the optimal path of the sensor of the sender to be used for data transmission toward the sink under the mentioned criteria (RE, MH, and TL). The produced routing path is then used in later transmission processes for several times (rounds) checking the status of each node involved in that path after each time to decide whether to use the same path for the next round or not.
As assumed earlier, the sink has information regarding the present status of every node concerning the level of battery energy, coordinates of the location, and traffic load. Consequently, the method of proposed routing locates the routing path of the node of the sensor which has the data to be sent to the sink as follows: a. Starting from the source node (the current node) as the local leader SM (LLSM) to be expanded, find all contiguous nodes which can immediately communicate with LLSM (that is to say, their range of transmission can reach LLSM). b. Whenever the sink is found as a neighbor of LLSM, it can send its data which is collected immediately without any medium hop. c. On the other hand, calculating the values of fitness for all discovered nodes and determining the global leader SM (GLSM)) is the best LLSM's neighbor node among all. Calculating the fitness values reads as follows: -Knowing coordinates (x, y) for every node inside the network, distance (d) of every node (n) to sink could be counted as follows: where (x s , y s ) and (x n ,y n ) are the coordinates (x, y) for nodes n & the sink s. -The value of fitness of the contiguous node (n) is obtained by using the (7): where RE(n) is the residual energy of node n; TL(n) is the current traffic load for node n; and α, β, and γ are integer coefficients specified by the user to control the effectiveness of each variable (metric). d. GLSM, then, evaluates the information taken from all LLSM's neighbor nodes and selects the best node with the highest probability P related to its probability value given by: where P(s i ) is the value of the probability of node n i , fitness (s i ) is the value of fitness of the node n i , and N is the number of the neighbor nodes. e. Whenever a set of nodes are discovered in the same process of expansion, they are successors to the extended node and substitutes to each other. The pointer of the pack for each node detected during the process of extension is set to the extended node. f. All processes from 1 to 4 are repeated until the sink is detected then all packets are sent through the optimal path toward the sink. The flowchart of the SMORP in WSN is shown in Figure 4.

PERFORMANCE EVALUATION
For evaluating the effectuality of the SMORP balancing consumption of energy and maximizing the lifetime of the network are taken into consideration and results of the simulation for the suggested are compared with these of the two well-known approaches, namely LEACH [25] and PEGASIS [26]. The three methods include the same metrics of routing namely, the shortest hop, the residual energy, and the traffic load through a search of the optimal path from the node of the source to the node of the sink. The systems simulation processes are carried out in MATLAB simulator software.

Simulation setup
The simulations are carried out by using MATLAB. A hundred nodes of the sensor are diffused in a topographical area that has of (100 m×100 m) dimension. Deployments of nodes are done randomly. The topographical area has the sensed transmission limited to (20 m). The performance tests of all approaches are done in this kind of topographical area. The sink of data is based at (90 m, 90 m). The initial energy is (0.5 J) for all nodes of the sensor in the network.
The model of the first-order radio which is largely applied to the routing protocol evaluation area in WSNs [25] is also followed in all approaches. As far as the model of this study is concerned, receiving and transmission costs are characterized by the expressions E n T(k)=E elec k+E amp k.d 2 and E n R(k)=E elec k, respectively, where k is the number of bit per packet, d is the distance from the node of the sender to the node of the receiver, E elec and E amp are per bit energy dissipation in receiving or transmitting circuitry and energy necessitated per bit per square meter for the amplifier to yield reasonable signal to noise ratio (SNR) respectively. Simulations are done applying the values 50 nJ/bit and 100 pJ/bit/m2 for E elec and E amp , respectively. The traffic load is supposed to be produced in a random way having [0...10] range of values in every node. Table 1 illustrates the system parameters in detail.

Simulation results
The live node number for every transmission round applying three different methods is stated in Figure 5. The suggested SMORP keeps more live nodes than the ones kept by both PEGASIS and LEACH approaches after the same number of a packet is transmitted. Whenever all the 2000 packets are sent inside the area, the lifetime of network achieved by the suggested method is about 50% more than that acquired by PEGASIS and nearly 60% more than that obtained by LEACH.
Also, in Figure 5, one can notice that the suggested method keeps the number of live nodes always higher than that in both PEGASIS and LEACH approaches. The difference in the duration of time relevant to the first dead node computed applying the three different approaches is stated in Table 2. It remarkable that the occurrence of the first node death in the suggested method is much later than that in other approaches.  Given Figure 5 and Table 2, one can deduce that the suggested method is more effective than both approaches of PEGASIS & LEACH in balancing the consumption of energy and extending of network lifetime. A WSN average residual energy decreases with the transmission rounds rise number. As the number of delivered packets increases, the results of the suggested method in values turn to be of higher average residual energy than that of both PEGASIS and LEACH approaches. Figure 6 indicates that the balance of better energy in a WSN is achieved by the suggested method.
The delay resulted from the transmission of data packets is a significant parameter for specific applications where data sensed is required to be collected in a short time. The three different approaches are compared in Figure 7. Also, the suggested SMORP has the shortest delay when compared to the delay in the other approaches as shown in Figure 8. The shorter delay implicitly indicates energy-saving and effective transmission (especially for significant and secure information). In particular, packets of data are sent through paths of different node-disjoint routing with multi-path routing to avoid network overcrowding and extend the lifetime of the network.

CONCLUSION
In WSNs, nodes are powered by limited battery energy. Hence, it is significant to choose strategies that effectively use the existing energy. Methods of routing path findings have a high effect on the lifetime of the network and this is one of the prime features of WSNs. Uneven drainage of energy is an inherent problem inside a WSN. For achieving transmission of effective data through the path of routing chosen to be an optimum path to maximize the total lifetime of the network with decreasing the delay resulted from the process of path finding, a modern method called spider monkey optimization routing protocol (SMORP) is suggested in this study. This modern method is capable of finding a path of optimal routing to be used in the transmission of data from the node of source toward the sink including a medium node or nodes by choosing ones with the highest remaining energy, minimal combined hops, and least pending traffic. Comparing the suggested method with the other two methods, the results show that the performance of the proposed method, according to the same criteria, is much better than that of the two methods regarding the lifetime of network and transmission delay.