# Multi-Gateway-Based Energy Holes Avoidance Routing Protocol for WSN
## 5 Multi-Gateway-Based Protocol
### Division of Area into Regions and Gateway Nodes Deployment  
In order to provide uniform distribution of CHs throughout the area, the protocol divides the area into multiple regions. If the area is large, it can be further divided into a larger number of regions. In our protocol number of regions is not fixed as in M-GEAR protocol [6]. Instead, in our protocol, the number of regions more or less depends on the size of the area.  
The entire area is divided into three types of regions: sink region (SR), gateway region (GR), and cluster region (CR). Each cluster region has a separate clustering process and has its own CHs; every node in the CR is a member of some nearby cluster. The formation of cluster regions also minimizes the distance from CHs to sensors. This results in a lower communication cost and lower energy depletion. To avoid the formation of energy holes near a receiver node, the clustering process is not performed in the sink and gateway regions. We have taken two scenarios to show how the area can be divided into multiple regions. As shown in Figure 1a, the 100 \(\times\) 100 m\({}^{2}\) area is divided into four cluster regions, two gateway regions, and one sink region. In Figure 1b, the same area has been divided into eight cluster regions, four gateway regions, and one sink region. When the area is divided into eight regions, two additional gateways are deployed in the region. In both types of division, one gateway node is deployed between every two regions.  
If the number of regions increases, the number of gateway nodes also increases. There should be an appropriate division of area into regions. If the area is small then it is useless to divide the area into a large number of regions. If the area is large, it can be divided into a greater number of regions. For a 100 \(\times\) 100 m\({}^{2}\) area, deployment of four gateways produces better results than the deployment of two gateways. Therefore, for a 100 \(\times\) 100 m\({}^{2}\) area, an appropriate value of the gateway node is four. Figure 1a shows a multi-gateway-based energy holes avoidance routing protocol with two gateway nodes (MGBEHA 2 GW) and Figure 1b shows a multi-gateway-based energy holes avoidance routing protocol with four gateway nodes (MGBEHA 4 GW). Sizes of all gateway regions are the same. Similarly, sizes of all cluster regions are the same. Gateway regions are at equal distance from the sink. The location information of sink and gateways are used to create regions around the sink and gateway nodes, respectively.  
If the area is large (e.g., 500 \(\times\) 500 m\({}^{2}\)), it can be divided into 12 cluster regions, 6 gateway regions and one sink region as shown in Figure 2a. A very large area (e.g., 1000 \(\times\) 1000 m\({}^{2}\)) can be further divided into 20 cluster regions, 10 gateway regions and one sink region as shown in Figure 2b. The number of sink region is always one and it does not change according to the size of the area. However, the number of gateway regions depends upon the number of cluster regions, and it is half of the number of cluster regions. The computation of number of cluster regions depends upon the size of the area. If the area is big, it will be divided into large number of cluster regions otherwise not. Figure 2c explains the partition of the 2000 \(\times\) 2000 m\({}^{2}\) area.  
Moreover, our algorithm has no restriction on the number of regions in an area. It is based upon the user's choice. If the user has cost constraint than he can use less number of gateways, on the other hand, if the user has no cost constraint and his main goal is extended lifetime, he may use large number of gateways in the area. The area is always divided into equal sized cluster regions. There can be any number of ways to divide a square area into equal parts. However, we have divided the area into equal parts as shown in Figures 1a,b and 2a,b.