*2.1. Limitations of the Energy Model*

This subsection describes some of the limitations of the proposed energy model. This model comprises the main types of energy required for a node to perform generic functions within the network. However, this model does not describe specific energies related to the anomalous behavior of the nodes, yet it is capable of predicting strange behaviors in the network due to the alteration of typical node functions. These behaviors are due to situations of stress, such as node connections and disconnections due to channel intermittence. Likewise, these situations can be represented as a result of other types of energy. For example, in network areas with intermittent nodes or links, nodes frequently disconnect. This situation reflects in increased retransmissions, channel auditing retries, and packet collisions. These changes increase the transmission, reception, switching, and energies of the CSMA/CA algorithm. Thus, the proposed model can identify anomalous behavior observed in these types of energy and draw conclusions regarding risk areas or potential attacks.

The main function of a WSN is sending information to one or more collector nodes and detecting the conditions of the channel to find the optimal route. Then, in these networks, it is possible to implement different sleeping node techniques. That is to say, there are periods of time in which a certain number of nodes enter into passive mode, consuming less energy than they normally do. In this study, we do not look into sleeping node energy. However, the model can be extended, adding this energy equation, if the voltage and current of a sensor in a given time interval are available. For these reasons, the proposed model is simple, easy to implement, and quite scalable as per analysis requirements.

#### **3. Analysis and Results under the Simulation Tool**

One of the objectives of this work is to assess critical metrics in WSNs. In this section, the performance of the MPH routing protocol is compared against three sensor network protocols: AODV, DSR, and ZTR. The performance metrics used for comparison are the total energy consumption, delay, overload, resilience, valid routes, and number of jumps. This analysis is performed to analyze the influence of these parameters on energy consumption.

This is used to assess possible anomalies in a network or an area at risk of attack. The delay and energy consumption in a network are directly related to the complexity of the routing algorithms. When a routing protocol uses many algorithms and processes to send a packet, the sensor nodes will introduce long delays and incur in high-energy consumption. The MPH routing protocol is not only characterized by its hierarchical topology, but also by the origin touting and fast reconfiguration of its topology when faced to an unexpected change. This has to do with the resilience of the network (the network's ability to recover from unexpected changes).

A routing protocol provides reliability when nodes exhibit in their tables (either routing or neighbor tables) valid routes, i.e., routes that have not expired or that have not been invalidated by a node disconnection. Overloading the routing protocol will affect the channel's occupation because it is constituted by the control packets that a routing protocol needs for the reliable delivery of information. The lower the overload, the lower the probability of collisions and, in turn, the lower the number of packet retransmissions. A small overhead ensures that the information will be delivered more quickly and reliably.

For simulations, a grid layout with 22 nodes described in Figure 3 is considered. The nodes are located randomly in an area of 300 m × 300 m and nodes have a coverage range of 15 m. A data rate of 250 kbps and a packet length of 22 bytes were taken. Table 3 shows the simulation parameters. Each node contributes a traffic of 10 packets per second. There are two coordinator nodes marked in red color. All network nodes can send packets to the coordinator nodes directly (one hop) or indirectly (multiple hops that form a route). There are nodes near to the coordinator and all other nodes must send packets through these nodes, causing them to drain their batteries faster because they constitute the network bottlenecks.

**Figure 3.** The network topology considered.

**Table 3.** Simulation and real network parameters under CSMA/CA carrier sense multiple access with collision avoidance [34].


Figures 4–9 show, for some well-known protocols in the literature, the energy types per crown for the distribution shown in Figure 3. These graphs show the numerical analysis for each type of energy described in the proposed energy model. A 24 h/7 day execution of 22 sensors was carried out in an area of 300 × 300 m2 of the university campus of Universidad Panamericana in Guadalajara, Mexico. A set of high-level wireless communication nodes CC2650 and CC2530, based on the IEEE 802.15.4 standard, were used. The space covered by the sensors is an area with trees, buildings, traffic of people and vehicles with both indoor and outdoor spaces. The distribution structure of the sensors is the one shown in Figure 3. We aimed at taking six representative protocols in WSN such as: AODV, DSR, LEACH, PEGASIS, MPH (proposed protocol), and ZTR. Crowns were formed by the proximity of the nodes with respect to the coordinating node. A crown has the characteristic that the nodes belonging to it have similarity with respect to their performance parameters, i.e., with approximately the same distance to the coordinating node, the nodes have more or less the same traffic and forwarding packets

to their destiny. This is why the nodes are grouped into categories called crowns, which make them take a specific level of similarity in the network. For these graph results, the network will only have a coordinating node and this will be node 1. It is important to note that crowns are formed based on the amount of links that each routing protocol forms; not all protocols have the same number of crowns to analyze. The proposed energy model lets us know exactly how much energy an average node spends on each crown. The energy model is applied to the programming and operation of the sensors to establish their energy consumption separately, depending on the type of energy. As the model is validated, it allows global and local knowledge of the energy of the nodes according to the performance parameters such as: the proximity to the coordinating node, the number of established links, the collisions that generate the amount of traffic and control packets, the delay in the delivery of information, and the processing of resources at the node level.

In Figure 4, the AODV protocol presents six crowns of nodes. This may be because AODV is a reactive protocol that forms links in all directions, so the network becomes a mesh with widely redundant links. However, the fact of having so many links may produce an increase in packet collisions and protocol control packets, which generates more packet retransmissions and listening attempts to the communication channel. The advantage of presenting several crowns or levels of nodes with similar performance is the redundancy and the amount of different routes that a package can take to reach its destination. The disadvantage presented by this number of packets administered by the routing protocol is the high-energy consumption due to the possible loss of packets and their retransmission. In AODV, the crowns with the highest energy load are 1 and 2, which are the closest nodes to the coordinating node. This is understandable because they are the nodes that forward the traffic of the other nodes in the network and the coordinating node generates a bottleneck. We observe that between the last crown (crown 6) and the first two crowns, the difference in energy expenditure is 48%, which shows that nodes farther from the coordinating node have less traffic load, less collisions and less retries listening to the channel, then the CSMA algorithm runs in less times. Due to the energy model, we can also note that in crowns 1, 2, 3 and 4 the transmission and CSMA energies are similar. This may be due to the strong weight of the network that is located at the center of the topology; the AODV protocol creates a mesh and not a link tree.

**Figure 4.** Energy types per crown for the AODV protocol.

In Figure 5, the DSR protocol presents a structure and a quantity of crowns similar to AODV. These two protocols are the highest energy consumers of all the protocols studied in this work, with a 15% higher expenditure of energy in the nodes. Crowns 1 and 2 have the highest energy expenditure due to the redundancy of the protocol links. Although in DSR the links form a mesh in the network and there is a large amount of packet flow, this protocol, unlike AODV, has a more marked energy

expenditure per crown; the first being the most consumed, and the last, the one that consume the less. For DSR, the energy difference between the first and the last crown is 42%. In addition, due to the topology configuration that DSR generates, there are many surrounding packets in the network (traffic and control), which generate packet losses, retransmissions and therefore, listening retries to the communications channel to determine if it is already available or still in use. This can be noted with the fact that CSMA energy is similar in almost all crowns. The AODV and DSR protocols, being both reagents, have a similar energy expenditure with a difference of only 6%, even though in the last crown, the transmission energy decreases in DSR because the crowns are more scaled than in AODV.

Crown 1 Crown 2 Crown 3 Crown 4 Crown 5 Crown 6

**Figure 5.** Energy types per crown for the DSR protocol.

In Figure 6, the LEACH protocol uses techniques to reduce collisions between clusters and within the clusters themselves. Data collection is centralized and runs periodically, which is a characteristic of a proactive protocol. The protocol configuration for this scenario points that for one third of each day, a node near the lower left corner of the topology (near node 1) will be the coordinating node, for another third of the day, it will be a node in the middle of the topology, and finally, for the remaining third, it will be a node near the top right corner of the topology (near node 22). Due to the imbalance that is established in these changes of roles of the nodes, there is less crowns in the network and almost all have approximately the same energy expenditure. The above allows stating that all nodes belong to the same crown. LEACH assumes that all nodes transmit with sufficient power to reach the coordinating node and that each node has sufficient computing power to support different MAC protocols. In practice, this is complicated and, as it can be seen in real cases, the first crown differs energetically from the last one by 6%. However, the existence of cluster and various roles of the nodes, allows reducing energy by 13% with respect to reactive protocols such as AODV and DSR. In LEACH, the transmission energy is almost the same in all crowns, except for the last one, with a difference of 5% with respect to the others.

**Figure 6.** Energy types per crown for the LEACH protocol.

In Figure 7, the PEGASIS protocol extends the life of the network by limiting the nodes communication only to their closest neighbors and take turns communicating with the coordinating node. This protocol uses networking techniques and allows only local traffic between nodes that belong to the same region or crown to reduce bandwidth consumption. One of the great advantages of PEGASIS is that the distance between the nodes is calculated based on the intensity of the signal; the links are really strong, thus preventing packet retransmissions. We observe that the difference in energy consumption between LEACH and PEGASIS is 14%, with PEGASIS demonstrating the greatest savings. Energy improvement occurs by avoiding overload caused by LEACH's dynamic generation of the cluster and by minimizing the number of packet transmissions and receptions using the data aggregation technique. PEGASIS assumes that each node must be able to communicate with the coordinating node directly and that each node contains a complete database of the location of the other nodes in the network. This reduces network performance a bit by making processing slightly heavier. The energy of the crowns is similar, only with a difference between them of 5% and due to the role relay in the nodes; the crowns are not scaled from higher to lower consumption.

**Figure 7.** Energy types per crown for the PEGASIS protocol.

In Figure 8, the MPH protocol is a hybrid protocol (predominantly proactive). It establishes link hierarchies based on the proximity of a node to the coordinating node. This hierarchical tree topology only allows a few links, but there is a sufficient degree of redundancy. In MPH, we observe five crowns scaled around the coordinating node with an energy difference of 10% between the first and the last one with a similar transmission/reception energies in all crowns. MPH takes advantage of the fact that there are no links among nodes of the same hierarchy level, which decreases the cost in processing the neighbor tables and decreases the amount of protocol control packets. The difference in energy consumption between AODV and DSR with respect to MPH is 40% in favor of MPH.

**Figure 8.** Energy types per crown for the MPH protocol.

The ZTR protocol, shown in Figure 9, is a proactive protocol, simple, and easy to implement. It consists of an algorithm with limited resources that performs multi-hop routing without route discovery procedures and is based on a hierarchical distribution scheme. As in MPH, we note that five scaled crowns are established from the highest to the lowest energy consumption. ZTR has a 5% energy saving with respect to MPH because its links are simpler and the nodes cannot have more than one parent node. The small difference in energy expenditure that is established between MPH and ZTR, being ZTR so simple, is because several packages can be lost due to the low redundancy of links but this fact is compensated with the ZTR's speed of information delivery.

**Figure 9.** Energy types per crown for the ZTR protocol.

Now, having tested the energy model for the random scenario, Figure 10 shows the energy distribution of the nodes for each observed protocol: AODV, DSR, LEACH, PEGASIS, MPH, and ZTR. This scenario is based on the topology presented in Figure 3. The packet sending rate is 10 packets per second and the links have a packet loss between 0.5 and 1.5%, measured on a one day window with an average per hour for each node. According to the results, it can be observed that approximately 75% of the nodes in MPH and ZTR present values below 0.10 Joules while for AODV, 75% of the nodes distribute their energy in values between 0.14 and 0.19 Joules. Regarding DSR, the energy values for the 75% of the nodes are distributed between 0.16 and 0.19 Joules. The MPH and ZTR protocols present some extreme values that show their proactive nature, in which the creation of hierarchical routes and the amount of energy can be concentrated in the nodes near to the collector nodes. We can also note that the MPH protocol has a more compact energy distribution between randomly distributed nodes, even more compact than ZTR since both have lower energy consumption compared to AODV and DSR. Compared to DSR, AODV has a marked distribution of energy between nodes; this indicates that the crowns, which nodes forward packets and are around the coordinator nodes, have more significant differences in energy consumption in AODV than in DSR. LEACH and PEGASIS present the most compact distribution of energy in the network nodes. The values of 50% of the nodes range between 0.06 and 0.078 Joules for LEACH and their most extreme value falls to 0.042 Joules, this can occur in the crowns furthest from the coordinating node. In this protocol, the farthest nodes from the coordinating node can lead to a shorter survival time and generate greater packet delays. For PEGASIS, 50% of the nodes have energy values between 0.06 and 0.07 Joules and have an outlier at 0.041 Joules. Due to the propagation of chain packets, this protocol is the most efficient in energy consumption. This protocol reduces both the bandwidth requirement and the overhead.

**Figure 10.** Energy distribution in the nodes for each evaluated protocol.

In Figure 11, energy transmission is varied in order to increase the coverage radius. Its aim is to show how energy behaves in each of the studied protocols. These conditions can also evaluate some type of resilience in the network according to each protocol. The fact of increasing the coverage radius generates more collisions in the network. Although the routes can be compensated, because they are shorter, nodes have a greater number of directly connected neighbors. Even so, the energy model shows that the MPH protocol has similar characteristics to ZTR, the latter being extremely simple and not scalable but quite fast and efficient. MPH shows an average energy saving of 10% with respect to ZTR, 24% with respect to DSR, and 28% compared to AODV.

In addition, we observe that LEACH and PEGASIS have similar behaviors with a difference of 3% between them. These are the protocols that have the lower energy consumption in face of the stress caused in the network. When the transmission power is increased, these protocols maintain the rotation of roles in the nodes and therefore, both the energy and the network overload are balanced. The above is perfectly combined with the fact that both are hierarchical protocols further enabling packet traffic. PEGASIS presents a decrease in the total energy for each radio due to its approach of sending packets in chain, unlike the establishment of clusters exhibited in LEACH. MPH differs from LEACH and PEGASIS by 30%. This may be due to the proactive nature of MPH, in which from time to time, the tables of neighbors are updated and generate greater overhead. If the radius increases, the tables of neighbors become bigger and their update more complex.

**Figure 11.** Energy according to the increase in the coverage radius of a node.

Figure 12 shows two comparative conditions for the six protocols under study: stable network conditions working properly and adverse network conditions under the topology referred in Figure 3. For the study, we took an average of energy at the same hour (noon) for 7 days for each of the nodes in the network. Nodes transmit at a rate of 70 packets per second. To generate interference and create adverse conditions in the network, we put 5 nodes close to the majority of nodes in the network that were emitting the same reactive jamming frequency, thus increasing the loss of packets along the links as it is shown in Figure 13 with unnumbered jammer nodes marked in blue. The network has a stress zone and a high focus on packet loss. This was made to analyze how the network reacts with each routing protocol and how this influences the energy of each node having both local and global perspectives regarding energy consumption of the network.

**Figure 12.** Energy at each node of the network under both stable and adverse conditions for the four protocols studied.

**Figure 13.** Grid topology with jammer nodes generating adverse conditions.

We observe that node energy in the surroundings of that half greatly increased in adverse conditions for AODV and DSR. ZTR and MPH try to stabilize the energy of the network nodes and redistribute the packet losses. LEACH and PEGASIS have a similar energetic behavior that does not necessarily behave by crowns from greater to lesser overload. These protocols react very well before adverse conditions because in more than 50% of the nodes, the energy expenditure is similar in both stable and adverse states. These protocols have a similar energy expenditure between them with a difference of 5% in favor of PEGASIS and a difference of only 3% with respect to MPH and ZTR. This is reflected in the fact that the average energy per node in adverse conditions for the network are 0.1990, 0.1968, 0.1805, 0.1741, 0.1671, and 0.1150 Joules for AODV, DSR, LEACH, PEGASIS, ZTR, and MPH, respectively. The above figures show that MPH has an energy expenditure similar to ZTR, which is a simple and fast algorithm; still MPH exhibits the advantage of route maintenance and redundancy. ZTR and MPH have similar natures, both having proactive characteristics. However, when there is a large number of packets in the network, there are more collisions and packet loss. The ZTR protocol can lose links and some isolated nodes might remain causing an increase in energy consumption. For this reason, the energy difference between MPH and ZTR is 31%. MPH, having multi-parent links, shows greater redundancy and increases the amount of valid routes that continue to function for changes in the network. This can be interpreted taking into account that MPH was designed to combine the best design features of a proactive protocol with the redundancy of the reactive protocols and the foregoing together with the verification of the proposed energy model, which allows visualizing easily and with concise data possible anomalies in specific areas of a network.

In Table 4 a sampling period of 100 seconds was taken for the simulations. Tests were performed every 10 seconds, which is the percentage of Packet Delivery Ratio (PDR). The PDR is a metric that indicates the number of packages delivered in a given time and indicates the collisions present in a network that cause packet loss. This performance metric is directly related to the energy and provides an idea on how nodes behave in the network; for example, if there are connections and disconnections of nodes, interference and quality of the links, among other features that show the performance of the routing protocol. As aforementioned, AODV and DSR have a similar behavior because their reactive nature. Initially, the network nodes do not know the routes to the destination, so they send request packets implying a large number of control packages, which increases the overhead. The LEACH and PEGASIS protocols try to make the route to the coordinating node efficiently through clusters or changes in the role of the coordinating nodes; this increases the assertiveness of the nodes in the package delivery, a consequence that is reflected in energy consumption. The difference in PDR in this initial stage between AODV and DSR with respect to LEACH and PEGASIS is approximately 23% in favor of the latter protocols. MPH and ZTR are proactive protocols, so at the initial stage, nodes behave the same as in stable state because the neighbor tables are periodically renewed and not when the routes require it. One of the big differences between MPH and ZTR is multi-parent links, which allow the packets to have greater redundancy in MPH and a reliable delivery. The difference in PDR between AODV and DSR with respect to MPH and ZTR is 28% in favor of MPH and ZTR.


**Table 4.** Percentage of Packet Delivery Ratio (PDR).

Concerning the rate of transmitted packets, we analyze the measurement impact of the energy model when we vary the packet transmission rate. Tests were carried out for 1 day (24 h). In particular, on a Wednesday; the day in which we can find regular traffic of people and vehicles on campus, and therefore, more operating wireless devices. We show these results in Table 5.

**Table 5.** Effect of packet transmission rate (PTR) variation on energy.


We note that, for five different packet transmission rates, the most drastic variation is found in the rates of 50 and 100 kbps, with a 37% difference with respect to energy at 250 kpbs. The difference in energy expenditure with the change in packet transmission rates is 43% higher for reactive protocols, compared to other protocols. The difference between proactive protocols and energy-aware protocols is only 5% in favor of the latter.
