Trust-based energy-efficient routing protocol for Internet of things–based sensor networks

Internet of things grew swiftly and many services, software, sensors-embedded electronic devices and related protocols were developed and still in progress with full swing. Internet of things enabling physically existing things to see, hear, think and perform a notable task by allowing them to talk to each other and share useful information while making decision and caring-on/out their important tasks. Internet of things is greatly promoted by wireless sensor network as it becomes a perpetual layer for it. Wireless sensor network works as a base-stone for most of the Internet of things applications. There are severe general and specific threats and technical challenges to Internet of things–based sensor networks which must overcome to ensure adaptation and diffusion of it. Most of the limitations of wireless sensor networks are due to its resource constraint objects nature. The specified open research challenges in Internet of things–based sensor network are power consumption, network lifespan, network throughput, routing and network security. To overcome aforementioned problems, this work aimed to prolong network lifetime, improve throughput, decrease packet latency/packet loss and further improvise in encountering malicious nodes. To further tune the network lifetime in terms of energy, wireless harvesting energy is suggested in proposed three-layer cluster-based wireless sensor network routing protocol. The proposed mechanism is a three-tier clustering technique with implanted security mechanism to encounter malicious activities of sensor nodes and to slant them into blacklist. It is a centred-based clustering protocol, where selection of cluster head and grid head is carried out by sink node based on the value of its cost function. Moreover, hardware-based link quality estimators are used to check link effectiveness and to further improve routing efficiency. At the end, excessive experiments have been carried out to check efficacy of the proposed protocol. It outperforms most of its counterpart protocols such as fuzzy logic–based unequal clustering and ant colony optimization–based routing hybrid, Artificial Bee Colony-SD, enhanced three-layer hybrid clustering mechanism and energy aware multi-hop routing in terms of network lifetime, network throughput, average energy consumption and packet latency.


Introduction
The Internet of things (IoT) has gained its ground rapidly in last couple of years offering unlimited applications in many areas comprises intelligent transport system, agriculture, healthcare, smart cites, smart buildings, smart grids, environment monitoring, education, industry, entertainment and so on. [1][2][3][4][5][6][7] The IoT is considered as next generation of Internet or expansion of Internet and World Wide Web, where huge number of things will be connected and would allow direct machine to machine (M2M) communication. [8][9][10] Almost every factor either hardware or software of IoT is important but the most indispensable element in IoT is the sensors, which are the ears and eyes of IoT 11 and become base for wireless sensor networks (WSNs). WSN becomes significant research topic due to its increasing role in new cutting-edge applications and state-of-the-art technologies.
WSN is a foundational technology for IoT. Whole IoT system relies on it. 12 WSN plays a strategic role in promotion and growth of IoT, permitting low end devices with limited resources and offering life-changing services. It uses tens to thousands of sensors connecting each other via wireless technology. 13,14 Advancement in sensors' technology makes it possible to build low cost and tiny-sized IoT-enabled wireless sensors to bring smartness in small-to large-scale appliances. 15 A typical WSN composed of numerous numbers of sensors nodes with sensing, communication and processing capabilities. 16,17 WSN can serve as a platform for many other domains such as measurement of important environmental parameters (humidity, temperature, light, pressure and so on) in smart agriculture, secure and reliable communication, military applications and monitoring, medicine and healthcare, different types of industries, traffic surveillance and so on. [17][18][19][20][21][22][23][24][25][26] There are severe threats and technical challenges to WSNs that must be overcome to ensure adaptation and diffusion of it. Most of the limitations of WSNs are due to its resource constraint objects nature. The sensors of open area WSN is always vulnerable to harsh or hostile environment challenges in terms of high temperature, humidity, pressure, dust, rain, snow and so on, which are affecting the operation of WSN, making it essential to have robust and resilience sensor nodes. Furthermore, other general problems and future challenges to WSNs are comprises limited constrained resources, limited communication capability, stability, fault tolerance, bandwidth, mobility, result precision, availability, trust, accountability, heterogeneity, integration, uncontrollable environment, technology and denial of service attack (DoS). Along with aforementioned general challenges, WSNs has specific issues that got much of the researchers' attention. These specified open research challenges of WSN are power consumption, network lifespan, network throughput, wireless routing protocols and network security.
Energy consumption is highly prominent topic in WSN communication. The energy efficiency is a key factor, plays a vital role for the longevity of WSN and influences the whole performance of network. 27 The lifetime of the WSNs depends upon energy level (EL) and considered as one of the main factors in performance evaluation of WSN routing protocol. 11,28 In WSN routing, the energy consumption, residual energy and total energy are always important metrics and parameters while computing cost function (CF). 29,30 Routing has been always an important factor in any type of communication network. It is always been a challenging job for researchers to route packets to destination efficiently, safely and with minimum overhead. Due to sensors' resource constraint, such as limited energy, limited processing and short communication range, the routing algorithm implementation is a cliffhanger task for the researchers. Countless efforts have been made and still extraordinary efforts are needed in this subject to come up with best solutions.
Clustering in WSN is a process in which the network is divided into hierarchy to do load balancing and to achieve other objectives such as scalability, lifetime maximization and energy minimization. It is very effective and efficient way to prolong lifespan of WSNs 31,32 and influence the overall performance of network. Hierarchal-based or cluster-based routing protocols are divided into cluster heads (CLHs) and member nodes (MNs), where CLH selection is based on important parameters such as residual energy and distance to sink node (SN). CLH role is rotating based on the rank of the nodes. The ranks of the nodes are defined by the increase or decrease in important parameters. Cluster head act as a leader or coordinator that take data from cluster members (CMs), aggregate it and forward it to base station (BS) or SN. [33][34][35][36][37][38][39][40] Also, cluster-based routing protocols are divided into three broad classes such as block cluster based, grid cluster based and chain cluster based. Furthermore, cluster-based WSN is divided into two-tier (two layers) and three-tier (three layers) hierarchies, as shown in Figure 1.
Another important aspect in WSN is security against malicious nodes. Illegal intrusions in WSNs highly disturb and degrade lifetime, throughput, authenticity, confidentiality, integrity, availability, bandwidth, quality of service (QoS) and so on. Routing protocols of WSNs are suffered from various attacks such as Sybil attack, selective forwarding attack, wormhole attack, black hole attack, sinkhole attack and hello flooding attack. 17,[41][42][43][44] To encounter aforementioned attacks, reliable, effective and resilient routing protocols are needed for WSNs.
Inspired by above-mentioned consideration, this work aimed to prolong network lifespan, improve throughput, increase number of alive nodes, decrease packet latency and packet loss and reduce energy consumption and further improvise encountering malicious nodes. To further tune the network lifetime in terms of energy, wireless harvesting energy (WHE) is suggested in proposed three-layer cluster-based and IoT-based WSN routing protocol. The proposed solution, trustbased energy-efficient routing protocol (TBEERP), is a three-tier clustering routing protocol with embedded check-up node (CN) to encounter malicious activities of nodes and to slant them into blacklist. Moreover, link quality (LQ) is also checked in order to further improve routing efficiency. Only hardware-based link quality estimators (LQEs) are considered in this proposed research work, which does not overhead or delay the overall process. The contribution of this research work can be summarized as follows: Harvesting energy is added in three-layer WSN clustering techniques to prolong lifespan of network and to improve network throughput. Due to this extra supplementary energy, the responsible roles (CLHs + CLGs) further extend their assigned duty. CNs are introduced in each cluster to mirror malicious attacks. Most of the processing is done by SN, which does not have any resource constraints. In proposed solution, CF plays pivotal role that spit out CLH and CLG role. Hardware-based LQEs are used to check link efficiency.
The rest of the article is organized as follows: related research and literature are briefly reviewed in section 'Related literature'. The proposed system model is explained in section 'Proposed system model'. Section 'Performance evaluation of proposed solution' elaborates simulation, results and analysis with required snapshots and section 'Conclusion' concludes this study.

Related literature
Tiered and layered data transmission is considered one of the robust and preferred schemes in WSNs. After passing through numerous experiments, this approach is now assumed very efficient routing techniques to route data packets to destination, for example, BS. In this type of structure, all sensor nodes are distributed into different layers with different roles such as CMs, cluster heads (CLHs) and cluster gateways (CLGs).
There are many literatures and research works written and tested 35 in WSN routing protocols. Some of them are robust, while some are average. The clusterbased algorithms or protocols have been undertaken for this proposed work as a base study. Main role in cluster is the role of cluster head (CH), that is, leader and its role changed based on important parameters such as current EL. In this regard, low-energy adaptive clustering hierarchy (LEACH) 45 is the forerunner work, which is considered as based literature for most of the clustering algorithms. In LEACH protocol, selection of CHs is carried out in every round. LEACH was first priority for cluster-based routing for a long time because it distributes equally the energy consumption in nodes. But it leads to additional routing overhead that result in plenty use of energy of CHs. Along with it, this protocol only accommodates single-hop communication from node to BS.
An enhanced three-layer hybrid clustering mechanism (ETLHCM) 11 by Ullah et al. further tried to limit control traffic after every round, especially for the selection of CH. In proposed mechanism, the energy of the nodes is divided into ELs, based on which it is decided when cluster nodes need to select new cluster head by lower layer. The EL is also used for balancing energy consumption between sensor nodes. The role is reverted to normal node from CH role, if its residual energy dropped by 1 EL. The ETLHCM greatly reduced the burden of wasteful control traffic exchange. It is claimed after simulation that ETLHCM showed 18% improvement in terms of network lifetime and half of the nodes alive (HNA) compared to hybrid hierarchical clustering approach (HHCA). It outperforms LEACH, three-layer LEACH (TL-LEACH) and HHCA in terms of network lifetime. However, this algorithm is lacking clear procedure for the selection of grid head (GH).
To encounter malicious attacks, such as wormhole, black hole and Sybil, an attempt has been made by Ai et al. 46 New protocol has been proposed to guarantee reliable routing and data exchange. This is a smart collaborative routing protocol, which is named as geographic energy aware routing and inspecting node (GIN). It incorporates directed diffusion routing, geographic and energy aware routing (GEAR) and inspecting node procedure. GIN is a completely novel approach to tackle these problems. In this proposed method, GIN is cohesive with GEAR protocol. Furthermore, it is experimented on NS3 and claimed that it surpasses the other three counterparts such as flooding, GEAR and greedy perimeter stateless routing (GPSR) in many aspects. It is novel concept but the combination of GIN with GEAR making it complex.
Many issues of WSN have been addressed in the literature by Hosen and Cho. 37 They have proposed a routing protocol by the name of energy-centric clusterbased routing (ECCR) for WSNs. Static clusters concepts were introduced, which decreases the overhead of control packets during the formation of clusters. The caretaker concept has been taken, inspired from Malathi et al., 44 for the election of cluster head, where ranks' information are allied with local data. The former cluster head is responsible to handover its role to forthcoming cluster head, which is elected in current round. This process highly reduces laden of control traffic regarding the selection of cluster head. This leads to further prolong and improve WSN lifetime. This scheme, however, fails in dynamic clustering distribution, which is demand of cutting-edge WSNs.
Another very serious attempt has been carried out by Arjunan and Sujatha 38 to exclude hot spot problem and to maximize network lifespan of WSN. The proposed model is a hybrid (proactive and reactive) unequal clustering protocol, which transmit data both in proactive and reactive fashion. This WSN protocol is fuzzy logic-based unequal clustering and ant colony optimization (ACO)-based routing hybrid (FUCARH).
This protocol consists of three phases such as CH selection phase, inter-cluster routing phase and cluster maintenance phase. The cluster construction is divided into two steps such as CH selection and cluster formation. The BS runs fuzzy logic for the formation of balanced clusters, which is achieved by the equal distribution of CHs in entire network. For the selection of CHs, the fuzzy logic uses five important parameters named residual energy, distance to BS, distance to its neighbours, node degree and node certainty. The results outclass the other counterpart (LEACH, threshold-sensitive energy-efficient sensor network (TEEN), distributed energy-efficient clustering (DEEC) and fuzzy energyaware unequal clustering algorithm (EAUCF)) protocols in terms of network lifetime, balance energy consumption and elimination of hot spot problem.
Ari et al., 39 proposed a protocol named Artificial Bee Colony-SD (ABC-SD), which is inspired by fast and efficient searching of artificial bee colony (ABC) to build lightweight clusters. This protocol is an extension of original ABC protocol. A versatile multi-objective function is aspired using linear programming (LP) formulation. The routing problems are targeted with a cost-based function, which uses energy and number of hops as parameters. The quality of communication is also taken in consideration. Through a centralized control algorithm, the clustering process is accomplished and this whole process is carried out in BS. This solution is good; however, LP makes it a bit fuzzy.
A novel routing algorithm has been proposed in Wang et al. 40 The energy depletion problem has been targeted in this study with a protocol named energyefficient compressive sensing-based clustering routing (EECSR). This paper worked on the combination of the merits of clustering techniques and comprehensive sensing-based (CSbased) system. First, the lemma of the relationship between two linked layers, optimal number of CH in each layer and optimum distribution of CH is presented. Second, an attempt has been carried out to eliminate hot spot problem in WSN and to minimize energy consumption. Third, the role of back cluster head (BCH) and its rotation with CH is proposed. The authors claimed of much better results in terms of energy efficiency and WSN lifetime extension.
A hybrid approach is considered by Younis and Fahmy 47 to achieve energy-efficient distributive clustering by the name of hybrid energy-efficient distribution (HEED) clustering. A novel protocol, which selects CH based on residual energy and other parameters such as node degree. HEED is fairly uniform cluster head distribution protocol across the network with very low messages overhead. The main objectives of the HEED are extending network lifespan, finishing clustering process in fixed number of iteration, reducing control overhead and creating sound distributed CHs. This literature used two unique terminologies such as source and server. The source is used for normal nodes and the server is used for cluster head.
An attempt has been made by Cengiz and Dag. 48 The proposed scheme is comprises two phases such as setup phase and steady-state phase. The setup phase made once in network lifetime in which CHs, CMs and other distributer are assigned their roles. In steady-state phase, transmission of the collected data occurred along with selection of new CHs and redistribution of CMs. The proposed solution is an energy aware multi-hop routing (EAMR), which achieves the objective by minimizing the surplus overhead in LEACH 45 and in its successors by implementing fixed clusters and reducing CH changes. Due to less number of CH change and fixed size of clusters, the network lifetime increased and network overhead decreased. Compared with other counterparts (LEACH, LEACH fixed clustering (LEACH-F), modified LEACH (Mod-LEACH), DEEC, stable election protocol (SEP) and low energy fixed clustering algorithm (LEFCA)), the EAMR showed significant improvements in terms data transmission, energy consumption and network lifetime. Because of fixed size of clusters, this scheme is not candidate for large-sized WSN.
A new cluster-based protocol hierarchal distributed management clustering (HDMC) is proposed by Shahraki et al. 49 The proposed technique uses many parameters such as action history of each node and local and general status of each node in order to select and determine best node for CH role. It further extend network lifetime, consume network resources fairly and improve network coverage further. Moreover, HDMC will be a good choice for WSNs routing because of its simple setup and low overhead (only one broadcast P kts + one P kts for being an MN and two P kts for CH selection). However, it assumed too much parameter for the selection of CH which leads to massive computation.
Yi and Yang 50 presented a clustering-based routing protocol named Hamilton energy-efficient routing (HEER) for WSNs. It took help from the concept of Hamiltonian path in graph theory to carry-on and carry-out its duty. Hamilton path is a path that traverses a graph and accesses each node only once. Advantages of Hamilton path is that HEER visits every node once in each round so to avoid duplicate messages from nodes to CHs. HEER collects data, aggregates it and then forwards it through Hamiltonian path to BS. HEER is implemented in MATLAB comparing it with low-energy adaptive clustering hierarchy cluster head technique (LEACH-CHT), LEACH and powerefficient gathering in sensor information systems (PEGASIS). It outperforms all others in term of network lifetime and transmission delay. This routing protocol uses Hamilton path for sending packets to BS. The disadvantages of Hamilton path may not be ignored.
Wang et al. 51 presented solution by the name of hybrid multi-hop partition-based clustering routing protocol (HMPBC), which tackled multiple problems of WSN to be solved. The CH selection depends upon the level of residual energy. The observed area is divided into zones and a single-chain structure is used in cluster to maximize network lifetime. Minimum spanning tree algorithm is adopted for communication among CHs. The proposed solution is simulated in MATLAB and outclasses low-energy adaptive clustering hierarchy multi-level opportunistic routing (LEACH-MLOR) and energy efficient hybrid multihop clustering scheme (EEHMCS) in many areas. Minimum spanning tree is making additional overhead in this algorithm.
Summary of state-of-the-art protocols in subject area is given in Table 1 Proposed system model Main tasks of sensor nodes in smart environment, such as smart cities, smart homes, smart health, smart agriculture, and smart grids, are to monitor physical and chemical changes and then pass it to the central location (SN) for further processing. Sensor nodes have different sensing capability and EL constraint. There are several challenges to IoT-based technology and WSN, in which the most burning and important is the energy consumption and maintenance during communication as mentioned in Li et al. 52 Therefore, this research highly focuses on reducing the number of control P kts during network communication.
To prolong network lifetime and to keep load balancing, the proposed model is cluster and hierarchal layered based. It is latency full and energy consuming task to send the field data by the sensor nodes directly to SN. Hence, it is supposed in this research that sense data will be forwarded to CLH by the CM, CLH forward it to CLG, where these aggregated data are further forwarded to SN.
To keep security check and balance and to avoid malicious attacks such as Sybil, Sinkhole, and Wormhole, this proposed model comes up with CN that carry-out security-related tasks. Furthermore, to make it result oriented and to equip it with upcoming IoT application challenges, this work has been rooted with WHE. Figure

Network framework
The proposed model is implemented into two rounds: Round 1, all sensors nodes, which are of heterogeneous nature, are deployed randomly in field. They are fixed and do not move after deployment. In addition, after We focussed on to limit control P kts during communication in order to decrease energy consumption and processing overhead. There are no exchanges of control P kts until death of CLH, CLG or CN or till shifting of its role to other nodes. Three-tier approach is used in this model (CMàCLHàCLGàSN). This approach also helps in load balancing and energy saving because in long-distance communication, plenty of energy is consumed. The detail of the proposed research work is described in the following sub-sections.

Deployment of sensors
To sense field data, 200 tiny microelectronic sensors are deployed over a targeted area in two dimensions (2D) at initial stage. Figure 4 shows this scenario. These nodes are of heterogeneous nature, having different capacity, size and competency power. The deployments of sensors are fixed, terrestrial and random. From these deployed 200 nodes, decision will be made of CLG, CLH and CN. To prolong network lifetime and to reduce computational overhead (as, when EL become low from specified threshold, then role of CLH, CLG or CN shift to other MN that is done through some computation to recalculate CF), each sensor node is equipped with WHE unit.

Initialization
This is prior communication phase in which the SN communicates with all deployed node via a dissemination initiation hello packet (Init À Hello Pkt ). After receiving Init À Hello Pkt from SN, each field nodes response with reply packet (Reply Pkt ) taking carriersense multiple access with collision avoidance (CSMA/ CA) mechanism in account. After receiving Reply Pkt from nodes, SN responses with acknowledged packet (Ack Pkt ), which give surety that the message has been received successfully. This Ack Pkt from SN to field nodes gives information about SN such as sink node identity (SNid). It is a centralized control mechanism to start and initialize WSN and to set the nodes into multiple clusters.
Furthermore, in this stage, SN gets important information about field nodes such as Node identity (Nid) Residual energy (R:E) Link quality (LQ) Distance (d tance ) from/to SN SN saves this information for future use. Also, based on these received P kts , SN judges LQ of each node.
Moreover, for distance calculation to SN, Euclidean equation 53,54 will be used where d tance n, SN ð Þ is the distance of node n to the sink node SN and X n and Y n are the node coordinates, respectively.

Energy model
To improve reliability of a WSN, efficient utilization of energy is needed. In WSNs, energy consuming is the most alarming and burning issue. IoT and cluster-based routing is revolving around energy-constrained sensors. Currently, three-layer cluster hieratical technique is considered conducive remedy for efficient energy consumption as compared to other existing techniques. 55 In this proposed model, nodes with high R:E or T :E get supplementary cost and become more favourable for CLG, CLH and CN role. In this research, first-order radio model 53 is used for the calculation of energy consumed in transmitting (E n-Trans ) and receiving (E n-Recvd ) of data packet P kt . Energy consumed (E n-cons ) by each node is given in the following equation Circuit consumed energy E n-Circut by each node is also added in above equation (2), so it becomes When node n transmit P kt of size l over a distance d, it consumed energy E n-Trans , where And receiving transmitted P kt a node consumed energy Moreover, in simplest definition, energy consumed by node during transmission of a single P kt is equal to the energy consumed by node, while receiving the same P kt as given in equation (6) E n-Trans = E n-Recvd Also to minimize wasteful operation and to save energy, the following function is used where WE cons represents the whole (total) energy consumed and can be calculated using equation (8) WE Cons where E Trans CntrlP kts represents the control packets during transmission and E n-Recvd Cntrl represents received control packets during transmission by node In this proposed model after initialization phase, total energy (T :E) of each node will be taken in consideration using equations (9) and (10)  where R:E is the residual energy, C:E is the current energy and H:E is the harvesting energy.
R:E or C:E of a node can be computed using equation (11) and H:E is computed via equations (12)- (14) R:E = C:R = E Initial À E Cons ð11Þ

Wireless harvesting energy
One of the main issues and challenges in upcoming 5G wireless network is to improve the energy efficiency of battery-fitted devices. 56 Same is the case of WSN, in which battery power capacity is vital factor in longevity of network lifetime. In WSNs, energy saving and consumption are extremely important aspects for optimizing and functioning as much as possible network devices and prolonging the lifespan of overall network. Hence, WHE technology is highly fascinating and enchanting solution, in which WSN devices can pick energy from around environment or from ambient radio signals. The specific hardware circuit in WSN devices for harvesting energy can be designed both for WHE and information transferring/receiving. 56 WHE is formulated in Gao et al. 57 using time-slot for energy harvesting and spectrum sharing with approach 'best cooperative mechanism' (BCM). The WHE equations are given in the following equation and where R p is the transmission rate, r1 and r2 are the energy harvests save ratio from ambient signals, g p is the energy supply rate, X p is the last time-slot, R c is the relationship of energy harvesting of last time-slot, g s and w s are the ratio between channel power gain-tonoise power transmitter and channel power gain-tonoise power ratio of link transmitter and receiver r p and R s is the instantaneous non-cooperative transmission rate.
The WHE circuit-equipped devices receive transmitted radio waves with its antennas and convert RF energy into DC energy source to supply it to sensor devices. In general, in broad, WHE is divided into two categories, namely, dedicated source and ambient source. 58 Furthermore, it is shown in Figure 5.

LQ or link efficiency computation
With the addition of residual energy, total energy and distance to SN, computation of end-to-end LQ is also an important factor in the proposed work, in order to keep QoS. LQEs play vital role in best route selection to the SN using different parameters of links. 59 Links in WSN communication are normally unreliable and weak. Different parameters are taken into account while computing LQ, such as hops' count, RSSI, SNR, LQI, packet error rate (PER) and packet reception rate (PRR). 54 In broad, LQEs are categorized into two classes such as hardware-based estimators, which includes RSSI, SNR and LQI, and software-based estimators, which includes PRR, risk priority number (RNP) and score. Algorithm 1 demonstrates the detailed procedure of LQE.
For link estimation and efficiency, we rely on hardware-based metrics of estimating LQ, which is provided by the physical layer, IEEE 802.15.4 standards. 60 For LQ prediction, RSSI, SNR and LQI are consideration as given below.
RSSI. In most of the new radio transceivers' circuit such as CC2420, the RSSI is an eight-bits integer value, which is read from RSSI register. Radio chips are providing RSSI value that is the strength of received radio frequency (RF) signal and P kt . 61,62 Same is the case of WSN, where relationship between RSSI values and distance plays vital role in ranging and positioning. 58 The value of RSSI is an average of the RSS at P kt arrival time. 63 The RSSI is very simple and cost effective localization technologies that depend on the value of RSSI for distance and location estimation. RSSI is the most common range-based measurement which guesses the distance of transmitter to a receiver using power of signals. 64,65 The RSSI can be formulated in the following equation where RSSI Val is 12 bits register and RSSI offset is equal to 245 dBm. RSSI ranges from 228 dBm to 2127 dBm. For better interpretation sometimes, mean of RSSI is taken into account, as shown in equation (17) where RSSI w is the mean of RSSI and N is the total number of calculated rssi i in window w.
SNR. SNR is the ratio of RSS to the strength of the background noise. To compute SNR, first RSSI of the received packet is recorded and then the background noise is measured. 66,67 It can also be defined as the ratio of the power of environmental noise to the power of useful signals and may be expressed using equation (18) SNR is expressed in decibels (dB) and may also be computed using equation (19) where P s represents the power of signal and N s represents the power of noise. Also, as in the definition of SNR that it first computes the RSSI of received signal and then background noise, which is expressed in equation (20) where RSSI dBm is the already calculated value in equation (15) or (16). Furthermore, the SNR of each successfully received P kt i is expressed by snr i and on the reception of sampling P kt , the receiver end computes the window mean of SNR -SNR w as given in the following equation A link with 20 dB or above is considered as very good, a link with SNR 12 dB is considered as good and a link with SNR between 5 and 10 dB can hardly considered as bad, average or good. 68 LQI. The LQI designates the quality of received signal calculated either energy detection (ED), SNR or combination of both. The value of LQI is very important for upper layers especially for network layer because routing protocol can take benefit of it. The quality of an IEEE 802.15.4 network's link can be predicted on the basis of the value of LQI. It can be formulated as given in the following equation where CORR is the hardware correlation considering value between 50 and 110 and a and b are the constants and its values depend upon the hardware links. Mean LQI calculation is highly appreciated in many literatures and claimed that it gives better results than normal LQI and can be computed in equation (23) where LQI w is the window mean of lqi k in (t 0 , t 1 ) and n is the number of successfully received packets.

Hardware-based triangle metrics
Hardware-based LQEs are extensively used metrics for checking of link efficiency. One of the main reasons behind it is low overhead as compared to softwarebased LQEs. These LQEs are built-in hardware chip (CC1101 and CC2420) and can be directly obtained from radio transceiver. 63,67 In this research to predict

end for
LQ, variance mean of the hardware-based LQEs (RSSI, SNR and LQI) is taken, which is named as 'hardwarebased triangle metric' and then this combined mean value of LQE is taken as input parameter in C:F. The idea of the mean of three metrics of LQEs has been taken from the literature. 68 The receiver estimates the variance of LQ (lq D ) to the origin using these equations Based on the value of distance lq D , the receiver guesstimates the LQ, which is detailed in equation (25) G = V À Good À Link, th good \lq D Good À Link, th avg ø lq D \th good Avg À Link, th bad ø lq D \th avg Bad À Link,

CF
The most important part of this proposed model is the computation and interpretation of C:F, which is a bit massive task and is carried out by SN, which does not have any memory or computational/processing constraints. C:F is an aggregated value of LQ, total energy (T :E), and nodes' distance from/to SN. C:F output is a numeric value that predicts and judges the significance of each node in communication. The higher the C:F value, the more appropriate and preceded candidate for becoming CLG, CLH and CN. Figure 6 illustrates this phenomenon. Furthermore, nodes which are selected as CLH, CLG and CN broadcast their assigned new role and stop P kt sensing role. Cost function (C:F) of each deployed nodes is computed using following parameters: 1. Residual energy (R:E) 2. Distance of each node from/to SN 3. End-to-end LQI 4. Total energy (T :E) = (residual energy + wireless harvesting energy (WHE)) Initially, residual energy of each node will be taken in consideration while computing C:F, but in later stages, total energy (T :E) will be taken into account. Equations (26) and (27) represent the computation of C:F at initialization stage with residual energy only and later stages with total energy and where a and b are the weighting factors (a + b = 1) used to tune the weight of energy and LQ. The assigned priority to each weighting factor in proposed scheme is given in the following equation:

Cluster formation phase
Cluster formation is an efficient way to minimize data transfer cost of large-scale WSNs. This phase is utilized to classify the network into hierarchal clusters. In this article, cluster-based routing is adopted, which enhanced lifespan and performance of WSN. Actually, competent and suitable clustering techniques have further enhanced network performance in terms of energy consumption, network lifetime, bandwidth, node throughput and routing delay. The proposed cluster-based routing scheme is divided into three-tier hierarchal model, namely, tier-1 is between CMs and CLHs (CMsàCLHs), tier-2 is between CLHs and CLGs (CLHsàCLGs) and tier-3 is between CLGs and SN (CLGsàSN). Figure 7 further describes this three-tier hierarchal cluster model/ scheme.
For cluster formation, different cluster algorithms are used, such as K-means (KM) and fuzzy-C-means (FCM), which are beyond the scope of this article. Each cluster in proposed scheme comprises CMs, cluster head, CLG and CN. Each of it plays their specific role that is described in the next section.

Selection of CN
CN is concerned to the security of proposed network model. It keeps CLH and CLG under inspection. These nodes use P kt monitoring strategy to prevent deliberate and malicious attacks such as Sybil, Wormhole and Sinkhole. If CLH and CLG do not forward more than a fixed number of P kts , then CN broadcasts message in cluster to stop responding to it and places the concerned CLH or CLG into blacklist. Algorithm 2 shows step-wise procedure of initialization, CLH, CLG selection and cluster formation.
Selection of CLG and CLH is based on the value of C:F but selection of CN is totally based on noncooperative and recurring game theory. 67,68 CN and CLH further enhance network lifespan and energy efficacy. Only CMs of CLH start campaign for becoming CN. This game is stated in the following equation where N represents the players, S represents the same strategy space and U represents the utility given to them. Set of strategy can be represented by equation (29) where CN represents the check-up node and CM represents the cluster member.
Either node may select only one strategy and will get a specific payoff, as process of this game can be labelled as a cost and payment model. Each node selects the strategy very carefully and tries to use less energy and capitalizes on their payoff. After taking assigning role of CN , it feel more responsibilities. Utility function is defined in the following equation where C cn and C cm are the cost of being either CM or CN . Consider two players joining the game and their payoff are shown in Table 2. Based on their payoff, consider that one player selects strategy CN , and then the other player will surly select CM strategy. The strategy combination (CN ,CM) take more payoff for the second player, that is The second player selects CN strategy, because the (CM,CN ) strategy pair obtains more payoff for the second player, that is However, if the order of the selection is changed, player 1 and player 2 still may select pair (CN,CM) and (CM,CN ). The payoff of selection will be as given in the following equation Same as in Nash equilibrium, one player will be CN and the other will be CM.

Performance evaluation of proposed solution
Numerous experiments have been carried out to judge the outcomes of the proposed protocol. The simulations of this study are conducted in NS3 tool. In total, 200 nodes of same residual energy are deployed over an area of 200 3 200 m 2 in 2D network. A single SN is placed outside of field area at a distance of 170 m. The details of the simulation parameters are shown in Table 3. The proposed protocol is compared with FUCARH, 38 ABC-SD, 39

Network lifetime
Network lifetime or lifespan means the total time of network from the initialization point till death of last node. It is one of the main factors to judge efficacy of any WSN protocol. The network lifetime tremendously increased compared with other related protocols due to embedded harvesting energy unit in proposed TBEERP and reduction in cluster head change as much as possible. In addition to it, the number of control P kts are greatly reduced which also caused longevity of network lifespan.
The supremacy of proposed system in terms of network lifetime over FUCARH, ABC-SD, ETLHCM and EAMR may be observed in Table 4 and in Figure 8. Especially, at round 500, nodes started dying in compared protocols but in our proposed system first node died at round 850. Similarly, almost all nodes die at round 1700 of compared schemes, but TBEERP still operated and lived up to round 1900. Hence, it shows that TBEER is much better in contrast to other contemporary protocols.

Residual energy
The energy at initial stage of a network or remaining energy of battery at the starting of each round is called residual energy. Energy dissipation in WSNs is directly proportional to network lifetime and its efficiency. Figure 9 presents residual energy analysis of proposed and other paralleled protocols. Figure 9 shows that residual energy of proposed system is more stable than competitive protocols. The results of residual energy usages are quite obvious, which are depicted in Table 5. Tabulated data show that residual energy of FUCARH and ABC-SD depleted before round 6000, residual energy of ETLHCM and EAMR totally drainage before round 7000, but residual energy of the proposed protocol operated even beyond 7000. Still 25 J of energy was present. The proposed system preserved and utilized network energy in better way as compared to other under-studied protocols.

Average energy consumption
The average energy consumption is the energy spent by each node in specific round. The pictorial form of energy consumption is shown in Figure 10. TBEERP shows much better results and high energy efficiency compared with other comparative algorithms. Table 6 further elaborates this comparison using textual data. From the results of Figure 10 and Table 6, it is clear that proposed protocol consumes less energy than FUCARH, ABC-SD, ETLHCM and EAMR. TBEERP defeated other protocols in this race because of having additional energy harvesting unit in each sensor, minimum shuffling of CH and low traffic overhead.

Number of alive nodes
As network lifespan is directly proportional to number of alive nodes. Main aim of this proposed protocol is   to keep alive network for a long time. The main reason behind it is the injection of WHE in our proposed model, which extends life cycle of each node participating in WSN. Hence, TBEERP outperforms all other four competitor schemes in term of number of alive nodes per unit time. Figure 11 presents that after round 2000 other protocol nodes start dying and this process become acute after round 5000. But from Figure 11, it is very obvious that the proposed algorithm wins this race with very distinct margin. At round 7000 (last round), all nodes of contemporary protocols die, except EAMR -15% nodes alive and proposed scheme -23% nodes alive till last round (Table 7).

Throughput
It is the successful delivery of packets from sensor nodes to the SN in unit time. High throughput means more efficient is the protocol. It is also one of the important measuring parameters to judge any routing protocol. To achieve high throughput in proposed scheme, CLG is introduced to act as a relay agent between cluster head and SN. It reduces the chances of packets loss which may occur in case of direct communication due to long distance. Figure 12 shows the result of throughput (bits/s) in which at initial stage almost all protocol are running with same pace and same throughput but then after round 4000 the proposed protocol gradually increases and surpasses all other protocols (FUCARH, ABC-SD, ETLHCM and EAMR) till last period of time (round). Tabulated information of throughput is shown in Table 8. Two metrics are used to calculate throughput: The amount of the delivered P kts received by SN at the end of simulation time and packet loss rate can be calculated via equation (34)  0  250  250  250  250  250  1000  200  218  224  230  237  2000  150  190  195  210  215  3000  120  100  170  180  190  4000  20  10  110  140  160  5000  5  4  70  90  120  6000  0  0  5  40  50  7000  --0  0  25 FUCARH: fuzzy logic-based unequal clustering and ant colony optimization-based routing hybrid; ETLHCM: enhanced three-layer hybrid clustering mechanism; EAMR: energy aware multi-hop routing; ABC-SD: Artificial Bee Colony-SD. Figure 10. Analysis of average energy consumption.  Figure 11. Analysis of total alive nodes.
Received P kts by sink node P Sent P kts to sink node ð35Þ where PL represents the packet loss.

Network stability
It may be defined as the duration till all sensor nodes stay alive in network or the duration before the death of first node in a network. This parameter is also referred as first node dies (FND) in some literatures. In WSN-based networks, it is one of the main judging criteria to check network efficiency. The values of network stability forecast network's future. It is directly proportional to network lifespan. Network stability period result of proposed scheme is shown in Figure 8 (network lifetime figures FND). Also, these results are listed in Table 4. Figure 8 and Table 4 show that the first node of proposed system died at round 850 which is much higher than 500 of FUCARH, 270 of ABC-SD, 230 of ETLHCM and 750 of EAMR, respectively. From Figure 8, it is clear that proposed system delays the death of first node, which means it performed better than others. High network stability of proposed algorithm is due to harvesting energy unit in each node, minimum number of CH shuffling and low overhead of control packets.

End-to-end delay
End-to-end delay means the time taken by a packet to travel from the source node to destination node (SN). In this research, it is highly emphasized to minimize end-to-end delay time and the results of Figure 13 and the data listed in Table 9 show the success ratio in this department. As compared to other peers, TBEERP showed minimum end-to-end delay time. The initial stage results of proposed protocol are same as other counterparts because of selection CLH, CLG and other computation such as election of CN. When selection is done, then the latency is minimized prominently, depicted at time 10,000 s. One of the reasons for minimized end-to-end delay is due to harvesting energy unit in CLH and CLG. Because of this supplementary energy, they continue their job for a long time without interruption with full momentum towards SN.

Conclusion
The IoT is considered as next generation of Internet or expansion of Internet and World Wide Web, where huge number of things will be connected and would allow direct M2M communication. The upcoming technology will be stuck around IoT paradigm and it will drive and automate whole system without the intervention of human being. In this research, the main focus Table 7. Alive nodes versus rounds.

Rounds
FUCARH ABC-SD ETLHCM EAMR Proposed   0  100  100  100  100  100  1000  100  100  90  100  100  2000  80  90  70  95  100  3000  62  85  55  90  93  4000  35  65  30  80  83  5000  20  25  10  60  70  6000  0  7  0  40  50  7000  -0  -15  23 FUCARH: fuzzy logic-based unequal clustering and ant colony optimization-based routing hybrid; ETLHCM: enhanced three-layer hybrid clustering mechanism; EAMR: energy aware multi-hop routing; ABC-SD: Artificial Bee Colony-SD. Figure 12. Analysis of throughput. was given to IoT-based WSNs and a sophisticated routing protocol for it. There are numerous problems to IoT-based WSNs ranging from general to specific problems. To overwhelm these issues, this work aimed to prolong network lifespan, improve throughput, increase number of alive nodes, decrease packet latency and packet loss, reduce energy consumption and further improvise encountering malicious nodes. To further tune the network lifetime in terms of energy, WHE unit is rooted in every sensors of proposed three-layer cluster-based WSN routing protocol. The proposed solution, TBEERP, is a three-tier clustering routing protocol with implanted security mechanism (CN) to encounter malicious activities of nodes and to send them into blacklist. The blacklisted nodes are no further part of communication in current round. The proposed algorithm is a centralized scheme, which spit out the role of cluster head and CLG based on the value of CF. The residual and total energies, distance to SN and LQ were the main parameters while computing CF of each node. Moreover, hardware-based LQEs are used to check link effectiveness and to further improve routing efficiency, as there is no need for extra computation or overburden because the link information is preexiting in PHY and MAC frames. At the end, excessive simulations have been carried out in NS3 to check efficacy of the proposed protocol. It showed splendid results and outperformed all others (FUCARH, ABC-SD, ETLHCM and EAMR) in terms of network lifetime, network throughput, average energy consumption, network stability and packet latency. The pictorial and textual data, which have been shown in section 'Performance evaluation of proposed solution' via graphs and tables, are portraying the supremacy of proposed protocols over it contemporaries in the above-said terms.

Declaration of conflicting interests
The author(s) declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.

Funding
The author(s) received no financial support for the research, authorship, and/or publication of this article.