TEMSEP: Threshold-oriented and Energy-harvesting enabled Multilevel SEP protocol for improving energy-efficiency of heterogeneous WSNs

Energy-saving in WSN-based monitoring systems has drawn considerable interest lately. Further investigations and real efforts are needed to reduce the rapid energy consumption in such networks that commonly use battery-operated nodes. In this paper, we propose TEMSEP (Threshold-oriented and Energy-harvesting enabled Multi-level Stable Election Protocol) for improving energy of large-scale WSNs. TEMSEP is a reactive protocol basing on hierarchical clustering, energy-harvesting relay nodes, and multilevel sensor nodes’ heterogeneity that supports unlimited levels of battery initial energy. Instead of continuous data transmission, the network nodes in TEMSEP send their data only when it is necessary by responding reactively to the changes in relevant parameters or events of interest. We introduce a new thresholding model that provides an ideal mechanism for such reactive behaviour in detecting events, based on the values of heterogeneous thresholds and the sliding window formulated. This efficiently regulates the data reporting frequency, and hence, directly achieves significant reductions in the network traffic-load, optimizes the energy consumption of battery-powered nodes, and maximizes the network lifetime. The extensive simulations show that TEMSEP highly improves the network performance by reducing up to 53% of the network traffic-load and save up to 73% of the total dissipated energy, on average. The stability period and overall network lifetime are increased, at least, by 69% and 56% respectively, compared to other tested protocols.

30141, Contiki, and TinyOS, [9]- [11]. This leads to userfriendly, easy-to-use, and cost-effective wireless devices and electronic technologies that come in smaller and smaller sizes, gaining higher popularity due to their accuracy and capability to observe different parameters and activities in various environments and circumstances. Researchers have identified this field as one of the most investigated areas in the last few years, triggering several business opportunities continuously and facilitating the widespread deployment of sensing technology for real-world domains [12], [13] As a central part of various today's applications, heterogeneous WSNs consist of a finite set of energy-constrained autonomous devices and small sensor nodes of different capabilities (e.g., battery-size, processing power, sensingrange, etc.) [14]- [16]. The key role of the heterogeneous WSNs is to collect different types of information about environmental conditions (e.g., pollution, temperature, moisture, acceleration, etc.), or to monitor different activities or even moving entities like animals, birds, and human through a broad range of applications [17]- [19]. This includes remote monitoring, precision agriculture, target tracking, hazard detection, video surveillance, health-care systems, etc. [20]- [22]. Such applications are mainly based on recent IoT technologies that enable various autonomous devices to integrate and cooperate automatically with each other in such a way that allows them to share their knowledge and carry-out various operations at high levels of accuracy and speed without manual assistance. For example, environmental data collection (so-called IoT-based smart ambient), becomes a major application, in which the important information, describing the elements of our physical environments and surroundings, are gathered so that the right action can be chosen at the appropriate time [23], [24]. GPS-based system is another example, which allows drivers to select better routes to the destination points and help in avoiding the high-traffic areas and other obstacles. Recently, this technology is rapidly developing and has been widely utilized as one of the most enhanced monitoring technologies that provides automated features and higher precision [25], [26]. In addition, for healthcare systems, wearables and in/on-body smart sensors help in observing the patient status, and hence the appropriate action can be decided according to his/her condition. Also, telematicshealth is one of the new powerful technologies in healthcare advancements which is growing-up and greatly ensures patients care, particularly in remote areas and for disabled, elderly people, and those having chronic diseases [27], [28]. Moreover, precision agriculture is an emerging strategy used for controlling the dynamic change of the cultivation area, improving productivity, predicting various diseases, managing pest levels, etc. Such smart management of farming resources keeps the environmental impact within an acceptable range and highly reduces the risk of deficits [29], [30].
Generally, in WSN, the tiny sensors are commonly equipped with small modules of electronic chips, transceivers, and communication protocols. The data recorded continuously by multiple sensor nodes at the field, on various environmental conditions, are transmitted through the network to a central point for further analysis, processing, and making decisions when required. The method in which nodes report their collected data to the center varies according to the type of protocols used and their way of functioning [31]. Based on the type of application and mode of information exchange, WSN protocols are classified into three main groups: reactive, proactive, on-demand, and hybrid protocols [32]- [35]. In reactive protocols (also called event-driven protocols) the data is transmitted only when the targeted event occurs or a certain attribute changes suddenly or its value reaches beyond a pre-determined level (such as detecting environmental changes) [36]). This type of protocols usually keep their transmitter radios switched off and turn them on only if the transmission requirements are met to report their sensed data immediately. Generally, this model is utilized in time-critical, and delay-sensitive applications. In proactive protocols (also called time-driven protocols), the nodes transmit their sensed data periodically every time interval called a transmission round (e.g., 1 second, 1 minute, 1 hour, etc.) based on the type of application and nature of the designed network. The transmitter radio also has to be in the active state every periodic interval to send data in its predefined time and can be put into sleep inbetween the repeated rounds. This model is commonly used in continuous monitoring applications, in which periodic data update is important for decision making [31]. In the ondemand protocols (also called query-driven protocols), the user controls and decides when and from which nodes data need to be gathered. Nodes receive a signal from the user asking for data or measurement of a specific attribute. The nodes then, in response, take the action immediately and sends the corresponding data they collected to the respective user [37] In hybrid protocols, two or more scenarios are incorporated. The nodes can work in adaptive mode to consider all the modes together. For example, the nodes send the attributes' values they gathered proactively every predefined transmission round as in proactive protocols, while they respond reactively if unusual changes occur suddenly or to the user query, based on given rules and policies as per reactive or query-based protocols. This achieves continuous monitoring, query-based, and event-sensitive applications For this, wireless sensors technology plays a key role in achieving such a non-stop process of data collection and monitoring applications, gaining considerable popularity and interest among researchers and manufacturers [38]- [40].
However, energy-saving management, and prolonging the overall network lifetime in the wireless sensing devices, have been recognized as major challenging issues recently [41]- [44]. In most of the wireless sensor applications, small-zise and non-rechargeable batteries are used as the only sources of nodes' power. A battery-operated device is assumed to keep working properly for a longer period of time (even years [45]), collaborating with other objects to perform its assigned task at a certain level of reliability and accuracy without human intervention [46], [47]. If some nodes are expired early, the network becomes unstable and the desired performance will not be met [4]. In addition, it is difficult to detect failures, manage the network nodes, or replace their batteries due to environmental constraints and largescale deployment, especially when deployed in harsh areas and unreachable places (e.g., forests, battlefields, difficult terrains, etc.) [48]- [51].
Therefore, reducing the energy dissipation of the sensor nodes is a major challenge in the designing and implementation of WSNs. In the standardization works, several LPWA technologies have been offered such as LoRA [52] that was primarily introduced as a solution for IoT infrastructure with a low-power data-link layer which can be utilized to link the devices of end-users to the distant network gateways. Therefore, optimizing their energy consumption and enabling them to run for longer time periods. Sigfox [53] and NB-IoT [54] also are other LPWA solutions provided for an efficient communication of several IoT devices and services. Such technologies help in implementing real-world and large-scale WSN in various environments with minimum power demand [10]. In the research path, several efforts have been exerted by many researchers through proposing different optimization schemes and structures for various WSN networks [55], [56]. Resource management, transmitted data reduction, hierarchical clustering, energy-aware routing, and energy-provision are major schemes that have been broadly applied to maximize network lifetime and minimized nodes' consumed energy, while taking into account other related requirements such as load balancing, stability, scalability, and fault tolerance [57], [58]. However, combining multiple techniques has shown noticeable efficiency for getting higher energy conservation while keeping the system performance at the desired level. Forexample, EH-mulSEP [59] is an efficient clustering-based protocol introduced recently that uses energy harvesting nodes to relay data upward to the base stations. Instead of sending data directly from CHs to base stations, energy harvesting nodes are utilized as an intermediate layer to relay received data to the base stations, and hence, reducing the transmission distance of the elected CHs and saving a considerable amount of energy.
In this paper, we propose a new protocol called TEMSEP (Threshold-oriented and Energy-harvesting enabled Multilevel Stable Election Protocol) as in an improved version of EH-mulSEP (which is described in the next section). We integrate three of the most efficient techniques (i.e., hierarchical clustering, energy-harvesting based relaying schemes, and multilevel heterogeneity models), and introduce a new eventthresholding model for multi-level heterogeneous WSNs, considering heterogeneous thresholds and a sliding window of previously reported data. TEMSEP adapts a reactive data transmission model based on the sliding window and the new event-thresholding model. Accordingly, in each transmission cycle, only the nodes whose measured values meet the eventreporting requirements will turn-on their transmitter and send these values towards base stations, while the others stay in energy-saving mode by keeping their transmitters switchedoff, and thus, save their energy. The purpose is to improve the manner in which the wireless nodes report their data towards base stations with minimum energy consumption. The major contributions of this paper are as follows: • Proposed TEMSEP reactive protocol that introduces a new event-thresholding model based on heterogeneous thresholds and a sliding window formulated. The new model provides a novel and general mechanism that determines heterogeneous thresholds of various nodes in large-scale WSN regardless of the total nodes' population, the number of nodes' categories, or their levels of initial energies. • Extensive simulations and analysis, comparing TEM-SEP to other protocols, using various levels of heterogeneity and different network conditions.
TEMSEP is a heterogeneity-aware protocol that has no limits on the number of nodes' types and supports several levels of initial energy in which various types of nodes may have different battery capacities (smaller -to-higher values of their initial energy, i.e., the amount of energy with which the nodes start operating within the network). Thus, TEMSEP is suitable and applicable for large-scale multilevel heterogeneous WSNs, regardless of the total number of nodes, levels of heterogeneity, or values of battery initial energies. The results of extensive simulation show that our new protocol highly reduces traffic-load and maximizes energy-saving, stability period, and overall network lifetime. The remainder of this paper is organized as follows: in the next section, we provide a literature review of the related works. In Section III, we detail TEMSEP, the proposed protocol, with more explanations of the new even-thresholding model, its algorithm, and working principles. Section IV presents the evaluation setup, methodology, and parameters, while Section V presents the simulation work, results analysis, comparison, and discussion. Lastly, we conclude the paper in Section VI.

II. RELATED WORK
In this section, literature review is conducted on techniques related to the proposed protocol. Hierarchical clustering and relaying schemes are discussed and summarized first. Then, we present EH-mulSEP protocol, an existing multilevel heterogeneity solution, focusing on its aspects related to the current paper through which we propose a novel solution that overcomes EH-mulSEP's inherited limitations.

A. CLUSTERING AND RELAYING TECHNIQUES
Hierarchical clustering is an efficient approach that has been widely adopted in various solutions. The network nodes are divided into a number of non-overlapping groups called clusters. Within each cluster, a single node called a CH (clusterhead) is elected alternately to aggregate data from other member nodes and send it upwards to the base station [60], [61]. Hence, saving the energy of other nodes and balancing the energy-load among all the cluster members. VOLUME 10, 2022 A variety of cluster-based solutions have been introduced in literature to realize energy-conservation and improve the overall network lifetime of wireless sensor networks. LEACH protocol, [62], is an early solution that introduces the concepts of dynamic clustering algorithms for energyefficient homogenous WSNs. In LEACH, the role of the cluster head, which needs the highest communication energy, is rotated amongst all the cluster nodes, and thus, achieving a fair balancing of the energy-load and extending the overall network lifetime. In [63], SEP protocol is introduced as the first solution that addresses heterogeneous WSNs by supporting two types of sensor nodes each has different levels of battery capacity. The authors used the concept of weighted election probability in selecting the CH nodes based on the previous role of the nodes and their initial-energy. SEP efficiently extends the total network lifetime, stability period, and enhance the load-balancing over LEACH. In [64], the authors proposed Z-SEP protocol that divides the targeted area into three smaller rectangular zones: a single middle zone and two head zones, and utilized both the static and the dynamic clustering approaches. The nodes in the first level (i.e., the normal nodes) are distributed in the middle zone, from which they can directly forward their data to the central sink node; while the nodes in the second levels (i.e., the advanced nodes) are deployed in the two head zones. Clustering techniques, as in SEP, are used to select a number of CHs to communicate data of the member nodes to the base station. However, such predefined partitioning of the area and the direct transmission to the sink node in the middle zone may result in unexpected performance, when applied to large-scale deployment networks. In [65], DSBCA is proposed by Liao and Qi, which considers the distance of the sensor to the central base station as well as their density distribution to form a balanced clustering structure. They suggested that as the node distance from the base station increases, the size of the cluster radius should be larger. The cluster with high connectivity density or that is close to the base station must have a smaller cluster radius and vice versa. DSBCA results in a noticeable improvement concerning energy-load balancing. The authors of [66] proposed a new protocol called ZET in which they divided the sensing area into nine equal-sized zones. The node's residual energy, the distance to the base station, and the distance to a reference point at the middle are considered to select the head of every created zone. The nodes send their data to CHs only if it becomes higher than a predefined threshold. CHs, then, aggregate and compres the received data in order to reduce the final message's size to be transferred to the base station. Hence, reducing the transmission energy.
In [67], HEBM is proposed as an optimizing algorithm for selecting CH nodes. The aim was to achieve an equal distribution of the cluster-heads in the sensing area in such a way that allows the other nodes (i.e., non-CH nodes) to be linked to clusters with a minimized communication energy and a fair load-balancing. The proposed solution shows a significant improvement in the stability period and the overall system lifetime. ZSEP-E protocol is proposed in [68] as an improved version of Z-SEP, aiming to fairly balance the energy-load over the entire network. The authors considered three types of heterogeneous nodes: normal, intermediate, and advanced sensor nodes. The normal and intermediate nodes are deployed in the middle zone; while the advance nodes are distributed in the two head zones. Using clusterbased techniques, ZSEP-E selects a number of CHs in each of these zones probabilistically based on the residual energy of the sensor nodes. In [69], the authors introduced FZSEP as an enhancement of ZSEP-E protocol based on the concepts of fuzzy logic. The density of node deployment, the node's residual energy, and the transmission distance are used in this solution in order to improve the process of CH election. The presented results show improved performance in terms of the overall network lifetime. CBCCP protocol is proposed in [70] for large-scale sensor networks. The proposed solution clusters the working area into a number of adjacent hierarchical rectangular areas. In each area, there exists a single CH and a set of coordinators (COs) that regulate data transmission from the lower cluster heads towards the base station layer. The authors stated that this solution achieves a fair load balancing and higher levels of scalability. However, traffic overloads may be experienced by CHs in the largescale networks, which may lead to unpreferred performance. The same framework idea in partitioning the working area into hierarchically clustered areas have been used in their work in [71]. A new algorithm for minimizing the cost of data transmission is introduced (based on some policies). The algorithm shows an enhanced performance concerning the scalability, the execution time, and the overall network lifetime. In [72], PDORP is proposed as a hybrid routing protocol that combines both the cache and the directional transmission characteristics of reactive DSR protocol [73] and proactive PEGASIS protocol [74]. Also, hybridization of GA and BFO is introduced for selecting energy-aware optimal paths. The authors aimed to choose a suitable and alternative path to be utilized in the case of node expiration so that the energy consumed through the transmission process is minimized, and the delay as well as the bit error rate, are reduced.
In [75], the authors proposed E-BEENISH that follows the same weighted election probabilities of nodes as in SEP to selects CHs, with an improved weighted election threshold introduced. Along with nodes type's probability, the new threshold considers two new parameters: the ratio of the node residual energy to the average of the total energy, and the ratio of the node distance form the base station to that from CH. The authors aimed to make use of the total energy of network efficiently and to balance the energy consumption among all the member nodes. They showed better results compared to existing SEP-based protocols. However, the solution do not support higher levels of heterogenity and thus, is not applicable for large-scale network with mutli-levels of heterogenity. IEE-LEACH is proposed in [76], as a new version of LEACH protocol to balance the distribution of the energy-load among all the sensor nodes and to extend the overall network lifetime. IEE-LEACH employs a different mechanism for electing CHs in which it considers the node's initial energy, the node's residual energy, the network total energy, and the average energy of all the sensor nodes. The node with higher energy than that of its neighbors or than the average energy of all the network nodes will get a higher probability to become a CH more frequently than others. The non-CH nodes determine their distance to the nearest CH and BS and then decide whether to participate in cluster formation or not. The nodes closer to the BS do not join any cluster and send their data directly to the BS. The protocol also uses a hybrid communication method in which the nodes also have the option of transmitting their data either in a single hop or in multi-hop mode based on the energy dissipation of the two paths. The least energy consumption path will be selected, and hence, saves energy and increases the network lifetime.
In [77], a new improvement of SEP protocol is introduced which is called DBCP (Distance-Based Clustering Protocol) for extending the lifetime of WSN. DBCP uses the distance of a node to the base station as an additional parameter for the node to join the nearest CH during clusters' formation. Each non-CH node in the network compares its distance to the BS and to the nearest announced CH. It joins the CH only if its distance is less than that to BS, otherwise, it remains independent and sends its data after compression directly to the BS, thus reducing the transmission distance of the nodes close to the base station which results in less energy consumption. However, for large-scale networks, this may not be an efficient solution as it considers only one base station, around which the member nodes represent a small portion of all network nodes. In [78], GCEEC (Gateway Energy-Efficient Centroid) protocol is proposed to balance the load among CHs and energy consumption among all the network nodes in precision agriculture WSN. The new solution is based on selecting the best location of CH using the concept of energy centroid and rotating CH role among energydensity nodes. The CHs, then, can send their aggregated data directly to the BS or through selected gateway nodes based on their distance to the BS. The gateways, which are the nodes adjacent to CHs, are selected by CHs for relaying data to BS through weighing procedure that considers three parameters: the distance between the cluster nodes, the remaining energy of CHs, and the number of adjacent neighbor CHs. The adjacnet node with a higher weightage is selected by CH as its gateway node. Their presented results indicate improvements in energy-saving, overall lifetime, and throughput. However, the solution is applicable only to nodes having the same initial energy and can not be used for multilevel heterogenous WSN. However, several LEACH-based and SEPbased protocols, as well as other similar approaches have been proposed in literature, providing various enhancements and different levels of heterogeneity supports for different deployment and operation scenarios. This includes HNBC [79], YSGAP [80], EECMHR [81], EERH [82], [83], [84], HMGWO [85], ECSCF [86], LA-MHR ITSEP [87], [88], ACOBAN [89], GAECH [90], EEREG [91],ZBRP in [92], ESEP-E [93], DEEC [94], etc.
Utilizing relay nodes in hierarchical clustering (such as using energy-harvesting enabled sensors) is also an emerging trend that significantly helps in maximizing energy operation time and save energy of none-harvesting nodes [95]- [98]. With the rapid growth of this technology and its use in smart digital systems, many cluster-based solutions have utilized energy-harvesting enabled sensors in several approaches introduced for WSNs. In [99], The authors investigated the issue of selecting optimal relay nodes and a new solution is provided for energy-aware cooperation in EH-WSN. They first discussed the joint allocation and cooperative communication impact. Then, a selection heuristic of the relay nodes for cluster-based EH-WSN is proposed, where two key factors are considered: energy-harvesting rate and local path loss. In [100], the authors used energy-harvesting enabled nodes for relaying data packets from other nodes which are non-energy-harvesting enabled. They modeled the problem to find "the minimum weighted connected dominating set", where the optimal positions of the relaying nodes could be determined so that the numbers of EH and non-EH nodes are kept to the minimum. In [101], a new relay node selection scheme is introduced, which relies on TSR (time-switching relaying) protocol, aiming to minimize the chance of selecting an unsuitable relay node. The authors proposed an FDX (full-duplex) block structure that enhances the effective transmission time of energy harvesting relay nodes and showed the superiority of their new schemes with respect to others. In [102], another solution is proposed which addresses the problem of placing the EH enabled relaying nodes. The major aim was to define the best relay nodes' locations in the working area, based on the already defined CHs' locations. They claimed that this approach can find near the optimal solution and therefore extends the overall system lifespan. This work is extended in [103] by proposing different models for studying the profile of energy harvesting. A new distributed scheme is provided which takes into account the fluctuation of harvesting rate, depending on their introduced models. In [104], the authors proposed a new algorithm for EH-WSNs that creates a cluster-head group (CHG) containing a number of nodes that act as CHs alternately in order to remove the need to select the cluster head nodes frequently in each transmission round. Thus, prevents potential failures and ensures perpetual EH-WSNs operation. The reader is referred to [104]- [116] for further discussion on energyharvesting and relay-nodes based solutions.
However, the above-discussed clustering-based schemes use a proactive data reporting model (i.e., regular data transmission). The network nodes continuously send their data to CHs in their time-slot every certain time interval regardless of any other factors such as event-occurrence, change in reported values, or the need to transmit the current sensed data. Such regular proactive transmission has its drawbacks in time-critical applications. The nodes waste their energy for VOLUME 10, 2022 unnecessary transmissions when there may be no change in the measured parameters. Such energy-aware solutions can perform well in the case of medium and small-scale networks based on their considered assumptions, however, they are not suitable for large-scale systems, where the energy demand becomes higher. Further, they lack the ability to support higher scalability and multi-levels of heterogeneity, which are essential requirements in the large-scale networks, so they result in additional traffic-load, excessive energy consumption, and reduced network lifetime. Therefore, the reactive data reporting model (event-oriented transmission), as we introduce in our proposed solution in this paper is an appropriate solution in such scenarios. The nodes send their data only if requested or certain criteria are met (e.g., major changes or the concerned event occurs) [117], [118]. This is very efficient in various applications and can save a higher amount of energy.

B. EH-MULSEP PROTOCOL
EH-mulSEP [59] is an efficient dynamic cluster-based protocol that supports multiple levels of nodes' categories (i.e., cate-1, cate-2, cate-3, . . ., cate-n) based on a state of the art heterogeneity model. The system model utilizes energy harvesting nodes as intermediate relay nodes that receive data from cluster-heads and forwards upward to base stations, This helps in saving energy of cluster-heads, which are selected alternatively from sensor nodes in the field, and hence, reduces their consumed energy by sending data to nearby relay nodes for short distances. EH-mulSEP introduces a new general model for the dynamic weighted election of clusterheads in heterogeneous sensor networks, based on the initial energy and previous role of the sensor nodes. As in this model, the weighted election probability of category i nodes (P i ) and the election threshold for the node k in category i (ET k i ) can be calculated as given below in (1) and (2), respectively: where N is the total number of network nodes, N 2 t , N 3 t , . . ., N n t , are the numer of nodes in cate-2 to cate-n, n is the heterogeneity level, α is the energy increasing factor of cate-i+1 nodes, p opt is the optimal percentage of CHs in every transmission interval, r is the current transmission round, and G i is the set of cate-i nodes that have not been elected as cluster heads in the last 1/P i rounds. According to the formulas provided in this model, the nodes equipped with further initial energies are selected as cluster heads more times than the nodes having low levels of initial energies. This imposes a very important balance of energy-load amongst all the categories of network nodes.
The member nodes of all clusters in EH-mulSEP send their collected data proactively in every transmission interval to their cluster-heads, which, in turn, aggregate it and forward to relay nodes towards base stations. However, this means that every node has to send data periodically regardless the change/no-change in the measured parameters, leading to dissipating unnecessary amount of energy, not only during the sending process by the member nodes, but also during receiving, aggregating, and re-sending processes by cluster heads and relay nodes as well. Therefore, the need is to regulate the reporting process of sensed data in such a way that minimizes the energy consumption of sensor nodes. This can be achieved efficiently by reducing the number of times at which the nodes have to report their sensed data unless there is an indication that it is necessary. Hence, maximizing the network stability and overall lifetime. To address such limitations and challenges, we propose TEMSEP protocol that significantly extends EH-mulSEP, and improves energy conservation. We present our new solution, in detail, in the next section. Table 1, summarizes the major differences between the proposed protocol and other related protocols discussed above.

III. TEMSEP: THE PROPOSED PROTOCOL
In this section, we present TEMSEP (Threshold-oriented and Energy-harvesting enabled Multi-level Stable Election Protocol), as an improved version of EH-mulSEP [59]. The aim is to provide a reactive transmission mechanism that saves unnecessary consumed energy of sensor nodes during transmission periods and to maximize the overall network operation time. We describe the system design of TEMSEP and the new event-thresholding model we developed in the next subsections.

A. SYSTEM MODEL FRAMEWORK
TEMSEP considers a hierarchical system framework, consisting of four layers: sensing/data-collection layer, clusterheads layer, relaying layer, and base stations layer as shown in Figure 1. The network in this model is assumed to consist of N heterogeneous nodes (HNs), R energy-harvesting intermediate nodes (EHs), B local base stations (LBSs), and a single master base station (MBS).
TEMSEP considers energy-harvesting nodes and heterogeneity model (as have been employed in the proactive EH-mulSEP protocol). For the energy-harvesting model, a number of nodes (EHs) have been utilized as intermediate relaying layer between CHs in the second layer and LBSs in the topmost layer. The total number of EH relay nodes (R) is calculated by: This is given based on the reasonable assumption that R must be directly proportional to N and p opt and inversely to n.
Here, a type of tradeoff is imposed, where the higher levels of heterogeneity are provided with larger amounts of initial energies and, therefore, compensate the need for adding extra EH relaying nodes, and thus reducing the network operational cost (by reducing the number of EHs). The energyharvesting nodes considered here can harvest their energy from the ambient sources with a harvesting rate R h which is assumed to be fluctuating in a given range (R h ∈ R h min , R h max ) due to the environmental effects. The harvested energy is stored in the node battery with a capacity of EH cap (harveststore-use [119]) for the later supply of its relaying process.
For nodes' heterogeneity, a multi-level model is used as described in [120]. This model supports up to n levels of heterogeneous nodes (cate-1, cate-2, cate-3, ..., cate-n) defined by their respective cardinalities: .., N 2 t , and their initial energy levels: .., E n t (where n is a positive integer number), and N 1 t + N 2 t + N 3 t + ... + N n t = N. The number of nodes (N i t ) and the amount of initial energy (E i t ) for each level are given in this model as follows: where α defines how many times E i t is more than E (i−1) t ; β and γ i are the primary and secondary parameters of the heterogeneity model respectively. However, based on this model, we can define the numbers of nodes for each category of heterogeneous nodes as well as the various levels of initial energies in our TEMSEP protocol. Accordingly, we have formulated our new event-thresholding model to fit with this model so it can be used for any large-scale WSNs regardless of the number of its heterogeneity levels.
TEMSEP is a dynamic cluster-based protocol in which the heterogeneous nodes (HNs) are divided into non-overlapping clusters, and for every cluster, a single node is alternatively selected as a cluster-head (CH) to coordinate data collection within its groups. Clusters are periodically changed in every time interval called a transmission round based on some predefined parameters (e.g., the set of active nodes, the nodes' residual energy, the number of adjacent nodes, etc.). In TEMSEP framework, the data is collected by the HN nodes in the first layer and sent to the CH nodes in the second layer. CHs, then, aggregate the received data and transmit upward to the EH nodes in the intermediate layer which, in turn, forward this data to the base stations in the upper layer.

B. EVENT THRESHOLDING MODEL
We introduce a new thresholding model to control data transmission in multi-level heterogeneous sensor networks. The model helps the administrator to manage the reporting frequency for each category of sensor nodes and defines the range of thresholds at which the nodes are requested to transmit their sensed data. The aim is to reduce the number of times nodes report their data upward to the base stations and hence save a higher amount of energy. In this model, we define two types of threshold: a Hard Threshold (HT ), after which a sensor node becomes ready to send its data, and a Soft Threshold (ST ), based on which the sensor node makes its decision whether to send the data or not. A sliding window (SW) of already reported data is also formulated and used in a conjunction with ST to make the final decision. Generally, in heterogeneous sensor networks, there may be a large variety of sensor types, each has its own role and range of values to be measured based on a number of attributes (e.g., environment type, location, level of accuracy needed, reporting frequency, etc.), and the decision of reporting an event is made based on the nature of the network as well as the role and type of the sensor itself. Therefore, our default scenario is to have a different HT for each node category by which all the similar nodes will have the same transmission frequency. In this case, each category i (cate-i) has a different value of hard threshold (HT i ) ranges between minimum and maximum values HT min L , and HT max L (i.e., HT i ∈ HT min L , HT max L , where i = 1, 2, 3, ..., n (n is the number of heterogeneity levels). However, in this thresholding model, we apply this initial concept differently by defining a range of thresholds for every category of sensors. We assume that in the category i (cate-i), every sensor k has a different value of its hard threshold (HT k i ) ranges between HT min i , and HT max i (i.e., HT k i ∈ HT min i , HT max i , where k = 1, 2, 3, ..., N t i . This is a very significant improvement to our initial scenario in which all the identical sensors have the same value of the threshold. This addition, in fact, enables the network admin to vary the value at which he/she will receive a sensed data for a specific sensor at a specific time. Also, it increases the data accuracy by giving some sensors low thresholds than others so to be able to cope with false reading which may occur sometimes due to environmental variation and noise interference. Thus, for our event-thresholding model, we have n pairs of hard thresholds (i.e., threshold range limits, R ht i ), each corresponds to one level of nodes' heterogeneity as follows: The threshold values (HT k i ) for all the senor nodes in cate-i are selected within the corresponding range. Defining R ht i is very important here, where the nodes in the higher levels of heterogeneity, which have more extra energy, are supposed to be used for reporting data more frequently than those having less amount of energy.
However, these ranges R ht 1 to R ht n , in fact, are subsets of the larger ranges (R sv 1 , R sv 2 , R sv 3 , ..., R sv n ), which represent the smallest and the highest sensed values (SV) that can be measured by the sensor nodes in cate-1, cate-2, cate-3, ..., cate-n, respectively, which can be represented in a similar manner as follows: The values of SV min i and SV max i should be decided in advance for each category, which is generally based on the type of sensors in each category and the intended use of them. Thus, to conclude the above formulation, the following is correct: In this proposed model, the process of deciding whether a node has to report its data or not is executed in two phases: In the first phase, the node in category i (SN k i ) checks its current sensed value (CV k i ). If CV k i is found to be equal or larger than its predefined hard threshold HT k i , then SN k i will enable itself to the possibility of reporting its data (i.e., CV k i ) and moves forward to the next phase of the process. This step is explained as in "node enabling procedure" below.
Node Enabling Procedure In the second phase, SN k i uses its given soft threshold (ST k i ) to take the final decision whether there is a need to report CV k i or not. In general, we define the soft threshold (ST ) of any sensor node as "the upper bound of difference between the current sensed value (CV ) and previously reported value (PV )" at which the node must report its data upwards to the base station. To enhance this initial definition, we define a sensor's Sliding Window (SW ) as a set of already reported values in the last Z reporting rounds (Z, here, represents the size of SW ). The SW of the sensor node k in category i is given as follows: where PV k i 1 is the latest reported value, PV k i Z is the oldest reported value considered, and i = 1, 2, 3, ..., Z. The average of differences (AD k i ) between CV k i and all the previously reported values within the SW k i , then, is calculated to determine whether to report the current measured value or not. Therefore, instead of using a single value of the already reported data in making decisions in the second step, Z reported values are employed to help in making reporting decisions more accurate and reliable. This is reasonable to make the right decision in order to avoid sensing errors, outliers, and mistaken measurements that may prevent nodes from reporting its significant and necessary readings. It also helps in reducing repeated reports of the same data in consecutive transmission cycles, which results in higher energy consumption (even if the sensed value is higher than HT k i which enables the node to possibly send their data). For this, we first calculate the sum of differences of sensor node k in cate-i (SD k i ) as follows: Then, the average of differences (AD k i ) is taken: The value of AD k i is then compared to ST k i to determine the final decision. If AD k i is found to be equal or larger than ST k i (the soft threshold of the sensor node), then SN k i activates itself (turning-on its transmitter) to report its data immediately (i.e., transmitting CV k i upward to the base station). This step is explained as in "transmitter activation procedure" below.
Transmitter Activation Procedure However, as our TEMSEP considers a state-of-theart multi-level heterogeneity model, the proposed eventthresholding model is general and can be used with any VOLUME 10, 2022 level of heterogeneity and initial energies of sensor nodes. The limits of thresholds and measured valued can be simply defined and controlled based on the type of sensors used in each category, which help in defining the level of reporting frequency based on the network function and monitoring requirement. Thus, applying the event-thresholding model, instead of sending data periodically, is the key idea in TEM-SEP to reduce the higher traffic-load imposed by all the nodes sending their data every predefined time interval, and thus, reducing the total amount of energy consumed by network nodes and maximizing network operation time. In each transmission cycle, only the nodes whose measured values exceed their predefined hard threshold and meet their soft threshold requirements are enabled to send collected values to their cluster-heads or nearest relay node; while the others stay in energy-saving mode by keeping their transmitter switchedoff. The main procedure of data transmission based on the steps defined in the model discussed above is shown in Algorithm 1 below.

Algorithm 1: THRESHOLD-ORIENTED TRANSMITION
SN k i .Activated = 1 8: send CV k i to CH or nearest EH. Identify N i t through Equation (4) 3: Identify E i t through Equation (5)  Place bs at its predefined location 13: end for divided into many repeated time-intervals called operationrounds or transmission-round (for example every 1 second, 1 minute, 1 hour, etc.) similarly as the way followed in [62], [63], [76], [121], [122]. For all the transmission rounds, the time interval is defined in a way that allows all the sensor nodes at the sensing layer to send their data through clusterheads towards base station nodes at the highest layer before new transmission round start over. Every operation round consists of two sub-phases: the set-up phase and the data transference phase. As a dynamic clustering protocol, the (HN) nodes in TEMSEP are re-clustered periodically in every set-up phase, where a new set of cluster-heads (CHs) is selected as members of the second layer for the current round. Based on the multi-level weighted election model discussed in Section II-B: in every transmission round, each k member node of cate-i randomly selects a number x in the range [0, 1]. If the chosen x is less than ET k i , the node, then, selects itself as a cluster-head and announces its information to all the other nodes in the network. Similarly, each energy harvesting relay node broadcasts its information, in every set-up phase, including its current status (sleeping/awake state) to all its neighbor nodes. Once the non-CH nodes receive these announcements, they send a joining message to either a CH or an EH node, whichever has the shortest distance. The selected CH and EH nodes then create TDMA (Time Division Multiple Access) schedules in a way that each member node is given a separate time slot. Also, every selected CH node sends a joining request to its nearest EH relay node so that the selected EH nodes assign an independent time slot to every joined CH node. The generated TDMA schedules, then, are broadcasted to all joined member nodes, after which the data transfer phase starts. At this point, the non-CH sensor nodes in the lower layer report their data towards the base stations layer based on the event-thresholding model described above. For every sensor node k in category i, if its data reporting requirements are met, then the node activates its radio and sends its current sensed value (CV k i ). In this step, TEMSEP adopts the conception of cross-layer communication model as used in EH-mulSEP in two different levels (see Figure 1 in Section III-A): (i) Data transmission between the first and third layers, and (ii) Data transmission between the second and fourth layers. Heterogeneous sensor nodes in the lowest layer can send their data either in a multi-hops transmission, through cluster-head nodes in the second layer, or in a singlehop path (cross-layer) directly to energy-harvesting nodes in the intermediate layer; wherever the transmission energy is the least. Similarly, for the second layer, the cluster-heads are allowed to transmit their data directly (cross-layer) to the LBS nodes in the top layer if the distance is shorter than that to EH intermediate layer. Figure 2 shows the sequences of all the operation stages in the proposed TEMSEP protocol.
For the relaying layer, the energy-harvesting nodes are assumed to have the ability to drive energy from ambient power sources simultaneously while transmitting and receiving information during operation rounds. Two harvesting thresholds are used to control the nodes' activation time. Each node can continue in work while its energy is more than E down th , otherwise it turns itself into the sleeping mode to harvest enough energy and turns on again once its energy is more than E up th . The amount of energy that can be harvested by a single node (E h ) and its total residual energy (E r ) are given by (8) and (9), respectively: where η c is the energy conversion efficiency, and P r is the amount of the received power. Algorithm 3, presents the pseudocode of TEMSEP main procedure.

IV. EVALUATION SETUP AND METHODOLOGY
For evaluating TEMSEP protocol, we have conducted extensive simulations using different configurations of the eventthresholding model, network heterogeneity levels, and deployment parameters. Matlab platform is used to carry out all the simulation works. We wrote a custom program and considered two different scenarios of heterogeneous network deployment, and compared our TEMSEP performance to that of traditional SEP [63], SEP-E [123], and other recently proposed protocols including EH-mulSEP [59], MRA [124], ITSEP [87], and "Priya et al" [83].

A. SIMULATION SETUP AND PARAMETERS
In our simulation, we have used two different configurations of the thresholding model parameters. These settings vary in the values given to the soft threshold (ST ) and hard threshold (HT ). The aim is to show how TEMSEP reacts when ST ranges from x to m, the minimum and the maximum values within which the ST can be relaxed. In addition, changing the range limits of hard threshold (R ht i ) may reduce network traffic-load and gives higher energy-savings as the data to be reported are minimized. The parameters' values we have chosen in these settings for the event-thresholding model are set based on our research outcome and literature studies. We have considered ST i and HT i range limits (i.e., R ht 1 , R ht 2 , R ht 3 , ..., R ht n ) for all values of i based on the smallest and the highest sensed values (SV min and SV max ) that can be measured by the sensor nodes in cate-1, cate-2, cate-3, ..., cate-n, respectively (which represented by R sv i for each nodes' category).  ch joins the nearst EH or LBS node 20: ch waits until receiving "TDMA" schedule 21: if ch recievs joining msg from non-CHs then 22: ch sends "TDMA" schedule to the non-CHs 23: ch receives new data packets from non-CHs 24: ch sends the new aggregated_data_packet to the nearst EH or LBS node are, respectively, 30% and 40% for the first configuration, and 40% and 50% for the second configuration with an increase equals to 10%. For ST i , we consider the level of heterogeneity i (i.e., cate-i) along with α (the energy encreasing factor of heterogenous nodes as defined by the heterogeneity model in Section III-A), which indicates that the amount of energy of a node in the ith level is more than that of a node in the (i-1)th level. We use this combination "α/i" in our simulation to vary the value of ST i in accordance to the TEMSEP essential assumption in which the nodes in the lower level (having less initial energy) are employed to report data less frequently than those nodes in the higher level, which assumed to be used for tasks that require to report their data more frequently (as they have higher amounts of energy), and so achieving a fair energy-load balancing. The different configurations of HT i and ST i are depicted in Tables 2 and 3, respectively.  In real scenarios, the value of HT i and ST i are defined by the administrator based on the nature of the network and types of sensors used. However, in our case, the values we have taken do not affect the simulation results or the comparison and they can be chosen with other values since all other limits are re-calculated accordingly, and the actual values of the nodes threshold are randomly chosen within each given range for more realistic simulation. For all the configurations of both the HT i and ST i , we have considered each setting of HT i with each setting of ST i , resulting in a total of four different configurations. These combinations of configurations have been applied on two different network scenarios (having different levels of heterogeneity, different amounts of total energy, different numbers of nodes, and different dimensions of the sensing area). This also gives us an idea of how TEMSEP behaves when applied to networks that vary on their main parameters (i.e., size, area, sensor nodes, and overall energy). The different scenarios considered in the simulation are depicted in Table 4.
For the validity of TEMSEP evaluation and comparison, we have followed the same principles, models, and methodology for energy-efficiency simulation of WSN that have been used by many research works in literature including the main clustering protocols, LEACH and SEP, and many other cluster-based solutions [61]- [63], [65], [79], [122], [125]. Also, we have considered the same values of simulation parameters and methodology in all the simulated protocols as used in SEP, SEP-E, and EH-mulSEP protocols for network setup (i.e., sensor nodes' deployment, CHs election, initialenergy, dissipation-model, heterogeneity, energy-harvesting, data transmission, etc.) [59], [63], [120], [126], [127]. To ensure the significance of the simulation results each protocol has been run 10 times, in all the simulated scenarios and/or configurations, then, the average has been taken as the final results. These results, as presented in Section V below, show similar behaviours of the protocols in all various simulated cases, indicating analogous improvements in all parameters considered. This gives us a clear indication that the obtained results are practically significant.

B. RADIO ENERGY MODEL
TEMSEP considers the first order radio energy dissipation model as shown in Figure 3 (this energy model has been widely employed in various protocols exist in literature [63], [128], [129]). The energy consumptions considered in this model are for data aggregation, transmission, and reception. The other power consumptions (e.g., for static energy, control signaling, sensing energy, etc.) are ignored as they are very less [63], [130], [131]. The energy consumption of the radio, according to this model, is based on the electronic circuit of both the transceiver and the power amplifier, the length of data transferred (l b ), and distance (d) between the communicating nodes. The transmitter energy consumption (E T x ), and receiver energy consumption (E Rx ) are defined as in (10) and (11), respectively: where E T x−elec and E Rx−elec are the energy dissipations for running the electronics of both the transmitter and the receiver respectively, E mp and E f s are the energy of the multipath and free space amplifier models respectively, while d 0 is the transmission distance between source and destination, which given by: The values of all other simulation parameters we have used in our simulations are given in Table 5.

C. EVALUATION PARAMETERS
We have evaluated TEMSEP with respect to other protocols in terms of several metrics as described below:   4. Number of alive nodes: Counts the total number of alive nodes continuously over the simulation time. 5. Dissipated energy: Indicates the total amount of dissipated energy over the simulation time. 6. Residual energy: Indicates the total amount of remaining energy over the simulation time. 7. Average number of CHs: Gives the total number of clusterheads elected per each operation round on average. 8. Traffic-load: Shows the network traffic-load continuously over the simulation time. 9. Lifetime gain: Gives the percentage increase in the network lifetime (improvement gained by TEMSEP). 10. Energy gain: Gives the percentage reduction in energy achieved by TEMSEP compared to others. 11. Traffic gain: Gives the percentage reduction in trafficload obtained by TEMSEP compared to others. 12. Round energy-cost: Gives the average amount of energy consumption per round during the simulation time. 13. Round data-sent: Gives the average amount of data sent per round during the simulation time.

V. RESULTS ANALYSIS AND DISCUSSION
In this section, we discuss the simulation results and comparison of TEMSEP to the other protocols, using different settings of HT i and ST i for both the first and the second network scenarios as defined in Table 4. For an easier and clear presentation of the simulation results, we give a different notation for each combination of HT i and ST i settings in TEMSEP as shown in Table 6. As mentioned above, we have used the same environment settings for all protocols in both scenarios and run each protocol 10 times. We observed that the results obtained for all runs, in all the scenarios and configuration simulated, are very close to the average we presented here and very far from zero. This indicates that the results are not obtained by chance and the differences of performance obtained by the proposed protocol over others are statistically significant. However, the results also show clear and meaningful improvements with higher percentages over others as shown in tables and figures below. This largely promotes the network performance for various metrics in all cases we considered and implies their practical importance. For the first scenario, Figures 4a, and 4b show both the total number of alive nodes with respect to the operation time (in terms of round) and the values of different lifetime measures (FND, HND, and LND), respectively. The improved performance of our reactive TEMSEP can be clearly seen compared to proactive EH-mulsSEP and traditional SEP. The heterogeneous nodes in our protocol TEMSEP expire much slowly than the nodes in EH-mulSEP and SEP, and hence extend the stability region and overall network lifetime. Implementing the proposed thresholding model in TEMSEP leads to such higher enhancements in performance over the compared protocols. In Table 7, we show the obtained values of the network lifetime (in terms of rounds) when different percentages of heterogeneous nodes are still active in the working mode.
We observe that in SEP, the first node dies at the round 598; in EH-mulSEP, it dies at the round 1406; while in TEMSEP(I, I), TEMSEP(II, I), TEMSEP(II, I), and TEMSEP(II, II), it dies at the rounds 2544, 3129, 2867, and 3860, respectively. This shows different levels of improvements with different combinations of HT i and ST i settings. From this, we can see the significant delay in nodes' expiration, which makes the stable period much longer, and leads to a more robust and reliable network. For the same configurations of HT i and ST i , the overall network lifetimes of our TEMSEP are equal to 12352, 15058, 12491, and 15106 compared to 3667 and 7376 for traditional SEP and proactive EH-mulSEP, respectively. We calculated the lifetime gain of our TEMSEP with the two configurations of HT i and ST i over the other two protocols at different levels of the heterogeneous nodes that are still active in the network. It is found that the total   lifetime of TEMSEP is increased by 67%, 104%, 69% and 104% for TEMSEP (I, I), TEMSEP(II, I), TEMSEP(I, II), and TEMSEP(II, II) respectively over that of EH-mulSEP protocol. As observed, the network stability period, in which all the nodes are still alive and operate in the working mode, is improved much better than the overall lifetime, giving a total improvement of 81%, 123%, 104%, and 175% in each of TEMSEP(I, I), TEMSEP(II, I), TEMSEP(I, II), and TEMSEP(II, II) respectively, over the same protocol. The comparison of lifetime gains achieved by TEMSEP on EH-mulSEP and SEP protocols at different points of its operation time are shown in Tables 8 and 9, respectively. The shorter VOLUME 10, 2022  stability duration resulted in EH-mulSEP and SEP is, generally, expected as the nodes report their data periodically in a time-driven model, dissipating higher amounts of energy especially when used in such large-scale sensor networks. Thus, the reactive data transmission in TEMSEP leads to higher improvements over EH-mulSEP protocol and much higher over SEP protocol as the later has a very short stability period and very less overall lifetime.
Moreover, the simulation results show that the total amount as well as the average of the energy dissipated by all the nodes per single transmission round are the least in TEMSEP compared to the other protocols for all the configurations of HT i and ST i considered. This is due to the few data reports sent by heterogeneous nodes in every time interval when implementing the proposed event-thresholding model; while in the EH-mulSEP and SEP, all the sensing nodes in the lower layer are supposed to send their data upwards to the base stations in every transmission round, and thus, increase the number of data reports, which in turn results in higher levels of energy consumption and faster expiration of heterogeneous nodes than TEMSEP protocol. Figure 5a shows the total amount of energy consumed by all the network nodes with respect to the operation time, while Figures 5b, and 5d show the average amount of energy consumed by all the network nodes in a single round, and the total amount of residual energy for all the protocols, respectively From the figures, we can see that TEMSEP always has the least energy consumption rate than others, and also, the average energy consumption per a single round is very less in all the configurations of HT i . The differences in energy consumption when we use higher HT i are noticeable as a result of the reduction in the number of data transmission per unit time. This, intuitively, means that there is a higher reduction in the network traffic-load in which TEMSEP has less data rate during the entire operation time than other protocols, and hence, this minimizes the processing and transceiving energy of relay nodes as well as base stations, making the network operating in an ideal situation without experiencing a bottleneck and/or traffic congestion.
In Figure 5c we show a comparison of the average number of cluster-heads (CHs) elected per a single round for all the protocols, while Table 15 presents the actual numeric values for the same along with the total number of lifetime's rounds of each protocol. As we can see even though TEMSEP has similar values to other protocols with marginal differences, its network lasts for a longer period of time; while that of others expires shortly. This also proves that CHs also consume less amount of energy in TEMSEP as a result of using the event-thresholding model as well as the energy-har-   We also observed during our simulation that TEMSEP has a more stable number of CHs over the operation time compred to other protocols, and hence, ensures longer network liftime. Figure 6a shows the average amount of data sent by all the network nodes in single round for all the protocols, while Figure 6b shows the total throughput of all protocols during the operation time. The throughput curve of the traditional SEP shows a higher data transmission rate until the round 3667 at which the last node in the network dies due to the higher energy demand. Other protocols utilize a layered framework based on energy-harvesting, and thus continue in operation, sending more data reports. Furthermore, in Table  11, we show the exact values of average energy (in millijoules) and average data transmitted (in Mebgabit) per single round for all the settings of HT i and ST i ; while in Tables 12  and 13 we show the percentage of reduction in energy and traffic-load achieved by TEMSEP over EH-mulSEP and SEP protocols, respectively. However, such higher improvements obtained by TEMSEP over the other protocols are due to implementing the proposed event-thresholding model. The thresholding model saves energy by regulating data reporting of all the network nodes and preventing nodes from transmitting their collected data unnecessarily unless the data reporting requirements are met. These requirements are formulated in terms of hard-threshold (HT i ), soft-threshold (ST i ), and sliding window (SW) of previously reported data as described in Section III-B. In addition, TEMSEP adapts an energy-harvesting based layered framework as conceptualized in EH-mulSEP protocol. Energy harvesting inter-mediate relaying layer helps significantly in decreasing the transmission distance of CHs and of the regular HN nodes in the lower layers, which in turn results in a minimized energy demand per unit time as well as an extended network lifetime over SEP protocol. Moreover, using multiple base stations (LBSs) in the layered framework enables CH nodes to save their energy when sending their data directly to LBSs (a single-hop transmission) with the help of the crosslayer communication, when the distance is shorter. From the figures and tables given above, it can be seen also that proactive EH-mulSEP performs better than the traditional SEP protocol as it uses the same layered network framework, even though it does not use any type of event threshold, and the nodes send their data proactively at every transmission interval.
The different configurations of HT i and ST i considered in our simulations help in building a clear idea on how the network administrator can decide the exact values of the thresholding parameters in order to achieve the desired frequency of data reporting and the level of energy-saving.
Here, a type of tradeoff may be considered to make a fair balancing while keeping the overall network performance at the planned level. As the HT i plays the primary role in the proposed thresholding model for enabling nodes to report their data, the ST i , which is calculated based on HT i , also has a significant impact as well. Relaxing HT i and ST i within predefined ranges gives a flexible control on the behavior of network nodes and helps in achieving the higher amount of saved energy as planned. This is done by perfectly defining the HT i and ST i values in accordance with the energy levels  of different heterogeneous nodes. In the figures and tables above, it can be clearly seen that the impact of HT i values on the TEMSEP performance is more than that of ST i . For closer comparison of the two settings of ST i , Figure 7, re-presents the results when the two settings of ST i are being used with the first configuration of HT i only. It shows the level of performance change when using the two configurations of ST i , which are calculated as 8 and 10, as well as 4 and 5 for both the first and second levels of heterogeneity, respectively, according to equations we defined in Table 3. The percentage of improvement in the length of stability period over the other protocols is higher than the improvements in the overall network lifetime, the amount of energy saved, or the reduction in the traffic-load. This implies that the HT i has a higher impact on the level of energy-saving, network lifetime, and traffic-load than the ST i ; nevertheless, both are key factors in achieving the desired network performance.
When higher values of HT i and/or ST i are used, more reduction in data transmission can be achieved, and thus, improved performance can be obtained. However, the results discussed above prove that our proposed protocol, TEMSEP, enables the administrator to make a perfect selection of HT i and ST i based on the event-thresholding model introduced in Section III-B, such that the nodes with higher levels of energy send their data more frequently than those having less amount of initial energy. Thus, achieving a fair energy-load balancing between all the heterogonous nodes and improving the level of energy conservation.
For the second scenario of the network simulated, three levels of heterogeneity have been considered instead of two,     [124], ITSEP [87], "Priya et al" [83], and SEP-E [123] protocols, where all these protocols support three levels of heterogeneous nodes. From the simulation results, it has been observed that TEMSEP performs further better than the other protocols (EH-mulSEP, MRA, ITSEP, "Priya et al", and SEP-E) for all the evaluation metrics we targeted. In general, the results show that TEMSEP acts in a similar way to what has been seen in the first scenario. The higher value of HT i and ST i we set, the better performance we get in terms of less traffic-load, higher energy saving, longer stability period, and extended network lifetime. Also, as a result of including higher levels of heterogeneity, noticeable improvements have been seen in comparison to that of the first scenario. The difference between the performance of TEMSEP and that of the other protocols has been clearly observed for most of the evaluation parameters (stable period, energy consumption, overall lifetime, transmission rate, etc.). In this scenario, even though MRA, ITSEP, "Priya et al", and SEP-E protocols have three levels of heterogeneity as in EH-mulSEP protocol, they show low performance due to the large monitored area, which leads to a longer transmission distance, and thus, higher energy consumption and early nodes' expiration. EH-mulSEP performs better than the four protocols as a result of utilizing intermediat relaying layer that helps in reducing transmission distance, and thus, in dissipating less amount of energy. However, TEMSEP protocol keeps performing more higher than EH-mulSEP due to its novel heterogeneous event-thresholding model, which ensures that nodes send their sensed data only when required, and thus, reducing unnecessary data transmissions, saving a higher amount of energy, and maximizing the overall network operation time. Such improved performance in TEMSEP is clearly observed over all these protocols for various metrics considered. MRA protocol shows better performance than ITSEP, "Priya et al", and SEP-E. This is due to its utilization of four base stations located on the borders of the monitored area, and thus, the cluster heads choose the nearest base station to send their aggregated data for a shorter distance than the other three, which results in less energy consumption and longer stable period. ISTEP also performs better than "Priya et al", and SEP-E protocols due to considering multihops transmission, in which cluster heads have two options to send their collected data either directly to the base station, which is located in the center of the monitored area, or through the nearest neighbor cluster-head, whichever have the shortest transmission distance. Consequently, a path to the base station with the least minimum energy-cost can be identified. Even though "Priya et al" provides a modified version of weighted election threshold, we have observed that it has unstable performance in terms of percentage of elected cluster-heads, which results in less performance in large-scale networks compared to the other protocols. Also, we have observed that considering homogenous thresholds in MRA and ITSEP to make decisions on the data transmission process helps them in saving energy and extending the overall network lifetime better than "Priya et al" and SEP-E.
In Table 14, we show the average numerical values of the network lifetime at different points of operation time for all the protocols, while In Figures 8a, 8b, 8c, 8d, and 8f we show the different measurements of the network lifetime for all the protocols, as well as the alive nodes, the total energy dissipation, the total throughput, and the total residual energy, all over 18000 rounds of the simulation time for all the protocols when applying both the configurations of HT i and ST i for TEMSEP. Even though the nodes are deployed in a larger area in this scenario which increases the transmission distance, TEMSEP is still providing improved performance and higher gains over the other protocols. It achieves maximum improvements of 134%, 117%, 214%, 280%, and 82%, for the network lifetime, 273%, 1248%, 1151%, 1370%, and 166% for the stability period, 65%, 69%, 100%, 82%, and 55% for the energy-saved, and 52%, 37%, 50%, 48%, and 53% for the reduced data transmission rate over MRA, ITSEP, "Priya et al", SEP-E, and EH-mulSEP protocols respectively. In Figure 8e and Table 15, we show a comparison of the average number of CHs elected per a single round and the numerical values along with the total operation rounds, respectively. Here, it can be seen clearly that TEMSEP has a higher average number of CHs than others compared to the first scenario, particularly with respect to MRA, ITSEP, "Priya et al", and SEP-E protocols, even though they have shorter lifetimes. This also implies that TEMSEP is able to control the energy dissipation of CHs for a higher scale network and larger sensing field, and thus, keep a stable number of CHs while achieving better energy saving.
Therefore, such results indicate that the new eventthresholding model implemented in our TEMSEP along with  higher levels of heterogeneity (by adding cate-3) help in delaying the death of sensor nodes. Thus, leading to an optimized performance in terms of different metrics, and saves an additional amount of dissipated energy. In Figure 9a and 9b, we show the average energy consumption and data transmission rate for a single round for all the protocols. This clearly shows that TEMSEP achieves less energy dissipation as well as a higher reduction in the average traffic-load compared to all other protocols. In Tables 16, 17, and 18, we show percentage of reduction in data transmission rate, the average lifetime gain, and percentage of energy-saving obtained by TEMSEP over all the other protocols in scenario-2. However, as per the results discussed in both the scenarios, we conclude that TEMSEP can highly improve the overall system lifetime, energy-saving, and traffic-load reduction over the other protocols. This is achieved by efficiently regulating the data reporting frequency based on the proposed event-thresholding model. In addition, the layered framework used in our protocol, based on an energy-harvesting relaying nodes, helps in reducing the transmission distance, and thus, in minimizing the total energy expenditure of all the network nodes. The consistent behavior of the TEMSEP in both the scenarios and different configurations, regardless of the sizes of nodes' population and targeted area, indicates that the reactive TEMSEP is a scalable protocol and applicable to large-scale and heterogeneous WSNs. As it considers a state-of-the-art multi-level heterogeneity mechanism, the novel event-thresholding model proposed in TEMSEP is a general model that can be integrated and applied to any use case with any level of heterogeneity and initial energies of sensor nodes. For example, in [132], the authors proposed a wireless charging method using WPCD (wireless portable charging device) that travels through the entire deployed sensing network in order to recharge the nodes' batteries wirelessly based on WPT techniques, SARSA, and Nodal A* algorithms, and thus, maintaining a perpetual WSN. Integrating TEMSEP thresholding model to this architecture will help in minimizing the nodes' dissipated energy and hence highly reduces the number of recharging cycles, and frequent traveling of the mobile WPCD. This leads to achieving both the objectives set by the authors which are optimization of the energy-dissipation rate of receiving/sending data and maximization of WPCD vacation time. Also, IEE-LEACH (Improved Energy-Efficient Routing Protocol) proposed in  [76] as discussed in Section II can benefit from applying TEMSEP thresholding model. In addition to considering an optimal CHs selection and cluster formation scheme, the non-CH nodes can efficiently control their transmission rate based on heterogeneous thresholds, keeping their transmitter switched off when possible and thus improve their lifetime. Furthermore, the heterogeneous fitness function formulated in [121] for optimal CHs election and its redesigned TDMA schedule can be straightforwardly integrated into TEMSEP event-thresholding scheme to guarantee improved load bal-VOLUME 10, 2022 ancing, energy-saving, and QoS parameters. In summary, TEMSEP event-thresholding model is applicable for integration with most of the state-of-the-art approaches and energy-saving techniques that support cluster-based routing, heterogeneity methods, and large-scale deployment, leading to better data transmission control and a higher amount of energy conservation.

VI. CONCLUSION
In this paper, we have proposed TEMSEP, a new reactive protocol for large-scale heterogeneous WSNs. TEMSEP provides a novel thresholding model that regulates data transmission of the sensing layer based on changes in the targeted events and relevant parameters. The sensor nodes in TEMSEP report their data only when it is necessary accord-ing to a new reactive mechanism formulated in this paper based on three defined parameters, i.e., hard-threshold (HT i ), soft-threshold (ST i ), and sliding-window (SW) of already reported data. TEMSEP integrates hierarchical clustering, multilevel heterogeneity models, and energy-harvesting relaying mechanism, which are considered amongst the most efficient schemes for reducing energy dissipation. The aim is to minimize network traffic-load imposed by sensor nodes, optimize the energy saving of battery-operated devices, and improve the overall network lifetime. We have discussed different aspects of TEMSEP, and explained the new eventthresholding model in detail which can be applied on the large-scale sensor networks regardless of the nodes' population, the dimensions of the targeted area, the number of heterogeneity levels, or the values of their initial energies. We then presented and analyzed the extensive simulation results conducted using various configurations of HT i and ST i , with different network scenarios. The performance of TEMSEP is compared to that of EH-mulSEP, MRA, ITSEP, "Priya et al", SEP-E, and SEP. Simulation results indicate that TEMSEP protocol performs much better than the other protocols in all the cases simulated, concerning several parameters considered. On average, the energy consumption and traffic-load can be reduced, respectively, by 73%, and 53% at maximum; while the total network lifetime and stability are improved, at minimum, by 56% and 69%, respectively over the other protocols.
For the future work, a number of improvements can be provided to the proposed protocol. we intend to study the application of TEMSEP on mobile heterogeneous WSN with event-driven fixed and variable bit-rate traffic patterns of nodes. The study and compliance of TEMSEP model with the recent communication protocols and connectivity standards such as 3GPP-based systems and services in the context of the current advancement will be prioritized. This needs more investigation on achieving better energy savings as well as keeping desired system performance in terms of other major parameters (such as security, data accuracy, reliability, etc.), depending on the nature of applications. Also, the process of the cluster-heads' election in TEMSEP can be improved by considering only the nodes that are most likely to send their data in the current rounds according to the proposed eventthresholding model, while the other nodes can be excluded from the election process. Moreover, the consideration of energy-harvesting nodes as one source of the heterogeneous sensing nodes will help in achieving a perpetual network lifetime.