1 Introduction

Along with improvements in wireless communications and digital electronics technologies, Wireless Sensor Networks have many applications in the field such as military, health, industry, and environment [1]. Energy-saving routing is very important for these network structures that perform their functions with limited energy resources [2]. In Sensor networks, the basic energy consumption is due to the routing of nodes and the routing of the node’s own data. It shows that the transmission of a bit from one point to another point consume equal power by running about one thousand micro codes. Therefore, power consumption can be minimized by performing many possible operations in transmission. For example, compressing a data before it is sent, or combining and sending many data packets can reduce the total power consumption [3]. In Sensor networks, a node can have more than one neighbor. However, when the common communication path is used, the probability of collision of transmitted data packets increases as the number of neighbors increases. When sending a data, common communication path often refers to the preferred path. Packet collision causes repeated data packets to be sent, which leads to unnecessary energy use [4]. Despite the use of modulation techniques to solve this problem in the data link layer, there are still operations to be done in the network layer [5]. In case of increasing packet losses, it is possible that the nodes do not use the same communication paths. The sensor nodes may be in listening or sleep mode when not active in communication [6]. Nodes use energy in listening mode as much as they are in communication, while they don’t use energy in sleep mode [7]. During listening, the measurements indicate that the amount of energy used by the sensor networks equals more than half of the total energy [8].

This is a major problem for Sensor Networks. For this reason, nodes cannot predict when to receive packets when they are constantly listening. In addition, most unnecessary packets can be received during listening. On the other hand, if all the nodes sleep, the node cannot forward the data packet to the base station. To solve this problem, an efficient routing algorithm is used to determine when a node will sleep/wake up, thus saving considerable energy [9]. In sensor networks, nodes are usually distributed at random [10]. The Sensor network needs to establish connections between these nodes. In addition, it is necessary to rearrange the faults and to catch up with the network changes. Sensor Networks do not have the above-mentioned approaches in hierarchical routing protocols, which are more energy efficient since they involve data clustering approach. In this study, an adaptive new hierarchical routing protocol is proposed which eliminates the disadvantages of the LEACH [11], PEGASIS [12], TEEN [13] and APTEEN [14] protocols out of the known hierarchical routing protocols in the literature.

The rest of the work was created in the following way. Attributes of a good routing protocol is given in Chapter 2. Related works are explained in Chapter 3. The recommended routing protocol is explained in Chapter 4. The performance evaluation results of the recommended protocol are presented in Chapter 5. The results of the study are included in Chapter 6.

2 Attributes of a Good Routing Protocol

In this section, features of a good routing protocol are given. All of these factors were taken into account in the proposed routing protocol. Because there are many limitations in Wireless Sensor Networks, it is necessary to design the routing protocol. In Sensor networks, there are many network resource limitations such as energy, bandwidth, central processing unit, memory [15]. Due to the efficient use of radio and energy resources and the need for effective operational capability, a routing protocol in sensor networks is expected to provide the following requirements [16,17,18,19]:Energy Efficiency: The Routing Protocol should extend the life of the network by allowing good connectivity and communication between the nodes. It should not be forgotten that replacing the batteries of these nodes is a very inefficient operation because the sensor nodes are randomly placed. Scalability: In Sensor networks, the number of sensor nodes can be hundreds or thousands, so the routing protocol designed should be adaptable to different network sizes. Durability: A good routing protocol should provide error checking and correction mechanisms. It must guarantee transmission in noisy environments and in time-varying wireless channels. Mobility: In Wireless Sensor networks, it is possible for the nodes to have their own mobility, base station mobility or mobility of the event to be detected. The routing protocol should provide the appropriate support for these movements. Quality of Service: Different applications in Sensor networks can vary in service quality in terms of packet loss and latency. Therefore, the Network protocol should be designed taking into account the service quality of specific applications. Flexibility: Operations of sensor nodes can be end unexpectedly because of battery consumption or environmental conditions. Routing protocols should come from the top of such situations, should immediately determine an alternative route. Self-operation: If it is a special unit that controls radio and guidance sources, a possible attack may occur and the Sensor Network may be completely destroyed. Since there is no central node that manages the process in the routing decisions, routing processes should be sent to the nodes in the network by the base station. Data Delay and Overhead Load: Significant factors affecting the design of the routing protocol. Data clustering and multi-hop operations are delayed. In addition, some routing protocols cause excessive computational burden with algorithms, if not suitable for severe energy constrained networks.

3 Related Works

Routing protocols are divided into 3 sections based on the network structure [20]. These; Flat, hierarchical and residential. In particular, it has been demonstrated that hierarchical routing protocols contribute significantly to energy savings in Sensor networks [21]. In hierarchical routing protocols, clusters are created and a cluster head node is assigned to each cluster [22]. The cluster heads are the leaders of the cluster they are in, and are responsible for retrieving the data of the sensor nodes in the cluster, collecting the received data and sending it to the base station [23]. This data aggregation in cluster-head nodes greatly reduces energy consumption on the network by minimizing the total message to the base station [24]. As energy consumption decreases, the life expectancy of the network also increases. The main idea behind the development of cluster-based routing protocols is to reduce network traffic towards the base station. LEACH [11], PEGASIS [12], TEEN [13] and APTEEN [14] protocols, which are among the hierarchical routing protocols in the literature, are described in this section.

3.1 LEACH

The Low Energy Adaptive Clustering Hierarchy (LEACH) [11, 25, 26] is a clustering based hierarchical routing protocol. A few of the sensor nodes in the LEACH protocol are randomly selected as cluster leaders. The main purpose of this selection is to ensure that the energy of the sensor nodes is used equally. Another task of sensor nodes that are cluster leaders is to collect information from nodes in the environment and transmit them to the base station. The LEACH protocol assumes that all sensor nodes have equal energy at each step and nodes consume equal energy. The LEACH protocol consists of two phases, the establishment phase of the network topology and the persistent state phase. In the first stage, clusters are created, cluster leader is determined, while in the second stage, data transmission takes place. Due to the design of the LEACH protocol, there are many disadvantages. These are listed below. LEACH assumes that each sensor node will pass directly to the base station or cluster head with a single hopper. Hence, it can not be used in applications where sensor nodes are deployed in large areas. The idea of dynamic clustering in the LEACH protocol, which should be the main aim of reducing energy consumption, places an additional burden on cluster leaders. Since Cluster Leaders are randomly selected, several cluster leaders may be found in the same area, while in some areas cluster leaders may be few. This prevents network communication. LEACH assumes that every sensor node consumes the same energy in each selection cycle. But it also includes cluster leaders. They acknowledge that each cluster leader is consuming equal energy.

3.2 PEGASIS

Power-Efficient Gathering in Sensor Information Systems (PEGASIS) [12, 27, 28] is a chain-based hierarchical routing protocol in sensor information systems. It presents an approach based on accepting the closest neighbors of sensor nodes as base stations and communicating with these nodes. If the sensor node can not reach its nearest neighbors, it changes its frame and identifies another nearby neighbors and accepts it as a base station. The PEGASIS protocol aims to increase the total energy of the network as a result of cooperation in the network, and to prevent unnecessary traffic in the network due to the proximity of the neighbor. The nearest neighbors determined by the signal power form a chain-like path. Thus, a chain-like path occurs up to the base station, from which the closest sensor nodes are formed. Due to the design of the PEGASIS protocol there are some disadvantages. These are listed below. PEGASIS assumes that each sensor node is in communication with the base station, but in practice the sensor nodes may need to jump more than once to reach the base station. PEGASIS assumes that all sensor nodes have the same level of energy and that their energy will be consumed at the same time. Because of the chain logic in PEGASIS, remote nodes can send their data with too much delay. Also, if the base station is seen by the sensor nodes, this causes the nodes in the network to waste energy and use the network unnecessarily.

3.3 TEEN

Threshold-sensitive Energy Efficient Sensor Network Protocol (TEEN) [13, 29] is a threshold-based hierarchical routing protocol. It is recommended for applications where time is important. In the TEEN protocol, the sensor nodes are functioning in the network according to their energy levels. A sensor node in a high energy state can both sense and route, while sensor nodes in a lower state are only detecting. Some disadvantages of the TEEN protocol are given below. A node can wait for its time slot for data transmission. If the node does not have the data, the repetitive time slot can be wasted. Transceivers are always open because cluster leaders always expect data from nodes.

3.4 APTEEN

Adaptive Periodic Threshold-sensitive Energy Efficient Sensor Network Protocol (APTEEN) [14, 30] is a threshold-based hierarchical routing protocol such as the TEEN protocol. The energy level is made dynamic in the APTEEN protocol. Therefore, the energy level can be determined according to the application requirements. APTEEN is suitable for time-critical applications such as environmental monitoring. Some disadvantages of the APTEEN protocol are given below. Creating clusters at multiple levels causes additional complexity. At the same time, the overhead is also increasing as the threshold-based functions are increased.

4 Proposed Routing Protocol

The proposed hierarchical routing protocol consists of two phases. In the first phase, the network map is being created. However, this process is done without GPS to avoid cost increase. In the second phase, sleep–wake/load balancing and data aggregation algorithms are used for routing operation. In the study, a sample laboratory study was conducted with TelosB IEEE 802.15.4 sensor nodes so that the network map can be obtained with maximum accuracy. A formula has been established as a result of the laboratory work. With this formula, team, group and zone assignments specific to the proposed protocol have been made. The TelosB node is only used for this operation. Subsequently all stages of the proposed protocol were simulated in the ns-2 environment. For a better understanding of the proposed routing protocol, the main map of the protocol is given in Fig. 1.

Fig. 1
figure 1

The main map of the proposed protocol

4.1 Topology Constructing

It is important that the location of the nodes in the network can be determined in order for the routing protocol to be realized to be energy efficient. For this, all sensor nodes in the environment send messages to the base station.

4.1.1 Sending Message to Base Station from Sensor Nodes

In most previous studies it was assumed that all nodes were able to reach the base station directly. But; in large-scale networks this is not possible. Since each sensor is usually 100 mt with a range of nodes, data comes from the base station with the help of cooperation. In the proposed protocol, the nodes directly reaching the base station send data directly to the base station while the nodes that can not reach directly transmit data over the neighbors. The packet structure of the message that each node sends to the base station is given in Table 1.

Table 1 The packet structure of the message sent by the sensor nodes to the base station

To determine the topology correctly, the sensor nodes send packets to the base station. The Algorithm 1 that allows the media nodes to send messages to the base station is given below.

figure b

4.1.2 Creating a Network Map by Base Station

After all the nodes in the environment send a message to the base station, the base station uses this information to generate a list as shown in Table 2 with the aid of the algorithm given below.

figure c
Table 2 List created by base station

The relation between RSSI and LQI is given in Table 3. RSSI and LQI are used with the help of some known reference positions. In order to achieve more efficient results than RSSI and LQI values, we first set known reference points for RSSI and LQI values. In this way, faults in different situations are corrected.

Table 3 The relation between RSSI and LQI [33]

A sample laboratory study was conducted with the TelosB IEEE 802.15.4 sensor nodes so that the base station can obtain these values and the network map with maximum accuracy. The topology used in the sample laboratory study is given in Fig. 2.

Fig. 2
figure 2

The topology used in the sample laboratory study

12 sensor nodes sent messages to the base station based on the packet structure given in Table 1 and the base station extracts the information given in Table 4 from incoming messages.

Table 4 Values obtained with TelosB nodes

As can be seen from Table 4, the Successfully Delivered Packet Ratio, RSSI and LQI values of the nodes near the Base Station are higher than the other nodes, while the Hop Count and Elapsed Time values are lower than the other nodes. Using this relationship, each node is given a note with (PR * (101 + RSSI) * LQI)/(HC * ET) formula. As specified in the formula, the parameters used to specify the location of the nodes in the network are PR, RSSI, LQI, HC and ET. PR, RSSI and LQI indicate that the position is good as the value increases. They are written as numerator. HC and ET indicate that the position is good as the value decreases. They are written as denominator. In this way, a node with a good position will have a big score on the result of the formula. Since the RSSI value can be up to − 100 dB, this value is added to 101 so that the result is not negative. This formula is only used to find team-group-zone concepts. This formula was not used afterwards.

The base station is sorting all nodes in this way by grading them. Then, according to the sort order, each node assigns a new ID. With the new ID, the zone, group and team informations are sent to the node. These terms used in the proposed protocol are explained below.

Team: refers to nodes that can reach the base station through the same hop count. It is determined by considering the total scores of nodes with equal hop count.

Group: refers to the neighborhood between the extreme node and the node closest to the base station. Grouping is done according to Hop Count. The maximum total score for each hop count is determined by considering the nodes.

Zone: Two groups close together form a zone. When scoring is done using the data obtained in Table 4, the results given in Table 5 are obtained.

Table 5 Specify the new ID for the nodes

As shown in Table 5, each node is ranked by total score. The base station that sets this up determines the team, group and zone codes according to the hop counts. For example, nodes that can reach the base station with the same number of hops are one team, while nodes having different hop counts form a group based on the order. These two nodes are in the same group because the 1 node is the first node with 1 hop and the 7 node is the first node with 2 hop. Two different groups form a zone.

The sample topology is shown in Fig. 3 for the base station.

Fig. 3
figure 3

Creating network map by base station

In Fig. 3 there are 3 zones. These zones will be referred to by their colors. Yellow (Y), Red (R), Blue (B). There are 2 groups in one zone. For example, in the Y zone, the group on the left is Y1–Y2–Y3–Y4–Y5–Y6 while the group on the right is Y11–Y22–Y33–Y44–Y55–Y66. Y1, Y11, R1, R11, B1, and B11 are called teams because they can reach the same number of base stations. So there are 3 zones, 6 groups and 6 teams.

The generated new IDs are sent to all nodes by the base station. In this way, the network map has been created by the base station. Algorithm 3 of determining team, group and zone information of sensor nodes and sending new IDs is given below.

figure d

4.2 Data Routing

In the network, the energy of the base station is assumed to be unlimited when the energy of all the nodes is initially assumed equal. The base station keeps records of nodes that send messages. Because the nodes have the same energy at first, the base station can know which node is functioning on the network. The energy levels are updated as nodes send messages to the base station. Sleep–Wake/Load Balancing and Data aggregation operations are performed while doing routing operation.

4.2.1 Sleep–Wake/Load Balancing

In the proposed protocol, while one group is working, other group is sleeping in the same zone. For example, when Y1–Y2–Y3–Y4–Y5–Y6 is running, Y11–Y22–Y33–Y44–Y55–Y66 are sleeping. This may be the opposite. In addition, team changes can occur in a group in the same zone. Y11–Y2–Y3–Y44–Y55–Y6 can sleep while Y1–Y22–Y33–Y4–Y5–Y66 are running as shown in Fig. 4. The base station determines sleep–wake states of the nodes according to the energy levels of the nodes. Nodes to work/sleep vary at certain intervals. At this point, the lifetime of the network is normally higher.

Fig. 4
figure 4

Sleep–wake/load balancing

In each zone, it is decided for each team which one sleeps and wakes up taking into account the energy levels of the nodes. When the energy levels of the nodes whose energy levels are initially equal are updated, the packet transmission rates of the corresponding node are determined. Because a node with more functionality in the network will consume more energy. With the algorithm given below, the nodes are switched to sleep mode at certain time intervals. The algorithm for the operation is given below (Algorithm 4).

figure e

4.2.2 Data Aggregation

To combine data in the proposed protocol, one cluster head is selected from each zone. In Fig. 5, sample topologies of zone R are given.

Fig. 5
figure 5

Sample topologies of zone R

The cluster head is evaluated by considering the distance of the nodes with the base station. In the example scenario, cluster heads can be 2, 3, and 4 nodes. The base station determines the energy levels according to which node will be the cluster head. The cluster head varies at specific intervals. For example, assuming that R33 is a cluster head, the nodes between this node and the base station may send data directly to base station, while the other nodes first send to R33 node. As shown in Fig. 5, while R1 and R2 directly send messages to the base station, the remaining nodes R44, R5, R6 send data to node R33 which is the cluster head. R33 performs dataaggregation and sends this value to the base station. The algorithm for determining the cluster head for Data aggregation is given below (Algorithm 5).

figure f

5 Simulation Results

Table 6 compares the proposed protocol with other protocols in terms of routing, data aggregation, energy efficient and multi-clearing.

Table 6 Comparision in terms of routing, dataaggregation, energy efficient and multi-hop

As seen from Table 6, LEACH, PEGASIS is weaker when compared to TEEN, APTEEN and Proposed Protocol because there are no data aggregation and multi-hopping features. In addition, the proposed protocol was compared with the existing protocols and the ns-2 [34] simulator was used with the LEACH plug-into see performance results. In the network where 100 nodes are used, the base station is fixed. Nodes are randomly distributed on the network. The field is 100 × 100. The initial energy of all the nodes is 2 joules.

In fact, a cooperation management is being put forward with with team-group-zone concepts. It is emphasized that the nodes in the network belong to a certain family, and they should work with each other by cooperation method. The more effective the nodes are in routing, the longer the life of the network. The common point of methods sleep–wake, load balancing and data aggregation is the cooperation between the nodes. In this study, this cooperation with the concept of team-region-zone is bound to a certain rule. Since all the energy of the nodes is equal in the beginning, a record of the energy of the node is kept with every packet sent and received after that. Which node is awake and which node is in the listening phase is dynamically changing according to these energy levels. At the same time, the cluster head can also change dynamically according to the energy level. The energy model represents the energy level of the nodes in the network. At the beginning of the simulation, the level of energy at which the node is possessed is called Initial Energy. The energy exchange existing in the simulation represents the level of energy at a node at any time. A node loses some energy for every packet transmitted and every packet received. However, the initial energy of the node is decreasing. If the energy level of a node reaches zero, it can no longer receive or send packets. The amount of energy consumption in a node can be printed in the trace file. The energy level of a network is determined by the sum of the energy levels of all the nodes in the network. The simulation parameters are given in Table 7.

Table 7 The simulation parameters

A comparative performance analysis of LEACH, PEGASIS, TEEN, APTEEN and the proposed protocol is presented based on the number of surviving nodes (Fig. 6) and energy expenditure (Fig. 7). The results of running the network 10 times under intensive communication have resulted in average values.

Fig. 6
figure 6

Number of surviving nodes (LEACH, PEGASIS, TEEN, APTEEN, proposed protocol)

Fig. 7
figure 7

Amount of energy consumed (LEACH, PEGASIS, TEEN, APTEEN, proposed protocol)

As can be seen from Fig. 6, the nodes using the protocols specified have not finished their power in the first 100 s. After a period of 500 s, LEACH and PEGASIS protocols experienced a further decline. As a matter of fact, after 750 s, LEACH, 1000 s later, no nodes of PEGASIS remained, all of them exhausted. Although the APTEEN protocol yields better results than the LEACH and PEGASIS protocols, it is not as good as the TEEN protocol due to the complexity of the APTEEN protocol. Load balancing, sleep–wake, and data combining are the best results in the proposed protocol because of the fact that they are effective.

As shown in Fig. 7, after 500 s, the amount of energy consumed in the LEACH and PEGASIS protocols approaches 2 joules. While the total energy is spent in the APTEEN protocol in about 1250 s, all energy is consumed in the TEEN protocol in about 2500 s. Since the recommended protocol sleep–wake operations are also performed, energy is used effectively, load sharing between the nodes, thus giving the best results when considering the amount of energy consumed.

Several techniques have been used in the proposed protocol and better results have been obtained in other protocols according to the energy and node count criteria as shown in Figs. 6 and 7. However, at first, a time is needed to obtain the network map. In addition, there is a negligible delay with respect to the procedures performed in the proposed protocol, as compared to the Teen and Apteen protocols. This is an expected result. Already every technique for energy efficiency increases the number of codes, which increases the processor cycle, so there is a delay, even at the microsecond level.

6 Conclusions

In this study, a new hierarchical routing protocol for wireless sensor networks was developed. Considering that the energy resources of sensor nodes are limited, sleep–wake, load balancing and data aggregation methods are used in the developed protocol. The data stream of the network is controlled by creating the network map from the base station. For the evaluation results, the application was first applied on the TelosB nodes using the Hop Count, Elapsed Time, Successfully Delivered Packet Ratio, RSSI and LQI values, and then the relationship between these values was formulated through the obtained results. In order to obtain the performance evaluation results, ns2 simulator was used to compare the number of surviving nodes and the amount of energy consumed by LEACH, PEGASIS, TEEN and APTEEN protocols and it was observed that the proposed protocol gave better results.