1 Introduction

Wireless sensor networks (WSNs) are consisted of several small devices, called sensor nodes, which measure the parameters of environment based on their applications [1]. The sensor nodes are responsible to gather and convert data to electronic signals [2]. Then the signals are broadcast to the sink node or the base station through wireless communication media in a single-hop or multi-hop manner to be processed [3, 4]. WSNs are increasingly used for critical programs including monitoring habitats, detecting fires in forests, and military monitoring [5, 6]. Criteria such as reliability, high-speed data transferring, and energy efficiency are some necessary properties for WSNs in their different application areas [7, 8]. Since wireless sensors are usually applied in the areas with difficult accessibility, and their energy is innately limited, frequent replacement of their batteries is difficult. This shows the importance of developing approaches to reduce energy consumption and to improve the network lifetime [9, 10]. Applying a proper routing method results in a significant increase in the network lifetime [11]. Due to the limitations of WSNs, providing a routing protocol for WSNs is challenging [12]. One method to decrease energy consumption is data aggregation, which reduces data transmission to the base station [13,14,15]. Data aggregation is a main principle, which applies processing, combining, and summarizing data packets to improve the network lifetime and to reduce resource consumption including energy and bandwidth [16]. However, aggregation protocols might result in poor quality services including decreased data accuracy and increased delay [17].

This paper proposed an energy-efficient layer routing protocol (EELRP). The proposed method divides the network into concentric circles. Next, the circles are divided into eight equal sectors with an angle of \(45^\circ \). Then an agent is selected for each section. The agent of each section is responsible to gather and aggregate the data sensed by the nodes of the same section. Receiving the data, the agent adds error detection and error correction codes and then sends it to the agent of the lower layer of the same sector. The procedure repeats until the data reaches the base station. Layering and sectorizing the network provides a regular structure for data aggregation and routing. In fact, the path for transferring information is predetermined, and there is no need to discover it. Here, the agent of the section receives, aggregates, and sends the data of the section so that the energy consumption of member nodes is reduced and the network lifetime is improved. Providing error detection and correction leads to increased accuracy of the received data.

The rest of the paper is organized as follows: Section 2 represents an overview of the related work. In Sect. 3, the details of the proposed method and its specific features and capabilities are explained, particularly its various processes. Then we provide the simulation of the proposed protocol and the analysis of its performance in Sect. 4. Finally, conclusions are represented in the last section.

2 Related work

One constrain of WSNs is the limited energy of their sensor nodes. The required energy to transfer information in WSNs is provided by the batteries embedded in nodes. Thus many protocols and methods of wired networks are not efficient in WSNs. According to the operation of protocols, network structure-based routing, and route discovery-based routing, routing protocols are classified into three categories [18]. Each group includes various methods and protocols.

  • According to the operation of protocols: protocol operation-based classifications are also an important component of the routing protocols of WSNs [18]. These routing protocols are classified into five groups: protocols based on negotiation, multi-path, query, service quality, and coherence [19].

  • Based on the network structure: the network structure can play an important role in the routing protocol operation in wireless sensor networks. The main feature of this type of routing protocols is the method of connection and communication of nodes based on the architecture of the network. These protocols are classified into three groups including flat routing protocols, hierarchical routing protocols, and location-based protocols [20].

  • According to route discovery: these protocols are defined based on the communication between nodes and the base station. The protocols can be classified into three groups: reactive, proactive, and hybrid [18].

In recent years, several research studies have been done on routing and aggregation in WSNs. This section reviews some of these algorithms.

EE-LEACH, an energy-efficient routing protocol for gathering data, has been proposed by Arumgam and Ponnuchamy [21]. All sensor nodes are of similar capacity and importance. The purpose of EE-LEACH is to reduce energy consumption and improve the network lifetime. Here, Gaussian distribution model is applied to effectively cover the sensor network area. Also, conditional probability theorem is used for nodes aggregation.

Mohanty and Kabat [22] proposed an energy-efficient structure-free data aggregation and delivery (ESDAD) in WSNs to aggregate the redundant data in the intermediate nodes. In ESDAD, the waiting time for packets in the intermediate nodes is calculated to effectively aggregate the data in the routing path. The sensed data packets are transferred into the aggregation point. The protocol calculates a cost function for next-hop selection. The protocol includes six phases: logical topology construction, judicial data transmission, next-hop node selection, structure-free data aggregation, waiting period for data aggregation and data forwarding, and congestion control and buffer management.

In large networks, increased number of nodes results in a significant rise in their communication overhead. Thus providing a mechanism to reduce cluster head communication overheads is important. Hatamian et al. [23] proposed a centralized genetic-based clustering protocol using the onion approach. In this method, the networks are divided into several onion layers. On selecting the optimal cluster heads and creating clusters, each cluster head node is located in a layer. Since cluster head nodes communicate solely with the CHs of their previous and next layer, communication overhead is decreased. CGC operation is divided into some rounds, consisting of two phases: set up phase and steady-state phase.

Huang et al. [24] proposed an algorithm organizing the network operation as a series of rounds. Each round includes a clustering setup phase and a steady-state phase. In the first phase, communication management nodes and cluster head nodes are selected. The second phase deals with inter-cluster multi-hop routing and data transmission.

Li et al. [25] proposed a Multi-Strip Data Gathering (MSDG) scheme that can effectively reduce the amount of transmitted data. In the MSDG scheme, the network is divided into multiple strips. In each strip, the aggregation nodes use the data fusion method to collect and transmit data to the strip center. The CS-nodes in the strip center employ the CS scheme for data collection. Multiple data packets can still be fused into a data packet so the data in each strip can be aggregated into a data packet with length using the CS routing method. Then rendezvous routing is used to transmit all the data in the strip to the sink in the form of a data packet with length. Additionally, the strip and CS-nodes use the rotation to achieve the goal of a balanced network load.

Muthukumaran et al. [26] proposed the HRML algorithm. The HRML assigns a level to each cluster head during the publicizing of the base station over the entire network, and when the route collapses, the scheme efficiently establishes a new level for the route between the base station and cluster heads. As soon as the sink node receives the route construction packet from the base station, the packet information is updated with the sink node’s own identification and hop calculation value and level, then the packet is disseminated to the sink node’s neighboring cluster heads. When the cluster head receives a failure message within its waiting time, it assumes that the route through the subsequent hop is broken so it retransmits the packet to different subsequent hop nodes from the routing table. If the cluster head does not receive a failure packet within its waiting time, it assumes that the packet has been successfully delivered so discards the data packet, which it was holding. If the source cluster head receives a failure packet and there is no alternate paths to the sink node, the cluster head broadcasts a request to the sink node to establish a route construction phase for that particular cluster head by transmitting the route construction packet again.

Darabkh et al. [27] proposed a Balanced Power-Aware Clustering and Routing protocol (BPA-CRP). Specifically, this protocol developed a batch-based clustering and routing protocol, in which the network topology divides the sensor field into equal-sized layers and clusters. BPA-CRP assigns four different broadcast ranges for each sensor. Also, BPA-CRP introduces a routing algorithm, in which a new node role called “Forwarder” is represented. This node is capable of transferring the collected data from its own layer and the one from further forwarders into the base station. Additionally, BPA-CRP introduces the “Only Normal” operation mode, which primarily prevents exhausted nodes from serving as cluster heads or forwarders any longer. Finally, this protocol puts proper node death-handling rules, which guarantee that each node dies smoothly without any loss of data or causing disruption for the network.

Wang et al. [28] proposed an Energy-Efficient Compressive Sensing-based clustering Routing (EECSR). EECSR consists of the cluster formation phase, the spanning tree construction phase, and the data acquisition phase. In the clustering phase, the process of selecting the cluster heads and joining the member nodes to the selected cluster heads are performed. The spanning tree construction phase generated the shortest path from the cluster heads to the sink. In the data transmission phase, the data sensed by the sensor nodes was transmitted to the sink through hop-by-hop communication.

Naghibi and Barati [1] proposed a mobile sink-based routing method (EGRPM). In EGRPM two mobile sinks for gathering sensed data by the nodes are used as well. Based on the communication between cells and mobile sinks, the cells are categorized into single-hop communication cells (SCCs) and multi-hop communication cells (MCCs). Mobile sinks move over two concentric orbits and stop at particular intervals to gather data from sensor nodes. In EGRPM, according to the mobility pattern of sinks, each half of the network is covered by a sink. This results in a decrease in energy consumption and an increase in the network lifetime.

Mosavifard and Barati [29] proposed a cluster-based two-level routing method. The method is consisted of two phases. In the first phase, CHs and BCHs are selected based on their residual energy, distance to BS, and centrality. By selecting BCHs, the overhead of clustering is reduced. The second phase is routing, which is consisted of intra-cluster routing and inter-cluster routing. In intra-cluster routing, each cluster is divided into four sections with the centrality of CH. In inter-cluster routing, CHs are layered based on their distance to BS. In this level, next hop is selected according to the layer number of CHs based on their residual energy and distance to the base station.

3 Proposed method

In EELRP, the geographical area of the network is layered as concentric circles of different radii. The base station is fixed and located at the center of the network area. The layers are divided into eight sectors with an angle of \(45^\circ \) using four diameters. The sectors are called \(S_1\) to \(S_8\). Sections are created through a crossover between layers and sectors. Each section contains some nodes and the most appropriate one in terms of centrality and remaining energy is selected as the agent. In aggregation and routing phase, the nodes of each section send sensed data to their agent. The agent aggregates data, adds error detection and correction codes, and sends information into the agent of the lower layer of the same sector. On receiving data, the agents investigate errors. When an error is detected, the agent performs required operations to correct the error. If it is not possible to correct the error, the upper layer is requested to resend the data. The procedure repeats until data reaches the base station. Due to the fact that the energy of the sensor nodes of WSNs is limited, EELRP seeks to provide an appropriate structure for reliable routing and aggregation to improve the network lifetime. The notations used in the proposed method are listed in Table 1.

Table 1 Notations

3.1 Problem formulation

The main goal of the protocol is to provide a regular structure for data aggregation and routing with error detection and correction ability such that the following objectives are achieved concurrently:

  • Maximize the protocol’s energy efficiency by minimizing the average consumed energy per node which in turn maximizes the network lifetime.

  • Increased reliability and prevents resending packets by applying error detection and correction RRNS code.

  • Maximize the protocol’s data delivery rate by select the suitable route.

The objective functions are constructed to simultaneously evaluate each candidate solution, based on the following objective functions.

3.1.1 Energy efficiency

To save more energy, fewer nodes (agent node) need to be participate in the routing process. The sensor nodes send the data packets to their agent. The agent send aggregated data to the base station hop-by-hop through other agent nodes. The maximum number of agent, given by Eq. (1).

$$\begin{aligned} K=8*N \end{aligned}$$
(1)

where K and N indicate the number of agents and number of layers in network, respectively.

Also, by applying error detection and correction RRNS code, retransmission of packets and the energy consumption of the network nodes reduced.

3.1.2 Reliability

Error detection and correction RRNS code is used hop-by-hop to detect and rectify faulty data. Since encoding and decoding are hop-by-hop performed, the reliability of the method is increased. An RRNS is defined as a chosen RNS with additional redundant moduli. Each redundant modulus is generally greater than any of the moduli of the chosen moduli set. Assuming the standard RNS consists of the moduli set of \(\left\{ P_1, P_2, , P_m\right\} \), the corresponding RRNS consists of a moduli set of \(\left\{ P_1, P_2,\ldots , P_m,\ldots , P_{m+2r}\right\} \) \( (r \ge 1)\). Assuming \(MAX (P_1, P_2,\ldots , P_m)\) is a function to get the largest modulus in this set, we get \(P_{m+j} > MAX (P_1, P_2,\ldots , P_m)\), for \(j=1,2,\ldots ,2r\). A typical RRNS system consists of \((m+2r)\) B/R converters, \((m+2r)\) subsystems and an R/B converter. The RRNS has capability of error detection and correction; by using \(2r (r \ge 1)\) redundant moduli r errors can be detected and corrected. We need the following definition to describe the error detection and correction capability of the RRNS.

3.2 Network model in EELRP

In the proposed method, we consider a WSN consisted of some sensor nodes, distributed randomly and constantly in the network area. Once being located in the network, the nodes are fixed. The nodes are homogeneous (i.e. the same energy source and hardware capability). Their initial energy is the same, and their energy sources are limited. Nodes periodically assess a geographical area and send the acquired data to the base station through the agent. In the proposed method the network is layered and sectorized. Then in each section, an agent is selected to collect the data sensed by the members of the same section. Logically, the topology of EELRP is cluster-based. The nodes are equipped with GPS. The base station is fixed in the network center and is so much powerful in energy and processing power. It’s assumed all nodes are aware of the location of the base station \((x_0,y_0)\).

3.3 EELRP

EELRP consists of five steps. The overall flowchart is illustrated in Fig. 1.

Fig. 1
figure 1

The overall flowchart of EELRP

Phase 1: Layering network

As shown in Fig. 2, the network area is divided into N layers of concentric circles with different radii. The layers are numbered \(L_1\) to \(L_N\). The most internal layer is a circle with radius R , the second layer is a circle with radius 2R , and the last one is a circle with radius \(N*R\) . In other words, R indicates the distance between layers and \(R<<R_c\) where \(R_c\) is the communication range of each node. The radius of \(L_{th}\) layer is derived from Eq. (2).

$$\begin{aligned} R_L=R+(L-1) * R=L*R \end{aligned}$$
(2)

where \(L=\left\{ 1,2,3,\ldots ,N\right\} \) and represent the number of layer.

Fig. 2
figure 2

Layering network area

On layering, each node identifies its layer number according to Eq. (3).

$$\begin{aligned} L_i=\lceil \frac{\sqrt{(x-x_0)^2+(y-y_0)^2}}{R}\rceil \end{aligned}$$
(3)

Where \((x_0, y_0 ),(x,y),R,\) and \( L_i\) indicate the location of the base station, the location of sensor node, the distance between layers, and the layer number of node, respectively.

Phase 2: Sectorizing network

The layered network is divided into eight equal sectors with an angle of \(45^\circ \) through four diameters. The sectors are called \(S_1\) to \(S_8\). Figure 3 shows the sectorized network. Sections are created through a crossover between layers and sectors. The number of network sections is derived from Eq. (4).

$$\begin{aligned} \text {Total number of sections}= 8*N \end{aligned}$$
(4)

Where N denotes the number of layers.

Fig. 3
figure 3

Sectorizing network area

On sectorizing the network area, the sector number of nodes \((S_i)\) is derived from Eq. (5). \(\alpha =tan^{-1}\frac{y^\prime }{x^\prime }\) \(x^\prime =x-x_0\) \(y^\prime =y-y_0\)

$$\begin{aligned} S_i,i= {\left\{ \begin{array}{ll} 1+[ \frac{\alpha }{45}], &{} if (x'>0 \textit{ and } y'>0)\\ 5+[ \frac{\alpha }{45}], &{} if ((x'<0 \textit{ and } y'>0) \textit{ or } (x'<0 \textit{ and } y'<0))\\ 9+[ \frac{\alpha }{45}], &{} if (x'>0 \textit{ and } y'<0)\\ \end{array}\right. } \end{aligned}$$
(5)

where \((x_0, y_0), (x, y),\) and \(S_i\) indicate the location of the base station, the location of sensor, and the sector name, in which the node is located, respectively.

Phase 3: Selecting agents

To transmit the data of sections to the base station, a node is selected as an agent in each section to receive the sensed data from other nodes. Then the agent aggregates the data and sends it to the base station. To select the agent, each node sends a Hello packet, containing its ID, remaining energy, section Identifier (including layer number and sector number), and location to its neighbors of the same section. Figure 4 illustrates a Hello packet.

Fig. 4
figure 4

Hello packet

On receiving Hello packets, nodes store their own information and those of other nodes of the same section in a table, called neighborhood table, regarding the field of section identifier. Table 2 shows the neighborhood table of nodes.

Table 2 Neighborhood table of nodes

Nodes calculate their own centrality using Eq. (6).

$$\begin{aligned} Center_i=\frac{\Sigma _{i=1}^q \sqrt{(x-x_i)^2+(y-y_i)^2}}{q} \end{aligned}$$
(6)

where q, (xy),  and \((x_i,y_i)\) denote the number of neighbors, node coordinates, and the coordinates of neighboring nodes, respectively.

Given its centrality and remaining energy, each node derives its fitness for being an agent of the section from Eq. (7).

$$\begin{aligned} Fit_{node_i} =\frac{Energy_{current}}{Energy_{max}}+\left( 1-\frac{center_i}{q*Dis_{max}}\right) \end{aligned}$$
(7)

where \(Energy_{current}\), \(Energy_{max}\), \(Dis_{max}\), q, and \(center_i\) are the remaining energy of node, the maximum energy of node while the battery is fully charged, the distance to the furthest node, the number of neighbors, and the node centrality, respectively.

Then each node sends a score packet, containing its ID and \(Fit_{node_i}\), to its neighbors. Figure 5 shows the score packet.

Fig. 5
figure 5

Score packet

On receiving the score packet, the nodes compare the ID of the received packet with those in their neighborhood table. If the ID is in the table, the \(Fit_{node_i}\) is recorded in the table. Next, nodes compare their own \(Fit_{node_i}\) with those of their neighbors in the neighborhood table, and the node with the highest \(Fit_{node_i}\) is selected as the agent of the section.

At the end of this phase, the agents of the sections are selected, and then each agent creates a TDMA scheduling and informs to the members of its section.

Figure 6 illustrates the network after completing phase 3.

Fig. 6
figure 6

Network after selecting agents

In each section, when the residual energy of the agent is less than 10%, the process of selecting the agent is repeated.

Figure 7 illustrates the flowchart of selecting the agents of sections.

Fig. 7
figure 7

Flowchart of selecting the agent of section

Phase 4: Sending sensed data to the agent of section

As shown in Fig. 8, the sensor nodes based on TDMA scheduling send the packets, containing the sensed data, section number (including layer number and sector number), and remaining energy to their agent. The agent investigates the section number of packets and decides based on the following conditions:

  • If the section number of the packet and agent are the same, the packet is accepted.

  • Otherwise, the packet is rejected since the data is not related to this section.

Fig. 8
figure 8

Sending the sensed data to the section agent

Phase 5: Sending data to the base station through agents

  • On receiving data packets, the section agents add error detection and correction codes to them based on RRNS, and then they are sent to the agent of the lower layer of the same sector. Providing error detection and correction is as follows. First, a moduli set such as \(\{ 2^{2n+2},2^{n+1}-1,2^n-1,2^{2n+2}+1,2^{2n+3}-1 \}=\{p_1,p_2,p_3,p_4,p_5\}\) is considered. \(P_1\), \( P_2\) and \(P_3\) are main moduli and \(P_4\) and \(P_5\) are redundant moduli. The agents of sections divide the aggregated data by these moduli and send the residues to the agent of their lower section of the same sector in a packet.

  • The agent of the lower section receives the data packet, containing error detection and correction code, sector number, and layer number. First, the agent compares the sector number of the data packet with its own sector number.

  • If the numbers are different, the packet is rejected since it does not belong to the sector.

  • Then the agent checks the layer number, if the data packet belongs to a lower layer, it will be rejected because it belongs to the layer nearer to the base station and should not be accepted.

  • If the data packet belongs to the same sector and is from an upper layer, it is accepted and decoded by the agent. If it is error-free, the received data is sent to the agent of the lower layer of the same sector.

To detect errors, initial data is recovered using the inverse convertor according to Eq. (8).

$$\begin{aligned} x = V_n \sqcap _{i=1}^n p_i+\cdots + v_3 p_2 p_1+ v_2 p_2+ v_1 \end{aligned}$$
(8)

Where \(v_1, v_2, v_3,\ldots , \textit{and } v_n\) are derived from Eqs. (9), (10), (11),..., and (12), respectively.

$$\begin{aligned} v_1&=x_1 \end{aligned}$$
(9)
$$\begin{aligned} v_2&= \mid (x_2- x_1) \mid p_1^{-1}\mid p_2 \mid p_1= \mid (x_2- x_1)| 2^{n+1}-1 =\mid x2 \mid 2^{n+1}-1 \nonumber \\&\quad +\mid - x_1 \mid 2^{n+1}-1 = V_{21} + V_{22} \end{aligned}$$
(10)
$$\begin{aligned} v_3&=\mid ((x_3- x_1)\mid p_1^{-1} \mid p_3-v_2) \mid p_2^{-1} \mid p_3 \mid p_3= \mid 2^{n-2}* (x_3- x_1 )+(-v_2)\mid 2^n-1 \nonumber \\&=\mid 2^{n-2}*x_3 \mid 2^n-1 + \mid - 2^{n-2}*+x_1 \mid 2^n-1 +\mid {-v}_2)\mid 2^n-1 = V_{31} + V_{32} + V_{33}.\end{aligned}$$
(11)
$$\begin{aligned}&\vdots \nonumber \\ v_n&= (((x_n - v_1) \mid p_1^{-1} \mid p_n-v_2) \mid p_2^{-1} \mid p_n-\cdots - v_{n-1})p_{n-1}^{-1}\mid p_{n-1}^ {-1} \mid p^n \mid p_n \end{aligned}$$
(12)

Then the recovered initial data (Y) is divided by redundant moduli. y is derived from Eqs. (13) and (14).

$$\begin{aligned} y_4 = Y \textit{ mod } P_4 \end{aligned}$$
(13)
$$\begin{aligned} y_5 = Y \textit{ mod } P_5 \end{aligned}$$
(14)

If \(y_4=x_4\) and \(y_5=x_5\), the received packet is error-free; otherwise, it is faulty.

  • If the error is correctable, the agent corrects it and the process continues.

  • Otherwise, the request of resending data is sent to the agent of the upper level. This procedure continues until the data reaches the base station. This process is shown in Fig. 9.

Fig. 9
figure 9

Sending data to the base station through agents

The flowchart of the proposed routing algorithm is illustrated in Fig. 10.

Fig. 10
figure 10

Flowchart of the proposed routing algorithm

3.4 Merging sections of low-energy level

Aggregating the data of its own section, the agent receives the remaining energy of nodes and calculates the average remaining energy of them according to Eq. (15).

$$\begin{aligned} Energy_{ave}=\frac{\Sigma _{i=1}^M Energy_{current_i}}{M} \end{aligned}$$
(15)

where M and \(Energy_{current_i}\) denote the number of section nodes and the remaining energy of node i, respectively.

If the average remaining energy is lower than 10% of the total energy of nodes, the agent sends a merging request packet to the agent of the upper section of the same sector. The request packet, containing the node ID and the merging/updating layer field, is depicted in Fig. 11.

Fig. 11
figure 11

Merging or updating layer packet

When merging/updating layer field, contained in the merging or updating layer request packet, equals 0, the packet is considered as a merging request.

On merging two sections of a sector, the agent of the upper section sends a merging advertisement packet, containing the node ID, the number of sections before merging, and the number of sections after merging, to all nodes of the merged sections, and advertise itself as the section agent. Figure 12 illustrates the merging advertisement packet.

Fig. 12
figure 12

Merging advertisement packet

The agent of the new section sends an up-layer packet to the agent of the upper layer of the same sector. When merging/updating layer field, contained in the merging or updating layer request packet as shown in Fig. 11, is 1, the packet is considered as an updating layer packet.

After receiving this packet, the agent decreases the layer number by one unit. Sending the updating layer packet to upper layers continues until the last layer of the same sector of the network is updated. Figure 13 shows the two lower merged sections of the sector 7.

Fig. 13
figure 13

Merging sections with low-energy level

4 Simulation and results

The results of simulation and evaluation are discussed in this section. The proposed method has been simulated through NS2 software in Linux operation system. The proposed routing method has been compared with CGC method [23] and Mosavifard et al. method [29] in terms of remaining energy, network lifetime, packet delivery rate, number of hops, and communication overhead that these parameters are the common parameters that used to evaluate and compare routing methods in the wireless sensor network. To provide a fair comparison between the proposed protocol and other protocols, they were compared under the same conditions. The parameters of simulation are listed in Table 3.

Table 3 Simulation parameters

The results of simulation and a comparison between the proposed method and other algorithms in terms of average energy consumption is illustrated in Fig. 14.

Fig. 14
figure 14

Average energy consumption at different times

As shown in Fig. 14, the average energy consumption of the proposed method is lower than that of CGC and the method presented by Mosavifard et al. In fact, the geographical area of the network is sectorized, and an agent is selected in each section. Since the section nodes send data to their agents, which are close to nodes, the energy consumption is reduced. Then the agents send information to the base station in a multi-hop manner. The paths to transfer information are predetermined so time and energy are not spent on route discovery. In fact, the agent sends information to the agent of the previous section. In other words, next hop is determined according to the section number, and there is no need to search for it; this leads to reducing energy consumption of the section agents. Also, if the data is faulty, error detection and correction code prevent resending data. Thus, all these properties result in reducing the average energy consumption in WSNs.

Increased ratio of the received packets to the sent packets leads to an increased packet delivery rate. Figure 15 illustrates the packet delivery rate in CGC, the method introduced by Mosavifard et al., and the proposed method.

Fig. 15
figure 15

Packet delivery rate in proportion to different node numbers

As shown in Fig. 15, an increase in the number of nodes results in a significant rise in the packet delivery rate of the proposed method compared with that of others. In this method, the network is layered and sectorized so that the paths are predetermined, and the data is sent through layers in a structured manner to reach the base station. Thus the data is regularly sent to the base station through some individual paths, and no time is spent on route discovery. Here, the probability of packets collision is minimized and the packet delivery rate is significantly increased.

Reduction of energy consumption and increasing load balancing in sensor nodes have effects on the network lifetime. Figure 16 illustrates an increase in the number of alive nodes in the network of the proposed method compared with CGC and the method proposed by Mosavifard et al. Due to applying some techniques such as layering, sectorizing, and merging, the energy consumption of member nodes, agents, and intermediate nodes is reduced, and load balancing is increased. So the network lifetime is increased.

Fig. 16
figure 16

Number of alive node

As shown in Fig. 17, although the communication overhead of the proposed method is higher than that of CGC method, it is still reasonable. Here, error detection and correction codes are used hop-by-hop to detect and rectify faulty data, a procedure which adds an overhead for calculation. Since encoding and decoding are gradually performed, the reliability of the method is increased.

Fig. 17
figure 17

Comparison communication overheads

It is expected that increased number of nodes leads to long paths for data transmission. As shown in Fig. 18, in the proposed algorithm, the paths are regular and predetermined, and the number of hops depend on the number of layers so that regarding the increased number of nodes, the number of hops is still acceptable and less compared with CGC and the method of Mosavifard et al.; because the data is sent to the base station through a layered network.

Fig. 18
figure 18

Route hop count

On simulating the proposed method and analyzing the results, we examined the advantages and disadvantages of the method. The proposed method outperforms other methods in terms of the average energy consumption, packet delivery rate, and number of alive nodes and hops. However, the overhead of the method is higher compared with that of other methods. Here, error detection and correction codes are used hop by hop to detect and rectify faulty data, which adds an overhead for calculation. Since encoding and decoding are gradually performed, the reliability of the method is increased.

Several hierarchical structures, having advantages and disadvantages, have been suggested to manage WSNs. Considering these benefits and drawbacks, we tried to propose an effective hierarchical method, providing error detection and correction and consuming minimum energy, to gather data. On simulating the proposed method, we investigated the parameters affecting the performance of the protocol. The performance of the proposed method is proper and acceptable. The results showed the applicability and effectiveness of the method.

5 Conclusion

One major issue in WSNs is the method of sending information from the network nodes to the base station and selecting the best path for information transmission. In the proposed method, the network is divided into some concentric circles, which are partitioned into eight equal sectors. Next, each section is assigned an agent, receiving data from nodes of the same section and sends it to the base station. Thus the energy required by nodes for data transmission is reduced. On data gathering, the agent adds error detection and correction codes and sends the data to the agent of the lower sector of the same section. The procedure continues until the data reaches the base station. Applying error detection and correction causes increased reliability and prevents resending packets. The structure of paths is regular and predetermined. The data is sent to the based station through a layered network. Thus the energy consumption is decreased, the network lifetime is improved, and the delivery rate is increased. The comparison of the EELRP with previous ones shows that it outperforms other methods in terms of average energy consumption, network lifetime, packet delivery rate, and route hop count. Further extension can enhance the proposed method through adjusting it with mobile WSNs, using mobile sinks with proper mobility models and employing a dynamic structure to manage the added or removed nodes.