Sensor nodes have been widely used in industry and have a significant impact on the efficiency of many military and civilian applications . These nodes have been used in areas like monitoring toxicity levels in factories and gathering data from inhospitable places like battlefields, jungles, and other hard to reach areas. The nodes are often constrained in terms of energy and have low data rates compared to typical wireless networks. Due to the unique characteristics of these sensor networks, efficient routing algorithms have been one of the technical challenges in wireless sensor networks (WSNs).
In recent studies, sensor networks that require performance guarantees such as for end-to-end delay have also been drawing increased interest. For instance, routing of imaging data in a battle environment requires careful handling in order to ensure that the end-to-end delay is within an acceptable range and the images are received properly without any distortion.
The bulk of research in wireless sensor nodes has been focused on developing algorithms that can maximize the lifetime of the network through efficient routing and energy usage. A combination of clustering methods for WSNs and the deployment of a mobile gateway to collect data directly from the source will efficiently decrease the end-to-end delay of real-time data transmission and at the same time it will efficiently utilize the energy of each node in the network.
Clustering methods have attracted researchers in the past decade. The concept of clusters in WSNs was first proposed in the design of the packet radio network, which was mainly used for hierarchical routing . With the continuous deepening of the study, to date, for constructing and maintaining the sub-cluster network structure, different researchers have proposed a large number of clustering algorithms. Clustering-based networks can reduce the cost of the routing algorithm and the flooding broadcast so that mobile nodes can be easily managed and the efficiency of the use of network resources improved . Clustering a WSN makes the network more manageable, improves the scalability of the network, and balances energy consumption among all nodes by preventing the nodes closer to the sink from using up all their energy earlier than the rest of the nodes.
While existing protocols achieve soft end-to-end delay guarantees, their service can diminish with the increasing quantity of real-time data. In order to enhance the timeliness of the network in situations where packets start missing their specified deadlines, one of the solutions being explored is the gateway’s ability to be relocated to the source of the data itself. The gateway, a mobile node, will have the ability to relocate itself to a location where the volume of real-time data is high. Mobile nodes are not a new concept and have been proposed for remedying a number of inherent problems with WSNs  including data collection , network operational lifetime , and connectivity . Although  conducted a study on mobile gateways in the past, the researchers did not propose a solution to the problem where the gateway needs to constantly keep track of the last hop nodes.
In this study, a clustering algorithm is implemented with improvements on . By doing this, the gateway does not have to maintain contact with the last hop nodes with which it was able to communicate. Instead, it is only going to maintain its communication with cluster heads upon leaving the signal range of the nodes in a specific cluster. These cluster heads have a greater transmission range and a higher amount of energy for longer communication with a mobile node.
The rest of this paper is organized as follows: Section II discusses the system model and methods. This includes the objectives of this paper, description of each model involved in the system like the clustering/routing algorithm, the routing mechanism for communication with the mobile gateway, and finally, the relocation approach. Section III discusses the possible outcomes of the experiment and we conclude in Section IV.
A set of sensor nodes are distributed in an area to monitor particular events. These devices are battery operated and are limited in terms of processing capabilities. The nodes are grouped in clusters using a particular clustering algorithm, which will be discussed later. Each cluster will have its own cluster head, which will represent the entire group. The performance required from these sensor nodes dynamically changes depending on the importance of the data that each device collects. A gateway node, which is less energyconstrained than the sensor devices, is deployed amidst the clusters and routinely checks for new data. This gateway is mobile such that it can relocate itself based on specific parameters. Depending on the level of importance of the data coming from a specific source, the mobile gateway can relocate itself near a cluster or within the range of a cluster’s head in order for it to retrieve data from the cluster’s nodes themselves. The mobile gateway is not informed through multiple hops but instead, the clusters’ heads are the devices responsible for informing the mobile gateway regarding the kind of data that their cluster is prepared to send.
The findings and approach from both related works described in Section III of this paper will be combined and improved using the model in Section V. This proposal seeks to address the problems involving real-time data transmissions, end-to-end delay, and efficient energy management through clustering routing algorithms. The following are the objectives of this proposed protocol.
i. As the gateway is being relocated, the gateway should remain within the transmission range of some of the cluster heads to listen for arrival of new data on other clusters.
ii. The traffic congestion should be decreased through the use of cluster heads that will aggregate and analyze data from the cluster nodes, eliminate redundant data, and transmit to the mobile gateway.
iii. The scalability of the WSN should be improved by grouping the nodes and assigning a head for each cluster.
iv. The throughput of the network should be increased by transmitting and processing more real-time data directly from the source.
v. The end-to-end delay of the entire network should be decreased by letting the mobile gateway communicate directly with some of the cluster heads, therefore minimizing hop counts.
vi. Rerouting frequency should be decreased by setting the cluster nodes to automatically switch to communicate with their respective cluster heads once the mobile gateway goes out of range. This eliminates the need for nodes to form new multi-hop paths with their neighbors or adjust their transmission power just to keep in touch with the gateway.
Specifically, clustering in WSNs has the following functions:
Cluster heads act as routers for information. Nodes only have to deal with local information.
If the network is divided into the hierarchical structure which is based on the clusters, then it will extend the method of the cellular networks to the WSN.
Cluster heads act as data processing centers. They compress and fuse redundant information in order to effecttively reduce the network load and extend the network lifetime.
According to the system requirements of the network, the clustering algorithm divided the network into several clusters. The basic performance indicators are as follows:
The algorithm should be fully distributed. Each node should only depend on local information to make decisions independently.
The algorithm should have low time complexity and message complexity.
After the algorithm runs, nodes in the network should be uniquely identified as either the cluster heads or ordinary nodes.
The algorithm should have good stability. In the subcluster network structure, dynamic movement nodes can frequently join or leave a cluster, and because the battery power runs out in some nodes, it can lead to changes in the network topology and thus affect the stability of the system. More seriously, intense mobility of the cluster node can sometimes result in the update of the first cluster node and reconfiguration of the network; frequent updates of the first cluster node will introduce a larger cost of computation and communication. This can seriously affect the performance of other network protocols, such as packet scheduling, routing, and resource management.
The clustering algorithm should be simple and efficient.
The goal of the clustering algorithm is to construct cluster sets that include all of the user nodes, and can better support resource management and interconnection of the routing protocols. In this study, the clustering algorithm used is further improved to support communication with a mobile gateway. Cluster heads are designed to communicate directly with the mobile gateway instead of ordinary nodes using multiple hops to relay messages to the mobile gateway.
LEACH is low-power, adaptive, and clustering routing algorithm, which was designed for WSNs  at MIT. Compared to the general flat multi-hop routing protocols and static clustering algorithms, LEACH can extend the network lifecycle mainly through the randomly selected sub-cluster leader. LEACH defines the concept of "round". One round consists of two phases, the initialization phase and the stability phase. In order to avoid the extra processing cost, the stabilization phase should last for a relatively long time .
The LEACH algorithm randomly selects cluster heads; it can evenly distribute high energy consumption to all nodes on the network by using rotation of the election so that nodes that have no energy can be randomly distributed. In addition, the LEACH algorithm uses a hierarchical structure; cluster heads reduce the energy consumption of data transmission through the data fusion mechanism, and therefore compared to the general multi-hop routing protocols and static clustering algorithm, LEACH can extend the network lifecycle by 15% .
3) Real-Time Routing Mechanism ？ Communication with Mobile Gateway
In , each node employs a packet scheduling discipline that approximates generalized processor sharing (GPS). Each sensor node is considered to be a source of different real-time data originating from multiple flows. The service ratio “
4) Relocation Approach
There are three issues to consider in gateway relocation. These are when to relocate the gateway, where to put it, and how to handle its motion without disrupting data traffic. In this subsection, we will discuss these issues and then state our algorithm to handle such issues.
When to move: first of all, the time for such relocation should be decided based on some performance observations such as the miss ratio. The miss ratio is indirectly related to finding proper
Where to move: the mobile node will move towards the cluster if it has a greater amount of real-time traffic to be transmitted than the rest of the clusters as shown in Fig. 3. This will helpful in two ways: 1) It will help in decreasing the average end-to-end delay since the number of hops for data packets to travel will be decreased, and 2) it will help in admitting more real-time flows since the load is alleviated by splitting the traffic.
How to move: in , one of the issues in moving the gateway is the data transmission. It will be unacceptable to increase packet losses on some data paths. The gateway motion handling mechanism tries to maintain continual packet delivery to the gateway through the adjustment of the transmission power of some sensors or via designating some forwarders to extend the current routes. However, in the case of this paper, maintaining transmission with the nodes is not necessary since the gateway, upon reception of the communication of another cluster head with a greater quantity of real-time data, will switch to communicate with the cluster heads, leaving the nodes to communicate with the mobile gateway and send their transmissions via their cluster head.
5) Proposed Algorithm
Like in , the gateway moves in strides but instead of moving to reach intermediate positions which are approximated using curves in analytical geometry, it moves based on the signal range and location of the cluster heads of each group of sensor nodes.
Cluster heads communicate with each other to reach the mobile gateway using multiple hops so that ordinary nodes can reserve their energy for sending important data once the gateway is within their reach. When a cluster head dies, another high energy node is elected. It is also possible for the cluster heads to be capable of energy harvesting.
The proposed algorithm is shown in Fig. 4.
The algorithm presented in this paper will lessen the frequency of rerouting by redirecting all of the sensor nodes to the cluster head once the mobile gateway goes out of range. The algorithm for this function is shown in Fig. 6.
The results in Fig. 5 from  showed very meaningful results but could be further improved using this algorithm in future experiments. One of the problems addressed by the researchers in  is the rerouting overhead. Frequent adjustment of the network topology due to the movement of the gateway out of the range of the sensor nodes causes this overhead in terms of energy consumption.
Rerouting overhead ？ unlike , this algorithm will have less rerouting because when the gateway moves away to another cluster and becomes unreachable for the cluster nodes, the nodes will simply switch to communicating and sending data to the cluster head, which will be the one responsible for communicating with the mobile gateway via the other cluster heads. In  if a gateway becomes unreachable, it instructs the cluster nodes to adjust the transmission power of their radio to cover the gateway’s next move. This may not be very energy efficient.
Delay and timeliness ？ delay of the transmission of realtime data will be put to a minimum since the gateway knows which cluster has the largest quantity of real-time data to send and relocates itself over to that cluster while continuing to check the data from other clusters via their cluster heads.
Energy consumption ？ energy consumption will be decreased due to the load on the nodes being alleviated by the actions of the cluster heads and the mobile gateway.
Throughput ？ more real time data will be received by the gateway. Redundant data will be fused and processed by the cluster heads, eliminating the need of the nodes to send large amounts of redundant data over multiple hops. Instead, the cluster nodes need only to communicate with their cluster head, which will, in turn, transmit the data to the gateway. When the gateway receives the data and classifies it as important or detects that that particular cluster has more data to send, the gateway will move towards that cluster of nodes to gather real-time data.
The proposed algorithm will solve some of the problems in previous research work specifically the following: 1) it will eliminate the need to maintain the same routes from the last hop nodes. Forwarder nodes will not be necessary because there are cluster heads that will be responsible for communicating with the mobile gateway; 2) the mobile gateway will never go out of the transmission range because it only has to maintain its communication with the cluster heads, which have significantly more energy than the rest of the nodes in the cluster and will have a higher transmission range; and 3) the rerouting frequency of the nodes that directly communicated with the mobile gateway will be eliminated because once the mobile gateway is out of reach, these ordinary nodes will automatically switch their transmission to their respective cluster heads.
This proposed protocol will greatly affect the timeliness of the data being received by the gateway. Due to the relocation of the gateway and the effective communication of the clusters, delays of real-time and highly important data will be minimized. The energy consumption of all the nodes will also be lessened due to the cluster head’s fusing of all the data in its cluster. This proposal will also significantly affect the throughput of the entire network. More real-time data will be received and redundant data will be eliminated at the cluster-level.