## 2 Related Works
### Five Types of Key Management Protocols
In addition, in a network which consists of a large number of sensor nodes, direct communication may not be feasible because of the large number of collisions. Multiple access schemes can be used to reduce the number of collisions, but the radio bandwidth of each sensor node would be reduced. Alternatively, direct communication can only be used in a small area with just a few sensor nodes in that area. (5) Grid-based Routing Protocol  
In recent years, many researchers [15-20] have studied how to use efficient grid-based data dissemination protocols for base stations. In the following section, we will introduce the relevant works. (5.1) Two-Tier Data Dissemination  
A Two-Tier Data Dissemination (TTDD) approach [15,16] provides scalable and efficient data delivery to multiple mobile base stations. The mobile base stations are in constant motion because they are used to build a two-tier structure in sensor networks. TTDD exploits local flooding within a local cell of a grid, which the sources build proactively. Each source uses the nodes on the grid line to transmit data to the base station. However, TTDD does not optimize the path from the source to the base stations. Also, TTDD frequently resumes establishing the entire path to the base stations when the path is down. Figure 3 shows the data forwarding process in TDD. (5.2) Coordination-Based Data Dissemination Protocol for Wireless Sensor Networks  
Mobile base stations using flooding to send queries to the nearest grid points. Queries are routed along the grid and data is traced along the path back to the base stations. As a result, the control overhead introduced by base station mobility is limited to the grid cell where a base station is located. A coordination-based data dissemination protocol for wireless sensor networks (CODE) [17] considers energy efficiency and network lifetime, especially for sensor networks with high node density. CODE uses a grid structure to establish an efficient data dissemination path between the sources and a mobile base station. Figure 4 shows a grid structure that is used to transmit data. A sensor node is selected to be a coordinator in each grid. When the mobile base station sends a query to the source node, the source node will receive the query and will then transmit data to the mobile base station. Figure 4: The CODE scheme for multi-hop routing through coordinators. Figure 3: The TTDD scheme for a source node forwarding data to a mobile base station. (5.3) Data Aggregation for Range Queries  
[PERSON] _et al_. [20] presented an efficient data aggregation algorithm for range queries (DARQ). DARQ is based on a grid structure. Figure 5 shows a DARQ scheme in which sensor nodes can determine their own locations using GPS. In [PERSON]'s scheme, a mobile base station makes requests for the source to aggregate regular-sharp data. When a source receives a query packet, it constructs an aggregate data tree. This scheme is able to aggregate data in the sensor field with void regions. Void regions are regions in which there are no nodes in a grid because obstacles exist in the grid, no node is deployed, or a node has already died. [PERSON]'s scheme utilizes the proposed face routing scheme [21] to discover where the void regions are and make a detour to avoid the void regions. When a node cannot deliver packets by greedy-forwarding, it uses face routing to make a detour to avoid the void regions. Our proposed scheme to generate dynamic key management is based on the DARQ scheme, one-way hash function, \"two-way\" mutual authentication, and symmetric encryption mechanism. A new key will be generated from the previous two keys when a sensor node transmits data in each transaction. The new key will be used for encryption to protect the gathered data. When the sensor node transmits data to a cluster node, the cluster node will request the decryption key of the sensor node from the base station. Since the base station has recorded two primary keys for all sensor nodes, it will transmit the required keys of that sensor node to the cluster node.