An Improved Threshold-Sensitive Stable Election Routing Energy Protocol for Heterogeneous Wireless Sensor Networks

In the Threshold-Sensitive Stable Election Protocol, sensors are randomly deployed in the region without considering the balanced energy consumption of nodes. If a node that has been selected as a cluster head is located far away from the base station, it will affect the efficiency of the network due to its early death. This paper proposes an improved energy efficient routing protocol named Improved Threshold-Sensitive Stable Election protocol (ITSEP) for heterogeneous wireless sensor networks. Firstly, we use a node state transformation mechanism to control the number of cluster heads in high-density node areas. Secondly, the proposed protocol improves the threshold formula by considering the distance from the node to the base station, the number of neighbor nodes, its residual energy, and the average distance between nodes. In addition, an optimal route with minimum energy consumption for cluster heads has been selected throughout data transmission. Simulation results show that this algorithm has achieved a longer lifetime than the stable election protocol algorithm, modified stable election protocol algorithm, and threshold-sensitive stable election protocol algorithm for the heterogeneous wireless sensor network.


Introduction
Wireless sensor networks can be divided into homogeneous wireless sensor network and heterogeneous wireless sensor network.All sensor nodes have the same software and hardware conditions in the homogeneous wireless sensor network.For the heterogeneous wireless sensor network (HWSN), all sensor nodes have two or more different kinds of the feature.The heterogeneous feature is mainly the different computing power, communicating protocol, communication range, transmission speed, function, energy, and others.In wireless sensor networks, the energy of the sensor is sometimes supplied by different energy devices (battery, renewable sources, and unlimited sources), and the initial energy is different.This is the energy heterogeneity wireless sensor network.This paper mainly discusses the energy heterogeneity of the sensor nodes that have varying levels of energy resources in HWSN [1][2][3][4][5].
The energy of sensors is supplied by a battery, so it is limited.Although many routing protocols for HWSNs have been proposed for achieving a network with a long lifetime and low-energy consumption data acquisition, how to prolong the lifetime of wireless sensor networks is still of attention to many researchers.Stable election protocol (SEP), which is designed to deal with heterogeneous networks, introduces the concept of advanced and normal nodes for cluster head selection [6].This is based Information 2019, 10, 125 2 of 9 on the weighted election probabilities of each node's addition to a cluster head according to the remaining energy in each node.The SEP algorithm does not require any global knowledge of the energy at each election round.Numerous heterogeneous protocols based on SEP have been proposed.The zonal-stable election protocol [7] is a clustering algorithm based on zones in which the advanced nodes have the probability of becoming a cluster head.However, nodes cannot be randomly deployed, and only advanced nodes are selected as a cluster.The ridge method based cluster head selection protocol [8] uses a Ridge technique to select the best cluster head, and the algorithm always chooses cluster heads from nodes with higher residual energy.Modified stable election protocol (M-SEP) [9] is a heterogeneous protocol based on clustering that considers the existence of different transmission types.The event-to-sink directed clustering protocol [10] realizes energy efficiency in a sensor network configuration by clustering the nodes only within the event-to-sink data flow corridor.This is to avoid unnecessary cluster formation and directionally to minimize the number of hops for data forwarding.The lower energy adaptive clustering hierarchy with special energy advanced node protocol [11] is an extension of SEP.It follows the hybrid approach to forwarding data against the energy of the nodes.The improved energy aware distributed unequal clustering protocol protocol [12] considers the number of nodes in the surrounding area in addition to the location of the base station and the residual energy for electing cluster heads.The methodology used is for retaining the same clusters for a few rounds and is effective in reducing the clustering overhead.The prolong stable election routing algorithm [13] is presented to prolong the stable period of fog-supported sensor networks by maintaining balanced energy consumption.The Threshold-Sensitive Stable Election Protocol (TSEP) algorithm [14] is also an improvement based on the SEP method.TSEP algorithm adds super nodes to the network.However, in terms of routing, data is still transmitted to the base station (BS) using single-hop transmission in TSEP.This routing would consume a lot of energy.The process of the TSEP protocol is described in detail in Section 2.
In this paper, an improved routing protocol for heterogeneous WSN is introduced by improving the TSEP algorithm to solve the problem of how to save energy and ensure a balanced network load.The proposed protocol improves the threshold of cluster head selection by considering the remaining energy of the node and the distance between the node and the base station.The cluster heads also integrate multi-hop data transmission in order to avoid overhearing and reduce their energy consumption.This improved protocol can use energy efficiently and prolong the networks lifetime.

TSEP
The TSEP algorithm is a heterogeneous wireless sensor network routing algorithm.The SEP algorithm is a two-level HWSNs algorithm composed of normal nodes and advanced nodes.The TSEP algorithm is a three-level HWSNs algorithm composed of normal nodes, advanced nodes, and super nodes.The super node's battery has a much larger initial energy than the advanced node and the normal node.The proposed algorithm applies the network model of the TSEP algorithm.The TSEP algorithm is divided into two phases: the setup phase and the data transmission phase.
In the setup phase, the nodes of the wireless sensor are randomly deployed in the network, and each node is in a different location from the base station.In this phase, the probability of selecting a cluster head in each round is directly related to the initial energy of the node.Using the threshold probability formula, it will be determined if each node becomes a cluster head.The formula proposed in [14] is as follows: where r is the current round number, s is the node, G is the node set that has not been selected as a cluster head in the current round, and p is the probability that one node will become a cluster head.The energy levels for each node have different probabilities.In the TSEP algorithm, the nodes are divided into normal nodes, advanced nodes, and super nodes, and their probability is respectively expressed as where P opt is the optimal probability of each node to become a cluster head, α is the super node's energy α times more than that of the normal node, β is the advanced node's energy β times more than the normal node, m is proportion of super nodes to total number of nodes n with energy more than the rest of the nodes, and b is the proportion of advanced nodes.Each node becomes the cluster head with the probability P opt .In each 1/P opt round, the chance that a node becomes a cluster head is only once.Nodes that are not selected are placed in the G, and the selection of the cluster head is continued in the next round.P opt assigns a weight to each node of different initial energy.The weighted probabilities of super nodes, advanced nodes, and normal nodes are defined as P sup ,P adv , and P nrm .The normal nodes, advanced nodes, and super nodes, respectively, use (2), (3), and (4) to replace the probability p in (1) to get the respective thresholds that are used to select the cluster head.Nodes will generate a random number from 0 to one.If the random number of the node is less than the respective threshold, the node is selected as the current round of cluster heads, and the corresponding T(s) is set to 0 so that the node will not be elected as a cluster head again.After selecting the cluster head, the selected cluster heads will broadcast an advertisement message using the nonpersistent carrier-sense multiple access algorithm.After receiving these messages, other non-cluster head nodes compare the signal strength of each received message to select a node with the highest signal strength as its own cluster head.After the cluster head receives the request message from the non-cluster head node, it establishes a TDMA (Time Division Multiple Access) time slot scheduling table.It then sends the schedule to the non-cluster head node in the cluster to indicate the presence of the non-cluster head node.When the cluster head sends the data, this process can only be completed during a specific time slot and until the formation of the cluster is complete.In the data transmission phase, the cluster head sends the data fused in the cluster directly to the base station.The flow diagram of the TSEP is shown in Figure 1.

Proposed Algorithm
In this section, we propose an improved algorithm to reduce energy consumption and prolong the network's lifetime.The improved algorithm contains three phases: node state transformation mechanism, cluster head selection, and data transmission phase.

Node State Transformation Phase
In the TSEP algorithm, nodes are randomly deployed in the network model.Therefore, some areas may have many nodes.The areas with a high density of nodes are more likely to cause transmission interference and select too many cluster heads.In the data transmission phase, too many cluster heads send data to the base station.This phenomenon wastes a lot of energy and does not prolong the network life cycle.Therefore, we use a node state transformation mechanism to control the number of cluster heads in high-density node areas.This process requires two steps, that is, selecting the neighbor nodes and checking the nodes' status.We have first introduced the selection process of the neighbor nodes.Initially, each node broadcasts a message within its range that contains the information about the identity label of node, residual energy, and current status.After receiving the message with the node information, the closest corresponding neighboring node stores the neighbor nodes information.A node may fail to find a neighbor node and can become an isolate node, and this could occur if the minimum distance between the isolate node and the other node is outside its range.We then set half of the pairs of nodes to be active and set the other half of the pairs of nodes to be asleep.The isolate nodes are set to be active all the time.After selecting the neighboring node, we should check the status of the node to determine what the node should do.If the node is in active mode, nodes will participate in the election of cluster heads.If the node is in sleep mode, nodes will only become a member node and will not become a cluster head in this round.

Proposed Algorithm
In this section, we propose an improved algorithm to reduce energy consumption and prolong the network's lifetime.The improved algorithm contains three phases: node state transformation mechanism, cluster head selection, and data transmission phase.

Node State Transformation Phase
In the TSEP algorithm, nodes are randomly deployed in the network model.Therefore, some areas may have many nodes.The areas with a high density of nodes are more likely to cause transmission interference and select too many cluster heads.In the data transmission phase, too many cluster heads send data to the base station.This phenomenon wastes a lot of energy and does not prolong the network life cycle.Therefore, we use a node state transformation mechanism to control the number of cluster heads in high-density node areas.This process requires two steps, that is, selecting the neighbor nodes and checking the nodes' status.We have first introduced the selection process of the neighbor nodes.Initially, each node broadcasts a message within its range that contains the information about the identity label of node, residual energy, and current status.After receiving the message with the node information, the closest corresponding neighboring node stores the neighbor nodes information.A node may fail to find a neighbor node and can become an isolate node, and this could occur if the minimum distance between the isolate node and the other node is outside its range.We then set half of the pairs of nodes to be active and set the other half of the pairs of nodes to be asleep.The isolate nodes are set to be active all the time.After selecting the neighboring node, we should check the status of the node to determine what the node should do.If the node is in active mode, nodes will participate in the election of cluster heads.If the node is in sleep mode, nodes will only become a member node and will not become a cluster head in this round.

Cluster Head Selection
In the TSEP algorithm, the cluster head election mechanism does not consider the remaining energy of the node and the distance between the node and base station, and each node has the probability of being selected as a cluster head.This leads to the premature death of these nodes and reduces the network's lifetime.Therefore, the proposed method introduces the residual energy of nodes into a threshold to reduce the probability of low energy nodes becoming cluster heads.The transmitted data is carried by the electromagnetic wave in the wireless communication system.The energy of the electromagnetic wave is absorbed by air and other objects.This reduces the energy of the received data.The difference in energy between transmitted data and received data is the consumption energy.In the wireless sensor networks, consumption energy for l bit data transmitted from one node to the other is normally expressed as: where E elec is the consumption energy for coding and modulating, d is the distance between the two nodes, r is the communication range of the node.Based on (5), we can see that the consumption energy is in direct proportion to distance.Therefore, it also introduces the average distance between nodes into a threshold to increase the coverage of the clusters and make the distance between nodes and the cluster head short to reduce the energy consumption of cluster heads.The distance between nodes is also considered to avoid having a cluster node that is far from the base station and consumes too much energy at the data transmission phase.Therefore, the improved threshold formula will solve the above problem.It is expressed as where r is the current round number, i is node ID, ω i is where S(i).E is the residual energy of the current node, d Ci−BS is the distance from node i to base station, Number(i) is the number of nodes in the range of do, d(i) is average distance from node i to other nodes,E ave represents the average energy of the current node,K opt is a constant, do and d(i) are expressed as where d(i, j) is the distance between node i and node j, ε f s and ε mp are the parameters for the amount of energy consumption per bit in the radio frequency amplifier.The values C 1 , C 2 , C 3 , and C 4 are the control parameters of the relative distance between nodes, the degree of the node, the residual energy of the node, and the distance from a node to the base station, respectively, and satisfy that From (7), we can make the following four conclusions: (1) A higher value for S(i).E means a higher value for ω i .Therefore, there is a high probability that a node with a large energy value will become a cluster head.(2) A lower value for D(i) means a higher value for ω i .Therefore, it is more likely that a node closer to the base station will become a cluster head.(3) A higher value for Number(i) means a higher value for ω i .Therefore, if there is more coverage within the cluster, there is a greater probability of a node becoming a cluster head.(4) A lower value for d(i) means a higher value for ω i .Therefore, if a node consumes less energy when it communicates with the surrounding nodes, it is more likely that it will become a cluster head.

Data Transmission Phase
In the TSEP algorithm, the cluster head directly transmits data to the base station.Therefore, the cluster head far from the base station will consume a large amount of energy and reduce the network's lifetime.In our improved protocol, each cluster head selects a route path to send data to the base station.The path is selected based on the consumption energy of the cluster head that sends data to the base station.
Each cluster head estimates the communication energy consumption during the transmission of l bit messages directly to the base station, which is defined as E Ci−BS .The value of E Ci−BS is given by ( 12) [6]: where E elec is the energy consumption per bit in the transmitter and receiver, d Ci−BS is the distance between the cluster head i and the base station, and do is the threshold.ε f s and ε mp are parameters in the free-space propagation model and path attenuation propagation model of the radiofrequency amplifier, respectively.The distance is measured based on the value of do whose value is given by ( 8), and the value of d Ci−BS is given by (10).As can be seen from ( 12), if d Ci−BS < do, then the energy consumption of nodes should be calculated using the upper part of the (12) (free-space propagation model).If d Ci−BS ≥ do, then the energy consumption of nodes should be calculated using the lower part of (12) (path attenuation propagation model).Then, each cluster head decides whether to find an intermediate cluster head for the current round.This decision is based on the following conditions: where d Ci−Cj is the distance between the cluster head i and the cluster head j, d Cj−BS is the distance between the node j and the base station.The value of d Ci−Cj and d Cj−BS is given by ( 14) and (15): Each cluster head starts by estimating the communication energy dissipation then the node j should serve as an intermediate node in its route.Otherwise, the intermediate node is not required.Therefore, a path with a minimum sum of energy consumption would be selected for data transmission, and it will be more efficient for some cluster heads that are at a long distance to use the intermediate node to communicate with the base station.
After the cluster head completes the data transmission, we should change the state of the nodes.If the node and its neighbor node are not dead, then the two nodes should keep their current state.
If a pair has one dead node, its partner would keep an active status and try to find another node to complete a pair.This indicates the completion of this round, after which all nodes prepare for the next round.

Simulations and Results
The simulations assume that 10 percent of sensor nodes are super nodes, which have twice the energy of normal nodes, and 20 percent of sensor nodes are advanced nodes, which have 1.5 times the energy of normal nodes.In practice, the communication range of sensors is 20~30 m.So, the experiment randomly deployed 100 nodes in a square area of 100 × 100 square meters to simulate the actual scene.The sink node is located at the center of the sensing area.We use '+' for the super node, ' ' for the advanced node, 'o' for the normal node, and '×' for the base station.The network model of this experiment is shown in Figure 2a.The optimal probability of each node to become a cluster head is set as 0.1.The initialized energy of the normal node is 0.5 Joules, the initialized energy of the advanced node is 0.75 Joules, and the initialized energy of the super node is 1 Joule.This proposed protocol is simulated using MATLAB.The parameters of the simulations appear in Table 1. Figure 2b shows the number of live nodes in each round of the network.It can be seen from Figure 2b that the nodes start to die at 1200 rounds when using SEP, M-SEP, and TSEP, but they start to die at 1400 rounds when using the proposed method.The nodes completely died at 1800 rounds, 2000 rounds, and 2500 rounds, respectively, when using SEP, M-SEP, and TSEP.However, at 2500 rounds, there still are about 40 surviving nodes for the proposed method.Therefore, this proves that the proposed method prolongs the network's lifetime.
Information 2019, 10, x FOR PEER REVIEW 7 of 10 route.Otherwise, the intermediate node is not required.Therefore, a path with a minimum sum of energy consumption would be selected for data transmission, and it will be more efficient for some cluster heads that are at a long distance to use the intermediate node to communicate with the base station.
After the cluster head completes the data transmission, we should change the state of the nodes.If the node and its neighbor node are not dead, then the two nodes should keep their current state.If a pair has one dead node, its partner would keep an active status and try to find another node to complete a pair.This indicates the completion of this round, after which all nodes prepare for the next round.

Simulations and Results
The simulations assume that 10 percent of sensor nodes are super nodes, which have twice the energy of normal nodes, and 20 percent of sensor nodes are advanced nodes, which have 1.5 times the energy of normal nodes.In practice, the communication range of sensors is 20~30 meters.So, the experiment randomly deployed 100 nodes in a square area of 100 × 100 square meters to simulate the actual scene.The sink node is located at the center of the sensing area.We use '+' for the super node, '◇' for the advanced node, 'o' for the normal node, and ' × ' for the base station.The network model of this experiment is shown in Figure 2(a).The optimal probability of each node to become a cluster head is set as 0.1.The initialized energy of the normal node is 0.5 Joules, the initialized energy of the advanced node is 0.75 Joules, and the initialized energy of the super node is 1 Joule.This proposed protocol is simulated using MATLAB.The parameters of the simulations appear in Table 1.It can be seen from Figure 2(b) that the nodes start to die at 1200 rounds when using SEP, M-SEP, and TSEP, but they start to die at 1400 rounds when using the proposed method.The nodes completely died at 1800 rounds, 2000 rounds, and 2500 rounds, respectively, when using SEP, M-SEP, and TSEP.However, at 2500 rounds, there still are about 40 surviving nodes for the proposed method.Therefore, this proves that the proposed method prolongs the network's lifetime.Figure 3(a) shows the residual energy of all nodes for SEP, M-SEP, TSEP and the proposed method.From Figure 3(a), we can see that the residual energy decreases with the increasing of rounds for all methods, but the proposed method has more residual energy than the others.The Figure 3a shows the residual energy of all nodes for SEP, M-SEP, TSEP and the proposed method.From Figure 3a, we can see that the residual energy decreases with the increasing of rounds for all methods, but the proposed method has more residual energy than the others.The residual energy of the super nodes, advanced nodes, and normal nodes are shown in Figure 3b.From Figure 3b, we can see that the speed of residual energy decreases faster for super nodes as compared with the others.This shows that the super node has a high probability of being elected as the cluster head.Therefore, in the initial stage and data transmission stage, the super node consumes more energy than the advanced node.The super nodes have more energy than the others, and they also consume more energy.This balances the energy consumption of all the nodes in the network and also prolongs the network's lifetime.From Figure 3(b), we can see that the speed of residual energy decreases faster for super nodes as compared with the others.This shows that the super node has a high probability of being elected as the cluster head.Therefore, in the initial stage and data transmission stage, the super node consumes more energy than the advanced node.The super nodes have more energy than the others, and they also consume more energy.This balances the energy consumption of all the nodes in the network and also prolongs the network's lifetime.Figure 4 displays the number of packets sent to the base station from the cluster heads with respect to the number of rounds.If there is a higher number of surviving nodes, there will be a higher number of selected cluster heads, resulting in a longer network lifetime.With the increase of the network's lifetime, the number of packets received by the base station also increases correspondingly.From Figure 4, we can see that the number of packets for the proposed method is more than that of the other methods, and its network lifetime is also longer than that of the other methods.

Conclusion
In this article, we proposed an improved protocol method for the heterogeneous wireless sensor network.At first, we have reviewed the TSEP method and presented our proposed method using the node state transformation, cluster heads selection, and data transition mechanism.We have randomly distributed 100 nodes in a square, and the base station was located at the center of Figure 4 displays the number of packets sent to the base station from the cluster heads with respect to the number of rounds.If there is a higher number of surviving nodes, there will be a higher number of selected cluster heads, resulting in a longer network lifetime.With the increase of the network's lifetime, the number of packets received by the base station also increases correspondingly.
From Figure 4, we can see that the number of packets for the proposed method is more than that of the other methods, and its network lifetime is also longer than that of the other methods.
residual energy of the super nodes, advanced nodes, and normal nodes are shown in Figure 3(b).From Figure 3(b), we can see that the speed of residual energy decreases faster for super nodes as compared with the others.This shows that the super node has a high probability of being elected as the cluster head.Therefore, in the initial stage and data transmission stage, the super node consumes more energy than the advanced node.The super nodes have more energy than the others, and they also consume more energy.This balances the energy consumption of all the nodes in the network and also prolongs the network's lifetime.Figure 4 displays the number of packets sent to the base station from the cluster heads with respect to the number of rounds.If there is a higher number of surviving nodes, there will be a higher number of selected cluster heads, resulting in a longer network lifetime.With the increase of the network's lifetime, the number of packets received by the base station also increases correspondingly.From Figure 4, we can see that the number of packets for the proposed method is more than that of the other methods, and its network lifetime is also longer than that of the other methods.

Conclusion
In this article, we proposed an improved protocol method for the heterogeneous wireless sensor network.At first, we have reviewed the TSEP method and presented our proposed method using the node state transformation, cluster heads selection, and data transition mechanism.We have randomly distributed 100 nodes in a square, and the base station was located at the center of

Conclusions
In this article, we proposed an improved protocol method for the heterogeneous wireless sensor network.At first, we have reviewed the TSEP method and presented our proposed method using the node state transformation, cluster heads selection, and data transition mechanism.We have randomly distributed 100 nodes in a square, and the base station was located at the center of the area.We used MATLAB to simulate the performance of the proposed algorithm.The results show that when running to 2500 rounds, the proposed algorithm still has at least 40 nodes surviving.So, compared with SEP, M-SEP, and TSEP, the proposed algorithm consumes the least amount of energy.Then, using the proposed method, the wireless sensor networks will have a long lifetime.

Figure 1 .
Figure 1.The flow diagram of Threshold-Sensitive Stable Election Protocol (TSEP) algorithm.HWSN: heterogeneous wireless sensor network; TDMA: time division multiple access.

Figure 1 .
Figure 1.The flow diagram of Threshold-Sensitive Stable Election Protocol (TSEP) algorithm.HWSN: heterogeneous wireless sensor network; TDMA: time division multiple access.
Figure 2(b) shows the number of live nodes in each round of the network.It can be seen from Figure2(b) that the nodes start to die at 1200 rounds when using SEP, M-SEP, and TSEP, but they start to die at 1400 rounds when using the proposed method.The nodes completely died at 1800 rounds, 2000 rounds, and 2500 rounds, respectively, when using SEP, M-SEP, and TSEP.However, at 2500 rounds, there still are about 40 surviving nodes for the proposed method.Therefore, this proves that the proposed method prolongs the network's lifetime.

Information 2019 ,
10, x FOR PEER REVIEW 8 of 10 residual energy of the super nodes, advanced nodes, and normal nodes are shown in Figure 3(b).