Virtual Grid-Based Routing for Query-Driven Wireless Sensor Networks

: In the context of query-driven wireless sensor networks (WSNs), a unique scenario arises where sensor nodes are solicited by a base station, also known as a sink, based on speciﬁc areas of interest (AoIs). Upon receiving a query, designated sensor nodes are tasked with transmitting their data to the sink. However, the routing of these queries from the sink to the sensor nodes becomes intricate when the sink is mobile. The sink’s movement after issuing a query can potentially disrupt the performance of data delivery. To address these challenges, we have proposed an innovative approach called Query-driven Virtual Grid-based Routing Protocol (VGRQ), aiming to enhance energy efﬁciency and reduce data delivery delays. In VGRQ, we construct a grid consisting of square-shaped virtual cells, with the number of cells matching the count of sensor nodes. Each cell designates a speciﬁc node as the cell header (CH), and these CHs establish connections with each other to form a chain-like structure. This chain serves two primary purposes: sharing the mobile sink’s location information and facilitating the transmission of queries to the AoI as well as data to the sink. By employing the VGRQ approach, we seek to optimize the performance of query-driven WSNs. It enhances energy utilization and reduces data delivery delays. Additionally, VGRQ results in ≈ 10% and ≈ 27% improvement in energy consumption when compared with QRRP and QDVGDD, respectively.


Introduction
Wireless sensor networks (WSNs) consist of two main components: several resourceconstrained sensor nodes and a resource-rich data collector unit, called a base station or sink. Sensor nodes have sensing, computing, and communicating capabilities in order to cater to the needs of applications and provide the required sensing information to the sink [1][2][3]. Sensor nodes are strategically positioned to detect and monitor various environmental parameters, including but not limited to humidity, pressure, light levels, and more [4][5][6]. On the basis of mobility, sinks can be characterized as either static or mobile. A static sink conserves the energy of sensor nodes because it does not require them to broadcast their location periodically. However, the neighboring nodes of the static sink experience more traffic as compared to the distant nodes, and they are prone to exhausting their energy rapidly. This situation is known as the crowded center effect [7] or the energy hole problem [8]. In numerous practical scenarios, sensor nodes are deployed in challenging environments where human intervention is impractical or unfeasible [9,10]. Therefore, charging or replacing their batteries is very difficult. Mobile sink deals with this situation as it changes its location with its movement, which leads to changes in its neighboring sensor nodes. Therefore, the data traffic does not put a burden on a specific set of sensor nodes, which was the case in the static sink. Mobile sink can accumulate the data from the sensor network by following any of the three mobility patterns: random [11], fixed [12], and controlled [13,14]. The sink mobility pattern depends on application requirements and surrounding environments. However, mobility of the sink resolves the crowded center effect and extends overall network lifetime, but it requires advertisement of its location periodically, which leads to an overhead in the network. Without this information, the sensor nodes may transmit data to the outdated location of the sink, leading to a low data delivery ratio and increased latency. To alleviate the overhead associated with providing the mobile sink's location and enhance network performance, grid-based routing protocols have been suggested. The routing protocols begin by constructing a virtual grid structure within the sensor network. Following that, a Cluster Head (CH) is chosen for every grid cell, and the remaining nodes within each cell, referred to as cell member nodes, transmit their data to their respective CHs. These CHs subsequently relay the data to the sink. This data transmission from the sensor node to the sink can be query-driven [5,15], event-driven [16], periodic [17], and hybrid. In the context of query-driven data transmission, the sink initiates the process by sending queries. Designated sensor nodes meeting the criteria specified in the query transmit the sensed data back to the sink. This paper proposes a Virtual grid-based Routing for Query-driven WSNs (VGRQ). The VGRQ algorithm creates square-shaped virtual grid cells in the sensor field, specifically targeting an even count of sensor nodes. Afterward, the Cell Header (CH) is selected considering both its energy level and distance from the midpoint of the grid cell. Four CHs together form a chain to reduce communication activities. A randomly moving mobile sink informs a CH about its location and sends a query mentioning the area of interest. This CH further shares this information with other CHs along the chain. Sensor nodes located within the area of interest and meeting the query requirements transmit their data to the respective Cell Header (CH). The CHs then forward the accumulated data to the mobile sink through a chain-like structure. This concept of transmission along the chain conserves the energy of the sensor nodes, reduces the data delivery delay, and increases the data delivery ratio.

Related Work
In this section, we discuss existing mobile sink-based routing protocols developed for WSNs.
Hexagonal cell-based Data Dissemination (HexDD) [18] partitions the network into six sectors using three principal lines: horizontal lines, vertical lines, and diagonal lines. Consequently, a hexagonal-shaped virtual infrastructure is created. These lines serve as designated areas for querying and data forwarding, functioning as rendezvous points. The sink initiates its query towards the central cell, which acts as the intersection point for the three primary lines. Now, the query is flooded within the lines until it encounters the requested data. Like queries, data also traverse towards the center cell and then are transmitted to the mobile sink.
Rendezvous-based Data Dissemination (RDDM) protocol [19] is a cluster-based mechanism. It first divides the sensor networks into multiple clusters and then constructs a rendezvous-based data dissemination tree by connecting all the cluster heads. The cluster head is a node that is elected from each cluster and forwards queries and data packets. One randomly moving mobile sink stays in a cluster, which is known as a rendezvous cluster head. Apart from this, all the cluster heads and sink send their query and data to the rendezvous cluster head. The selection of rendezvous cluster head is carried out according to the energy.
The Query-Driven Virtual Grid-Based Data Dissemination (QDVGDD) protocol [20] functions by partitioning the sensor field into numerous virtual grid cells. Within each cell, a specific node is designated as the Cell Header (CH). To facilitate efficient data dissemination, a mobile sink traverses along the boundary of the sensor network and transmits its query to the CH located at the boundary. Subsequently, this boundary CH forwards the query to the CH(s) within the sink's AoI. Upon receiving the query, the sensor nodes within the network sense their environment and relay the collected data to the respective CH. These CHs then take charge of sending the accumulated data to the mobile sink.
Energy and Delay-Efficient Data Acquisition (EDEDA) [21] is also a grid-based routing protocol. It considers both base station and mobile sink. Rather than moving randomly or following a specified path, a few of the grid cells are identified, where the mobile sink sojourns for collecting the data. From each sojourning location, the mobile sink directly collects the data from nine grid cell heads. The trajectory of the mobile sink is designed in such a way that its data collection journey begins and ends at the base station, following the Hamiltonian cycle. After collecting the data, the mobile sink hands over the data to the base station in each round.
The Trajectory Planning and Route Adjustment (TARA) technique [22] adopts a gridbased approach by constructing square-shaped grid cells within the sensor network. These grid cells are evenly numbered and serve as the fundamental units of organization. A cell head is elected for each grid cell through a process that takes into account its distance from the cell's midpoint and its remaining energy level. These cell heads are responsible for transmitting the accumulated data to the sink. To ensure effective data collection, the mobile sink follows a trajectory that traces the perimeter of the sensor field while also passing through its center. This trajectory is carefully designed to distribute the data load evenly across the network. Whenever the mobile sink pauses at a specific grid cell during its journey, all the corresponding cell heads adjust their routes towards the sink. This adjustment process adheres to a predefined set of rules, facilitating efficient data transmission and coordination.
Query-driven Ring Routing Protocol (QRRP) [23] constructs multiple, equidistant, concentric rings in the network according to the length of the network and communication range of the sensor node. When a sink stays at a particular location, it informs ring nodes. Ring nodes save this information for transmitting the data. Furthermore, the sink also sends a query to the ring node, mentioning the area of interest. The query is forwarded from the ring nodes to the sensor nodes located within the designated area. Upon sensing the data, the sensor nodes transmit it back to the ring nodes. Subsequently, the ring nodes employ angle-based routing to transmit the aggregated sensed data to the mobile sink.
The Query-driven Backbone-based Routing protocol (QBR) [24] establishes a virtual backbone within the central region of the sensor field. This backbone consists of specific nodes known as backbone nodes, some of which form connections with each other, resulting in the creation of a tree-like structure called the backbone tree. These backbone tree nodes play a crucial role in maintaining information about the sink's location. When the sink intends to obtain data, it initiates the process by sending a query message to the closest backbone tree node. This node then forwards the query towards the requested area, extracting location information along the way. In reply to the query, the sensor nodes within the specified region transmit their sensed data to the corresponding backbone tree node. The collected data are subsequently transmitted from the backbone tree node to the mobile sink. Table 1 presents a summary of these protocols, including their structure type, sink movement type, number of sinks, and data transmission mode.  [19] Cluster Random Multiple Query QDVGDD [20] Grid Fixed One Query EDEDA [21] Grid Fixed One Event TARA [22] Grid Pre-defined One Event QRRP [23] Ring Random One Query QBR [24] Backbone Random One Query VGRQ (proposed) Grid Random One Query

Limitations of Existing Mechanisms
In HexDD [18], the flooding of the query within the lines causes a set of sensor nodes to deplete their energy earlier than other nodes and introduces the energy hole problem. Furthermore, there is no mechanism provided to increase the width of primary lines. In RDDM [19], the rendezvous cluster head is responsible for transmitting the query and data packets. These tasks increase the load on rendezvous cluster heads and exhaust their energy very quickly. It triggers frequent re-election of rendezvous cluster heads and adjustments in the rendezvous-based data dissemination tree. It affects energy consumption and data delivery delays. In QDVGDD [20], the mobile sink travels around the boundary of the sensor network. However, in this routing strategy, there is no provision for providing the location information of the sink to the sensor nodes. Due to this, the routing path does not need to be the shortest all the time. Apart from this, the sensor nodes lying at the boundary carry so much burden that they will lose their energy earlier than other nodes. The construction of multiple rings in the large-scale sensor field is a time-and energyconsuming process in QRRP [23]. In QBR [24], query and data packets travel through backbone nodes to reach the intended sensor nodes and sinks, respectively. In this way, backbone nodes carry most of the burden, and there is no provision for exchanging the responsibilities of backbone nodes with remaining nodes, which makes routing challenging.
VGRQ restricts the broadcast of query messages by enabling the sharing of query messages exclusively among cluster heads through chains, which is an improvement over HexDD [18]. The participation of multiple cluster heads in query and data routing ensures an equitable distribution of the workload among them. This is different from RDDM [19], where only the rendezvous cluster head is responsible for transmitting the query and data. The random movement feature of VGRQ makes it well-suited for a wide range of applications, which is an advancement compared to QDVGDD [20], where the sink follows a fixed mobility pattern. Moreover, in VGRQ, the sink periodically shares its location information with the sensor nodes, enabling the identification of the shortest routing path. This functionality is absent in QDVGDD [20]. The process of constructing a grid in VGRQ is significantly easier and more efficient compared to constructing rings in QRRP [23] and establishing a backbone structure in QBR [24].

VGRQ: The Proposed Routing Mechanism
In this section, the working of VGRQ and the necessary assumptions taken into the consideration are discussed.

•
The sensor nodes follow a random distribution during deployment. • Sensor nodes are static, homogeneous, and GPS-enabled. • Every sensor node is allocated a distinct identifier (ID) to distinguish it from other nodes. • The mobile sink follows a random mobility pattern to collect the data. • There is no obstacle in the sensor field.

Phases of VGRQ
The VGRQ works in five phases: (i) grid construction, in which multiple grid cells are constructed in the sensor field; (ii) cell header election, in which a cell header is elected for each grid cell; (iii) updating mobile sink position, where the mobile sink provides its location to the cell headers along the chains; (iv) query transmission, where the mobile sink sends a query packet to acquire the data; and (v) data transmission, where sensor nodes of AoI send the data to their respective CHs. The detailed description of each phase is discussed below.

Grid Construction
In the VGRQ approach, the sensor field is divided into square-shaped virtual grid cells with dimensions of M × M. The determination of the optimal number of cells and cell headers is achieved through the utilization of TEEN [25] and APTEEN [26] algorithms. Specifically, the cell headers are selected as 5% of the total number of sensor nodes. If there are n sensor nodes in the network, VGRQ constructs a grid with M × M dimensions, where the value of M (representing the number of rows and columns) is obtained using Equation (1).
The construction of the grid for varying numbers of deployed sensor nodes is depicted in Figure 1a-c. Sensor nodes identify their cell ID using their GPS information. Once established, the virtual grid structure remains unchanged and static. Let the length of the side of the sensing field be L and the sides of each grid cell be L/M. Once construction of the virtual grid structure is accomplished, each sensor node identifies the grid cell (r, c), i.e., the rth row and cth column, where they belong based on their location (x, y), as depicted in Figure 2.

Cell Header Election and Chain Formation
Once the virtual grid is constructed in the sensor field, cell headers are elected for each grid cell using Algorithm 1. Every sensor node computes the distance between itself and the center of its corresponding grid cell (Step 1). Sensor nodes whose distance is less than the defined threshold (Step 2) broadcast a header election message containing their location, grid cell ID, energy, and distance (Step 3). Sensor nodes receiving this message that belong to the same grid cell and whose distance is less than the one mentioned in the message reply with a header candidate message. This message contains the sensor node's ID, distance from the grid cell's center, and energy (Steps 4, 5, and 6). The node closest to the midpoint of the grid cell having maximum energy is elected as the cell header (Step 9). To notify sensor nodes of its grid, the cell header broadcasts an I am header message consisting of location and ID (Step 10). This process is executed in every grid cell.

Algorithm 1 Cell header election
Require: C(x, y), ID, Energy, d Ensure: Cell header election 1: Sensor node i calculates its distance d from the mid-point of grid cells 2: if d i < threshold then 3: Broadcast Header_Election message C i (x, y), ID, Energy, d i

4:
for each node j receiving Header_Election message do 5: if (C i (x, y) == C j (x, y) && d j < d i ) then 6: send Header_Candidate message ID, Energy, d j Node i gives up && elects node k having smallest distance to mid-point of grid cell && highest energy 10: Node k broadcasts I_am_Header C(x, y), ID message 11: end if In VGRQ, cell headers take charge of keeping sink location information, sending queries to AoI, collecting data from cell members, and aggregating it and forwarding it to the sink. Since cell headers carry these many responsibilities, they lose their energy faster than the other nodes and become hotspot nodes. To prevent this situation, cell headers progressively exchange their responsibilities with their respective cell members to maintain uniform energy distribution in the cluster.
Once cell header election is completed, chain(s) of four cell headers are constructed by following Algorithm 2. Chain construction is accomplished on the basis of the x-coordinate and y-coordinate of CHs. The grid cells whose CHs participate in chain formation are said to belong to a sector. As shown in Figure 3, there are five total sectors and each sector constitutes four grid cells.

Updating Mobile Sink Position
In VGRQ, the sink is considered to have a random mobility pattern in the sensing field. Consequently, the sensor nodes need to possess knowledge about the sink's current position to ensure the transmission of their data in the appropriate direction, thereby facilitating its successful delivery to the sink. In the absence of this information, sensed information may lost or delivered with unacceptable delay. However, broadcasting the sink position information increases the communication activities in the sensor field. In the resource-constrained WSNs, this is not an optimal way. Thus, instead of providing and maintaining the location information on each sensor node, the mobile sink provides it to the CHs only as follows: Step 1: The sink node broadcasts hello message.
Step 2: Upon receiving hello message, the CH replies with hi message to the sink.
Step 3: The sink sends its position information and sojourn time to the closest CH, then the CH shares this notification with neighboring CHs following the chain.
Step 4: If the sink walks to a new location within the sector, then CHs belonging to that sector keep the location information with themselves and do not send it to other CHs belonging to other sectors, as shown in Figure 4a.
Step 5: If the sink walks to a new sector, then CHs share the sink's updated location with all the CHs across the sectors, as shown in Figure 4b.
In this way, the mobile sink's location is provided and shared among CHs in a selective way.

Query Transmission
VGRQ is designed for a query-driven scenario, where the exchange of data is initiated only when the sink requires the data by sending a query in the sensor field. Thus, the mobile sink transmits queries within the sensor field. Similar to broadcasting the mobile sink's location, broadcasting the query is also not optimal in terms of energy. Thus, it is required to transmit the query in the sensor field in such a way that it reaches the intended AoI with less energy consumption and delay. The process of query propagation from the sink to the AoI is described below.
Step 1: The sink sends Query message to the closest CH mentioning AoI.
Step 2: The CH, after obtaining the query, first identifies the location from where the sink requires data and then sends the query towards the intended CH along the chain.
Step 3: The CH of the inquired area further sends a query to the sensor nodes belonging to the AoI. Two or more grid cells can be covered in an AoI. Figure 5 depicts query transmission in VGRQ.

Data Transmission
Sensor nodes, upon receiving the query from their respective CH, check whether they belong to the AoI or not. If they belong to the AoI, then they sense the data and send it to their respective CHs. The CHs further perform fusion on the received data and transmit it towards the mobile sink along the chain, as shown in Figure 6. By employing this data transmission mechanism, the need to establish explicit routes for the sensor nodes is mitigated, resulting in energy conservation.

Performance Evaluation
To evaluate the effectiveness of VGRQ, MATLAB simulations are performed. This section highlights the performance parameters utilized in the simulations and presents the results and analysis of VGRQ, comparing it with QDVGDD. Table 2 presents the specific values assigned to various parameters utilized in the simulation process.

Performance Metrics
The proposed mechanism is assessed based on the following performance metrics.
• Energy consumption: Sensor nodes in WSNs are equipped with limited energy, which is mainly consumed in transmitting the data. To calculate the energy consumption, a first-order radio energy model is used [27]. • Data delivery delay: It represents the duration between the transmission of data from the sensor nodes to the sink and the subsequent reception of that data at the sink. For calculating delay, the data delivery model is adopted from [28]. • Data delivery ratio: It is described as follows: = data packet received at sink total number o f data packets sent by sensor nodes

Simulation Results
In this section, the performance of VGRQ is analyzed and compared with QDVGDD [20] and QRRP [23], which are the latest query-driven approaches proposed for mobile sink-enabled WSN. We have chosen to compare these routing protocols because QDVGDD represents the most recent grid-based query-driven protocol, while QRRP represents the most recent query-driven protocol that incorporates random sink mobility.

Energy Consumption
The energy level of sensor nodes plays a vital role in resource-constrained WSNs. Since it is not always possible to recharge or replace a sensor node's battery, preserving the limited battery power of sensor nodes is of utmost importance. In a mobile sink-based query-driven scenario, most of the energy is consumed in propagating the mobile sink position information and forwarding the query packet to its intended region. Figure 7 depicts the energy utilization patterns of the VGRQ and QDVGDD protocols. With an increasing number of sensor nodes, there is a corresponding rise in energy consumption. However, it is observed that the VGRQ protocol exhibits lower energy consumption compared to QDVGDD since the number of grid cells is decided according to the count of sensor nodes, and accordingly, the chain is connected. Data and query transmission is carried out via chain, which saves sensor nodes' energy. In QDVGDD, the number of grid cells increases with the sensor network length, and consequently, the overhead of border cell headers increases, which causes high energy consumption. On the other hand, QRRP performs better than QDVGDD. In QRRP, the mobile sink periodically updates ring nodes about its location. And query and data transmission take place via rings, which conserve energy. However, the number of ring nodes in QRRP is higher as compared to cell headers in VGRQ. QRRP performs better than QDVGDD since it employs a randomly moving mobile sink to collect the data, which uniformly distributes the energy consumption across the network.

Data Delivery Delay
The data delivery delay is an essential metric for time-constrained real-time applications. In mobile sink-based WSNs, the absence of the sink's current location stands as a primary factor that impacts the delay. In this situation, data packets have to be rerouted towards the sink's latest location, which results in increased delay. Figure 8 shows the data delivery delay of VGRQ and QDVGDD. The rationale behind the high data delivery delay in QDVGDD is the unavailability of the updated sink position information to the sensor nodes, which causes the data to travel a long route to be delivered at the sink. In contrast, VGRQ has the provision of periodically providing the location information of the sink to CHs, and they transmit the query as well as data over the chain, respectively, to the AoI and sink. Although QRRP also provides the sink's location to ring nodes, it involves a greater number of hops in its routing path than the VGRQ protocol. Thus, QRRP results in more delay as compared to VGRQ. However, QRRP outperforms QDVGDD, since QRRP always ensures the shortest routing path for query and data transmission.

Data Delivery Ratio
In mobile-sink based WSNs, where the sink changes its location over a period of time and is moving and not providing its location on a regular basis, data packets will be delivered at the sink's outdated location, which will increase the data packet drop ratio and decrease the data delivery ratio. Figure 9 shows the data delivery ratio of VGRQ and QDVGDD. The data delivery ratio of QDVGDD is low in comparison to VGRQ because in QDVGDD, the sink travels along the boundary of the sensor network to acquire the data. Boundary cell headers are responsible for sending the data of non-boundary cell headers apart from their own. Thus, with the increase in sensor nodes, overhead on boundary cell headers increases, which reduces the data delivery ratio. On the other hand, in VGRQ, the sink moves randomly in the sensor field. Therefore, the load of data transmission is distributed over all the cell headers, which improves the data delivery ratio. The data delivery ratio of QRRP is lower as compared to VGRQ, due to congestion around ring nodes. This reduces the data delivery ratio of QRRP. However, random mobility of QRRP makes it perform better than QDVGDD.

Conclusions
This research introduces a new routing protocol, called VGRQ, specifically designed for query-driven Wireless Sensor Networks (WSNs) with a mobile sink. It is a grid-based routing protocol that binds all the cell headers in chains. Randomly moving mobile sinks update cell headers about their location. This restricts the sharing of sink locations over the entire sensor field and conserves the overall network energy expenditure. The chains are utilized to share mobile sink location information and transmit query and data messages. The performance of VGRQ is assessed and analyzed against QDVGDD and QRRP. And it is found that VGRQ is more energy-efficient and delivers the data with less data delivery delay in comparison to both QDVGDD and QRRP. Thus, VGRQ is suitable for time-sensitive scenarios.
In the future, we would like to implement multiple mobile sinks and evaluate the performance of VGRQ in this environment. Although multiple mobile sinks can improve the network performance in terms of data delivery delay and data delivery ratio, providing the location of multiple mobile sinks to sensor nodes will be a challenging task. Furthermore, faulty node detection and void grid cell identification also need to be examined.