# Multi-Gateway-Based Energy Holes Avoidance Routing Protocol for WSN
## 6 Proposed Algorithm
Figure 6: Residual energy per round for different protocols in (a) 100 m \(\times\) 100 m; and (b) 500 m \(\times\) 500 m area. This well-adjusted energy consumption maintains an energy level in the network per round as shown in Figure 8b. All nodes exhaust their energy in a uniform way. Figure 8b shows an energy map of whole topology at different rounds. The initial energy of all nodes is 0.5 J. After 500 rounds, the energy of all nodes lies between 0.46 J and 0.38 J, after 1000 rounds, the energy lies between 0.33 and 0.18 J. This concludes that none of the nodes die in the network, up to 1000 rounds. The network remains stable until the first node dies and energy holes are not created until the 1083 round. In order to test the efficiency of the protocol in very large areas, we have designed two scenarios, one with a 1000 \(\times\) 1000 m\({}^{2}\) area and another with a 2000 \(\times\) 2000 m\({}^{2}\) area. We have also analyzed the performance metrics for different node densities (\(\lambda\) = Number of nodes/area) in the area. Figure 9a shows the number of alive nodes in a 1000 m \(\times\) 1000 m area. The maximum lifetime and the stability period of the network are approximately 1700 rounds and 10 rounds, respectively. A high node density does not affect the performance of the network. Figure 9b illustrates the effect of different node densities on the MGBEHA protocol in the 2000 \(\times\) 2000 m\({}^{2}\) area. The maximum lifetime in this area is 600 rounds. Node density does not have a significant impact on the lifetime of the network. Although the number of gateways has been increased in the network, the lifetime is reduced with an increase in the size of the area. Figure 10a,b illustrates the residual energy of the network in a 1000 \(\times\) 1000 m\({}^{2}\) area and in a 2000 \(\times\) 2000 m\({}^{2}\) area, respectively. In a large area, energy is available in the network, but the lifetime of the network is reached very early. Figure 8: (a) 95% confidence interval of each point for all metrics of the MGBEHA protocol; and (b)energy map of the whole topology at different rounds for the MGBEHA protocol. Figure 7: Total packets sent towards the sink in different protocols for (a) 100 m \(\times\) 100 m; and (b) 500 m \(\times\) 500 m area. Figure 12a,b illustrate the total number of packets transmitted towards the sink in 1000 \(\times\) 1000 m\({}^{2}\) area and in 2000 \(\times\) 2000 m\({}^{2}\) area, respectively. The number of packets transmitted for high density is much more than the number of packets for the low density. However, transmission of packets halts after the 17,000 rounds in 1000 m\({}^{2}\) area, and after approximately 500 rounds in the 2000 m\({}^{2}\) area. Figure 13a,b give the validation of simulation results against the theoretical analysis of energy consumption of the network for the MGBEHA protocol. According to the figure, our simulation results are very close to the theoretical results. It proves that average energy consumption of the network in the presence of different number of gateways. The number of alive nodes is directly related to the available energy in the network. The total number of packets transmitted to the sink and received throughput of the network depends on the number of alive nodes in the network. ## 10 Future Work

A deterministic algorithm for mathematical computation of the number of regions in an area will be provided in the future work. ## 11 Conclusions

In order to avoid energy holes and improve energy efficiency of a sensor network, we have proposed an energy-balanced MGBEHA protocol. The division of the area into regions and use of gateway nodes at optimal positions have a considerable effect on the lifetime of the network. Nodes are

Figure 12: Total packets sent towards the sink in (**a**) 1000 m \(\times\) 1000 m; and (**b**) 2000 m \(\times\) 2000 m area. Figure 13: Average energy consumption in (**a**) 100 m\({}^{2}\) area with 2 GW and 4 GW and (**b**) in 500 m\({}^{2}\) with 2 GW, 4 GW, and 6 GW.