1 Introduction

The vast advancements in technology in general and in wireless communications have specifically given us the ability to mass-produce small, low-cost sensors that can connect to each other wirelessly. The sensors once deployed, whether in a random or a pre-engineered way, will connect to each other and form a wireless sensor network (WSN). WSNs are made of a large number of sensors deployed in a certain area. The sensors would transform physical data into a form that would make it easier for the user to understand. WSN technology is growing rapidly and becoming cheaper and easier to afford, allowing different kinds of application usage of such networks. WSNs can be used for a wide variety of applications dealing with monitoring (health environments, seismic, etc.), control (object detection and tracking), and surveillance (battlefield surveillance), perimeter and topology discovery [18].

Wireless sensor networks are characterized with denser levels of sensor node deployment, higher unreliability of sensor nodes, sever power, computation, and memory constraints. Thus, the unique characteristics and constraints present many new challenges for the development and application of WSNs. Sensor nodes are battery-powered and are expected to operate without attendance for a relatively long period of time. In most cases it is very difficult and even impossible to change or recharge batteries for the sensor nodes.

Due to the difference of WSNs from other contemporary communication and wireless ad hoc networks, routing is a very challenging task in WSNs. For the deployed sheer number of sensor nodes it is impractical to build a global scheme for them. IP-based protocols cannot be applied to these networks. All applications of WSNs have the requirement of sending the sensed data from multiple points to a common destination called base station (BS). Resource management is required in sensor nodes regarding transmission power, storage, on-board energy and processing capacity. There are various routing protocols that have been proposed for routing data in WSNs due to such problems. The proposed mechanisms of routing consider the architecture and application requirements along with the characteristics of sensor nodes. There are few distinct routing protocols that are based on quality of service awareness or network flow whereas all other routing protocols can be classified as hierarchical or location based and data centric. Hierarchical routing protocols where our new proposed protocol can be classified have special advantages related to scalability, efficient communication, and efficient energy in WSNs.

In WSNs, the sensor nodes are often grouped into individual disjoint sets called clusters. Clustering is used in WSNs, as it provides network scalability, resource sharing and efficient use of constrained resources that gives network topology stability and energy saving attributes. Clustering schemes offer reduced communication overheads, and efficient resource allocation thus decreasing the overall energy consumption and reducing the interferences among sensor nodes. The basic idea of clustering routing [911] is to use the information aggregation mechanism in the cluster head (CH) to reduce the amount of data transmission, thereby, reduce the energy dissipation in communication and in turn achieve the purpose of saving energy of the sensor nodes. In the clustering routing algorithms for wireless networks, LEACH [12, 13] is considered as the most popular routing protocol that use cluster based routing in order to minimize the energy consumption. LEACH was one of the first major improvements on conventional clustering approaches such as minimum-transmission-energy (MTE) or direct-transmission which do not lead to even energy consumption throughout a network in WSNs. In LEACH, the function of the CH is the collection of data received from member sensor nodes and forward the information directly to the BS. And if the CH is far away from the BS then it requires more energy to transfer the information to the BS and therefore it will die soon and so LEACH has the lowest network lifetime. While LEACH helps the sensors within their cluster dissipate their energy slowly, the CHs consume a larger amount of energy when they are located farther away from the BS. Also, LEACH clustering terminates in a finite number of iterations, but does not guarantee good CH distribution and assumes uniform energy consumption for CHs.

Most of LEACH improvements concerned with the way of electing CHs not how to achieve balancing inside the clusters during round operation which is our contribution in this paper. The main goal of the proposed protocol is to evenly distribute energy consumption over all sensor nodes by dividing the work among the CHs and its cluster members (CMs) which reduces energy consumption of CH. Each non-CH uses power control to set the amount of transmit power based on the received strength of the CH advertisement. Also, the proposed protocol is independent from CHs election method, and so any other cluster-based routing protocol can adopt it to satisfy energy balancing between CH and CM.

The rest of the paper is organized as follows: Sect. 2 briefly reviews related work. Our problem description and formulation is covered in Sect. 3 In Sect. 4, we introduce our approach to carry out the proposed problem. The simulation results of the proposed protocol are presented in Sect. 5 In Sect. 6, we conclude our work.

2 Related research

Routing in WSNs is very challenging due to several characteristics that distinguish them from contemporary communication and wireless ad hoc networks [1416].

The traditional routing protocols have several shortcomings when applied to WSNs, which are mainly due to the energy-constrained nature of such networks [17]. For example, flooding is a technique in which a given node broadcasts data and controls packets that it has received to the rest of the nodes in the network. This process repeats until the destination node is reached. Note that this technique does not take into account the energy constraint imposed by WSNs. As a result, when used for data routing in WSNs, it leads to problems such as implosion and overlap [18, 19]. Given that flooding is a blind technique, duplicated packets may keep circulate in the network, and hence sensors will receive those duplicated packets, causing an implosion problem. Also, when two sensors sense the same region and broadcast their sensed data at the same time, their neighbors will receive duplicated packets. To overcome the shortcomings of flooding, another technique known as gossiping can be applied [20]. In gossiping, upon receiving a packet, a sensor would select randomly one of its neighbors and send the packet to it. The same process repeats until all sensors receive this packet. Using gossiping, a given sensor would receive only one copy of a packet being sent. While gossiping tackles the implosion problem, there is a significant delay for a packet to reach all sensors in a network. Furthermore, these inconveniences are highlighted when the number of nodes in the network increases. The limited energy resources of sensor nodes pose challenging issues on the development of routing protocols for WSN. Introducing clustering into the network’s topology reduces the number of transmissions in the network. It also provides energy efficiency as CHs aggregate the data’s from its CMs, thereby reduce duplication of transmission and enhance the network lifetime.

Many research projects in the last few years have explored hierarchical clustering in WSN from different perspectives. A variety of protocols have been proposed for prolonging the life of WSN and for routing the correct data to the BS. Each protocol has advantages and disadvantages. Battery power of individual sensor nodes is a precious resource in the WSN [21, 22]. Some of the hierarchical protocols are LEACH, PEGASIS, TEEN, and APTEEN. LEACH [12, 13] is the first and most popular energy-efficient hierarchical clustering algorithm for WSNs that was proposed for reducing power consumption. The key features of LEACH are: (1) randomized rotation of the CH and corresponding clusters, (2) local compression to reduce global communication, and (3) localized coordination and control for cluster set-up and operation. LEACH reduces energy consumption by minimizing the communication cost between sensors and their CHs and turning off non-head nodes as much as possible [23]. The time duration of the set-up phase is non-deterministic, and if the duration is too long due to collisions, sensing services are interrupted. In such cases, LEACH may be unstable during the set-up phase depending on the density of sensors. LEACH uses single-hop routing where each node can transmit directly to the CH and the BS. Therefore, it is not applicable to networks deployed in large regions. Furthermore, the idea of dynamic clustering brings extra overhead, e.g. head changes, advertisements etc., which may diminish the gain in energy consumption. While LEACH helps the sensors within their cluster dissipate their energy slowly, the CHs consume a larger amount of energy when they are located farther away from the BS. Also, LEACH clustering terminates in a finite number of iterations, but does not guarantee good CH distribution and assumes uniform energy consumption for CHs.

In [24], the authors proposed a protocol called LEACH-B, at each round LEACH-B, after first selection of CH according to LEACH protocol, a second selection is introduced to modify the number of CHs in consideration of node’s residual energy. As a result the number of CHs is constant and near optimal per round. The simulation shows that the improved protocol has better performance of prolonging the network lifetime than LEACH protocol. In [25], the authors presented T-LEACH, which is a threshold-based CH replacement scheme for clustering protocols of WSNs. T-LEACH minimizes the number of CH selections by using threshold of residual energy. Reducing the amount of head selection and replacement cost, the lifetime of the entire networks can be extended compared with the existing clustering protocols.

In [26], Zytoune et al. presented a stochastic low energy adaptive clustering hierarchy protocol (SLEACH), which outperforms the LEACH when the interesting collected data is the minimum or the maximum value in an area. SLEACH uses the same method proposed in LEACH for forming clusters. Once the clusters are formed, the CH broadcasts in its cluster a data message containing its measurement assuming it the pertinent value. Only the nodes, having most significant data, send their messages towards the cluster-head.

In [27], the authors extend SLEACH algorithm by modifying the probability of each node to become cluster-head based on its required energy to transmit to the BS. Their contribution consists in rotation selection of CHs considering the remoteness of the nodes to the BS, and then, the network nodes residual energy. In [28], the authors proposed an algorithm called TB-LEACH which is an improvement of LEACH. TB-LEACH constructs the cluster by using an algorithm based random-timer, which doesn’t require any global information. The work described in [29] proposed Variable-Round LEACH (VR-LEACH). VR-LEACH changes the round time according to the residual energy of the CH at the beginning of the round, the energy cost in every frame and the constants λ. In VR-LEACH a constant value for λ and the frame time μ are determined each round time, where the values of λ, and μ experimentally defined. The work in [30] proposed energy-LEACH (E-LEACH) protocol which is an improvement of LEACH. E-LEACH improves the choice method of the CH, makes some nodes which have more residual energy as CHs in next round. The main differences between our work and [2430] are the following: the proposed protocol (1) provides energy consumption balancing over all sensor nodes in each cluster, i.e., evenly distribute energy consumption over all sensor nodes (CHs and the CMs) which increases the network lifetime, (2) distributes the workload per frame which increases the network lifetime and (3) considers gathering process in frame level not round level by a specific node therefore, only the gathering process of the current frame will be affected in case of the death of that specific node. The used notations in the following sections are given in Table 1.

Table 1 Table of notations

3 Motivations and Problem Descriptions

In this section we shall show that in LEACH there is a big energy gap between the CHs and CMs by calculating the overhead energy for the CHs and CMs. The operation of LEACH is divided into rounds. Each round begins with a setup phase when the clusters are organized, followed by a steady-state phase when data are transferred from the nodes to the CH and to the BS.

In setup phase, all sensor nodes select a CH by a threshold. The threshold value depends upon the desired percentage (p) to become a CH, the current round r, and the set of nodes that have not become CH in the last \(\frac{1}{p}\) rounds. Each node wants to be a CH, chooses a value between 0 and 1. If this random value is less than the threshold value, then the node becomes cluster head for the current round. Then each elected CH broadcasts an advertisement message to the rest of the nodes in the network to invite them to join it.

In steady-state phase, the operation is divided into frames (a frame is the interval during which each regular node sends one message with the sensed data to the CH [31]), where nodes send their data to the CH at most once per frame during their allocated transmission slot. The duration of each slot in which a node transmits data is constant, so the time to send a frame of data depends on the number of nodes in the cluster. Figure 1 shows the time line for one round of LEACH.

Fig. 1
figure 1

One round of LEACH operation

According to this scenario, the energy consumed by CH and CM is given as follows:

  1. 1.

    The total energy consumed by CH (E CH ) will be:

    $$E_{CH}=E_{CHsel}+ E_{CHAD} + E_{CHcom}+ E_{CHf},$$
    (1)

    where E CHsel E CHAD E CHcom , and E CHf are given by:

    $$\begin{aligned} E_{CHsel}(k,d)&=\left(\left(\frac{K_c}{\alpha}\right)*\left(E_{elec}+E_{amp}*d_{toSink}^2\right)\right) + \left(\frac{p*n-1}{\alpha}*(K_c * E_{elec}*\beta)+K_t*E_{elec}\right), \\ E_{CHAD}(k,d)&=p*n*K_c * E_{elec}. \\ E_{CHcom}(k,d)&=N * K_c * E_{elec}+K_t * \left(E_{elec}+E_{amp}*d_{max}^2\right), \\ E_{CHf}(k,d)&= m*\left(N_i*K_d*E_{elec}\right)+(N-N_i) *\left(\beta * K_d*E_{elec}\right)+K_d*\left(E_{elec}+E_{amp}* d_{toSink}^2\right), \end{aligned}$$
  2. 2.

    The total energy consumed by CM (E CM ) will be:

    $$E_{CM}=E_{CMcom}+ E_{CMf},$$
    (2)

    where E CMcom and E CMf are given by:

    $$\begin{aligned} E_{CMcom}(k,d)&=\left(\frac{K_c}{\alpha} * \left(E_{elec}+E_{amp}* d_{toCH}^2\right)+\left(\frac{N-1}{\alpha}\right)*K_c*\beta*E_{elec}+K_t*E_{elec}.\right.\\ E_{CMf}(k,d)&=m*k_d*\left(E_{elec}+E_{amp}* d_{toCH}^2\right). \end{aligned}$$

From Eqs. (1) and (2), it is clear that there is a big energy gap between E CH and E CM . This is because in LEACH protocol, the role of a CM in a cluster is to sense the surrounding environment and transmit the sensed data to its CH. On the other hand, the CH aggregates and sends the received data to the BS, which drains out more energy of the CH as compared to other nodes. This operation will be repeated in each frame which leads to energy gap between the CH and its CMs. For more clarity, consider Fig. 2, where we used a 100-nodes network with randomly distributed nodes between (x = 0, y = 0) and (x = 200, y = 200) and BS at location (x = 50, y = 175). In order to measure the energy dissipation of sensor nodes, we use the same energy parameters and radio model as discussed in [12]. It can be noticed that there is a big energy gap between the CHs and the CMs during managing clustering.

Fig. 2
figure 2

Energy consumption rate at CHs and CMs in LEACH

Most of LEACH improvements concerned with the way of electing CHs not how to achieve balancing inside the clusters during round operation. The main goal of the proposed protocol is to evenly distribute energy consumption over all sensor nodes by dividing the work among the CHs and the CMs in frame level. To reduce energy consumption of CH, each non-CH uses power control to set the amount of transmit power based on the received strength of the CH advertisement. Our approach is independent from CHs election method, and so any other cluster-based routing protocol can adopt it to satisfy energy balancing between CHs and CMs. In order to prove this, as a part of our simulation results we have compared between ELEACH and the modified ELEACH which adopts our approach (pre-steady and steady-phase).

4 Enhanced LEACH protocol (IBLEACH)

In this section, we describe IBLEACH which improves the energy distribution among sensor nodes in each round and prolongs the network lifetime. The implementation process of IBLEACH is divided into rounds and each round is divided into three phases, Setup, Pre-Steady and the Steady State; each sensor knows when each round starts using a synchronized clock. Figure 3 shows the time line for one round of IBLEACH.

Fig. 3
figure 3

One round of IBLEACH operation

4.1 Setup phase

The setup phase operation of IBLEACH is similar to the setup phase operation of LEACH. IBLEACH starts with the cluster setup phase. During this setup phase the CHs are randomly elected from all the sensor nodes and several clusters are constructed dynamically.

4.2 Pre-steady phase

The main idea of the pre-steady phase is to calculate the cluster workload (which includes the aggregation of the sensed data from CMs and send the aggregated data to the BS) in one frame, then elect CM that can handle the aggregation processes through all frames in the round. If not exist such node, elect CMs that can handle the aggregation processes for each frame in the round and the CH will handle the aggregation process for frames that do not have aggregators. In this phase, each CH executes the following steps:

  1. 1.

    For each CM cm i , calculate cm i .NAggregator that cm i can work as an aggregator this will be according to its cm i .E remaining and cm i .E frame (Algorithm 1, Lines 11–14).

  2. 2.

    Elect aggregators for all frames in the current round by executing Algorithm 3. Given the CMs list M, NServeFrames and the current round number. The main steps of Algorithm 3 are as follows:

    • while there is an unselected node in M

      • elect a sensor node from M (say cm aggregator ).

      • if cm aggregator can serve the aggregation process in all frames, decrease NAggregator by NServeFrames and return cm aggregator .

    • return NULL, if there is no node to serve the aggregation processes in all frames.

  3. 3.

    if the returned cm aggregator is not NULL, assign the cm aggregator to serve each frame in the round by adding cm aggregator to the list of aggregators G aggregators (ch) (Algorithm 1, Lines 16–17). Otherwise, do the following:

    • Elect the aggregator that can serve only one frame in the round by executing Algorithm 3 with the parameters: the CMs M, the number of frames that need to be served by one aggregator (NServeFrames = 1) and the frame number (f) (Algorithm 1, Line 21).

    • If the returned value is not NULL, assign the returned aggregator cm aggregator to serve the current frame. Otherwise assign the ch to serve the aggregation process for this frame (Algorithm 1, Lines 22–26).

  4. 4.

    Broadcast the TDMA schedule and G aggregators (ch) (item number one in the list will serve frame number one in the round) to all CMs.

By the end of this phase, sensor nodes in each time frame are divided into two categories: CMs and CHs.

CMs These sensor nodes sense the environment and transmit the results to their aggregators. CMs are divided into two categories; sensing sensor nodes that do the sensing tasks and aggregators that aggregate data from the sensing sensors and send the aggregated data to BS this will help to reduce the energy consumed by CHs.

CHs These sensor nodes manage and determine the schedule information in their cluster. The selected CH performs the following tasks:

  • Determine which node can work as aggregator in each frame.

  • Create a TDMA schedule and assign to each node a time slot in which it can transmit the sensed data.

  • Broadcast the TDMA schedule and the aggregators list to all the CMs.

  • Maintain and manage the cluster.

  • Aggregate sensed data from CMs in absence of aggregators.

The pseudocode of this phase is given in Algorithm 1.

figure d

4.3 Steady state phase

In Steady State phase, the operation is divided into frames. In each frame, CMs send their data to the aggregator cm aggregator according to their time slots. The aggregator must keep its receiver on to receive all the data from the nodes in the cluster. After receiving all data, the aggregator sends it to the BS after performing data aggregation (see Algorithm 2).

figure e
figure f

5 Simulation results

In this section, we examine the improved protocol through NS2 [32] to evaluate the performance. A network of 100 nodes is deployed in an area of size 200 × 200 with BS at (50, 175). In order to measure the energy consumption of sensor nodes, we use the same energy parameters and radio model as discussed in [12], wherein energy consumption is mainly divided into two parts: receiving and transmitting messages. The transmission energy consumption needs additional energy to amplify the signal depending on the distance to the destination. Thus, to transmit a k-bits message a distance d, the radio power consumption will be,

$$E_{Tx}(k,d)=\left\{\begin{array}{ll} kE_{elec} +k\epsilon _{fs} d^{2} & d< d_0 \\ kE_{elec} +k\epsilon _{mp} d^{4} & d \geq d_0, \\ \end{array}\right.$$
(3)

while to receive this message, the radio expends will be

$$E_{Rx}(k)=k*E_{elec}.$$
(4)

Simulated model parameters are set as: \(E_{elec}=50\,\hbox{nJ}/\hbox{bit}/, \epsilon _{fs}=10\,\hbox{pJ}/\hbox{bit}/\hbox{m}^{2}, \epsilon _{mp}=\frac{13}{10000} \hbox{pJ}/\hbox{bit}/\hbox{m}^{4}, d_0=\sqrt{\epsilon _{fs}/\epsilon _{mp}}\), and the initial energy per node = 2J.

We use the following performance metrics to indicate the performance of clustering protocols:

  • Network lifetime: is the time interval from the start of operation of WSN until the death of the first alive node.

  • Energy consumption: is measured by the total energy of the network energy dissipation.

Figure 4(a, b) show the energy consumption of IBLEACH compared with that of LEACH. Figure 4(b) shows that the distribution of consumed energy over all nodes in LEACH is irregular compared with the distribution of consumed energy over all nodes in IBLEACH. From the figures, it is clear that the balancing of consumed energy distribution is achieved by IBLEACH. The increase rate of energy consumption of IBLEACH is much lower than the rate of LEACH this is because in IBLEACH the energy consumption is evenly distributed over all sensor nodes and the gathering process is considered by frame level.

Fig. 4
figure 4

Energy consumption in a IBLEACH , b LEACH

Figure 5(a) shows that using IBLEACH, the CHs and the CMs approximately have the same average energy consumption rate, which reflects a distribution of energy consumption over all sensor nodes compared with LEACH.

Fig. 5
figure 5

a Average Energy consumption at CHs and its CMs in LEACH and IBLEACH, b Network life time in LEACH, LEACH improvements and the proposed IBLEACH

Figure 5(b) shows the lifetime for LEACH, ELEACH, TLEACH, VRLEACH, LEACHB, and IBLEACH. In LEACH, ELEACH, and LEACHB, the first node died earlier than TLEACH, VRLEACH, and IBLEACH. We can note that the network lifetime in the proposed protocol IBLEACH is increased compared to LEACH, ELEACH, TLEACH, VRLEACH and LEACHB. This is because (1) IBLEACH evenly distributes the work among the CHs and its CMs which increases the lifetime of the network. (2) IBLEACH distributes the workload by round, which is not the case by the others, (3) IBLEACH considers gathering process on frame level by a specific node, and so the death of the specific node will only affect on the gathering process of the current frame.

Figure 6 shows the average energy consumption of ELEACH and the modified ELEACH (ModifiedELEACH). The results indicate that a balance in energy consumption between CHs and its CMs is achieved in ModifiedELEACH which proves the efficiency of our approach.

Fig. 6
figure 6

Energy consumption in ELEACH and Modified ELEACH

The last test was executed to demonstrate that the efficiency of our approach does not depend on the topology type. We executed the proposed protocol IBLEACH and LEACH in three different topologies (Intel Berkeley Research Lab (IBRL) [33], random, and random with holes Fig. 7a). The IBRL topology is commonly used to evaluate the performance of some existing models in WSNs [3438]. Figure 8 shows that in the three different topologies, the network lifetime of IBLEACH is increased compared to LEACH.

Fig. 7
figure 7

Example of used random WSN with holes topology

Fig. 8
figure 8

Network life time of LEACH and IBLEACH in different topologies

6 Conclusion

In this paper, we have proposed a routing protocol for improving LEACH by introducing IBLEACH which is balanced energy consumption protocol for WSNs. Through distributing the cluster load overhead over the CMs, the life time of the entire network extended compared with LEACH protocol. Our simulation results show that IBLEACH outperforms LEACH and its improvements in terms of the network lifetime and balanced energy consumption.