1 Introduction

In recent years, wireless sensor network (WSN) based agricultural environment monitoring has becomes one of the most efficient methods for agricultural production monitoring [1, 2]. Routing protocol is one of the key technologies in WSN optimization researches. For large-scale farmland WSN applications, there are problems such as large network scale, uneven node distribution, strict energy consumption limits, and multilevel heterogeneous node energy, which may lead to energy cavitation. Thus, the main problem of large-scale farmland WSN routing algorithm is how to realize the reduction and balance of network energy consumption [3, 4].

Wireless communication power is the major part of energy consumption in WSN nodes. Routing algorithms could determine the network energy consumption level by defining the network data transfer mode. Many WSN routing optimization studies have been made such as cluster-head selection and rotation scheme. However, these methods still have following shortcomings, such as undetermined cluster number, unbalanced energy consumption and high cluster-head selection cost, etc. In order to reduce and balance the network energy consumption, a ECRRS (energy efficient cluster-head rotation and relay node selection) algorithm is proposed in this work. Cluster-head selection, cluster-head rotation and hybrid routing policies are used to prolong the network lifetime and improve energy efficiency. Simulation and performance evaluation are also provided.

The rest of the paper is organized as follows. The overview of the related works is presented in Sect. 2, followed by the System model and assumption in Sect. 3. Section 4 proposes the new method ECRRS and shows in detail. Simulation results and analysis are provided in Sects. 5 respectively. Finally, the paper ends with conclusions in Sect. 6.

2 Related Works

WSN routing algorithm can be classified into flat routing and hierarchical routing according to network structure. Flat routing algorithms such as DD (direct diffusion) [5] and SPIN (sensor protocols for information via negotiation) [6] are simple and robust. In flat routing, nodes have equal status and there is no need to foreknow the network topology information. However, for lacking centralized optimization management of advanced nodes, the flat routing network becomes bloated with increasing network size. To solve this problem, researchers have proposed a series of optimized flat routing protocols. Perkins CE et al., raised AODV (ad hoc on-demand distance vector) [7, 8] routing protocol, which requests message RREQ (Route REQuest) from source node broadcast routing and seek self-routing list after receiving the node of this message. If there is an effective routing, message RREP (Route REPly) is replied.

Hierarchical routing algorithm, on the other hand, represented by clustering routing protocol, is an important branch of current WSN routing studies [9, 10]. Chandrakasan et al., put forward the concept of round in LEACH (low energy adaptive clustering hierarchy) [11] algorithm. In LEACH, each round is divided into cluster establishment stage and stable data communication stage. In the cluster establishment stage, nodes determine whether to become cluster-head according to probability p [11]. After one node is determined to be cluster-head, clustering information is broadcast and non-cluster nodes select the nearest cluster node to join in. After the cluster-head receives the data of all intra-nodes, fused data are sent to sink node. The major problem of LEACH lies in the randomness of cluster-head selection. Thus, energy consumption balance between nodes cannot be guaranteed and some nodes may die quickly due to being cluster-head frequently.

To solve the unbalanced load of random cluster-head, researchers proposed various LEACH-based improved algorithms, for example, LEACH-C (LEACH-centralized) [12], DEEC (distribute energy-efficient clustering) [13], CHCS (cluster-head cycling switch) [14], which take node residual energy as the basis of cluster-head selection. For example, CHCS algorithm perceived node residual energy in the initial stage. After residual energy information exchange between adjacent nodes, adjacent nodes with highest residual energy in the competitive stage are voted and the node with highest votes in the region is announced as cluster-head [14]. After energy weight is introduced, nodes with high residual energy have higher possibility to be cluster-head and the extra energy consumption of cluster-heads can be shared equally among high-energy nodes. However, this kind of routing protocols only balances residual energy during cluster-head selection and intra-nodes joining the cluster adopt the principle of minimum communication cost, which may cause some cluster-heads at key positions dying quickly due to heavy communication load. Also, traditional cluster-head selection algorithms do not consider that cluster nodes far away from the base station may have much more energy consumption [2, 3].

For unbalanced load between clusters, researchers raised HEED (hybrid energy efficient distributed) [15], EECS (energy efficient clustering scheme) [16] and other improved algorithms. EECS algorithm puts forward communication cost Formula (1) on the basis of competitive cluster-head selection to determine which cluster nodes belong to [16].

$${\text{cost}}(j,i) = w \times f(d(P_{j} ,CH_{i} )) + (1 - w) \times g(d(CH_{i} ,BS))$$
(1)
$$f( \cdot ) = \frac{{d(P_{j} ,CH_{i} )}}{{EX(\hbox{max} \{ d(P_{j} ,CH_{i} )\} )}},\quad g( \cdot ) = \frac{{d(CH_{i} ,BS) - \hbox{min} \{ d(CHi,BS)\} }}{{\hbox{max} \{ d(CH_{i} ,BS)\} - \hbox{min} \{ d(CHi,BS)\} }}$$
(2)

where cost(j, i) represents the cost of node Pj joining cluster-head CHi; d(Pj,CHi) represents the distance from node to the cluster-head; d(CHi,BS) represents the distance from cluster-head CHi to the base station; weight w represents the ratio of member node energy to cluster-head energy consumption and it varies according to different applications; function \(f( \cdot )\) represents the minimum communication cost from the node to the cluster-head; and function \(g( \cdot )\) represents the minimum communication cost from cluster-head CHi to the base station. Node Pj selects the minimum cluster-head in cost(j, i) to join and further guarantee the load balance between clusters.

3 System Model and Assumption

3.1 Network Assumption

All sensor nodes are deployed in an M × M square region, and the network assumptions are as follows:

  • The network is a high density static network with all nodes location fixed. The connectivity and coverage of the network is fine.

  • The network has only one sink node (base station) with infinite energy collects the data from all other nodes;

  • All nodes have the same structure and initial battery power E0, but the power consumption of each node is not equal.

  • There are two communication modes, intra-cluster mode and inter-cluster mode, and transmission power of all nodes are controllable.

  • All nodes have the capability of monitoring the energy level of itself;

  • The network is hierarchical structure organized, with a cluster radius r.

  • All cluster heads have the capability of data fusion.

3.2 Power Consumption Model

The communication power consumption model is set as in Ref. [5]. The transmitting power Etx is calculated as below [5, 17, 18]:

$$E_{tx} = \left\{ \begin{aligned} lE_{elec} + l\varepsilon_{f} d^{2} ,\quad d < d_{crossover} \hfill \\ lE_{elec} + l\varepsilon_{m} d^{4} ,\quad d \ge d_{crossover} \hfill \\ \end{aligned} \right.$$
(3)

where l refers to the number of bits in a packet, Eelec refers to the energy consumption when node transmitting circuit or receiving circuit transmit one bit data, d refers to the distance between the transmit and receive nodes, \(d_{crossover} = \sqrt {\frac{{\varepsilon_{f} }}{{\varepsilon_{m} }}}\), is a threshold distance in the model, if d is less than \(d_{crossover}\), then the free space attenuation model is used. If d is larger than \(d_{crossover}\), the multi-path attenuation model is used. \(\varepsilon_{f}\) and \(\varepsilon_{m}\) are the energy coefficients of power amplification in two models.

The receiving power Erx is calculated as below:

$$E_{rx} = lE_{elec}$$
(4)

where l is the number of bit which transmit information.

According to Formula (3), the transmission energy consumption is related to the distance. When the d is larger than \(d_{crossover}\), the and transmission power grows more rapidly. In order to get a balance in the monitoring range and power consumption, the perception radius r is set to \(d_{crossover}\).

4 ECRRS Algorithm

4.1 Topological Density Correlation Cluster-Head Selection

Among current methods, the clustering mechanism can be classified into possibility clustering and competitive clustering. LEACH [11] algorithm adopts possibility clustering and owns certain randomness. It is easy to cause uneven cluster-head distribution. In Fig. 1a, the clustering regions of two adjacent cluster-heads overlap a lot, which not only lead to poor energy consumption balance but also causes frequent network conflicts. Competitive clustering algorithm, for example, EECS algorithm, selects competitive cluster-heads according to node residual energy and cluster-heads with optimal local energy can effectively avoid cluster-head concentration and make network clustering more even, shown as Fig. 1b.

Fig. 1
figure 1

Comparison diagram between possibility clustering and competitive clustering in the number of cluster-heads and clustering radius

With the same initial energy, taking residual energy as the only judging condition of cluster-head selection may lead to nodes in the marginal area or node sparse area have more possibility to be cluster-heads. Shown as Fig. 2, if node n1 becomes cluster-head, the clustering radius r1 can guaranteeing the network connectivity in this region. If n2 becomes cluster-head, the clustering radius shall be r2 to guarantee the network connectivity in this region. Obviously, r2 > r1. In this case, the energy consumption efficiency of the network is significantly decreased.

Fig. 2
figure 2

Difference between nodes in different topologies positions in clustering radius

Therefore, in this paper cluster-head selection not only considers node energy but also takes the node topological density and the distance to sink node into consideration. Thus, nodes in the regional topological center own higher priority to be cluster-head. Making cluster-head distribution and node density distribution consistent gives a full play of cluster routing to high efficiency. Specifically, network topological density correlation-based cluster-head selection considers the following factors, node residual energy, distance to sink node, and network topological density. Cluster-head selection weight can be expressed as,

$$W_{i} =F\left( {{Er}_{i} ,{d}_{i} ,{N}_{i} } \right)$$
(5)

where Eri represents the residual energy of node i; di represents the distance of node i from sink node; Ni represents the regional topological density of node i and its value is the node degree of node i with competitive radius of \(d_{compete}\) as communication radius.

As an improvement and application of Ref. [14], the calculation mode of weight of cluster-head selection, Wi, is shown as Formula (6).

$${W}_{i} = \alpha \frac{{{Er}_{i} }}{{\hbox{max} ({Er})}} + \beta \left( {1 - \frac{{{d}_{i} }}{{\hbox{max} ({d})}}} \right) + \gamma \frac{{{N}_{i} }}{{\hbox{max} ({N})}}$$
(6)

where max(Er) represents the maximum node residual energy in the current cluster; max(d) represents the maximum distance to sink node in the current cluster; max(N) represents the maximum node degree in the current cluster; and α, β and γ represent each coefficient. Because fraction is normalized value, so when it aims at maximizing the network lifetime, the contribution of node residual energy Eri to Wi shall be ensured maximum, then di and then topological density Ni. Thus, we can get \(\alpha > \beta > \gamma\), satisfying \(\alpha + \beta + \gamma = 1\). According to the calculation method of Formula (6), when the node residual energy is almost the same, nodes with closer distance to sink node and higher regional topological density own higher priority to being cluster-heads. When these nodes have enough energy, the network can be guaranteed with high energy use efficiency.

4.2 Cluster-Head Rotation Based on Energy Threshold Judgment

To ensure energy balance between nodes, current clustering algorithms carry out competitive cluster-head rotation in each round but frequent cluster-head selection also brings great communication costs. Reference [3] raised odd-round cluster-head selection algorithm. Instead of selecting cluster-head selection in every rounds, the energy-approximant cluster-head rotation method in this paper permits energy optimal node as cluster-head continuously until its residual energy is lower than a given threshold Ti. At the same time, to avoid cluster-head nodes using up energy due to being cluster-heads continuously, the average energy of cluster nodes is taken as the judgment energy threshold of cluster-head. In this way, cluster-head still can maintain energy superiority in the cluster. By reducing the cluster-head selection times, a huge part of algorithm communication costs can be saved.

The specific way is that when one node becomes the cluster-head, node residual energy information in the cluster is collected once. According to this, the energy threshold of the cluster-head is determined based on certain rules. The cluster-head takes on the role of cluster-head until its residual energy less than or equal to the threshold. When to change cluster-head, node with highest weight (mentioned in Sect. 4.1) is assigned as the cluster-head in the next round and the notification message is broadcast. The rules are as follows.

Rule 1: At the network initialization, cluster-head selection is carried out according to Formula (6). When node Si becomes the cluster-head for the first time, Cluster_Build_MSG is broadcast. All the adjacent nodes receiving this message can join in. The cluster-head in the first round collects node energy information in the cluster and calculates the energy threshold Ti. Then the monitoring data are collected and uploaded.

Rule 2: Before uploading data in each round, cluster-head node Si shall judge whether self-residual energy Eri is greater than Ti. If so, monitoring data are collected and uploaded and it acts as the cluster-head in the next round. The round ending message is broadcasted. If residual energy Eri is less than or equal to Ti, Election_MSG is broadcast. The nodes in the cluster upload both monitoring information and their energy information. Current cluster-head Si selects new cluster-head Sj according to cluster node information based on the rules in Formula (6). After New_ClusterHead_MSG is broadcast, node Sj bears the role of cluster-head in the next round.

It can be seen from Rule 1 and 2 that when node Si acts as cluster-head in continuous rounds, node residual energy information only needs to be collected twice at the first round and final round, which reduces the sending times of energy broadcast and voting information in the cluster-head selection.

It can be seen that it is difficult for LEACH algorithm [11] to realize load balance between clusters due to unstable clustering number and it adds the difficulty in the network energy consumption balance. On the other hand, in ECRRS algorithm, the new cluster-head is selected by old cluster-head, so the cluster-head number is constant, which ensures the network energy consumption balance. The actual clustering number is determined by the competitive radius and the optimal competitive radius will be discussed in Sect. 5.1.

4.3 Relay Node Selection

In traditional routing algorithms, normal nodes receive clustering information and select a cluster-head to join in [19, 20]. The cluster-head communicates with sink node directly. However, for large-scale farmland WSN applications, the scale of the monitoring region is far greater than the clustering radius, which may cause two kinds of problems. (1) There may be no available cluster-head in one node’s communication radius. (2) The far-end cluster-heads communicate with sink node directly, whose great energy consumption may lead to uneven network energy consumption. To solve these problems, this paper proposes flat diffusion hybrid routing method on the basis of the clustering algorithm and introduces intra-cluster relay and inter-cluster relay node.

If node Ni and Nj in the network cannot communicate directly, node RN shall be used as relay node. Shown as Fig. 3, the transfer energy consumption of the direct communication between node Ni and node Nj is,

$$PC_{ij} = 2k_{ij} E_{elec} + k_{ij} \varepsilon_{m} d\left( {N_{i} ,N_{j} } \right)^{n}$$
(7)

where ki represents the uploading bits of cluster-head CHi and n represents the channel environment attenuation coefficient. For intra-cluster communication, n is 2; and for inter-cluster communication, n is 4.

Fig. 3
figure 3

Diagram of relay node selection

When using relay node, the data transfer energy consumption cost is,

$$PC_{ij}^{*} = 4k_{i} E_{elec} + k_{i} \varepsilon_{m} d\left( {N_{i} ,RN} \right)^{n} +\, k_{i} \varepsilon_{m} d\left( {RN,N_{j} } \right)^{n}$$
(8)

It can be seen from Fig. 3 that when n = 2, namely, intra-cluster communication, for relay node RN2, \(a^{2} + b^{2} = c^{2}\), which is the critical value of relay selection. For RN1, if \(a^{2} + b^{2} > c^{2}\), this relay shall not be used. For RN3, if \(a^{2} + b^{2} < c^{2}\), this relay shall be used. Similarly, when n = 4, namely, inter-cluster communication, when \(a^{4} + b^{4} < c^{4}\), it is thought that the relay node can reduce transfer energy consumption and this relay node can be used.

In ECRRS algorithm, the selection of proper relay nodes not only needs the consideration of path transfer cost but also needs taking the energy consumption balance between transferred nodes into consideration. Referring to the calculation method of intra-cluster load balance cost in Ref. [16]. In this paper, the cost that sent data from Ni to Nj via relay node RN can be expressed as,

$$\hbox{min} \;\cos t(i,j) = A\frac{{E_{consum} (N_{i} )}}{{E_{RN} }} + B\frac{{T_{RN} }}{{\overline{T} (N_{i} )}} + C\frac{{d(N_{i} ,RN)^{n} + d(RN,N_{j} )^{n} }}{{d(N_{i} ,N_{j} )^{n} }}$$
(9)

where \(E_{consum} (N_{i} )\) represents the transfer energy consumption of cluster-head CHi; \(E_{RN}\) represents the residual energy of relay node RN; and \(T_{RN}\) represents the accumulated relay times of node RN. Node RN with the minimum selection cost is taken as the transfer relay from node Ni to Nj.

Diagram of relay node selection in hybrid routing is shown as Fig. 4 and the specific rules are as follows.

Fig. 4
figure 4

Construction diagram of relay node selection in hybrid routing

  1. 1.

    Nodes with distance to sink node less than intra-cluster communication radius, \(d_{compete}\), directly communicate with sink node but it can be taken as the relay node of inter-cluster communication to participate in the construction of upper-layer flat routing.

  2. 2.

    After a normal node receives the clustering message of the cluster-head, it sends message of joining and join this cluster. If a node receives the clustering messages from multiple cluster-heads, it could select a cluster-head with smaller node degree. After clustering is finished, the cluster-head will adjust the intra-cluster communication radius according to intra-node access so as to save energy consumption.

  3. 3.

    Reverse routing diffusion starting message is broadcast from sink node, and the construction of the upper-layer flat routing is initiated. After cluster-heads receive the message of routing diffusion, the routing information is saved. After adding self-routing information, the message is transferred. If a node receives multiple path diffusion messages, routing path with optimal path energy is selected until all cluster-heads join in.

5 Simulation and Analysis

5.1 Performance Evaluation Indexes

5.1.1 Network Lifespan

We define LSdie1 as the time of the first node died, LSdie10 represents the time of 10% nodes died and LSdie90 represents the time of 90% nodes died [18, 21, 22]. The time of 10% nodes died was chosen as the network lifespan.

5.1.2 Energy Consumption Balance

This paper adopts the WSN node energy variance and time difference from 10% nodes died to 90% nodes died to evaluate the network balance.Energy variance can be expressed as [21, 22],

$$D_{E} (t) = \frac{{\sum\nolimits_{i = 1}^{N} {\{ E_{i} (t) - m_{E} (t)\}^{2} } }}{N}$$
(10)

The time difference can be expressed as,

$$T_{10 - 90} = LS_{die90} - LS_{die10}$$
(11)

Considering both, the smaller T10−90 and DE(t) are, the better the network energy balance is.

5.1.3 Optimal Clustering Number

Clustering number has significant influences on the network lifetime and inter-cluster energy consumption balance [23, 24]. In LEACH [11] and other probability clustering algorithms, the clustering number is determined by probability p, but the distribution of cluster-head number presents obvious randomness. In CHCS [14] and other competitive clustering algorithms, the distribution of cluster-head number is more centralized and the performance of network energy consumption balance is better. In Ref. [25], the optimal clustering number is

$$k = \sqrt {\frac{N}{2\pi }} \sqrt {\frac{{\varepsilon_{fs} }}{{\varepsilon_{mp} }}} \frac{M}{{d_{2BS}^{2} }}$$
(12)

where N represents the network node number; d2BS represents the mean distance from the cluster-head to the sink node; and M represents the length of the square monitoring region. k Clusters are used to satisfy the coverage of the monitoring region. Considering the overlapping of circular regions, the optimal competitive clustering radius can be estimated [26].

$$R_{compete} = \sqrt {C_{lap} *\frac{M*M}{\pi k}}$$
(13)

where Clap represents the overlap coefficient, taking 1.25. The optimal theoretical value Rcompete is about 30 m. The network performance of the optimal clustering radius in the simulation process was verifies as following.

5.2 Results and Discussion

The simulation was running under the MATLAB environment, the parameters were set as in Table 1.

Table 1 Simulation parameters

The influences of ECRRS competitive radius on the network life span are shown as Fig. 5. It can be seen that when the competitive radius is \(0.4\,d_{crossover}\), the network life span is the longest. Considering the round coverage of clustering have part of overlapping, Rcompete shall be slightly greater than \(0.4\,d_{crossover}\).

Fig. 5
figure 5

Influences of ECRRS competitive radius on the network life span

As it is shown in Fig. 6, the first dead node of LEACH occurs at about 100th round and 10% node died at about 250th round. The network life span is smaller than other algorithms. The reason for this is that LEACH algorithm adopts random cluster-head selection mode [9]. Nodes far from sink node and relatively isolated nodes with high based energy consumption can be selected as cluster-heads with the same probability, which may lead to excessive energy consumption and sooner death. In CHCS algorithm, the first dead node occurs at about 450th round and 10% node died at about 550th round. The reason is that CHCS [11] algorithm selects nodes with higher residual energy as cluster-heads, which avoids the accelerated death of nodes with high based energy consumption. Compared with LEACH algorithm, the energy consumption balance between nodes is improved. It also can be seen that the survival nodes in CHCS algorithm drops significantly during 400th round and 900th round. The cluster-heads in CHCS [11] algorithm communicate with sink node directly, which causes the energy of nodes far from sink node dropping quickly and further death. Furthermore, CHCS [11] algorithm needs collecting node energy information in each round and voting, which generates numerous algorithm costs. Thus, the lengthening effects of the network lifetime by CHCS algorithm are limited compared with LEACH algorithm. In HEED algorithm, the first dead node occurs at about 500th round and 10% node died at about 850th round. HEED selects a cluster-head considering average minimum reachability power (AMRP) as well as the residual energy [15]. HEED also proposed an efficient cluster-head competition mechanism [15]. Therefore the network lifetime of HEED is a little better than CHCS. In ECRRS algorithm, the first dead node occurs at about 600th round and 10% node died at about 1,150th round. In the view of first node die, the network lifetime of CHCS, HEED and ECRRS are close to each other. However, ECRRS algorithm owns longer network life than CHCS and HEED algorithm in 10% node die. That is the 10% node-die network lifespan of ECRRS is 1.35 times of HEED, 2.1 times of CHCS, 4.6 times of LEACH.

Fig. 6
figure 6

Comparison between different algorithms in the network life span

It can be seen from Fig. 7 that at the initial stage of the network operation ECRRS algorithm owns good network connectivity and the number of son nodes in the network is 0 when topological center node is selected as cluster-head. With the network running, the residual energy of topological center node decreases and nodes with energy superiority in other positions replace it and become cluster-head. After 400th round, son nodes occur in the network to guarantee the network connectivity. The changes of son nodes are random but on the whole, they tend to decrease with the increasing dead nodes.

Fig. 7
figure 7

Changes of son nodes in ECRRS algorithm

Comparison of mean node residual energy is shown as Fig. 8. It can be seen that the mean node residual energies of ECRRS, HEED and CHCS algorithm change steadily while the mean node residual energy of LEACH algorithm changes greatly. The slope of mean node residual energy curve represents the mean node energy consumption at each moment. Thus, the mean node energy consumption of ECRRS algorithm is slightly lower than HEED and CHCS algorithm, for the cluster-head selection costs of CHCS and HEED algorithm are higher. The mean node energy consumption of LEACH algorithm is mainly determined by the cluster-head position, so the slope changes randomly, which leads to a low energy consumption efficiency. The energy consumption efficiency of ECRRS algorithm is higher than LEACH, CHCS and HEED.

Fig. 8
figure 8

Comparison between different algorithms in mean node residual energy

Besides the network life, node energy consumption balance also is a focus of WSN energy consumption optimization research. It can be seen from Fig. 6 that from 10% nodes died to 90% nodes died, LEACH algorithm passes about 450 rounds, CHCS algorithm passes about 350 rounds, HEED algorithm passes about 200 rounds and ECRRS algorithm passes about 100 rounds. It can be seen from results that LEACH algorithm does not consider the node energy consumption balance. Though CHCS algorithm selects nodes with the maximum residual energy as cluster-head, however its balance result is local optimum. According to the distance to sink node, the energy consumption differs obviously. HEED have a better energy balance performance because the using of AMRP [15]. By using multi-hop among cluster-heads, ECRRS algorithm can effectively reduce the high extra energy consumption of far-end cluster-heads and achieve better effects of energy consumption balance.

It can be seen from Fig. 9 that LEACH algorithm owns the poorest energy consumption balance. Node energy difference expands rapidly and after 100th round dead nodes occur. At the same time, the energy variance presents irregular changes at a larger value and the variance decrease to 0 quickly shortly before all nodes die. Node energy variance of CHCS algorithm remains a low level but its major part is obviously higher than ECRRS and HEED algorithm. After the network begin, the node energy variance of CHCS algorithm increases steadily until the occurrence of dead node and it begins to drop slowly. These indicate that CHCS algorithm achieves good effects of energy consumption balance but the great energy consumption difference between far-end and near-end cluster-heads leads to continuously expanding node energy consumption variance. During 400th to 600th round, high energy consumption nodes at far-end cluster-head begins to die and the node energy consumption variance decreases. HEED selects a cluster-head considering average minimum reachability power (AMRP) as well as the residual energy [15]. Thus, HEED has the best energy balance performance in Fig. 9. It also can be seen that the energy balance performance of ECRRS algorithm is slightly better than that of CHCS algorithm and significantly better than that of LEACH algorithm.

Fig. 9
figure 9

Comparison between different algorithms in node residual energy variance

It is shown in Fig. 10 that the mean energy cost of cluster-head selection from high to low is CHCS, HEED, ECRRS, LEACH. The cluster-heads was choose randomly by nodes themselves in LEACH. Accordingly, the cluster-head selection cost of LEACH in the figure is always 0. CHCS and HEED did cluster-head selection in every round mainly considering the residual energy. Besides, ECRRS did cluster-head selection occasionally only when the residual energy of cluster-heads meets the threshold. Therefore, in 800th round, the cluster-head selection cost of HEED is about 2.6 times of ECRRS, while the cluster-head selection cost of CHCS is about 3 times of ECRRS,. The cluster-head selection cost of CHCS is a little higher than HEED in the figure.

Fig. 10
figure 10

Comparison between different algorithms in mean cost of cluster-head selection

6 Conclusion

ECRRS algorithm proposed in this paper enables nodes in the topological center have higher probability to be cluster-heads, which improves the network energy efficiency. Energy threshold judgment is used to realize cluster-head rotation, which decrease the frequency of cluster-head rotation and avoid the communication cost of frequent cluster-head selections. Relay node selection is adopted to guarantee the network connectivity when the position of the cluster-head is not good and it effectively reduces the communication energy consumption of far-end cluster-heads. The simulation results show that the 10% nodes-die network lifespan of ECRRS is about 1.3 times of HEED, 2.1 times of CHCS and 4.5 times of LEACH. The cluster-head selection cost of ECRRS is about 38% of HEED and 33% of CHCS. The energy balance performance of ECRRS is a little better than CHCS and much better than LEACH. Comparing to LEACH, CHCS and HEED, results indicate that ECRRS improves the energy efficiency, reduces the cost of cluster-head rotation, prolongs the network lifespan and balances node energy consumption.