# Improvement of Perception Layer Routing Protocol with Static Nodes in IoT-Based Microgrids
## 2 Problem Analysis  
As a hierarchical routing protocol, LEACH protocol further reduces energy consumption and prolongs the network life cycle compared with the flat routing protocol. However, its distribution and random selection characteristics have led to many problems that cannot be ignored. The following is a detailed description of the major problems of the LEACH protocol:  
1. One of the important parameters in the LEACH protocol is the ratio \(p\) of cluster heads to the total number of nodes. The value of this parameter in the protocol is a constant set in advance. After the parameters are initialized, the value of \(p\) will not change. However, the static \(p\) value cannot adapt to the needs of the network under different conditions and operating periods. When the network operates to the later stage, the number of dead nodes increases, and an excessively large cluster head ratio \(p\) will cause an excessively larger number of cluster heads in the network. A large number of cluster heads not only reduces the network data transmission efficiency, but also accelerates the energy attenuation. Meanwhile, if the cluster head ratio \(p\) is set too small, the number of member nodes within the cluster will increase, thus resulting in the rapid death of cluster head nodes and jeopardizing the stability of the network topology. An excessively smaller number of cluster heads will increase the average distance between the member nodes and the cluster heads, thus leading to an increase in the network energy consumption.
2. The LEACH protocol establishes clusters through random selection of cluster heads. However, this random mechanism does not take into account the differences in energy and location between nodes, resulting in unreasonable cluster heads. Under the random selection mechanism, the nodes far away from the base station and the nodes with excessively low remaining energy will be selected as cluster heads, which accelerates the death of nodes in some areas of the network and affects the overall stability of the network.
3. In the LEACH protocol, after the cluster heads are selected, the node will search for the cluster head with the smallest distance within the cluster radius and send a join request. However, the static cluster radius cannot meet the needs of nodes at different locations. In areas with high node density, an excessively larger cluster radius will cause more energy to be consumed to selected the most suitable cluster head during the establishment of clusters.  
4. The randomization mechanism used by LEACH in the cluster head selection stage does not consider the impact of node density on the network. Randomized cluster head selection will make it impossible for the number of cluster heads in the areas with higher node density to meet the real needs, while the number of cluster heads in the areas with lower node density exceeds the needs.  
In response to Problem 1, the transformation of the static cluster head ratio \(p\) into a dynamic cluster head ratio \(P\) based on the lowest energy consumption calculation can make the number of network cluster heads more reasonable. In response to Problems 2 and 4, multiple factors such as node residual energy and neighbor node density are employed to improve the cluster head selection threshold, so that the stability of the network topology can be maintained. In response to Problem 3, selecting a dynamic cluster radius for clustering can meet the actual needs of the network during clustering.