1 Introduction

Wireless sensor network (WSN) which is comprised of different sensor nodes, monitors its surrounding [1, 2]. A sensor node is comprised of different components: sensor, processor and communication unit [3, 4]. Depending on application, WSNs might have other side components like mobility unit and energy harvesting unit [5, 6]. WSNs are deployed in a wide range of applications. Some of these applications include monitoring temperature, moisture, water level, pressure, operation of vehicles in roads, monitoring large structures like bridges, military and security application, remote health monitoring and many other applications [7]. Based on WSN, with the development of technology to insert smartness everywhere, devices have been proposed for connecting physical world and events space to cyber world where data is processed and decision is made. This development resulted in emergence of Internet of Things (IoT) [8,9,10]. On the other hand, with the development of technology in renewable energy resources context, energy harvesting WSN (EH-WSN) is proposed. These networks can be employed in larger applications [11, 12].

WSN has some challenges including short lifetime, high energy consumption, weak stability, complicated network management in large scale, and additional network overheads [13]. In wireless communication, data transmission consumes more energy compared to data processing. Therefore, one of the ways to increase network lifetime is to consider routing and clustering [14,15,16,17]. In clustering, nodes are divided into clusters. In each cluster, there is one cluster head (CH) and several cluster members (CMs). CMs obtain data from an environment and send them to their CH. CH aggregates data and then transmits them to a base satation (BS) [18, 19]. Clustering method has many advantages including scalability, balanced energy consumption and improving network lifetime [13, 20]. Advantages of clustering and classification of clustering features are described comprehensively in [21]. Existing clustering protocols are divided into dynamic, static and hybrid classes. In static clustering, clustering is performed once in the network. Advantage of this method is that overhead of clustering becomes minimum. However, main shortcoming of static clustering is that if clustering is not performed correctly, some nodes will die earlier than others. In dynamic clustering, clustering is performed at each round and each time, new clusters are produced. This method has high overhead but it prevents applying pressure on some nodes. In hybrid method, not only stability and network lifetime are improved but, also overhead can be reduced [22].

In the proposed protocol, clustering method is hybrid of static–dynamic and hybrid of distributed-centralized methods. In centralized clustering, BS clusters’ nodes are based on a general knowledge of network. In distributed clustering, nodes perform routing without any information about status of the network. In these methods, there are less overhead because no message is transmitted between nodes and a BS [23]. In a hybrid method, clustering can be performed while general knowledge of a network and overhead reduction are used.

Rest of this paper is organized as follows: Sect. 2 reviews previous work. Section 3 presents the proposed algorithm. Section 4 evaluates simulation results. Section 5 concludes the paper. Finally, Sect. 6 presents future works.

2 Literature review

Many researches have been conducted to improve energy consumption using protocols based on clustering algorithms. Hybrid energy-efficient distributed clustering (HEED) is one of the most well-known algorithms in WSN clustering [24]. This algorithm employs hybrid parameters of node energy and communication cost for selecting CH. Nodes with higher energy have higher chance to be selected as CH. Communication cost might depend on a node degree or inverse of a node degree. Distribution of CHs in HEED is a well performed operation. However, clustering is performed dynamically and overhead of this method is high. Various methods have been proposed based on HEED, for instance, in [25] condition for connection of CHs using asymptotically almost surely technique is more suitable and a tighter bound is also proposed for number of CHs. However, the proposed method is significantly different from HEED and the methods which are based on HEED like [25], for instance, size of clusters in HEED is equal while in our proposed method they are unequal. Intra-cluster routing of the proposed method is multi-hop while in HEED, it is single-hop. However, other differences can be seen in Table 1.

Table 1 Comparison of some of the clustering algorithms with our proposed method

Another method is fuzzy-logic-based clustering approach for WSNs using energy prediction [20]. In this method, LEACH architecture and an approach based on expected residual energy are used for dividing energy consumption among nodes. Accordingly, the method is called LEACH-ERE. In this paper, a fuzzy-logic-based clustering using energy prediction approach was proposed. This algorithm is implemented using distributed and dynamic forms; results indicate efficiency of the proposed algorithm. However, this algorithm uses single-hop routing which is not suitable for high-dimensional environments and its overhead is high.

Another method called hybrid game theory based and distributed clustering (HGTD) [18] was proposed in 2015. This algorithm was based on game theory. This protocol prevent two CHs to be next to each other, an iterative algorithm was proposed to select final CHs among tentative CHs. Like previous methods, overhead of this method was also high.

Fuzzy based unequal clustering (FBUC) method was proposed in 2014 [19]. In this algorithm, radius of nodes were determined based on fuzzy system with inputs of remaining energy and degree of nodes. CHs were selected based on energy level. Moreover, CMs join the CHs based on fuzzy system with distance from CH and CH degree are inputs of fuzzy system. Overhead was a challenge of this method.

Hybrid unequal clustering with layering (HUCL) protocol was proposed in 2015 [22]. HUCL was a hybrid of dynamic and static clustering methods. Clusters closer to BS were smaller. In this method, CHs were selected based on energy of node, distance from BS and number of neighbors. Moreover, data transmission to BS was in multi-hop form. In this algorithm, the CH which has no CM changes its status to CM and joins the nearest CH.

Energy-efficient overlapping clustering (EEOC) was proposed in 2016 [26]. Based on overlapping cluster formation mechanism, selected CHs were distributed uniformly. Nodes with proper energy in overlapping areas were selected as relay nodes considering distance. This mechanism reduces energy consumption in inter-cluster communication phase. This method does not consider distance of nodes from BS to calculate delaytime and radius.

In 2016, an improved energy aware distributed unequal clustering method (EADUC-II) was proposed [27]. In this method, clusters closer to BS were smaller. In order to determine competition radius of nodes, parameters like distance from BS, node energy and number of neighbors of nodes were considered. Although this method was hybrid, but it was not suitable for improving overhead.

A Boolean spider monkey optimization based energy efficient clustering (SMOTECP) protocol was proposed in 2017 [28]. In this protocol, different parameters like energy of nodes, distance of node from CH were considered. Purpose of this protocol was to optimize energy consumption through employing boolean spider monkey optimization (SMO). Energy consumption of CHs using threshold-based inter-cluster data transmission algorithm was reduced. Since this method was centralized, it is not suitable for high-dimensional environments.

In 2017, multi-clustering algorithm using fuzzy logic (MCFL) was proposed [29]. In this method, a multi-clustering algorithm based on fuzzy logic was proposed to reduce energy consumption and increase network lifetime. In this algorithm, nodes are clustered in different rounds using different algorithms. Selection of CH in some specific rounds was avoided which reduced overhead of control messages. Reducing overhead, reduces energy consumption and increases network lifetime. Despite improvements, overhead of this method was high.

A fuzzy-based hyper round policy (FHRP) was proposed in 2017 [30]. In clustering protocols like hybrid protocols, overhead cost of CH rotation is very high. However, this paper was proposed to eliminate this overhead. In FHRP, instead of each round, clustering was performed at the beginning of each hyper round which was comprised of multiple rounds. Length of a hyper round was not constant and it was calculated using fuzzy systems. Residual energy of node and its distance from BS were inputs of the fuzzy systems and length of hyper round was the output. The new approach has eliminated most of control messages and increased network lifetime. However, routing in this protocol is single-hop and hence, operational power drops for larger networks.

In this paper, it has been tried to carry out clustering with unequal cluster sizes in order to increase network lifetime and improve existing methods. Probability of a node to be selected as CH is formulated considering energy level of each sensor through offering a new mechanism for determining strategy. CMs send packets to the CHs through layered multi-hop routing and new assistance to CHs (ACHs) mechanism. Then, CH transmits packets to a BS through layered multi-hop routing. In routing, another mechanism is discretion license that prevents transmissions of incomplete(faulty) packets to a destination. Table 1 shows a summary and comparison of some of the clustering algorithms mentioned above with our proposed method.

3 The proposed approach

In this paper, a hybrid unequal energy efficient clustering (HEEC) is proposed for WSN. Sensor nodes are distributed in an environment randomly. Each node can operate as a CH or a CM. All nodes and BS are stationary and can adjust transmission power considering distance.

3.1 Network model

Energy consumption radio model is similar to the LEACH protocol [1]. WSN is considered to have N sensor nodes and a BS with infinite supply connected to the network. It is assumed that sensor nodes are distributed in an environment with M × M dimension. Energy consumption of transmitter is defined as in Eqs. (1) and (2) and energy consumption of the receiver is defined as in Eq. (3):

$$E_{TX} (i,K,d) = E_{elec} K + E_{fs} Kd^{2}$$
(1)
$$E_{TX} (i,K,d) = E_{elec} K + E_{mp} Kd^{4}$$
(2)
$$E_{RX} (i,K) = E_{elec} K$$
(3)

where K is the number of data bits and d is the distance between two nodes. Eelec(nj/bit) is the energy consumption of each bit when transmited or received. \(E_{fs} \left( {pj/bit \times m - 2} \right)\,\,{\text{and}}\,\,E_{mp} \left( {pj/bit \times m - 4} \right)\) is energy consumption of each bit for transmitter amplifier considering transmission distance. If distance between two nodes is shorter than d0 (refer to Table 3), energy consumption is obtained using Eq. (1) and if distance between two nodes is higher than d0, energy consumption is calculated using Eq. (2). Also, nodes can aggregate and integrate data packet.

3.2 Performance of HEEC

After distribution of nodes in an environment, handling phase is performed. In this phase, a message is broadcasted by a BS in the network. Based on received signal strength indicator (RSSI), nodes calculate their distance from the BS. Then, nodes send status messeage to the BS. The BS performs layering and determines clustering strategy. After handling phase, HEEC operations are divided into setup phase and data transmission phase. Setup phase is comprised of 5 sub-phases including: (1) calculating delay time and determining radius, (2) CH competition, (3) cluster formation, (4) computation of intra-cluster layer, and finally (5) constructing path to the BS. Data transmission phase is comprised of several major slot phases. Each major slot is comprised of several rounds and three other sub-phases including CH rotation, inter-cluster compare layer and constructing path to the BS. In order to better understand, performance of HEEC is shown in Fig. 1. Figure 2 also shows HEEC flowchart.

Fig. 1
figure 1

HEEC operation

Fig. 2
figure 2

Flowchart of HEEC protocol

3.3 Handling phase

This phase is divided into: (1) layering, and (2) transmission strategy determination sub-phases. In the first sub-phase, BS first calculates difference of furthest and closest node and divides it into 4 layers empirically. Length of each layer is calculated as dL=(dMax dMin)/4, where dmax is distance of farthest node form the BS and dmin is distance of closest node from the BS. Identity of a layer is sent to the nodes of that layer by the BS. Clustering is performed independent of layering. In the second sub-phase, in order to determine network strategy, if dL is greater than a threshold value, then the BS selects the first strategy. Otherwise, BS selects the second strategy. According to first strategy, if distance of nodes is long, then nodes require their neighbors’ information for clustering. Also, each node should inform its local information including energy status and its location to its neighbors. This results in clustering with better precision so that network lifetime is improved. In the second strategy, if nodes are located near each other, they do not require local information of neighbors for determining CH, because transmission distances are short. In this strategy, overhead of non-effective node messages are avoided. Algorithm 1 shows handling phase of HEEC protocol. Lines 6–17 of the algorithm 1, are related to layering and lines 18–22 refer to the determination of the transfer strategy by the BS.

figure c

3.4 Setup phase

As mentioned, setup phase includes 5 sub-phases. In the first sub-phase, nodes calculate their cluster radius based on Eq. (4):

$$R_{c} (i) = \left[ {1 - \alpha \left( {\frac{{d_{\hbox{max} } - d_{i,BS} }}{{d_{\hbox{max} } - d_{\hbox{min} } }}} \right) - \beta \left( {1 - \frac{{E_{rem} (i,r)}}{{E_{Max} }}} \right)} \right]Rl_{\hbox{max} } \times \lambda$$
(4)

where Rc(i) is radius of node i. RLmax is maximum competition radius for becoming CH. Erem(i,r) is the remained energy of node i at round r. EMax is maximum capacity of node energy. α and β are weight factors which might be between 0 and 1. Moreover, in upper layers, RLmax is multiplied by a determined coefficient like λ so that nodes close to BS have smaller radius and further clusters have bigger radius. Smaller radius in nodes close to BS causes the node selected as CH to have higher energy for receiving and transmitting data of further CHs to the BS.

In the following, nodes calculate their delay time to announce being CH. If the BS announces first strategy for nodes, each node shares its location and energy level with its neighbors before calculating delay time. When nodes identified their neighbors, they calculate average energy of their neighboring nodes. Average energy of neighbors is calculates using Eq. (5):

$$E_{Ave} (i,r) = \frac{{\sum\nolimits_{j \in NN(i,r)} {E_{rem} (j,r)} }}{{\hbox{max} (\left| {NN(i,r)} \right|,\varepsilon )}}$$
(5)

where EAve(i,r) is average energy of neighboring of node i. NN(i,r) is set of neighbor nodes. |NN(i,r)| is the number of neighbors. Each node calculates its delay time using Eq. (6):

$$delay\;time(i,r) = \left\{ {\begin{array}{ll} {\frac{{E_{Ave} (i,r)}}{{E_{rem} (i,r)}} \times \frac{1}{{\hbox{max} (\left| {NN(i,r)} \right|,\varepsilon )}} \times \theta \times \hbox{max} (\eta ,\varepsilon ) \times v_{r} \times t_{w} } \hfill & {\quad E_{Ave} (i,r) \le E_{rem} (i,r)} \hfill \\ {v_{r} \times t_{w} } \hfill & {\quad E_{Ave} (i,r) > E_{rem} (i,r)} \hfill \\ \end{array} } \right.$$
(6)

where, tw is time of second phase and vr is a random number between 0.9 and 1. η is number of times that node is selected as CH. ε is a very small number to prevent the result from becoming zero. θ is obtained using Eq. (7):

$$\theta = \sum\limits_{j \in NN(i,r)} {\frac{{\hbox{max} \left( {\frac{{E_{rem} (j,r)}}{{E_{Max} (j)}},\varepsilon } \right)}}{{1 - \frac{{d_{i,j} }}{{R_{c} (i)}}}}}$$
(7)

In Eq. (6), nodes with proper energy level have lower delay time and their chance of becoming CH is higher. Equation (7) also causes set of nodes which are located at the center of neighbors have higher chance of becoming CH. Moreover, this threshold looks to reduce total distance of nodes from CH and helps a node which has better energy compared to its neighbors, to become CH.

If the BS selects second strategy and nodes do not require to know status of their neighbors, delay time of each node is calculated using Eq. (8):

$$delay\,\,time(i,r) = \frac{{E_{init} (i)}}{{E_{rem} (i,r)}} \times \hbox{max} (\alpha ,\varepsilon ) \times v_{r} \times t_{w}$$
(8)

where Einit(i) is initial energy of node i.

Second sub-phase is CH competition in which based on delay time mechanism, a node with smaller delay time has higher chance of becoming a CH. In this phase, each node should wait until its delay time ends. If a node does not receive CH message from its neighbors during delay time, it announces being CH after its delay time ends and broadcasts a head message in the network. If a node receives a head message, it updates CH candidates table and cannot be selected as CH.

Third sub-phase is cluster formation, in which each node receiving a head message from CHs join a CH that requires minimum transmission energy. These nodes transmit join message which include energy level and distance from CH to its intent CH.

Fourth sub-phase is computation of intra-cluster layer. Here, a new associate CH (ACH) mechanism is proposed. At first, each CH performs intra-cluster layering. CH calculates average distance of nodes from itself and then calculates average energy of CMs. Nodes which have shorter distance compared to average distance are located in the first layer. The BS selects nodes which are located in the first layer and have higher energy compared to average energy of CMs as associate CHs. These nodes help the CH to consume less energy for receiving data. Moreover, it should be considered that nodes which are located in the first layer transmit data to CH directly and in single-hop. However, nodes which are located in the second layer, might transmit data to CH in multi-hop. CH, selects next hop of nodes located in the second layer among itself and ACHs such that less energy is required for transmission of CM. It should be noted that in data transmission scheduling, nodes which are further from CH, transmit data earlier. Thus, ACH nodes which receive data from a CM in the second layer, aggregate it with their own data and transmit it to the CH at their transmission turn. Finally, CH transmits scheduling information based on time-division multiple access (TDMA) including time of transmitting nodes and next hop information.

Fifth sub-phase is constructing path to the BS. In this phase, CMs might change their state to sleep mode. First, CHs of first layer broadcast a route message conveying their identity including energy status and number of member nodes in the network. It should be noted that CHs of first layer transmit data to the BS, directly. Nodes of second layer update their routing table upon receiving the message. Then, they transmit route message to upper layers. If upper layer CH receives a route message from a bottom layer CH, then it calculates cost of transmitting data to that CH. A CH selects next hop such that cost is minimized. This cost is calculated as in Eq. (9):

$$relay(i) = \left\{ {\begin{array}{*{20}l} {\left( {w_{1} \times \frac{{1 - E_{rem} (j,r)}}{{E_{Max} }}} \right) + \left( {w_{2} \times \left( {\frac{{d_{i,j}^{k} }}{{d_{i,BS}^{k} }} \times \frac{{d_{{j,nexthop_{j} }}^{k} }}{{d_{j,BS}^{k} }}} \right)} \right)} \hfill & {\quad if\,\,E_{rem} (i,r) \ge E_{TX} (i,l,d_{i,j} )\,\,and\,\,E_{rem} (j,r) \ge E_{TX} (j,l,d_{j,nexthopj} ) + (E_{RX} (j,l) \times (M(j) + 1))} \hfill \\ {Inf} \hfill & {\quad otherwise} \hfill \\ \end{array} } \right.$$
(9)

where dij and dj,nexthoj are distance between CHs i and j and CH j and its next hop. ETX(i,l,di,j) is the energy required for transmitting l bit data from CHi to CHj where their distance is di,j. ETX(j,l,dj,nexthopj) is the energy required to transmit l bit data from CHj to next hop, where their distance is dj.nexthopj. ERX(j,l) is the energy required to receive and aggregate l bit data for CH j. M(j) is the number of nodes which are a member of CH j. w1 and w2 are weight factors such that (w1+ w2= 1). In addition, effect of w1 is considered to be more than w2 such that a CH is selected which has more suitable energy. K is distance impact. If distance between two CHs is more than the threshold distance (do), k = 4, otherwise k = 2. After each CH selects its next hop then it sends its route reply message to next hop CH. If a CH in an upper layer does not receives a route message from CH in the bottom layer, it performs transmission to the BS, directly. Then, data transmission is performed based on constructed path. Algorithm 2 shows setup phase in HEEC. In algorithm 2, lines 3–17 correspond to first sub-phase, calculating delay time and determining radius. Lines 19–29 and lines 30–39 correspond to second and third phase,respectively. Fourth sub-phase, computation of intra-cluster layer, is represented in lines 40–45. In this sub-phase, CH divided CMs into two layers. Nodes which are in the first layer and their distance from CH is small and their energy is higher than the average energy of nodes are selected as ACH and scheduling is formulated such that further nodes transmit data sooner. Then, scheduling is broadcasts. Lines 46–62 represent constructing path to the BS sub-phase.

figure d

3.5 Data transmission phase

Data transmission phase is comprised of multiple major slots. Each major slot is comprised of multiple rounds and three sub-phases including CH rotation, computation of intra-cluster layer and constructing the path to the BS. Each sub-phase is investigated in the following.

3.5.1 Round

Each round is comprised of two intra-cluster data transmission and inter-cluster data transmission. In the first phase, nodes transmit their data to BS based on TDMA. In the second phase, CHs transmit their data to the BS based on the constructed path. In this phase, the protocol uses carrier-sense multiple access (CSMA) to transmit data. In data transmission phase, a new approach is proposed for data transmission called discretion license. The purpose is to reduce invalid transmission and save energy by correct prediction. In this method, a node can transmit data only when discretion license is calculated. To this end, each node calculates energy consumption for this transmission. Transmission discretion license is verified when energy level is higher than the amount required for transmission. This way, node transmits packet. If node cannot find a destination with transmission allowance, it ignores transmission and the packet is lost without consuming energy. This way, transmission which may cause death of a node and make energy level decrease to zero, is prevented; therefore, imperfect transmissions are prevented. Inter-cluster data transmission and intra-cluster data transmission are performed this way. The important point is that discretion license is performed by the node completely in real-time and autonomous. Each node decides in real-time whether to transmit or not. In fact, discretion license is not associated to routing and layering.

Algorithms 3 and 4 show intra-cluster data transmission and inter-cluster data transmission in HEEC. In algorithm 3, a node is in ACH, CH or CM. If node is CM, it must send its data to ACH or CH according to the schedule. Lines 4 –18 of algorithm 3 correspond to CM. If node is ACH, it must operate according to TDMA-msg and if it is relay, it must receive and aggregate data from nodes of layer 2 and send their data to CH. Lines 19–29 correspond to ACH. If node is CH, data should be received during intra-cluster data transmission. In algorithm 4, CM and ACH nodes sleep and only CH nodes transmit data to BS. According to sub-phase 5, constructing path to the BS is performed in setup phase. CH next hop like i might be CHj or BS. Accordingly, discretion license is performed autonomously by the CH.

3.5.2 CH rotation

Except last major slot, at the end of each major slot, there is one CH rotation phase. In this phase, all CMs send a message including energy status to the CH. CH selects a node which has higher energy as CH for the next round and changes its status to normal node. Then CH broadcasts all information of new CH and cluster to CMs.

3.5.3 Inter-cluster compare layer and constructing path to the BS

Inter-cluster compare layer and constructing path to the BS are applied after CH rotation. These sub-phases are sub-phases 4 and 5 of setup phase. In this sub-phase, new CHs perform computation of intra-cluster layer and select new ACH and transmit TDMA scheduling message. Moreover, CHs explore a new path to the BS.

figure e
figure f

4 Simulation results and evaluation

In order to evaluate the proposed HEEC protocol, it is compared with LEACH-ERE (2012) [20], HUCL (2015) [22], EADUC-II (2016) [27] and FHRP (2017) [30]. Simulations are performed for four different scenarios which can be seen in Table 2. MATLAB 2014 is used for simulation. Number of live nodes and average energy of nodes, load balancing, stability, first node death (FND), half node death (HND), last node death (LND) and throughput are evaluated. Simulations are performed more than 50 times for each scenario and average results are described.

Table 2 Scenarios for simulating the proposed algorithm

4.1 Simulation parameters

Some of the simulation parameters are described in Table 3. Moreover, some of the important simulation parameters are determined through different simulations. It should be mentioned that based on WSN application, values of parameters can be determined. Focus of this paper is to improve FND and stability period. In order to determine number of rounds in a major slot and number of major slots in a data transmission phase, simulation is carried out 10 times and average results are considered. According to Fig. 3, number of rounds and number of major slots is 6 because in different simulations, better average FND is obtained. Thus, in a major slot, there are 6 data transmission rounds, then CH rotation is performed. In addition, in a data transmission phase, data is transmitted to the BS 36 rounds and after each 36 round, setup phase is performed again.

Table 3 Parameters used for simulation
Fig. 3
figure 3

FND under different rounds in different major-slot at data transmission phase for scenario1 (Rlmax = 100 and initial energy = 0.5–1.5 J)

Another important parameter in determining strategy is distance threshold. The BS decision is based on this threshold and distance between farthest and closest node to the BS and LR value in Eq. (4). Threshold value is considered half the maximum node radius (Rlmax/2). Thus, whenever LR is greater than Rlmax/2, nodes share their information with their neighbors to perform clustering more precisely.

4.2 Strategy determination

In 50 different simulations for each scenario, results show that in the scenario 1, the BS has used second strategy in all simulations. In other words, in none of simulations of the first scenario, neighbor’s information were not used for clustering. Considering distribution of nodes in the network and location of the BS at the center of network, pythagoras theorem can be used to infer that difference between furthest and closest node to the BS is reduced (considering status of nodes in worst case is 141 m). In all simulations, LR is less than Rlmax/2. In the scenario 2, condition is different. The BS is at a corner and difference between furthest and closest node to the BS is high (approximately diameter of perimeter ~ 282 m). Value of LR increases. Results show that in all simulations, the BS uses first strategy. Accordingly, in the second scenario, HEEC uses neighbor’s information for clustering. Condition is different in the scenarios 3 and 4. The BS is located outside of the network area. Simulation results show that in 50 different simulations, the BS has used first strategy 23 times and second strategy 27 times for scenario 3, and in the same way 36 times and 14 times, respectively for scenario 4. Considering distribution of nodes and distance between closest and furthest nodes, the BS selects proper strategy.

4.3 Network stability and network lifetime

Tables 4, 5, 6, and 7 show network stability period and lifetime including FND, HND and LND of protocols in the first, second, third and fourth scenarios. In all four scenarios, the proposed protocol outperforms HUCL, EADUC-II and LEACH-ERE. Compared to FHRP in scenarios 2, 3 and 4 in which distance of the BS from nodes is higher, HEEC outperform FHRP in terms of FND, HND and LND. This is because the FHRP is designed single-hop to reduce overhead of CH rotation and routing control messages. Thus, in large environments especially in a 500 × 500 environment which is closer to real environment, its efficiency and stability is lower compared to HEEC. It should be noted that HEEC is multi-hop both in intra-cluster and intrer-cluster transmission and it is designed for large and real environments. In the first scenario where the BS is at the center, nodes are close to it and multi-hop transmission would not be effective. However, even in this scenario, HEEC is more stable than FHRP. Since HEEC has CH rotation overhead and multi-hop routing overhead, its energy saving is lower than FHRP. However, our proposed method has performed well in four different environments with high stability. Adaptability of this method is the results of determining strategy after distribution of nodes in the environment. Obtained results show that the proposed protocol has delayed measures and transmit more packets on the event of these measures. Increase in stability is due to the low energy nodes not selected as CH and hence energy consumption is divided between nodes during simulation in a balanced manner.

Table 4 Simulation results of stability and life time in scenario #1
Table 5 Simulation results of stability and life time in scenario #2
Table 6 Simulation results of stability and life time in scenario #3
Table 7 Simulation results of stability and life time in scenario #4

4.4 Average number of alive nodes

Figure 4 describing the number of live nodes during simulation. results show that HEEC outperforms other protocols and it has increased average number of live nodes during simulation. This is because the proposed protocol balances energy consumption among different nodes and prevent nodes death.

Fig. 4
figure 4

The number of alive nodes during the network lifetime. a scenario #1, b scenario #2, c scenario #3, d scenario #4

4.5 Average energy of nodes

Figure 5 shows average energy of live nodes during simulation. It can be inferred from the results that by reducing network overhead, load balancing improvement in the proposed method has balanced energy consumption. In the proposed protocol, energy consumption is divided among nodes by determining proper CH. Moreover, multi-hop transmission is used to reduce energy consumption. Moreover, discretion license policy of the proposed protocol prevents unsuccessful transmissions, maximum energy saving and increases average energy. Compared to FHRP, average energy of alive nodes in scenarios 1 and 4 is lower due to two reasons: (1) FHRP has lower overhead compared to HEEC especially because CH rotation and routing control messages do not exist in this protocol. Therefore, in the first scenario, average energy of alive nodes is better. (2) In scenario 4, high stability of HEEC prevents death of nodes. For instance, FND of HEEC in this scenario is 2548.7% better than FHRP. Therefore, nodes with bad energy exist in the network and affect average energy of alive nodes.

Fig. 5
figure 5

Average energy of alive nodes during the network lifetime. a scenario #1, b scenario #2, c scenario #3, d scenario #4

Figures 6, 7, 8 and 9 show average energy of nodes in simulation of scenarios 1–4. In all four scenarios, nodes are heterogeneous. Therefore, difference between energy of nodes is obvious. However, it can be seen that by executing HEEC and focusing on load balancing, energy level of nodes become closer to each other. It can be seen that energy consumption among nodes is balanced.

Fig. 6
figure 6

Load balancing in scenario #1

Fig. 7
figure 7

Load balancing in scenario #2

Fig. 8
figure 8

Load balancing in scenario #3

Fig. 9
figure 9

Load balancing in scenario #4

On the other hand, one of the main purposes of the proposed method is to reduce overhead through reducing control messages in the network. Figure 10 shows total energy consumed for control messages. These figures show that the proposed protocol and FHRP has consumed less energy for control messages. This finally increases network lifetime. LEACH-ERE protocol is implemented dynamically and as can be seen, its control message overhead is high. HUCL and EADUC-II are hybrid protocols which have reduced control message overhead and this energy saving has increased network lifetime.

Fig. 10
figure 10

Total Energy consumption for control message. a scenario #1, b scenario #2, c scenario #3, d scenario #4

4.6 Throughput

Figure 11 shows average of generated packets during the network lifetime; all of them indicate that the proposed protocol is more efficient. This method has generated and transmitted more packets during simulation. This increase in throughput is due to balanced energy consumption, stability increase and improvement of number of available nodes.

Fig. 11
figure 11

Throughput. a scenario#1, b scenario#2, c scenario#3, d scenario#4

Loss packets are those which are imperfect or have not been received at the destination during data transmission. Calculating number of lost packets is an important parameter. Packets which cannot be guaranteed to be transmitted successfully create many challenges like increasing overhead. On the other hand, preventing transmission of this packet might result in successful transmission of this packet in next rounds. In order to reduce transmission of invalid packets, a new method called discretion license is used. Since each node investigated its current energy and energy required for transmission before each transmission, the proposed protocol guarantees efficiency and quality. Main point is that loss packets in HEEC do not consume energy at the origin and this might improve network lifetime. Tables 8, 9, 10 and 11 show constructed packets, average lost and invalid packets and percentage of lost packets at different times. As can be seen, the proposed protocol has minimum number of lost packets compared to other two methods. In scenario 4, LEACH-ERE selects cluster head at each round, hybrid protocols, EADUC-II, HEEC and HUCL select cluster head every other round and CH rotation is performed in the meantime to prevent loss of CH and packets by sharing CH load. However, the other hybrid protocol, FHRP does not perform CH rotation to eliminate overhead. Considering FHRP algorithm, if network load is on a specific CH at the beginning of long rounds, stability is decreased and a large volume of packets are lost especially for networks with large dimensions.

Table 8 Average packet loss and average throughput for scenario #1
Table 9 Average packet loss and average throughput for scenario #2
Table 10 Average packet loss and average throughput for scenario #3. (0.0% means percentage of lost packets is negligible)
Table 11 Average packet loss and average throughput for scenario #4. (0.0% means percentage of lost packets is negligible)

4.7 Analysis of novelty

The proposed protocol has improved network performance well. Important reasons of such improvements in the proposed protocol are as follows: (1) Selecting suitable CHs considering energy levels and status of neighbors. Using a new mechanism for clustering strategy considering distribution of nodes in the network. (2) Using unequal clustering and determining optimal radius of nodes to overcome hotspot problem in inter-cluster multi-hop routing. (3) Using hybrid static–dynamic clustering and eliminating maximum control messages to reduce overhead and increase stability simultaneously. (4) Using hybrid distributed-centralized clustering for layering nodes in inter-cluster transmission and reducing overhead. (5) Using discretion license in data transmission to prevent unsuccessful transmissions and reduce energy consumption. (6) Using multi-hop routing based on inter-cluster layering and offering ACH nodes mechanism to help the clusterhead and distribute load of clusterhead among multiple nodes. (7) Using energy-based multi-hop routing based on intra-cluster layering.

Accurate design of the protocol improves its performance significantly. In order to investigate the protocol accurately, Fig. 12 shows an example of clustering in scenario 1–4 by HEEC. Green nodes represent CMs, cyan nodes represent ACHs and blue nodes represent CHs. As can be seen in these figures, presence of ACH nodes along with CHs reduces overhead of CHs. Many of CM nodes are far from CH and existence of ACHs reduces consumption of CMs. Moreover, clusters close to the BS are smaller such that inter-cluster multi-hop routing is performed with maximum efficiency.

Fig. 12
figure 12

Sample of clustering graph formed by HEEC. a scenario #1, b scenario #2, c scenario #3, d scenario #4

5 Conclusion

WSN has limited energy resources. In this paper, a hybrid unequal energy efficient clustering and layered multi-hop routing are proposed for WSN. Here, clustering is performed through a hybrid of distributed and centralized method. BS performs layering and determines protocol strategy for using neighbor’s information in clustering. Routing among the nodes, CH and BS, is formulated based on multi-hop routing with inter-cluster and intra-cluster routing. In this method, overhead and energy consumption are reduced through eliminating excess control messages. Moreover, efficiency and quality of data transmission is ensured using discretion license. Results show that HEEC can improve stability in first to four scenarios compared to HUCL, EADUC-II, LEACH-ERE and FHRP.

6 Future research

In recent years, with the development of technology, IoT has emerged. Energy-efficient communication in IoT-based on wireless nodes in large-scale systems is a key challenge [10]. Our future plan is to improve this protocol to save energy in this environment. In future works, we intend to consider energy-harvesting nodes which guarantee energy saving and a network with long life-time.