1 Introduction

A Wireless Sensor Network (WSN) consists of a large number of tiny devices called sensor nodes [1]. These Nodes are deployed randomly in a geographical area. Their roles are to sense, collect, aggregate and send data between each other or to a base station (BS). This communication costs important energy consumption. On the other hand, sensor nodes use batteries as power sources that are limited resources. In addition, this power source is usually not replaceable or rechargeable. Hence, the need to extend the lifetime of nodes and minimize energy consumption is necessary. Due to these energy constraints, many routing protocols [2, 3] have been designed to achieve the energy efficiency in WSN especially the hierarchical routing protocols. In these protocols, the network is divided into a number of clusters. In each cluster, there is only one node that communicates with the BS called Cluster Head (CH). By selecting a CH, the routing overhead of not CH nodes is reduced since these nodes have only to send data to CH. These protocols use data aggregation and fusion in order to reduce the number of transmitting messages to the BS. And furthermore, all nodes have a chance to be a CH [3, 4]. On the other hand, inserting a percentage of heterogeneous nodes in the network is an efficient way to prolong the network’s lifetime. In fact, Heterogeneous Wireless Sensor Networks (HWSNs) [5, 6] are very much useful in real deployments because they are closer to real life situations. This paper presents an extended version of the work published in [7]. We extend our previous work by three principal axes. First, we insert some heterogeneous sensor nodes in the network instead of using only homogeneous nodes. Then, we divide the network area into regions with the aim to reduce the energy consumption and hence prolong the network’s lifetime. Finally, we locate the BS in the center of the sensing field. Later in the paper, simulations will show good results. The rest of the research work is organized as follows. Related works are presented in Sect. 2. Section 3 describes and explains our proposed protocol. Simulation results are shown and discussed in Sect. 4. We conclude in Sect. 5.

2 Related work

Over recent years, various hierarchical protocols and algorithms are developed to enhance the energy efficiency in WSNs. In this section, we give an overview of some of them. Low Energy Adaptive Clustering Hierarchy (LEACH) has been introduced in [8] to reduce power consumption. LEACH divides the network into clusters and only one node in each cluster can be selected as a CH in every round. The CH communicates directly with the BS to send data and uses data aggregation techniques that reduce energy consumption and prolong the lifetime of the WSN. The reference [9] proposes a new approach based on LEACH and covers the CH selection phase. In fact, the proposed algorithm calculates the center point between the sensor node and the Base Station. Then, the node chooses the closest CH to the center point and gets bound to it to form clusters. In reference [10], the authors focus on selecting CH to save energy consumption and lifetime of the network. They consider the remaining energy of nodes and give analysis and simulations when the BS is inside or outside the network area. Optical-LEACH (O-LEACH) is an improved version of LEACH. It was introduced in [11] as a clustering hierarchy, an optical and adaptive protocol that minimizes energy consumption. In this reference, the node should have current energy greater than ten percent to become a CH. The reference [12] calculates a new threshold which is based on node energy, the distance between sensor nodes and BS, the distance between CH and BS. The analysis of simulation results proves that this new algorithm is better in term of balancing the node energy and prolonging the network lifetime. In the reference [13], the authors propose a new algorithm that firstly calculates the optimal cluster number by considering location adaptability and data aggregation rate. Secondly, they present a new threshold based on remaining energy, initial energy, the average energy consumption, and node degree to select CH. Thirdly, a self-adaptive uneven clustering algorithm is proposed that takes a node degree into consideration and solve the “hot spot” problem. And finally, they propose a solution to solve “the isolated node problem”. In [7], we have proposed a new approach for selecting CH based on LEACH protocol for the homogeneous WSN. Since LEACH does not take into account the remaining energy of the node and the distance between the node and the BS in choosing the CH. In our new algorithm, the selection of CH is based on three factors: residual energy, the distance between the CH and the sink and the number of neighbor nodes within the cluster range. Thus, elected CH must have at the same time high residual energy, a maximum number of neighbors and finally a low distance to the sink. By considering these factors, energy consumption is reduced and the lifetime of the network is prolonged. In [14], the authors have introduced the heterogeneity by developing the Stable Election protocol (SEP) which is based on two levels of heterogeneity. In SEP protocol, sensor nodes are divided into advanced nodes and normal nodes. The advanced nodes represent an m fraction of the total number of nodes n in the network and are provided with an additional energy “a” compared to normal nodes. So the initial energy for normal nodes is \(E_0\) and for advanced nodes is \(E_0*(1+a)\). Like Leach protocol, CHs election in SEP is done randomly on the basis of thresholds of each type of node. Nodes sense data and transmit it to the associated CH which convey it to BS. Distributed energy efficient Clustering (DEEC) has been elaborated in [15] for heterogeneous wireless sensor networks. In DEEC, the probability to select a cluster head is based on the ratio of residual energy and the average energy of the network. The rotating epoch for each node depends on its initial and residual energy. The advanced nodes that have the highest initial energy have more chances to become CHs than the normal nodes that have the lowest initial energy. Hence, DEEC protocol can increase the lifetime of the network, but it has a major shortcoming: it penalizes the advanced nodes when their remaining energy decreases up to the order of the normal nodes which leads to the death of these advanced nodes quickly. Zonal-Stable Election Protocol (Z-SEP) has been proposed in [16]. It is a clustering algorithm based on dividing the network to zone for heterogeneous wireless sensor networks. Z-SEP considers two types of nodes: advanced and normal nodes. The advanced nodes which have the highest initial energy are located at corners far from the base station. However, the normal nodes which have the lowest initial energy are placed in the middle near to BS. In this case, the normal nodes transmit directly their data to BS and the advanced nodes transmit data via CHs.

3 Proposed work

In this section, we provide a description of our proposed protocol. First, we will introduce the network model used in our work and explain the strategy of sensor nodes deployment, and then the approach is used to select CHs. Finally, we will present our energy model.

3.1 Heterogeneous network model

We consider a heterogeneous wireless sensor network of n nodes with two levels of energy heterogeneity. Hence, we have two types of node: advanced and normal nodes. We assume that “m” is the fraction of the advanced nodes and this type of nodes has “a” more energy than normal nodes. Thus, we have “\(n*m\)” advanced nodes with initial energy equal to \(E_{adv} = E_0*(1+a)\). Then, we have “\(n*(1-m)\)” normal nodes that have \(E_0\) as initial energy. The total initial energy of our HWSN is:

$$\begin{aligned} E_{tot} = n \cdot (1+ma) \cdot E_{0} \end{aligned}$$
(1)

3.2 Node deployment strategy

In our work, we have assumed that the base station is static, located at the center of the sensing area and its location is known to each node. Also, sensor nodes are deployed randomly and are static after deployment. Besides, we have divided the network area into two regions (Reg-1 and Reg-2) as shown in Fig. 1.

Fig. 1
figure 1

The proposed network architecture

We have assigned the normal nodes, which have the lowest initial energy, to the Reg-1 and the advanced nodes, which have the highest initial energy, to the Reg-2. The division of the network into zones is based on the distance between the deployed nodes and the base station and the availability of the nodes according to their remaining energy. In fact, the energy consumption increases when the distance to BS increases. That is why the Reg-1 which is the closest one to the BS contains the normal nodes and Reg-2 contains the advanced nodes. Consequently, normal nodes can transmit their data directly to the BS without going through a CH. But the advanced nodes use the clustering technique to select CHs and form clusters. In this way, all nodes from each cluster send data to their own CH then each CH sends the collected data to the BS. Dividing the Reg-2 into clusters helps to efficiently manage the data transmission and increase the lifetime of advanced nodes. Furthermore, the proposed scheme balances the energy consumption of the network, provides an efficient coverage and extends the network’s lifetime. On the other hand, this scheme can be deployed for border surveillance or monitoring which is an application of WSNs and its main issue is how to minimize energy consumption to prolong the lifetime of the network. Consequently, our proposed scheme can be a solution in such application.

3.3 Cluster head selection approach

In the literature, there are several algorithms to select Cluster Heads. The classic and most famous ones are the Bully algorithm [17] and LEACH [8]. The bully algorithm was first presented by Garcia Molina [17]. It is used for dynamically selecting a leader by using the process ID number. The process with the highest process ID number is elected as the leader process. The big problem of this algorithm is the high number of messages exchanged between the nodes due to the broadcasting of election and OK messages. This leads to additional energy consumption. Furthermore, the bully algorithm doesn’t consider any criterion of the node (e.g. the remaining energy, the distance to the base station, etc.) to select CHs. Also, Low Energy Adaptive Clustering Hierarchy (LEACH) which is a distributed clustering protocol divides the network to clusters and only one node (CH) in each cluster is the leader and it changes each round. CH communicates directly with the BS to send data and uses data aggregation technique what reduce energy consumption. The main shortcoming of LEACH is the random selection of CH that is applied to all sensor nodes without taking into account any factor. Due to the limitations of these algorithms and especially, the neglect of certain essential factors in the selection of CHs, we have used the approach developed in [7] to select CHs. This approach considers three essential factors to calculate the threshold of CH selection. These factors are the distance between the node and the BS, the residual energy and the number of neighbor nodes within the cluster range. Thus, nodes having at the same time high residual energy, short distance to the sink and several neighbors are chosen as CHs. The threshold T is written as follows:

$$\begin{aligned} T(i)=\left\{ \begin{array}{lc} \left( \frac{(P * cost(i))}{(1- P*(rmod(\frac{1}{P})))}\right) &{}\quad if (i \in G)\\ 0&{}\quad otherwise \end{array}\right. \end{aligned}$$
(2)

where P is the probability to become a cluster head, r is the current round and G is the set of nodes that have not been CHs in the last 1 / P rounds. The cost function is expressed as:

$$\begin{aligned} cost(i)= \left( \alpha *\left( \frac{E_{rem}(i)}{E_{init}}\right) + \beta *\left( \frac{N_{nb}(i)}{N_{alive}}\right) + \gamma *\left( \frac{D_{toBS}(i) - D_{toBSmin}}{D_{toBSmax} - D_{toBSmin}}\right) \right) \end{aligned}$$
(3)

where \(E_{rem}\)(i) is the remaining energy of node i, \(E_{init}\) is the initial energy, \(N_{nb}(i)\) is the number of neighbors of node i, N alive is the number of alive nodes, \(D_{toBS}(i)\) is the distance between the node i and the BS, \(D_{toBSmin}\) is the distance between the closest node to the BS and the BS and \(D_{toBSmax}\) is the maximum distance to the BS. \(\alpha \), \(\beta \) and \(\gamma \) are weight parameters between 0 and 1 that are determined through the Analytic Hierarchy Process (AHP) method.

In addition, we have added some conditions to the algorithm in order to distribute the energy load evenly among the advanced nodes. Firstly, CHs are not fixed in each round. For example, if the current round is r and P is the probability to become CH, the nodes that are CHs in the round r cannot be CHs for the next \((\frac{r+1}{P})\) rounds. Thus, the chance of the remaining nodes, which are able to become CHs, is increased. On the other hand, we have taken into account that there is no CH in the range of another CH and if this case arises, only the node that has the high remaining energy is selected as a CH. In this way, we avoid selecting CHs that are close to each other. Therefore, the energy load is spread between all the advanced nodes in the Reg-2 and the lifetime of the network can be increased. After selecting CHs in Reg-2, the remaining advanced nodes have to choose its cluster for each round. The choice of nodes is based on the distance between the node and the CH. Nodes opt for the closest one and get bound to it to form clusters.

3.4 Flowchart of our proposed protocol

The main steps of our proposed protocol are explained in the flowchart of Fig. 2.

Fig. 2
figure 2

Flowchart of the proposed approach

The first step of our algorithm is to divide the network area to the region, then assign nodes to regions according to our proposed strategy of deployment as described in Sect. 3.2. Then, rounds begin. In each round, normal nodes of Reg-1 sense the area and transmit their data directly to the BS. For Reg-2, each advanced node chooses a random number between 0 and 1. If this number is less than the threshold defined in Eq. 2, the node becomes a CH. After CH selection phase, each CH broadcasts its advertising messages to the remaining advanced nodes to let them choose the nearest CH and form clusters. The choice of remaining sensor nodes is based on the signal strength of the received broadcast messages. Once clusters are formed, the CH creates a time division multiple access (TDMA) schedule and informs other sensor nodes when it can transmit. Nodes member sense and transmit their data to CHs in their own time slot and their radio can be turned off. The only CH must keep their radio on to receive all data from nodes. Finally, CHs aggregate the received data and transmit it to the BS.

3.5 Energy model

In our research, we have used the same energy model as the traditional LEACH [6], as shown in Fig. 3.

Fig. 3
figure 3

The radio energy consumption model

Note that \(E_{elec}\) is the energy consumption per bit of running transmitter or receiver circuitry, k is the number of bits, \(\epsilon _{fs}\) and \(\epsilon _{mp}\) are proportional constant of the energy consumption for the transmit amplifier in the free space channel model (\(\epsilon _{fs}\) . k .\(d^2\) power loss) and multipath fading channel model (\(\epsilon _{mp}\) . k .\(d^4\) power loss), respectively and d is the distance between transmitter and receiver. Thus we can deduce the energy consumed to transmit k bits along a distance d through a free space channel model is:

$$\begin{aligned} E_{Tx}(k,d)=E_{elec} * k + \epsilon _{fs} * k * d^2 \end{aligned}$$
(4)

Or multipath fading channel is:

$$\begin{aligned} E_{Tx}(k,d)=E_{elec} * k + \epsilon _{fs} * k * d^4 \end{aligned}$$
(5)

And the energy to receive these bits is:

$$\begin{aligned} E_{Rx}(k) = E_{elec} *k \end{aligned}$$
(6)

4 Simulations and numerical results

In this section, simulations are performed via Matlab software. We have compared between our proposed protocol and three other protocols: LEACH [8], SEP [14], DEEC [15], ZSEP [16] and the approach proposed in [7] using parameters listed in Table 1.

Table 1 Parameters system

As shown in Fig. 4, we consider an HWSN with distributed sensor nodes by region in \(100 \times 100\) network field. Normal nodes appear in green, advanced nodes in red. The BS is set at the center of the sensor area and appears in black dot.

Fig. 4
figure 4

Initial wireless sensor network

4.1 Performance metrics

In order to evaluate the performance and efficiency of our proposed protocol, we focus on:

  • The number of dead nodes;

  • The throughput (the number of packets sent to BS);

  • The stability period;

  • The network lifetime;

  • FND, HNA and LND: are respectively the first dead node, the half dead nodes and the last dead node.

4.2 Simulation results

Figure 5 illustrates the number of dead nodes per round in the network and a comparison between LEACH, New approach_ENASE, SEP, DEEC, ZSEP and our proposed protocol. We can see that our protocol outperforms the other protocols. Furthermore, we represent the Table 2 which provides the FDN, HDN and LDN for each protocol. From these results, we can clearly conclude that our proposed protocol beats the other protocols in term of the first dead node and the last dead node.

Fig. 5
figure 5

The number of dead nodes per round

Table 2 FND, HND and LDN

Figure 6 describes the number of packets sent to the BS for each round and these results confirm that the throughput of our proposed protocol is far better than the rest of the protocols.

Fig. 6
figure 6

The throughput per round

Figure  7 focuses on the stability period of LEACH, New approach_ENASE, SEP, DEEC, Z-SEP and our proposed protocol. When comparing these bar graphs, we can note that the stability period of our proposed is longer than LEACH by 90% , New approach_ENASE by 85%, SEP by 48,2%, DEEC by 39% and Z-SEP by 21,65%. Therefore, our protocol outperforms the other protocols in terms of the stability period.

Fig. 7
figure 7

The stability period

Figure 8 represents the network lifetime of our proposed protocol as well as LEACH, New approach_ENASE, SEP, DEEC, Z-SEP protocols. This proves that, with using our proposed protocol, network lifetime is well prolonged by 75% comparing to LEACH, 59,1% comparing to New approach_ENASE, by 42,39% comparing to SEP, by 38,64% comparing to DEEC, by 4,54% compared to Z-SEP.

Fig. 8
figure 8

The network lifetime

Compared to the previous work [7] which deals with the homogeneous network, we have moved to the heterogeneous one by inserting the advanced nodes which have more initial energy than normal nodes. This heterogeneous network has been divided into two regions. Each one contains a type of nodes. In addition, only the Reg-2 (advanced nodes) has been concerned with clustering, the normal nodes of the Reg-1 send their data directly to the BS. This strategy considerably conserved the residual energy of the nodes. In summary, inserting some heterogeneous nodes in the network, setting the BS in the center of the network area and dividing the network into regions have reduced the energy consumption of the nodes and ameliorated the lifetime of the network. This explains the results shown above which are much better than the previous work [7].

5 Conclusion

In this paper, we have proposed a new protocol inserting some heterogeneous nodes in the network. In fact, our proposed protocol is based on dividing the sensing field into two regions. Each region contains one type of nodes: normal or advanced nodes. Normal nodes which have the lowest energy are assigned in the region near to the base station. Then, this type of nodes transmits directly their data to the BS. On the other hand, the advanced nodes are deployed in the outermost region. In this region, CHs must be selected to transmit data to the BS. The simulation results show that the first dead node is delayed by about by 90% than LEACH, by 85% than New approach_ENASE, by 48,2% than SEP, by 39% than DEEC and by 21,65% than Z-SEP. The lifetime of the network is prolonged by about 75% comparing to LEACH, 59,1% compared to New approach_ENASE, by 42,39% comparing to SEP, by 38,64% comparing to DEEC, by 4,54% compared to Z-SEP. All these results prove that our proposed strategy is effective in reducing the energy consumption and prolonging the lifetime of the WSN.