# Multi-Gateway-Based Energy Holes Avoidance Routing Protocol for WSN
## 6 Proposed Algorithm
\begin{table}
\begin{tabular}{l c c c c c c c c c c c c} \hline \hline \multirow{2}{*}{**Protocols**} & \multicolumn{4}{c}{**200 \(\times\) 200 m\({}^{2}\) Area**} & \multicolumn{4}{c}{**300 \(\times\) 300 m\({}^{2}\) Area**} & \multicolumn{4}{c}{**500 \(\times\) 500 m\({}^{2}\) Area**} \\ \cline{2-13}  & \multicolumn{4}{c}{**Lifetime (Rounds)**} & \multicolumn{1}{c}{**MGBEHA \({}^{\text{\text{\text{\text{\text{\text{\text{\text{\text{\text{\text{\text{\text{ \text{\text{\text{\text{\text{ \text{ \text{           }}}}}}}}}}}}}\) & **\({}\)** & **MGBEHA \({}^{\text{\text{\text{\text{\text{\text{\text{\text{\text{\text{{\text{\text{{\text{ \text{\text{ \text{ \text{ { \text{           }}}}}}}}}}}}}}\) & **\({}\)** & **Lifetime (Rounds)** & \multicolumn{1}{c}{**MGBEHA \({}^{\text{\text{\text{\text{\text{\text{\text{\text{\text{\text{{\text{\text{{ \text{\text{\text{\text{\text{ \text{         \text{{       }}}}}}}}}}}}}}\) & **\({}\)** & **Lifetime (Rounds)** & \multicolumn{1}{c}{**Lifetime (Rounds)**} & \multicolumn{1}{c}{**MGBEHA \({}^{\text{\text{\text{\text{\text{\text{\text{\text{{\text{\text{\text{{ \text{\text{\text{\text{\text{{\text{ \text{    \text{        }}}}}}}}}}}}}}}\) \\ \cline{2-1}  & **FND \({}^{\text{\text{\text{\text{\text{\text{\text{\text{\text



In the GSEP protocol, before initiating the transmission, a node always computes the distance between itself and all gateways and then chooses the gateway with the minimum distance. This method increases the lifetime in a small area, but in a large area most of the nodes have a large distance from all gateways. Although the total number of gateways in the GSEP protocol is much higher than the MGBEHA protocol, but the residual energy (shown in Figure 6a,b) of GSEP is much lower than the MGBEHA because all of the gateways are at the edge of the network. Nodes which are distant will deplete their energy faster. The number of live nodes becomes less in the network and they have to find alternative paths for data transmission. Further, in each round a node has to compute the distance between itself and all gateways, increasing the computation overhead. In our experiment, we have tested the GSEP protocol in a homogeneous (all nodes with equal initial energy) environment. In case of the MGBEHA protocol, gateways are not concentrated in an area; a separate gateway node is present to cover a part of the area, so the distance between CH and gateway nodes is always less, as a result less energy is consumed in communication and sufficient live nodes are present in the network. The number of live nodes in the network affects the number of packets transmitted to the sink. With more live nodes present in the network, more packets will be transmitted to the sink. The MGBEHA protocol has a higher number of live nodes for a higher number of rounds; therefore, the number of packets transmitted to the sink by the MGBEHA protocol is greater than other protocols, as shown in Figure 7a,b. However, there is a very small difference in the number of packets transmitted to the sink for 4 GW, 6 GW, and 8 GW in 500 \(\times\) 500 m\({}^{2}\) area. A variation in simulation results is represented by the 95% confidence interval and is shown in Figure 8a. In LEACH, energy holes can be created around the sink if large size clusters are formed near the sink. The energy of cluster members and CH will deplete with prolonged communication. Holes can also be created in remote areas if CHs are formed there, as CHs in remote area need more power to transmit data. The MGBEHA protocol avoids the energy holes problem as follows: holes cannot be created in the sink area, as nodes near the sink node do not transmit other node's data and these are not involved in cluster setup phase, which further saves their energy. Similarly, holes cannot be created in a gateway region, as nodes here transmit only their data to the gateway and do not act as a relay node. Instead a gateway node acts as a relay node for CHs and reduces power depletion of the CHs.