An Energy-E ﬃ cient and Secure Routing Protocol for Intrusion Avoidance in IoT-Based WSN

: Due to the advancement of information and communication technologies, the use of Internet of Things (IoT) devices has increased exponentially. In the development of IoT, wireless sensor networks (WSNs) perform a vital part and comprises of low-cost smart devices for information gathering. However, such smart devices have constraints in terms of computation, processing, memory and energy resources. Along with such constraints, one of the fundamental challenges for WSN is to achieve reliability with the security of transmitted data in a vulnerable environment against malicious nodes. This paper aims to develop an energy-e ﬃ cient and secure routing protocol (ESR) for intrusion avoidance in IoT based on WSN to increase the network period and data trustworthiness. Firstly, the proposed protocol creates di ﬀ erent energy-e ﬃ cient clusters based on the intrinsic qualities of nodes. Secondly, based on the ( k,n ) threshold-based Shamir secret sharing scheme, the reliability and security of the sensory information among the base station (BS) and cluster head are achieved. The proposed security scheme presents a light-weight solution to cope with intrusions generated by malicious nodes. The experimental results using the network simulator (NS-2) demonstrate that the proposed routing protocol achieved improvement in terms of network lifetime as 37%, average end-to-end delay as 24%, packet delivery ratio as 30%, average communication cost as 29%, network overhead as 28% and the frequency of route re-discoveries as 38% when compared with the existing work under dynamic network topologies.


Introduction
Internet of Things (IoT) is a worldwide communication infrastructure that consists of different connectivity objects that impart networking, sensory and information processing tools [1][2][3][4].The basic theme of IoT is to provide connectivity anywhere, of anything and anywhere between homogeneous objects.Radio-frequency identification (RFID) [5][6][7] is an initial technology for IoT that allows electromagnetic fields to transfer the identification data automatically towards the reader via wireless connectivity devices.Radio signal transponder (tag) and tag readers are the two main parts of RFID system.Usually, RFID tags encompass electronically stored information and people can classify, track and monitor the objects.The RFID tags are attached to any object for information gathering and monitoring the target location.
Wireless sensor networks (WSNs) [8][9][10][11] is a further foundational technology for IoT, which comprises of smart objects called sensor nodes.These nodes are deployed in an unstructured manner for information capturing with limited constraints in terms of different resources i.e., energy, computational, memory and processing power.However, due to the complex structure of WSN and restricted constraints on sensor nodes, implementing security for IoT systems is hard to process and communication may compromise with the variety of network attacks [12,13].
Moreover, WSNs based on IoT are used in both attended and unattended environments such as air pollution, water quality monitoring, smart cities, etc., another critical matter is to improve energy efficiency [14,15] besides reliable data forwarding.In the past, different researchers have been presented with a cluster-based solution for WSN to achieve energy efficiency [16][17][18][19][20].In clustering schemes, the nodes are separated into different regions with one cluster head referred to as the leader node.The aim of the cluster head is to collect the data from member nodes, aggregate them and further forwarded towards the base station (BS).The data transmission from cluster heads to BS may be accomplished either using single hop or multi-hop strategy.Probabilistic and non-probabilistic methods are mainly two kinds of clustering solutions.In probabilistic [21][22][23][24][25], clusters are generated in randomly order, which results in unbalanced load distribution and energy consumption.On the other hand, the non-probabilistic method [26][27][28][29] uses multiple factors for the selection of cluster heads.Although, the non-probabilistic methods give an improved performance as compared to traditional probabilistic methods, however, because of dynamic nature of sensor nodes [30][31][32][33][34], improving energy conservation and routing robustness are still open challenges for IoT based on WSN.
This research paper focuses on developing an energy-efficient and secure routing protocol to achieve reliable network communication against malicious threats.As compared to existing energy efficient IoT based WSN systems, our proposed energy-efficient and secure routing protocol (ESR) protocol differs in two major aspects.Firstly, the ESR protocol makes use of the inherent abilities of nodes and generates various energy efficient clusters by considering the quality of service (QoS) requirements.Further, ESR protocol exploits a practice of bounded clustering to update the status of cluster heads with minimum communication cost, as least number of re-election packets are flooded inside each cluster.Secondly, to achieve trustworthiness and secure network-wide data routing, ESR protocol adopts a light-weight secret sharing scheme between cluster heads and BS.In this scheme, the BS generates a secret key, which is partitioned and shared among the set of cluster heads.During the transmission between cluster heads and BS, based on the proposed secret sharing scheme the incoming packets are encrypted.Similarly, on the arrival of the packets from cluster heads towards the BS, decryption is performed before further transmission to the end user based on the proposed data security scheme.
The proposed scheme is computationally secure, extensible with respect to the increase in the network field and dynamic in terms of changing the keys.Based on the aforementioned contributions, the ESR protocol is appropriate for a large scale IoT based WSN systems that need energy-awareness, trustworthiness and fault-tolerability.
The remainder of the research paper is as given.The related work and detailed for the research formulation are discussed in Section 2. The introduction of ESR protocol along its design, functionality and algorithms are discussed in Section 3. The sensitivity analysis of weighted factors for optimizing the ESR protocol is addressed in Section 4. The simulation model and numerical results of ESP protocol against related work are illustrated in Section 5 followed by Section 6, which concludes this article.

Related Work and Research Formulation
In most of the large scale networks such as IoT and restricted constraint of sensor nodes, the energy conservation goal is a demanding parameter.Normally, in cluster-based networks [17,19,35,36], cluster heads are considered as a controlling entity, which performs a symbolic role during data gathering and transmission.Being a focal point for all activities within a cluster, due to abundant network traffic they are exposed to quick energy consumption.Therefore, the selection of optimal cluster heads has a symbolic effect on the network performance especially with respect to network stability and homogeneity.Moreover, in large scale IoT based WSNs, secure data routing is another crucial part due to constraint resources.Most of the existing schemes [37][38][39][40] have unreliable and insecure network communication due to the absence of protection mechanisms against malicious threats.
The first proposed cluster based routing protocol, low energy adaptive clustering hierarchy (LEACH) [21] comprises different stages and the individual stage partition into two sub phases.In the setup phase, clusters are generated whereas data transmission occurs in a steady phase.In addition, cluster head selection is done periodically, every node in the network field produces a number based on random strategy and if the generated number is smaller than the preset threshold, the role of the cluster head is assigned to the node.Although, LEACH is distributed protocol, however, it might happen that nodes with lower energy levels to be selected as cluster heads.In addition, over the sensor field, cluster heads are not evenly distributed, which causes additional energy dissipation.
In [41], the authors improved the performance of the LEACH protocol by incorporating multi-hop criteria for data transmission.However, initially, the clusters are generated randomly, which leads to unbalanced energy consumption.Further, constructed multi-hop paths are non-optimized thereby results in routing holes and route breakages.In addition, chain-chain based routing protocol (CCBRP) [42] aims to improve energy conservation of sensor nodes in data forwarding.CCBRP integrates the functions of LEACH and Power Efficient Gathering in Sensor Information Systems (PEGASIS) by arranging the entire nodes into different chains.CCBRP offers a hybrid scheme and executes the constructed chains in two different stages.The main problem of this protocol is high energy consumption and latency rate with the increase in network size.Consequently, due to restricted scalability, CCBRP is inappropriately suitable for huge scale networks.
Authors [43] proposed load balancing and the data collection algorithm aims for saving energy consumption and improved the performance of network with respect to data aggregation and forwarding.The proposed algorithm generates a set of layers based on hop counts among nodes and sinks node.However, the selection procedure of next-hop works in the hop by hop manner, which results in increasing communication costs.Moreover, an increase in network size leads to a higher number of route discoveries and additional transmission delays.Furthermore, robust and energy efficient authentication protocol for industrial IoT [44] presented three-factor authentication and provides data security for WSN.The proposed solution offers proper mutual authentication between nodes, however, unnecessary energy is consumed during the authentication process and compromised network lifetime.Similarly, the Shamir secret sharing scheme [45] has been exploited in [46,47], and aims to provide data security over the network field.The schemes are composed of two main phases i.e., share generation and share re-construction.A generated secret key is partitioned between set of nodes by using (t, n) threshold-based, where a subset of any nodes is sufficient for reconstructing the secret key.However, the proposed solutions exchange a lot of messages in the network field that dissipate additional energy and lead to routing overhead.
In the energy efficient balanced cluster-based data aggregation (EEBCDA) algorithm [48], the network field is structured into unequal sized rectangular grids with one cluster head.The cluster head's position is shifted among member nodes within each grid.By exploiting the information of residual energy, the set of few nodes are selected as cluster heads within each grid.However, the operation of generating a grid is more complex and required more overheads.Furthermore, the remaining structure of EEBCDA is comparable to LEACH.Moreover, reliable and energy-efficient data collection for large scale WSNs [49] aims to improve the energy resource of nodes with consistent routing.In the hotspot region, a fewer number of nodes are selected for capturing information while more monitor nodes are selected in a non-hotspot region.Moreover, based on converging the multi-path route for event monitoring nodes, the aggregated data packets are sent towards the sink node.However, data security is overlooked in the proposed solution and networks may compromise information disclosure in a harsh and complex environment.
In LEACH-ensuring reliable data delivery (LEACH-ER) [50], by exploiting energy and data reliability factor the selection process for the cluster head, is initiated.The main idea behind LEACH-ER was to reduce the rate of packets reception inside a cluster among cluster heads and member nodes, which results in improving network lifetime and energy efficiency.However, routes are non-optimized, which causes retransmission and route breakages.Energy efficient in [51], a multi-hop communication routing (MCR) protocol is proposed and aims to improve network lifetime and load balancing.In MCR, based on weighted metrics, the cluster head election is made.Furthermore, multi-hop criteria adopted for data forwarding forwards BS.However, the constructed routings are not optimum and within the cluster, the data transmissions occur based on single-hop.

Proposed Intrusion Avoidance Protocol
This section summarizes the proposed energy-efficient and secure routing (ESR) protocol for IoT based WSN.The basic structure of a cluster based network is illustrated in Figure 1.The proposed ESR protocol divides the overall its functionality into two main components that are discussed in the next sections.In the first component, ESR protocol organizes optimum hierarchical topology construction and the thresholding based secret sharing scheme (SSS) [45] for secure data routing.Based on multiple criteria along with QoS constraints, the optimized cluster heads are determined in association to the distributed clusters in energy efficient and balanced manner.Furthermore, the proposed clustering scheme improves network lifetime with low overhead and power consumption ratio between the sensor nodes.In the second component, the secure and trustworthy routing path is constructed between cluster heads and BS to avoid any intrusions caused by malicious nodes.To achieve reliable data forwarding, the BS generates a secret key, which is shared among selected cluster heads.In data forwarding from cluster heads, the data packets are encrypted using the SSS mechanism.On the other hand, BS reconstructs the inbound data packets from cluster heads using the proposed secret sharing scheme.Furthermore, the relative impact of each factor in an optimized selection process of the cluster head is evaluated based on a sensitivity analysis, which is a mathematical model that provides an understanding of the affiliation among input and output values in development.Simulation results of ESR outperform other relevant schemes with respect to packet delivery ratio, network lifetime, end-to-end delay, communication cost, number of route discoveries and network overhead.Figure 2 illustrates the block diagram of the ESR protocol.
optimized, which causes retransmission and route breakages.Energy efficient in [51], a multi-hop communication routing (MCR) protocol is proposed and aims to improve network lifetime and load balancing.In MCR, based on weighted metrics, the cluster head election is made.Furthermore, multihop criteria adopted for data forwarding forwards BS.However, the constructed routings are not optimum and within the cluster, the data transmissions occur based on single-hop.

Proposed Intrusion Avoidance Protocol
This section summarizes the proposed energy-efficient and secure routing (ESR) protocol for IoT based WSN.The basic structure of a cluster based network is illustrated in Figure 1.The proposed ESR protocol divides the overall its functionality into two main components that are discussed in the next sections.In the first component, ESR protocol organizes optimum hierarchical topology construction and the thresholding based secret sharing scheme (SSS) [45] for secure data routing.
Based on multiple criteria along with QoS constraints, the optimized cluster heads are determined in association to the distributed clusters in energy efficient and balanced manner.Furthermore, the proposed clustering scheme improves network lifetime with low overhead and power consumption ratio between the sensor nodes.In the second component, the secure and trustworthy routing path is constructed between cluster heads and BS to avoid any intrusions caused by malicious nodes.To achieve reliable data forwarding, the BS generates a secret key, which is shared among selected cluster heads.In data forwarding from cluster heads, the data packets are encrypted using the SSS mechanism.On the other hand, BS reconstructs the inbound data packets from cluster heads using the proposed secret sharing scheme.Furthermore, the relative impact of each factor in an optimized selection process of the cluster head is evaluated based on a sensitivity analysis, which is a

Optimize Clusters
The number of nodes is dispersed randomly in a square sized network field at the beginning of initialization phase.Each node remains static and has a unique ID with limited constraints.The BS has no restriction in terms of innumerable resources.In the beginning, BS broadcasts its locality in hop-by-hop manner over the monitoring field and all the nodes received it.Furthermore, the routing table of each node is updated by incorporating the neighbor's information.Afterwards, ESR protocol announces the cluster head selection mechanism in the network field in a scattered manner.By using residual energy   , the Received Signal Strength Indicator ( ) , proximity from BS     and queue length   factors, the competitive value   is computed for all the nodes.Each node receives its neighbor's information through the exchange of control messages.Firstly, node energy is the most contributing factor in the survival of the network thus maximum residual energy of a node is given more significance.Secondly, the uses of RSSI measure the performance of the wireless link that offers a good packet reception rate if the RSSI value is more than a certain threshold.ESR protocol computes the RSSI threshold, which is the average reception rate of beacon packets from N neighbors at a certain time period (Δt) as given in Equation 1.The node's RSSI value must be greater than the computed threshold.If the RSSI value is less than the threshold, it indicates low link quality, which results in a rise in the probability of packets lose ratio.Let X denote the reception rate of beacon packets, then the following equation is used to compute the value of the RSSI threshold.
Thirdly, the shortest path of node towards BS minimizes energy consumption and longer the network lifetime.In the end, the factor of queue length   improves data delivery performance and measures the congestion level at the node level.RRi is the reception of packets in bytes at node i, and TB is the total buffer size in bytes, then the queue length QLi of a node i can be computed using Equation 2.

Optimize Clusters
The number of nodes is dispersed randomly in a square sized network field at the beginning of initialization phase.Each node remains static and has a unique ID with limited constraints.The BS has no restriction in terms of innumerable resources.In the beginning, BS broadcasts its locality in hop-by-hop manner over the monitoring field and all the nodes received it.Furthermore, the routing table of each node is updated by incorporating the neighbor's information.Afterwards, ESR protocol announces the cluster head selection mechanism in the network field in a scattered manner.By using residual energy e i , the Received Signal Strength Indicator (RSSI i ), proximity from BS d i to BS and queue length QLi i factors, the competitive value C v is computed for all the nodes.Each node receives its neighbor's information through the exchange of control messages.Firstly, node energy is the most contributing factor in the survival of the network thus maximum residual energy of a node is given more significance.Secondly, the uses of RSSI measure the performance of the wireless link that offers a good packet reception rate if the RSSI value is more than a certain threshold.ESR protocol computes the RSSI threshold, which is the average reception rate of beacon packets from N neighbors at a certain time period (∆t) as given in Equation ( 1).The node's RSSI value must be greater than the computed threshold.If the RSSI value is less than the threshold, it indicates low link quality, which results in a rise in the probability of packets lose ratio.Let X denote the reception rate of beacon packets, then the following equation is used to compute the value of the RSSI threshold.
Thirdly, the shortest path of node towards BS minimizes energy consumption and longer the network lifetime.In the end, the factor of queue length QLi i improves data delivery performance and measures the congestion level at the node level.RR i is the reception of packets in bytes at node i, and TB is the total buffer size in bytes, then the queue length QL i of a node i can be computed using Equation (2).
Finally, all the factors are summarized based on weighted means as shown in Equation ( 3), and the nodes are appointed as initial cluster heads based on the highest competitive value C v Accordingly, proposed ESR protocol selects an optimize cluster heads based intrinsic qualities and generated clusters are more adaptable.The computed value of C v is normalized in the series of [0,1].
In Equation ( 3), weighting factors are denoted by w1, w2, w3 and w4 for different selection aspects, namely the node's residual energy, RSSI, proximity from BS and queue length.During the selection process, all the weighting factors signify the particular impact in computing the competitive value of nodes, whereas w1 + w2 + w3 + w4 = 1.The sensitivity analysis of the weighting factors is discussed in Section 4. The evaluated competitive value is in the series of [0,1] as all the residual energy, RSSI, proximity from BS and queue length have values in the same range.Firstly, the residual energy metric makes the cluster selection mechanism more adaptive.Furthermore, the RSSI facet is unified in the selection mechanism of the cluster head, which shows the performance of the wireless link.Moreover, based on the smallest distance from BS, an appropriate node is considered for the selection of the cluster head.Each node transmits beacon packets to its neighbors at an interval of the fixed period.On receiving beacons packets, the neighbor node evaluates its RSSI value and sends back towards the source node.In the end, the queue length factor is incorporated in the selection mechanism of cluster head, thus a node is given higher priority to be elected as a cluster head if its transit queue length is higher than a certain threshold.After the selection of primary cluster heads, they advertised their status in a precise manner.All the normal nodes join their adjacent cluster head for the formation of clusters, upon receiving the status messages.Normal nodes might receive status messages from more than one adjacent cluster heads and associate themselves with those cluster heads, having the strongest RSSI value.At the end of the clusters formation process, ESR protocol assigns a unique ID for all generated clusters in order to specify their boundaries.The set of nodes selected as cluster heads announce channel access schedules based on time-division multiple access (TDMA).

(t, n) Thresholding Based Secret Sharing Scheme (SSS) for Secure Data Routing Against Intrusions of Malicious Nodes
In the proposed approach, the BS generates a secret key S, which is to be partitioned among a set of n cluster head using (t, n) threshold-based Shamir's secret sharing scheme where any t subset of cluster heads are enough to reconstruct the secret key S. It must be noted that for Shamir's secrete sharing scheme, the following two conditions must be satisfied: i.
Any combination of t or higher number of subkeys (S 0 , S 1 , . . ., S t−1 ) can reconstruct the secret key S. ii.
Less than t or fewer number of subkeys can not reconstruct the secret key S.
In SSS, for construction of t subkeys, a t − 1 degree polynomial is constructed.For creating a (t, The reconstruction of the secret keys S requires computing the Lagrange basis polynomial given in Equation ( 5).
After computing t − 1 Lagrange values, these are put in Equation ( 6) for the computation of secret key S.
Each share of the key S i is diffused towards the cluster heads, which is flooded towards an individual node in the particular cluster.When the node forwards the sensory data D i towards the cluster head, it is encrypted by applying the Exclusive OR (XOR) operation with the key S i as given in Equation ( 7).
After receiving the encrypted data E i from the member nodes, the cluster head transmits it to the BS for further processing.Similarly, on the arrival of encrypted data, the BS decrypts the data using the decryption key S and transmits it to the end user.

Updating of Cluster Heads
As WSNs have restricted resources, thus ESR protocol re-formulate the role of cluster heads in a dynamic manner.The main aim behind updating of cluster heads component is to achieve uniform load balancing and energy consumption.ESR protocol observes the subsequent to evaluate the network measure. i.
When any cluster head j receives the data packet then firstly it verifies whether it already received the same data packet or not.If yes, then cluster heads simply drop the duplicate data packet to reduce network congestion and energy consumption.ii.
It might be a case that the cluster head receives a new data packet, but it has no enough energy resource, i.e., e j < threshold, then it quits from data forwarding and initiates re-election mechanism inside a particular cluster boundary.Furthermore, the ESR protocol also computes the congestion rate C r of each cluster based on the function, which signifies the normalized congestion value in the range of [0,1] as shown in Equation (8).
where ADR represents the average delay ratio among data packets and ARR represents the average reception rate of data packets.ESR protocol continuously checks the C r value, and if it does not fall in the range of [0,1], ESR protocol assumes that a particular cluster head has extended to congestion limit and needs to initiates the re-election process as described in Section 3.1.
In Algorithm 1, all the main modules of the proposed ESR protocol are lightened.BS generates secret key S 3.
The secret key S is partitioned into a set of t cluster heads 4.
Share of key S i transmits to the set of t cluster heads 5.
Node n i transmits the data D i to the cluster head 6.
Data is encrypted using XOR operation with the key S i : BS decrypt the received data packets from a set of t cluster heads using the decryption key S 8.
end procedure Updating cluster heads

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.
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.
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 1optimizes 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., nonmobile.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 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.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    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    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 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.

Network Model and Discussion
In this research work, the implementation and evaluation phases were carried out in NS2 as a network simulator [52] along with the mannasim framework [53].A varying number of nodes are distributed in random order with 10 malicious nodes.The malicious nodes broadcast false route reaction packets in order to be selected as next-hop for data forwarding.We considered a squared size sensor field by keeping a fixed number of nodes.Initially, nodes have 5 J of energy level and homogeneous in terms of various resources.Further, the transmission range was set to 20 m for each node.A constant bit rate (CBR) connection was established between sending and receiving nodes.To evaluate the energy consumption over the sensor field, the energy model [21] was used in this research work.The energy model evaluated the energy consumption (E t and E r ) related to data transmission and receiving by using Equations ( 9) and (10).In this research study, Table 1 gives the default simulation parameters, where the units of m is meter, s is second, J is joule and nJ is nana joule.
where: k shows the number of data bits; d is the transmission distance; E elect is the amount of consumed energy in data transmission; d t is the distance threshold value.

Numerical Results of ESR Protocol
In this section, we evaluated the numerical results of ESR protocol in the comparison of LEACH-ER, LEACH-MAC and CCBRP.The numerical results of ESR protocol were measured with other solutions under different network topologies.The network topologies were varied based on a different number of nodes from 100 to 500.To establish the dynamic network topologies, all the nodes were distributed randomly over the sensor field.The comparison among protocols was performed with respect to network lifetime, average end-to-end delay, packet delivery ratio, average communication cost, network overhead and the frequency of route re-discoveries parameters.Moreover, error bars based on varying standard deviations were used to indicate error or uncertainty in the measurement of experimental results.

Network Lifetime
For varying node density topologies, Figure 7 proves the performance of the ESR protocol with respect to the network lifetime as compared to existing work.It is observed in Figure 6 that ESR had a prolonged network lifetime, especially in high network load, as an average of 37% enhancement was accomplished in the comparison of other solutions.This is due to optimizing the clusters formation process and initiating the re-election mechanism on the network analysis.In addition, ESR protocol used local clustering functionality that decreased overheads and unnecessary energy consumption in the re-clustering phase.Further, the ESR gave a light-weight secure routing mechanism to route the encrypted sensory information towards BS.

Network Lifetime
For varying node density topologies, Figure 7 proves the performance of the ESR protocol with respect to the network lifetime as compared to existing work.It is observed in Figure 6 that ESR had a prolonged network lifetime, especially in high network load, as an average of 37% enhancement was accomplished in the comparison of other solutions.This is due to optimizing the clusters formation process and initiating the re-election mechanism on the network analysis.In addition, ESR protocol used local clustering functionality that decreased overheads and unnecessary energy consumption in the re-clustering phase.Further, the ESR gave a light-weight secure routing mechanism to route the encrypted sensory information towards BS.shown the highest data delivery ratio as an average of 30% improvement than existing solutions, especially in high nodes density topologies.This is due to the fact that ESR protocol considering multiple and optimal criteria for the selection of cluster head, and more priority was given to the more suitable nodes for generating stable and energy efficient clusters.In addition, after the formation of clusters, they remained fixed and ESR re-initiated inbound process for the selection of cluster heads.Moreover, the reliability of the data packets that were communicated between the base station (BS) and cluster head was achieved using the (, ) threshold-based Shamir secret sharing scheme, which results in reducing route breakages and ultimately increased data delivery performance.

Packet Delivery Ratio
Figure 8 demonstrates the performance measurement in terms of packet delivery ratio for ESR protocol against the existing work under varying nodes density topologies.In Figure 8, ESR has shown the highest data delivery ratio as an average of 30% improvement than existing solutions, especially in high nodes density topologies.This is due to the fact that ESR protocol considering multiple and optimal criteria for the selection of cluster head, and more priority was given to the more suitable nodes for generating stable and energy efficient clusters.In addition, after the formation of clusters, they remained fixed and ESR re-initiated inbound process for the selection of cluster heads.Moreover, the reliability of the data packets that were communicated between the base station (BS) and cluster head was achieved using the (k, n) threshold-based Shamir secret sharing scheme, which results in reducing route breakages and ultimately increased data delivery performance.

Average End-to-End Delay
Under varying nodes density topologies in Figure 9, the performance of ESR protocol was evaluated against other solutions with respect to average end-to-end delay.In fact, due to high data traffic, congestion and an increasing number of malicious nodes, the value of end-to-end delay also increased.However, it was seen that the proposed ESR protocol had a lower end-to-end delay in the comparison of other solutions, particularly in large sized and high network load.The numerical results illustrated that ESR protocol achieved a 24% average decrease of end-to-end delay in the comparison of other solutions.Actually, the proposed ESR protocol formed the clusters in an adaptive manner and updates the status of cluster heads within a particular boundary of a cluster.In addition, ESR protocol gave more consistent and robust data forwarding nodes based on a link quality RSSI values that led to routing performance.Unlike other existing solutions, ESR protocol performed the measurement of network analysis to revolve the position of cluster heads in the sensor field, which reduced the chances of routing hole and minimized the data latency ratio.

Average End-to-End Delay
Under varying nodes density topologies in Figure 9, the performance of ESR protocol was evaluated against other solutions with respect to average end-to-end delay.In fact, due to high data traffic, congestion and an increasing number of malicious nodes, the value of end-to-end delay also increased.However, it was seen that the proposed ESR protocol had a lower end-to-end delay in the

Network Overhead
In Figure 11, the comparison of ESR protocol is illustrated against the existing solution under varying nodes density topologies.The numerical results demonstrated that ESR protocol had attained an average of 28% reduction in network overhead than the existing solutions because ESR protocol provided a light-weight secret sharing scheme between cluster heads and BS, which was not only computationally secure to handle the intrusions against malicious nodes but also extensible in terms of varying network topologies.In addition, trustworthy routing paths led to a fewer number of route re-construction messages in the sensor field and thus reduced network overhead.Furthermore, the wireless channels were less congested, as ESR protocol minimized re-election packets because of bounded clustering.
achieved an average of 29% reduction in communication cost under varying nodes topologies.This was due to making use of neighbor's information, and in the selection process of cluster heads only a limited number of nodes contributed.Moreover, the re-election for cluster heads was re-called based on the demand and network analysis.Furthermore, support of data security and reliability, ESR protocol decreased the number of route re-transmissions, which resulted in shortening the communication cost.

Conclusions
The aim of this paper was to present the energy-efficient and secure routing (ESR) protocol for intrusion defense in IoT based on wireless sensor networks.In the existing solution, most of them used a greedy algorithm for the construction of the routing path, overlooked intrusions in an infrastructure-less and unattended environment.This results in a high number of route discoveries and re-transmissions, particularly under the number of malicious nodes and high network load scenario.Basically, ESR optimized the selection process of cluster heads and used a distributed stretegy to generate clusters for uniform distribution of energy consumption.Furthermore, by considering higher values of RSSI and least network congestion improved the routing performance with respect to QoS constraints and data reliability.Moreover, to achieve a secure network-wide data routing against malicious nodes, ESR protocol adopted a light-weight secret sharing scheme between cluster heads and BS.This provided data security from nodes towards the cluster heads and further to the BS against malicious threats.For future work, the proposed protocol will be extended by considering multi-hop network communication along with the mobility standards.
mathematical model that provides an understanding of the affiliation among input and output values in development.Simulation results of ESR outperform other relevant schemes with respect to packet delivery ratio, network lifetime, end-to-end delay, communication cost, number of route discoveries and network overhead.Figure 2 illustrates the block diagram of the ESR protocol.

Figure 1 .
Figure 1.Structure of the cluster based network.

Figure 1 .
Figure 1.Structure of the cluster based network.

Figure 2 .
Figure 2. Block diagram of the energy-efficient and secure routing protocol (ESR) protocol.

Figure 2 .
Figure 2. Block diagram of the energy-efficient and secure routing protocol (ESR) protocol.

Figure 3 .
Figure 3. Energy consumption per selection with various numbers of cluster heads under different weighting factors.

Figure 3 .
Figure 3. Energy consumption per selection with various numbers of cluster heads under different weighting factors.

Figure 4 .
Figure 4. Route breakages with various numbers of cluster heads under different weighting factors.

Figure 5 .
Figure 5. Transmission distance various numbers of cluster heads under different weighting factors.

Figure 6 .
Figure 6.Packet delivery ratio various numbers of cluster heads under different weighting factors.

Figure 4 .
Figure 4. Route breakages with various numbers of cluster heads under different weighting factors.

Figure 4 .
Figure 4. Route breakages with various numbers of cluster heads under different weighting factors.

Figure 5 .
Figure 5. Transmission distance various numbers of cluster heads under different weighting factors.

Figure 6 .
Figure 6.Packet delivery ratio various numbers of cluster heads under different weighting factors.

Figure 5 .
Figure 5. Transmission distance various numbers of cluster heads under different weighting factors.

Figure 4 .
Figure 4. Route breakages with various numbers of cluster heads under different weighting factors.

Figure 5 .
Figure 5. Transmission distance various numbers of cluster heads under different weighting factors.

Figure 6 .
Figure 6.Packet delivery ratio various numbers of cluster heads under different weighting factors.

Figure 6 .
Figure 6.Packet delivery ratio various numbers of cluster heads under different weighting factors.

Figure 7 .
Figure 7. Network lifetime in varying node density topologies.

Figure 8
Figure 8 demonstrates the performance measurement in terms of packet delivery ratio for ESR protocol against the existing work under varying nodes density topologies.In Figure 8, ESR has

Figure 8 .
Figure 8. Packet delivery ratio in varying nodes density topologies.

409 5 . 4 .
Average End-to-End Delay 410 Under varying nodes density topologies in Figure 9, the performance of ESR protocol was

Figure 8 .
Figure 8. Packet delivery ratio in varying nodes density topologies.

Figure 8 .
Figure 8. Packet delivery ratio in varying nodes density topologies.
comparison of other solutions, particularly in large sized and high network load.The numerical results illustrated that ESR protocol achieved a 24% average decrease of end-to-end delay in the comparison of other solutions.Actually, the proposed ESR protocol formed the clusters in an adaptive manner and updates the status of cluster heads within a particular boundary of a cluster.In addition, ESR protocol gave more consistent and robust data forwarding nodes based on a link quality RSSI values that led to routing performance.Unlike other existing solutions, ESR protocol performed the measurement of network analysis to revolve the position of cluster heads in the sensor field, which reduced the chances of routing hole and minimized the data latency ratio.

Figure 9 .
Figure 9. End-to-end delay in varying nodes density topologies.

Figure 10
Figure 10 illustrates the comparison of ESR protocol with other protocols in terms of average communication cost under varying nodes density topologies and in the presence of malicious nodes.Remarkably, with a varied number of nodes and malicious nodes, a network led to traffic jamming and network disconnections, which resulted in increases in communication cost and transmission

Figure 9 .
Figure 9. End-to-end delay in varying nodes density topologies.

Figure 10 Figure 10 .
Figure 10 illustrates the comparison of ESR protocol with other protocols in terms of average communication cost under varying nodes density topologies and in the presence of malicious nodes.Remarkably, with a varied number of nodes and malicious nodes, a network led to traffic jamming and network disconnections, which resulted in increases in communication cost and transmission interruption.However, based on Figure9, it is seen that ESR protocol reduced the communication cost in the comparison of other schemes especially when network load increased.ESR protocol had achieved an average of 29% reduction in communication cost under varying nodes topologies.This was due to making use of neighbor's information, and in the selection process of cluster heads only a limited number of nodes contributed.Moreover, the re-election for cluster heads was re-called based on the demand and network analysis.Furthermore, support of data security and reliability, ESR protocol decreased the number of route re-transmissions, which resulted in shortening the communication cost.

439 5 .
6. Network Overhead 440 In Figure 11, the comparison of ESR protocol is illustrated against the existing solution under 441 varying nodes density topologies.The numerical results demonstrated that ESR protocol had 442 attained an average of 28% reduction in network overhead than the existing solutions because ESR 443 protocol provided a light-weight secret sharing scheme between cluster heads and BS, which was not 444 only computationally secure to handle the intrusions against malicious nodes but also extensible in 445 terms of varying network topologies.In addition, trustworthy routing paths led to a fewer number 446 of route re-construction messages in the sensor field and thus reduced network overhead.447 Furthermore, the wireless channels were less congested, as ESR protocol minimized re-election 448 packets because of bounded clustering.

Figure 10 .
Figure 10.Communication cost in varying nodes density topologies.
5.6.Network OverheadIn Figure11, the comparison of ESR protocol is illustrated against the existing solution under varying nodes density topologies.The numerical results demonstrated that ESR protocol had attained an average of 28% reduction in network overhead than the existing solutions because ESR protocol provided a light-weight secret sharing scheme between cluster heads and BS, which was not only computationally secure to handle the intrusions against malicious nodes but also extensible in terms of varying network topologies.In addition, trustworthy routing paths led to a fewer number of route re-construction messages in the sensor field and thus reduced network overhead.Furthermore, the wireless channels were less congested, as ESR protocol minimized re-election packets because of bounded clustering.

Figure 12
Figure 12 illustrates the comparison of ESR protocol with other protocols in terms of a ratio of route re-discoveries under different nodes density topologies.It is observed that in the presence of malicious nodes, a network incurred a high number of packets for route discoveries and re-transmissionnns.Nevertheless, based on Figure 12, it is seen that ESR protocol decreased the packets of route re-discoveries in the evaluation of other solutions specifically when the network size increased.ESR protocol had attained an average of 38% reduction in the number of packets for route re-discoveries under the scenario of different nodes density topologies.The reason behind this was that ESR measured the

Figure 12 .
Figure 12.Ratio of route re-discovery packets under varying nodes density topologies.

Algorithm 1 :
Energy-efficient and secure routing protocol