1 Introduction

WSNs consist of small sensor nodes which are powered by battery energy and have limited memory units. WSNs have two significant features: lack of infrastructure and self-organization. These features turn sensors into an appropriate choice for several applications. Nevertheless, it should be noted that sensor networks have sensor nodes with limited battery energy. Hence, the manner of saving nodes’ energy without compromising network performance is a challenging issue in designing WSN protocols. As far as a sensor node is alive, it can carry out its tasks. A WSN have many sensor nodes which are responsible for receiving information from the environment and transmitting information to a base station or sink via a single hop or multi-hops. In general, since nodes near a sink share several multi-hop routes and integrate data towards the sink, they are likely to deplete their battery power resources faster and sooner than the other nodes. Nodes’ shutdown results in topology failure and reduction of sensing coverage. Moreover, sink might be separated from the network and the data produced by the sensors is no longer accessible. Also in a WSN, the sensor nodes close to the sink are overburdened as they act as a bridge between the sink and the rest of the network for forwarding data to the sink. This results in rapid energy depletion of these sensor nodes and leads to network partitioning. Such adverse circumstance is termed as hot spot problem in a large WSN, while the sensor nodes nearby the sink exhaust their energy, the far away sensor nodes. Using mobile sinks has been suggested as a possible solution for sorting out this problem. The hot spot area around the sink changes as a result of sink mobility and the excessive energy consumption around the sink is distributed throughout the network. It should be highlighted that uniform energy consumption enhances network lifetime.

Moreover two major possible energy losses that a sensor node exercises in a wireless sensor network is energy lost during sensing and communication cost. The energy loss in communication is much higher than the energy loss in sensing. But communication cost is the major loss that can be efficiently reduced.

In this paper, a new efficient clustering algorithm based on mobile sink was proposed for WSNs which is able to cluster network nodes according to their energy level and can enhance network reliability. So the proposed approach aims at reducing the communication cost as much as possible using mobile sink thereby providing energy efficiency. The main stages of the proposed approach include:

  1. A.

    Formation of one-hop clusters (Clustering).

  2. B.

    Notification to mobile sink and sink mobility.

  3. C.

    Sensing of mobile sink by clusterheads.

  4. D.

    Clusterhead energy conservation.

  5. E.

    Monitoring clusterheads.

2 Related Works

A routing protocol, called NODIC, was proposed in [1] for finding optimal clusterheads in distributed WSNs. In distributed sensor networks, each node may be a clusterhead or a normal node. Related studies indicate that, in the networks where remaining energy criterion is used for selecting clusterheads, death of the first node is postponed. However, if the position criterion or the number of neighbors, or in other words, more communication is used, death of the last node is postponed and network lifetime is enhanced. The solution proposed in this paper for the above-mentioned issues is a combination of these two possible modes. The clusterhead is randomly selected according to (1). If its probability value is less than T(n) in each round, the clusterhead will be selected as a temporary clusterhead.

$$T\left( n \right) = \left\{ {\begin{array}{*{20}l} {\frac{\text{p}}{{1 - p*\left( {r mod\frac{1}{p}} \right)}}} \hfill & { if\quad n \in G} \hfill \\ 0 \hfill & { otherwise } \hfill \\ \end{array} } \right.$$
(1)

where T(n) denotes the threshold value; r refers to the number of round and p refers to the probability for being selected as the clusterhead.

After a number of clusterheads are randomly selected in the network, temporary clusterheads transmit an advertisement message. As soon as each of the normal nodes receives this message, they select the closest clusterhead based on their distances. Then, they transmit the connection message along with their remaining energy to the temporary clusterheads. After all the nodes transmit their membership messages, the temporary clusterhead makes decision based on the nodes’ remaining energy. In case the remaining energy of the entire cluster is greater than 70% of the total initial energy of the cluster, the node with more energy will be selected as the new clusterhead. Otherwise, the node having more neighbors and, consequently, more communications, will be selected as the new clusterhead. Finally, new clusterhead’s information including its coordinates and ID will be transmitted to the nodes through an ack message. In this way, the clusterhead is selected optimally and independently in the first round with regard to the conditions of each cluster. As soon as the remaining energy of the clusterhead is less than a specific amount in the next rounds, reclustering will be conducted. In general, in case the remaining energy in each cluster of the network is less than 70%, switching will be carried out.

In [2], the way of detecting and recovering nodes’ errors in relation to energy efficiency in WSNs, entitled multi-purpose energy efficiency routing for WSNs, was investigated. The method proposed in [2] included two phases: the first phase is concerned with data routing related to error tolerance and the second phase is concerned with energy efficiency routing method. Simulation results indicated that the proposed routing has a better supervision over the nodes which leads to effective maximum energy efficiency with regard to tolerating errors in WSNs.

A general overview of network lifetime enhancement in WSNs was proposed in [3]. As a result, data transmission route is selected in such a way that total energy consumption throughout the network is reduced. Along this purpose, clustering is used which contributes to using energy in limited resources. Hence, network lifetime is enhanced.

An intra-network distributed multiple routing method was proposed in [4] for increasing failure tolerance in the network and for maintaining nodes’ energy. Based on simulation results, sub-path discovery method indicated an efficient method which is compatible with the features of the multiple communication pattern of WSN. The main rationale behind this routing type is to tag messages related to each route and to identify neighboring routes which transmit the messages.

An optimal scheduling mechanism and a method for transmitting packets in WSNs were proposed in [5] where information is collected in clusterheads. The purpose of this method was to investigate the processes of a real-life round for a specific time period in routing data packets to the base station with minimum packet loss probability. For achieving this purpose, scheduling algorithm was optimized so that time slots through which data transmitted by the sensor nodes are sorted. The scheduling method guarantees that all the packets are transmitted in a certain slot; hence, delay is reduced; also, there is a packaging probability for each node.

In [6], an analytic model was proposed for the issues of network lifetime and coverage in WSNs by using 2-dimensional Gaussian distribution. Coverage probability in Gaussian distribution depends on factors such as Gaussian SD, distance between a respective point and a central point. By adjusting different above-mentioned parameters, coverage probability and network lifetime are enhanced. Using scheduled node deployment algorithm, long network lifetime and greater coverage are enhanced from a limited number of sensor nodes.

In [7], the issue of enhancing WSN security was addressed by using a number of additional transmitters so as to ensure that, in the initial designing, each sensor node with the shortest non-connected k-form routes to the sinks is identified. For identifying maximum k value so that each node has the shortest non-connected k-form, the researchers in [7] suggested the measurement of route and the type of its active programming. Then, they introduced GRASP-ARP as a centralized off algorithm which uses the method of counting routes so as to minimize the number of transmitters. They used the technique of counting routes and Ford–Fulkerson algorithm for finding non-connected routes. This approach increases the speed of counting process for the entire network. Experimentally, when compared with the previous methods, this method provides a suitable and logical scheduling which uses 35% less transmitters.

In [8], a fuzzy routing protocol based on collective intelligence was proposed for solving the problem of unbalanced cluster creation. This algorithm, referred to as FIS (swarm intelligence basedfuzzy routing protocol), uses average fuzzy c-clustering algorithm for clustering all the nodes within balanced clusters. Then, it uses Mamdani Fuzzy Inference System for selecting clusterheads. This method not only guarantees the production of balanced clusters but also specifies their exact number.

3 The Proposed Method

Given the limitation of energy, routing with energy-efficiency is considered as an important challenge in sensor networks. In the method proposed in this paper, we suggested a new distributed clustering routing protocol with high reliability, namely DCRRP. This algorithm has three stages: in the first stage, a new method is proposed for selecting clusterheads. That is, clusterheads are selected based on nodes’ distances from the sink and their remaining energy. In the second stage, for enhancing reliability, decisions about the replacement of previous failing clusterheads are made dynamically and locally. When errors and failures occur, clusters can make independent decisions for selecting the best alternative clusterheads. In the third stage, clusterheads collect data from members within the cluster and the sink is informed so that it moves to the location where there is a lot of data and the clusterhead’s energy in that location is decreasing. Detailed information about the proposed method is given below.

3.1 Stage One: Cluster Production Phase

In a WSN, the sensor nodes are densely organized in a geographical region and the nodes are used to sense the environment and to perform the task of data collection. Moreover, the data collected by the sensor nodes are routed through intermediate nodes in order to send them to the base station called sink node where it is collected and stored for further analysis. In such a scenario, the sensor nodes expend more energy in the transmission of data from the sensor nodes to the sink node and hence the energy consumption for transmission becomes more than the energy required for processing the data at the base station. In cluster based routing, nodes are grouped into small groups called clusters which help to reduce the energy by sending the data through the clusterheads. In this scenario, the coordinators or clusterheads can send the data directly to the sink node if they are present near to the sink node. On the other hand, the coordinators have to send the data to the sink node through multi-hop communication with other coordinators if the coordinators are not present near to the sink node. If the same node remains as the coordinator for a longer time, then its energy is drained fast and hence it will lead to reduction in network lifetime. In clustering, a sensing and data collection field is partitioned into smaller cluster. From each cluster, one sensor node is chosen as the Coordinator or clusterhead which aggregates the data collected from other sensor nodes and routes the aggregated data to the base station. The nodes of the clusterhead closer to the sink node are over-burdened by subsequent data arrival from the other participating nodes. Therefore, the energy of those nodes is exhausted rapidly. This makes the networking system to be disconnected from such nodes and this phenomenon is termed as hot spot problem [9].

In order to address the energy consumption issue effectively, we propose a new Energy-Efficient clustering algorithm in this part which overcomes the hotspot problem and utilizes the energy of nodes more efficiently. This algorithm for clusterheads selection based on the residual energy of the nodes and the distance of the nodes from the sink node. As the transmission consumes energy based on the distance, the distance to the sink is considered as an important parameter in this work to select the clusterhead so that the energy utilization is monitored perfectly. Since the information transmission from source to the sink is performed by the grid coordinator which acts as a relay node, it minimizes the energy consumption in the routing process which has improved the lifetime of the network.

In the proposed method, the cluster-based network model has the following three main elements which are depicted in Fig. 1: sink node, clusterhead and member nodes within the cluster. The sink node is responsible for getting collected data by the clusterhead. Member nodes within clusters sense data from the environment and transmit it to their related clusterheads. Clusterheads receive data from cluster members, process them and transmit them to the mobile sink. In general, for establishing clusters, nodes with high remaining energy and low distance from the sink are selected as the clusterheads; also, nodes with less remaining energy are selected as cluster member nodes. Each node belongs only to one cluster. On the other hand, given the objective of minimizing clusterheads’ energy consumption during data transmission process, a lot of attention has been given to the inter-cluster and intra-cluster communication cost. That is to say, while getting connected to the clusterheads, cluster member nodes try to connect to the closest clusterheads with the highest energy among all the legal clusterheads. In case a node’s distance from two clusterheads which have identical energies is equal, it will randomly select one of the two clusterheads.

Fig. 1
figure 1

Clustering-based network model in the proposed method

In the clustering stage, sensor nodes are classified into separate clusters. Before beginning the competition for becoming a clusterhead, each node independently regulates its scheduler according to (2).

$$t\left( i \right) = \frac{{E_{m} \left( i \right) - E_{r} \left( i \right)}}{{E_{m} \left( i \right)}} \times T_{CH} \times D_{iS}$$
(2)

where t(i) denotes the scheduler of the ith sensor node. TCH refers to the maximum allocated time. Em (i) and Er (i) refer to the node i’s maximum initial energy and remaining energy, respectively. Dis denotes the distance of the ith node’s distance from sink s which is measured according to (3).

$$D_{is} = \sqrt {\left( {x_{i} - x_{s} } \right)^{2} + \left( {y_{i} - y_{s} } \right)^{2} + \left( {y_{i} - y_{s} } \right)^{2} }$$
(3)

where (yi, xi, zi) indicates the ith node’s position of and \(\left( {y_{s} ,x_{s} ,z_{s} } \right)\) refers to the position of the sink. According to (2), the node with more remaining energy and less distance from the sink is more probable to be selected as the clusterhead because its scheduler indicates a smaller number; when the scheduler is finished, node i introduces itself as the clusterhead and broadcasts an advertisement message within its transmission range (R). The advertisement message includes node’s ID, its remaining energy Er(i) and its position P (i). If node j receives this message, it quits its candidacy for becoming a clusterhead and cancels its scheduler. Hence, it will be an ordinary node until the next round. Node J saves the list of nodes from which it has received advertisement messages and entitles it as the set of neighboring clusterheads. As a cluster member, node j should join one of the available clusterheads in the list. Thus, among the set of its available neighboring clusterheads, the clusterhead with high energy among the available clusterheads which has shorter distance from node i is connected. Then, this node sends a Join or connection message including the ID of the respective node and its position P(i) to the selected clusterhead. In this way, clusters are formed. Then, routes to the sink should be determined which is done hierarchically. That is, a DVB (direct virtual backbone) is created for all the clusterheads. At the beginning, the sink node sends a route request message to all the clusterheads located within its 2R range. This message includes information such as node’s ID, level and information about the location of the sink. It was assumed that the level of the sink node is zero. When the clusterhead u receives a message, it increases its level for a certain amount and selects the sink node as its father (PNFootnote 1(u) = sink). In other words, the level of all the clusterheads located within 3R range of the sink is equal to one. Then, the clusterhead u extracts the ID and location of its father (sink node) from route request message and registers them in the list of fathers. Hence, it sends this information while transmitting TDMAFootnote 2 pack to the cluster member nodes so that they can select one of the parents for error tolerance in case an error occurs. Also, the clusterhead u registers information such as ID, L(u), Er(u) and position P(u) in the route request message and resends it to all the clusterheads within its radio range. If the clusterhead v receives a route request message and its level is smaller than or equal to level of node u, it will ignore that message. Otherwise, it increases its level to a value one unit greater than that of node u and considers it as one of the PNs. It extracts the ID and position of the parent node (clusterhead u) from the route request message and registers it in the list of parents. Then, it transmits them while transmitting TDMA stack to the cluster member nodes. In this way, these stages are carried out and all the clusterheads broadcast route request message so as to complete DVB creation process. Within DVB, a clusterhead might have several PNs. Hence, several routes to the sink will be created. After establishing clusters, clusterheads send a response packet to the sink including information such as their ID, physical position and remaining energy. This information is registered in the routing table of the sink; accordingly, in the data collection phase, the sink moves towards the clusterheads or selects its alternative node based on this information.

3.2 Stage Two: Establishing Reliability

Since failure can result in the degradation of the overall performance of the network, a clusterhead’s failure can be regarded as a limitation for those sensor nodes’ which are observed by that clusterhead. Indeed, it prevents data collection and data dissemination. Hence, routing algorithms in clustering should be tolerant of errors, especially with respect to errors occurring in clusterheads. Consequently, the objective of this stage is to select the best alternative clusterhead when the previous clusterhead fails. In this way, reliability is enhanced. According to the previous stage, in establishing DVB, each n − 1-level clusterhead has several parents and the clusterhead itself might operate as a parent for the n-level clusterheads. On the other hand, the clusterhead of a cluster might have k sensor nodes.

When a clusterhead is in error due to battery depletion or another hardware issue, its communication with other cluster members is disconnected. Also, it cannot operate as the father for the nodes of the next level. Moreover, its communication with its parents is also disconnected. In the previous stage, while establishing routing tree, each node which is selected as the clusterhead transmits a list, i.e. list of parents, to the cluster member nodes while transmitting TDMA pack. This list indicates father clusterheads. In this way, nodes become aware of the information of their clusterhead’s parent node so that they can quickly restore the tree when a problem occurs for the current clusterhead. As a result, nodes can keep doing their activities. In case a clusterhead has a problem within the cluster, member nodes of that cluster can easily notice the clusterhead error because they do not receive any ACKs for the data packets they have transmitted. At this time, cluster member nodes whose clusterhead is in error broadcast a HELP message within their radio range. This message includes information about nodes’ energy level, their IDs, previous clusterhead’s ID and their distances from BS. If a node is the member of another clusterhead, when it receives the HELP message, it will destroy it. Otherwise, it competes for being selected as the clusterhead. After each sensor node receives HELP message, it sets its timer according to (2). It carries out the stages of clustering phase so that one of the cluster members whose clusterhead is in error is selected as the clusterhead. Until now, cluster and cluster members’ communication was maintained by selecting a new clusterhead from the parent nodes of the previous clusterhead. That is, the communication of the cluster and new clusterhead with the sink or BS is maintained via parent nodes. As mentioned above, while n − 1 level clusterhead operates as the parent of n-level clusterhead, in case it commits an error, n-level clusterhead will easily detect it. That is to say, when it sends each data packet, it does not receive any ACKs from it. Hence, for identifying new n − 1 level clusterhead as its parent, the new n − 1 level clusterhead broadcasts a message within its 2R range while it transmits the declaration message (advertisement) about becoming the clusterhead. With respect to the ID of the available previous clusterhead in this message, the clusterheads can compare the ID with the IDs that they have in their parent list. If the ID is available in the list of the existing parent nodes, they remove the characteristics of the previous clusterhead from the parent list and replace it with the new clusterhead. Next, they measure the average remaining energy of the available clusterheads in the list and establish the new parent list; this list includes clusterheads with higher average remaining energy or equal average remaining energy. The members of this set operate as the parent nodes of the clusterheads. The new clusterhead may or may not a member of the list of new parents. Thus, using the method proposed in this paper, in case a problem occurs for the clusterhead, we were able to restore the available routing tree and prevented the creation of a new routing tree.

3.3 Stage Three: Data Collection Phase

In sensor networks, when data transmitter cannot send data in one hop, multi-hop relations are used. One of the ways for reducing energy consumption is to use multi-hop relations so that the routes requiring less energy consumption for data transmission can be used. On the other hand, an increase in the number of hops leads to a condition in which more nodes throughout the route buffer the packet. Accordingly, this issue causes more processing and overhead. Thus, it is essential to use a sink which is capable of moving and contributes to the reduction of different hops in routings in the network. As mentioned in the first stage on the establishment of clusters, there is a sink table which is updated; this table includes fields such as the IDs of clusterheads, their geographical positions and their remaining energy. Also, in each round, as the remaining energy of the nodes changes, the node which is selected as the clusterhead is updated. When data collection task by the clusterheads is finished, clusterheads send a message to the sink and inform it about their remaining energy after they have exchanged a message. They announce that they have data to be transmitted. Now, it is the sink’s turn to begin to receive data. One of the proposed solutions is to use a mobile sink and make decisions about selecting the replacement location. Since a random location for the sink is selected and embedded in each round, the sink will make decisions according to the clusterheads’ remaining energy which is included in the table. If the remaining energy of the clusterheads is more than 70% of their total initial energy, the sink will move to the location which was randomly embedded for it. However, in case the remaining energy of the clusterheads is less than 70% of their total initial energy, the sink will move towards a dense area. It should be noted that the sink will place a node as its representative in the embedded location which is responsible for collecting data from clusterhead. Now, the clusterheads will be informed of the two coordinates which were specified for receiving data. Hence, they will send data to the closest coordinate through a single-hop or multi-hops. At the end, the sink returns to its main position and receives data via the representative node. After that, clusters’ activities start again. The next round will be carried out in the same way. The flowchart of the proposed method is given in Fig. 2.

Fig. 2
figure 2

Flowchart of the proposed method

3.4 Simulation Environment

In this paper, OpnetModeler 11.5 [10] was used for simulating the proposed method and comparing it with NODIC routing protocol [1]. This simulation software allows network designers and researchers to precisely predict the performance of protocols and equipment via simulation. Simulation parameters used in this study are given in Table 1.

Table 1 Simulation parameters

In the proposed method, network topology including 50 nodes and four scenarios were taken into consideration. In the first scenario, sensor nodes were randomly distributed in the area based on NODIC protocol. In the second scenario, nodes were randomly distributed in the area which operated based on the proposed DCRRP protocol. In the third scenario, sensor nodes were randomly distributed in the area which operated based on NODIC protocol and some of them had errors. In the fourth scenario, nodes were randomly distributed in the area which operated based on DCRRP protocol and some of them had errors. An identical topology was assumed for all the four scenarios. Figure 3 illustrates network topology for the first and second scenarios of the network without errors. Figure 4 illustrates network topology for the third and fourth scenarios of the network where a number of nodes are in error. Figure 5 depicts the movement of the sink towards dense areas in the proposed method.

Fig. 3
figure 3

Network topology with 50 sensor nodes for the scenarios without errors

Fig. 4
figure 4

Network topology with 50 sensor nodes for the mode with errors

Fig. 5
figure 5

Network topology after the movement of sink towards dense areas

4 Simulation Results

The node consumes energy for transmission, reception and processing. Nodes consume greater energy during transmission than reception and processing. The average energy consumption is the average energy consumed by nodes in the network. As shown in Fig. 6, the average energy consumption in the mode without errors was investigated for the proposed method and NODIC protocol. The vertical axis of Fig. 6 indicates energy consumption and the horizontal axis denotes simulation time. The consumed power is equal to the total of the used energy by the nodes within the network. The energy used by one node is equal to the total of used energy for communications such as transmission and expectation. As it was expected, NODIC protocol had the highest power consumption because network nodes do not operate consciously. In other words, they directly transmit the collected data to the sink. However, in the proposed method, mobile sink was used for transmitting data. Also, in case there is a lot of data, since the sink moves towards the dense area, the distant nodes do not have to consume energy for sending data. Moreover, the dense area around the sink changes by its movement. In this way, the excessive increase in energy consumption around the sink is distributed over the network. This condition contributes to uniform energy consumption in the network.

Fig. 6
figure 6

Average power consumption of network in the scenarios without errors

Furthermore, Fig. 7 shows the comparison of the proposed algorithm with NODIC protocol in terms of average energy consumption. The vertical axis denotes power consumption and the horizontal axis indicates simulation time. As it is expected, with regard to the scenarios with errors, NODIC protocol had higher power consumption than the proposed protocol. In the proposed method, when some of the clusterheads have errors, thanks to local selection, the best clusterheads from the cluster members replace the erroneous clusterheads which enhances network reliability. Accordingly, data is transmitted through the alternative clusterhead.

Fig. 7
figure 7

Average power consumption of network in the scenarios with errors

Moreover, as shown in Fig. 8, the proposed algorithm and NODIC protocol were compared with each other in terms of end-to-end delay for the scenarios without errors. The vertical axis denotes end-to-end delay and the horizontal axis refers to simulation time. It was observed that end-to-end delay increased in NODIC protocol since some clusterheads might transmit some part of data but do not have sufficient energy for sending the remaining part of it. Hence, they cannot complete data transmission action. Also, due to excessive data transmission, the clusterhead depletes its energy and is shut down. Consequently, data transmission is delayed and error occurs in the network. Nevertheless, in the clustering stage in the proposed protocol, by selecting the best alternative clusterhead from among the members of the cluster, the erroneous clusterhead is replaced which enhances reliability. Also, by the movement of the sink towards dense areas where low-energy clusterheads are placed, it receives data from them before they are shut down. Consequently, end-to-end delay is reduced.

Fig. 8
figure 8

End-to-end delay for the scenarios without errors

Also, the following figure illustrates the comparison of the two algorithm with respect to end-to-end delay in the scenarios with errors. The vertical axis denotes end-to-end delay and the horizontal axis refers to simulation time. In a similar vein, it was found that, in the scenarios with errors, NODIC protocol increased end-to-end delay. That is, in case an error occurs, the clusterheads in NODIC have no pre-planned solutions. Thus, nodes might use loger routes for transmitting data which leads to increased end-to-end delay. In contrast, in the proposed protocol, in the case of an error occurrence, by selecting the best alternative node from the cluster member nodes, direct virtual backbone (DVB) to the sink node is quickly created. As a result, end-to-end delay is reduced (Fig. 9).

Fig. 9
figure 9

End-to-end delay for the scenarios with errors

Moreover, as depicted in the following figure, the proposed and NODIC protocols were compared in terms of multimedia access delay. The vertical axis denotes multimedia access delay and the horizontal axis refers to simulation time. Multimedia access delay refers to the time period between data packet reception by MAC layer and the time it is completely placed on the wireless media. The justification for investigating this parameter is that many multimedia applications are limited in terms of delay. Hence, after the specific set time, the respective application may not have any uses. It was found that the delay of multimedia files increased in the NODIC protocol. It is attributed to the fact that, due to very high data production rate in transmitting video and also, due to the explosive feature, congestion occurrence increases. However, in the proposed protocol, thanks to the movement of the sink and fast data transmission to the sink, the delay of multimedia files is reduced (Fig. 10).

Fig. 10
figure 10

Multimedia access delay in the scenarios without errors

In addition, as shown in the following figure, the two protocols were compared with one another in terms of multimedia access delay in the scenarios with errors. The vertical axis denotes multimedia access delay and the horizontal axis refers to simulation time. It was observed that, in NODIC protocol, in the mode with errors, the delay of multimedia files increased. Since much energy is required for direct data transmission to the sink at high distances, sensor nodes have to transmit data to the sink node via multi-hops. Hence, due to the heavy display of packets in the sensor nodes which are at the single hop neighborhood of the sink, much energy is depleted and critical points are created. Hence, delay increases accordingly (Fig. 11).

Fig. 11
figure 11

Multimedia access delay in the scenarios with errors

Also, Fig. 12 shows the comparison of the two protocols in terms of throughput in the scenarios without errors. The horizontal axis denotes simulation time and the vertical axis refers to the number of delivered packets at a given time. Throughput refers to the total received packets by the receivers divided by the time between the first and the last reception. In fact, the throughput is measured by dividing the file size by the time which results in throughput in megabits per second. As illustrated in Fig. 12, the number of successfully delivered packets to the sink I NODIC protocol was less than that of the proposed protocol which is attributed to the shortage of energy and the probable shutdown of nodes. In contrast, in the proposed protocol, given the movement of the sink towards data transmission requesting node and the placement of the sink in the vicinity of the clusterhead, the number of packets delivered to the sink node will be high.

Fig. 12
figure 12

Throughput in the scenarios without errors

Finally, the following figure shows the comparison of the proposed and NODIC protocols in the scenarios with errors. The horizontal axis denotes simulation time and the vertical axis refers to the number of delivered packets at the time, i.e. throughput. It was found that, in NODIC protocol in the scenarios with errors, throughput is poor which is attributed to the probable shutdown of the clusterheads due to error or the depletion of the energy of the batteries. However, in the proposed protocol, inasmuch as the sink moves towards the data transmission requesting node and it is placed in the vicinity of the clusterhead, the number of successfully delivered packets to the sink node is high (Fig. 13).

Fig. 13
figure 13

Throughput in the scenarios with errors

5 Conclusion

In WSNs with a fixed sink, since the nodes are near the sink and there is dense data concentration in the area near the sink, these nodes are more likely to deplete their energy resources. Inasmuch as nodes’ shutdown leads to topology failure and reduced sensing coverage, the data produced by the sensors may no longer be accessible in the network.

In this paper, a reliable routing protocol based on clustering and mobile sink was proposed for WSNs. Mobile sink is regarded as a potential solution towards hot spot problem or energy hole problem as it significantly reduces energy consumption of the sensor nodes and thus enhances network lifetime. Also, by making the decision about the local and dynamic selection of the best alternative clusterhead at the time error occurs, network reliability is enhanced.

As mentioned earlier in the paper, the proposed and NODIC protocols were simulated in Opnet and compared with each other. The simulation results were considered with respect to the following criteria so as to investigate the performance of the two protocols: power consumption, end-to-end delay, delay in transmitting multimedia files and throughput. In general, it was observed that the proposed protocol performs better than the NODIC protocol. Thanks to selecting more stable and sustainable routes with high-energy nodes and using dynamic sink, the efficiency of the entire network was optimized and the reliability of packet delivery was enhanced in comparison with NODIC protocol.