# A Novel Security Architecture for WSN-Based Applications in Smart Grid
## 3 Clustering Protocols in WSNs
### Related Work  
Many researchers have contributed to the development of clustering algorithms in WSNs and the utilization of all their advantages in various ways and all areas, such as security. In the following, many research papers interested in clustering algorithms are discussed. [PERSON] et al. in [19] are interested in the low energy adaptive clustering hierarchy (LEACH) clustering protocol. It elects the CH among the nodes of the CH on the threshold equation randomly without regard to the energy of the nodes. Hence, the authors propose to enhance LEACH by modifying its threshold equation to consider the remaining energy to the maximum energy factor. The authors in [21] proposed a clustering algorithm where the selection of the CHs is based on the combination of a trust metric in addition to many other metrics. The trust metric relies on the behavioral aspect. It is based on direct and indirect observations of the node behavior. The factors used to assess the trust metric are the rate of the received acknowledged packets, the successful packets rate, the ratio of forwarding data, and the availability of nodes. Other metrics are used in the election process of CHs which are the waiting time of the node, its connectivity degree, and its relative mobility. [PERSON] et al. [22] proposed a new clustering algorithm for WSNs with a practical swarm optimization (PSO) algorithm to enhance the lifetime of the network. The proposed algorithm consists of three phases: in the cluster formation with the PSO algorithm phase, the sink node is responsible for forming the clusters. Each node sends its identifier, location, and current energy level to the sink node. To ensure the effectiveness of the CHs selection, the sink computes the average energy level of each node. PSO is used by the sink node to identify the convenient number of CHs that minimizes the cost function. The inter-clusters communication phase establishes a path between the sensor nodes to transmit data. Finally, in the data transmission to the sink node phase, the CHs send data to the sink node. The authors in [23] proposed an improved distributed energy-efficient clustering algorithm (IDEEC) for heterogeneous WSNs. The algorithm runs in rounds. First, the energy consumption is evaluated to define the minimum value for each round. Then, the IDEEC protocol evaluates the residual energy of the nodes and selects the CHs based on it. In the next step, IDEEC determines the optimal number of CHs in each round. To select the CH, a probability value is computed to ensure that the node having the highest energy level is selected CH and ensure that the total number of CHs is optimal. The authors in [24] proposed to detect, identify, and prevent the black hole attacks in mobile WSNs using a system built on a hierarchical cluster topology beside a trust model. The hierarchical cluster topology is composed of four levels including sensor node, CH, coordinator node (CO), and base station (BS). The network is divided into clusters, each cluster contains one or more CH and CO. The sensor nodes collect data and forward it to the CH. The CHs aggregate the data and forward it to the CO which, in turn, forwards it to the BS. The authors add a trust metric in the black hole attack detection mechanism, where the behavior of the nodes is assessed. The trust model is divided into two phases. First, the nodes discover their neighborhood and determine their trustworthiness by calculating the packet delivery ratio. Then, untrustworthy sensor nodes are revoked by adding them to a blacklist. The authors proposed in [25] a clustering algorithm named EPMS that uses the PSO algorithm. EPMS is used in the routing process to improve network performance. First, the network is divided into several regions using the PSO algorithm. Secondly, each sensor node calculates its distance from the center of gravity of the area. Thirdly, the average of remaining energy among all nodes of the region is calculated.