# A Novel Security Architecture for WSN-Based Applications in Smart Grid
## 5 Results
### Simulation Results  
First of all, we will investigate the number of elected CA. To this end, we plot, in Figure 2, the number of CA as a function of the number of nodes in the network. We observe that whenever the number of sensor nodes in the network increases, the number of elected CA increases also. It passes from 5 for 150 nodes in the network and a cluster size of 30 nodes to 6 clusters for 200 nodes. All the clusters have a fixed size which relies on the maximum number of members, if a cluster is saturated, a new cluster will be created. It is obvious also from Figure 2 that the size of the cluster affects the number of CA, if it increases the number of CA decreases. This points out that the proposed clustering algorithm always selects the minimum number of CAs necessary to allow all nodes to join the clusters as we will show later. A new cluster is created only if the existing clusters are full. Figure 3 shows the impact of the transmission range on the number of elected CA. Since the proposed algorithm is designed to fit into a SG environment where the number of sensors in the network is high at the same time the sensors will be widespread in the plant, we have opted to use high transmission range values (more than 50 m). As shown in Figure 3 the number of CA is notably decreasing when the transmission range increases. Indeed, 18 clusters are created for a transmission range of 50 m however only 10 clusters are created in the case of 250 m for a total of 250 sensor nodes in the network and a cluster size of 25. This result can be explained by the fact that when the transmission range of the sensor nodes increases, far sensor nodes will be able to detect the CA. Hence, fewer CHs will be elected, and consequently fewer clusters will be formed. It is worth mentioning that the more the transmission range increases, the more energy will be consumed, that is why we have opted for a maximum of 250 m in Figure 3.  
Figure 4 shows the number of CAs as a function of the percentage of malicious sensor nodes in the network. It is obvious in Figure 4 that the percentage of malicious nodes in the network does not affect the number of CA. The number of CA is constant on increasing the number of malicious nodes for two reasons: the election of the CA is based on a trust metric that reflects the trustworthiness of the node, so a malicious node will not be able to become a \begin{table}
\begin{tabular}{c c} \hline \hline
**Parameters** & **Values** \\ \hline The number of sensor nodes & 200 \\ \hline Network size & \(100\times 100\) m \\ \hline Max number of nodes in a cluster & 25 \\ \hline Percentage of malicious sensor nodes & \((5,25)\) \\ \hline Simulation duration & 2000 s \\ \hline \hline \end{tabular}
\end{table} 
Table 2: The simulation parameters. CA. The second reason is that the join requests coming from the sensor nodes to the CA are filtered by the registration authority to avoid any compromise of the certification authority. Figure 5 presents the percentage of malicious sensor nodes elected CAs as a function of the number of malicious nodes in the network for the proposed algorithm as well as a clustering algorithm entitled Energy Efficient Secure trust-based (EEST) [20] described in the related work section. Figure 5 shows that around 10% of malicious sensor nodes are elected CAs in EEST while none of the malicious sensor nodes is elected CAs in the proposed algorithm. This feature is due to the trust metric used in the election process. Only trustful sensor nodes can be elected CAs in the proposed algorithm. Figure 3: Number of CA as a function of the transmission range. Figure 2: The number of CA as a function of the number of sensor nodes in the network. Figure 6 shows the percentage of sensor nodes that are members of the clusters as a function of the total number of sensor nodes in the network. We notice that when the transmission range is equal to 100 m around 2% of the nodes are not in clusters.