# Multi-Gateway-Based Energy Holes Avoidance Routing Protocol for WSN
## 6 Proposed Algorithm
In the case of the GSEP protocol FND at round 983, its stability period is more than M-GEAR and LEACH protocols and, hence, the network remains connected for 983 rounds and produces throughput, but after 50% nodes of the network die, throughput keeps on decreasing, although AND at round 2500, but very few nodes remain alive in the network after round 1300 as shown in Figure 5. Large numbers of rounds and lesser throughput in the last rounds reduce TIRPR of GSEP as compared to MGBEHA protocol. b) **Case 2:** Results analysis of 100 nodes in 200 \(\times\) 200 m\({}^{2}\) area/300 \(\times\)300 m\({}^{2}\) area/500 \(\times\)500 m\({}^{2}\) area (Table 4)

As the size of the area increases, the first node dies very soon in all protocols. However, the value of AND drops slowly for MGBEHA protocol and rapidly for other protocols. In case of LEACH, for a small area (100 \(\times\) 100 m\({}^{2}\)), value of AND is round 1800, but for large area (500 \(\times\) 500 m\({}^{2}\)) it drops below round 1300. For the M-GEAR protocol value of AND drops up to 1838 and for the GSEP, it drops up to 1972. The TIRPR of the MGBEHA protocol increases as compared to other protocols for large areas. Optimal number and correct position of gateways also improves network lifetime as shown in Figure 5a and Table 4.

Figure 4: Variation of throughput for different protocols in (**a**) 100 m \(\times\) 100 m; and (**b**) 500 m \(\times\) 500 m area. In a large area the MGBEHA protocol has a lifetime more than other protocols as shown in Table 5 and Figure 5b. By increasing the number of gateways in a large area, the stability period and the lifetime of the network improves, as shown in Table 5. When the number of gateways increased from 4 to 6 in the 500 \(\times\) 500 m\({}^{2}\) area, its stability period increased from 87 to 102 and its lifetime improved from 2490 to 2525, and the TIRP also improved from the previous value. However, when the number of gateways was further increased from 6 to 8, there was no improvement in the performance metrics, which implies that there are an appropriate number of gateways for each area size, after which there is no improvement in the network lifetime. The M-GEAR protocol has a single gateway in the center of the area; if the area increases, the distance between CH and the gateway node also increases, so it is not capable of handling distant node communication. Moreover, if there is any CH near the sink area, it does not consider the distance between itself and the sink, CH will always transmit to the gateway node. This results in doubling the communication power consumption. As a result, residual energy in the network will be very low, as shown in Figure 6a,b. More energy can be saved if the distance between CH and the sink node is also considered. \begin{table}
\begin{tabular}{c c c c c} \hline \hline \multirow{2}{*}{**Protocols**} & \multicolumn{4}{c}{**100 Nodes in 100 \(\times\) 100 m\({}^{2}\) Area**} \\ \cline{2-5}  & \multicolumn{3}{c}{**Lifetime (Rounds)**} & \multicolumn{2}{c}{**(Throughput Improvement Ratio**} \\ \cline{2-5}  & **FND \({}^{+}\)** & **HND \({}^{\#}\)** & **AND \({}^{\$}\)** & **per Round) MGBEHA (4 GW)/X \({}^{*}\)** \\ \hline MGBEHA (4 GW) & 1083 & 1560 & 2700 & 1 \\ MGBEHA (2 GW) & 984 & 1495 & 2500 & 1.9 \\ LEACH & 775 & 1100 & 1800 & 26.7 \\ M-GEAR & 515 & 1420 & 2500 & 36.4 \\ GSEP & 983 & 1145 & 2500 & 26 \\ \hline \hline \end{tabular}

\({}^{*}\) =Protocols (MGBEHA (4 GW), MGBEHA (2 GW), LEACH, M-GEAR, GSEP), FND \({}^{+}\) = First node dies, HND \({}^{\#}\) = Half nodes die, AND \({}^{\$}\) = All nodes die.

\end{table} 
Table 4: Protocols performance of 100 nodes for 100 m \(\times\) 100 m area. Figure 5: Number of nodes alive per round for different protocols in (**a**) 100 m \(\times\) 100 m; and (**b**) 500 m \(\times\) 500 m area.