# An Energy-Efficient and Secure Routing Protocol for Intrusion Avoidance in IoT-Based WSN
## 4 The Sensitivity Analysis  
This section performs the sensitivity analysis of weighting factors for the selection process of cluster heads in dynamic network topology. By using weighting factors w1, w2, w3 and w4, Equation (1) optimizes the process of cluster heads selection that incorporates the values of residual energy, RSSI, proximity from BS and the queue length factor. All the factors are integrated in a weighted manner and used to conclude the measurement of the impact for each factor in the respective evaluation. The summation of the fractions of effects for all the weighted factors represents must be equal to 100%i.e., w1 + w2 + w3 + w4 = 1. Actually, there are no optimum values for weighting factors; therefore, sensitivity analysis is accomplished to conclude the most suitable values for making any decision. To perform sensitivity analysis, 100 sensor nodes are deployed randomly in a square sized network field. Furthermore, during experiments all the nodes maintain their positions, i.e., non-mobile. The nodes are homogeneous with a initial energy level is set to 5 J. Furthermore, the transmission power for all the nodes is fixed to 20 m. To evaluate sensitivity analysis under dynamic topology, varied number of nodes are selected as cluster heads. The range for selected cluster heads is varying from 2 to 10.  
To evaluate the optimized performance for cluster head selection, four different values of weighted factors are used, where configuration-1 corresponds to w1 = 0.5, w2 = 0.3, w3 = 0.1 and w4 = 0.1, configuration-2 denotes w1 = 0.1, w2 = 0.5, w3 = 0.3 and w4 = 0.1, configuration-3 represents w1 = 0.3, w2 = 0.1, w3 = 0.5 and w4 = 0.1, configuration-4 shows w1 = 0.2, w2 = 0.1, w3 = 0.1 and w4 = 0.6. All configurations are measured with respect to energy consumption, route breakages, transmission distance, and packet delivery performance as a benchmark to accomplish the optimum values for w1, w2, w3 and w4. In addition, the graphical representation using error bars is also used to indicate the error or uncertainty in the experimental results.  
In Figure 3, configuration-1 gives better results as an average of 31% in the comparison of configuration-2, configuration-3 and configuration-4 in terms of energy consumption. The computation of energy consumption depends on the average ratio of power consumption between sensor nodes in send/receive cluster head election packets. Figure 4 illustrates the effects of route breakages for all considered configurations, and configuration-2 outperforms the results as an average of 38% than configuration-1, configuration-3 and configuration-4. Figure 5 shows the transmission distance for each of the evaluated configurations. Accordingly, configuration-3 results in better performance as an average of 36% than configuration-1, configuration-2 and configuration-4. In the end, Figure 6 illustrates that configuration-4 in terms of packet delivery ratio gives better outcomes as an average of 37% than other configurations.  
Figure 3: Energy consumption per selection with various numbers of cluster heads under different weighting factors.  
Based on the performed sensitivity analysis in Figure 3 to Figure 6, the experimental results illustrated that each weighted factor has a significant impact on the selection of cluster head under various IoT based WSN topologies. Thus, to expose the balanced contribution and optimizes the cluster head election process, the weighted factors are set to uniform values.  
Figure 4: Route breakages with various numbers of cluster heads under different weighting factors.  
Figure 5: Transmission distance various numbers of cluster heads under different weighting factors.  
Figure 6: Packet delivery ratio various numbers of cluster heads under different weighting factors.