# Merging Grid into Clustering-Based Routing Protocol for Wireless Sensor Networks

Ying-Hong Wang, Yu-Wei Lin, Yu-Yu Lin, Hang-Ming Chang

► To cite this version:

Ying-Hong Wang, Yu-Wei Lin, Yu-Yu Lin, Hang-Ming Chang. Merging Grid into Clustering-Based Routing Protocol for Wireless Sensor Networks. 9th International Conference on Network and Parallel Computing (NPC), Sep 2012, Gwangju, South Korea. pp.421-428, 10.1007/978-3-642-35606-3_50 . hal-01551340

HAL Id: hal-01551340

https://inria.hal.science/hal-01551340

Submitted on 30 Jun 2017

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
# Merging Grid into Clustering-based Routing Protocol for Wireless Sensor Networks

Ying-Hong Wang, Yu-Wei Lin, Yu-Yu Lin, Hang-Ming Chang

Computer Science and Information Engineering
Tamkang University
Tamsui Taipei, Taiwan, R.O.C.

inhon@mail.tku.edu.tw, harry040@hotmail.com, jerry198926@hotmail.com, chmcicel74723@gmail.com

**Abstract.** After sensors are deployed, it cannot be recharged in Wireless sensor networks. Therefore, the energy of sensors is limited. In this situation, how to design a routing algorithm is very important. An effective algorithm can reduce energy consumption and prolong network lifetime. In this proposal, we proposed a routing protocol. And it can reduce the energy consumption of nodes and use energy effectively to sense by clustering. Finally, we compare the methods we proposed with the others by simulation.

**Keywords:** Cluster; Power saving; Routing protocol; WSNs.

## 1 Introduction

In recent years, wireless application and wireless communication markets have become more popular due to the rapid development of wireless communications technology. Moreover, the advance in micro technology has led to wide adoption of multiple wireless network technologies consisting mainly of wireless sensor networks [1]. In wireless sensor networks, micro-manufacturing technology continues to increase capabilities in environmental sensing, information processing, wireless communications, computing ability, and storage capacity. In order to take full advantage of these advances, reducing energy consumption to extend network lifetime of wireless sensors is critical, and thus an important topic for research.

The characteristics of wireless sensor design calls for small footprint, low cost, power saving, and accurate sensing ability. The current areas of research can be divided into the following several categories: routing protocol, target tracking, locating, data aggregation, fault tolerance, sensor node deployment and energy management. Each sensor node has data processing, communication, and data sensing responsibilities, all consume a limited energy resource. In this premise, a wireless sensor node achieves the greatest benefit from an increase in energy consumption efficiency. Therefore, how to design an effective routing protocol is a very important topic. In the wireless sensor network applications using the environment as a static target and more under consideration, we hope that the node does not have too strong
computing power and other additional equipment in order to achieve as much as
possible to reduce energy consumption and cost effectiveness. To achieve this goal
we propose a cluster-based routing protocol for wireless sensor network that is
Merging Grid into Clustering-based Routing Protocol for Wireless Sensor Networks,
MGCRP.

## 2 Related Work

There are numerous papers on using routing protocols to make wireless sensor networks stable, effective and power saving. [2, 3] introduces the concept of using routing protocols in wireless networks.

Recently, there are three leading ways of routing. They are chain-based, cluster-based and tree-based; our paper will focus on cluster-based. In cluster-based routing nodes are divided into clusters and the cluster head will send the data collected from normal nodes to sink.

Low Energy Adaptive Clustering Hierarchy (LEACH) [4] is proposed by Heinzelman. This routing protocol divides nodes into several clusters by their location, and the nodes can only communicate with in the same cluster.

Energy-Balanced Chain-cluster Routing Protocol (EBCRP) [5] is proposed by Xi-Rong Bao. It is a cluster-based distributed algorithm that builds a path of chains through the use of a ladder algorithm.

## 3 Merging Grid into Clustering-Based Routing Protocol

Our proposed routing protocol is divided into two phases: Clustering Phase and Routing Phase, and we will add Cluster-Head Rotation Mechanism to maintain routing persistence in the Routing Phase.

### 3.1 *Network Environment and Assumption*

We assume the wireless sensor network is composed of a sink and a large number of static sensor nodes randomly deployed in the target area.

#### a. *System Environment*

We assume n sensor nodes randomly distributed in the area to be monitored are
continuously sensing and reporting events. These sensor nodes are static. We use $\mathbb{S}_i$ to
indicate the i-th node, sensor nodes set $S = \{\mathbb{S}_1, \mathbb{S}_2, ..., \mathbb{S}_n\}$, and the number of S is n.
We make the following assumptions about the sensor nodes and the network module.

i) The sink is deployed in a region away from the sensors and we assume that the energy of the sink is infinite.

ii) Sensor nodes will be assigned a unique identifier before deployed in the sensing area.

iii) All nodes have the same computing, storage and energy capabilities.

iv) The sensor node's transmission power can be changed according to the distance
from the receiver.

v) All sensor nodes are static. In addition, each sensor node knows its own location and the sink knows their location though the use of the location mechanism.

b. Energy Consumption Module

Our paper is uses [7] the communication energy consumption module, and follows the formula:

$$E_{\tau}(k, d) = E_{Rx}k + E_{amp}(d)k \quad (1)$$

$$E_R(k) = E_{Rx}k \quad (2)$$

$$E_{fuse}(k) = E_{fuse}k \quad (3)$$

Formula (1) means the sensor nodes have an energy cost when transmitting data, (2) means the sensor nodes have an energy cost when receiving data, (3) means the sensor nodes have an energy cost when the data fuses. In these three functions, where k is data packet size, $E_{Rx}$ is energy cost for transmitting one unit data of the sensor node, $E_{Rx}$ represents the energy cost when node receives one unit data, $E_{fuse}$ is energy cost of the fusing the data. When the sensor nodes transmit amplification is required, so transmitting nodes have an additional $E_{amp}(d)k$ energy cost. The value of $E_{amp}(d)k$ can be determined by formula (4).

$$E_{amp}(d)k = \varepsilon_{F5}d^2 \quad (4)$$

Where d is the distance between two nodes, $\varepsilon_{F5}$ represents the amplified electric power energy cost.

c. Sensor Node and Cluster Information

TABLE 1. is the sensor node information table, which is used to record information about itself. Next we will introduce each field of the table. Node_ID is the identification of the node. Res_Energy is the residual energy of the node. Head_ID is the identification of the cluster head in its own cluster, if the Head_ID and Node_ID are the same, the node itself is the cluster head. Cluster_ID is the cluster number the sensor node belongs to. Next_Hop is the next sensor node to forward data to. TABLE 2. is the cluster table, it records information of every cluster member and including the following fields Node_ID, Res_Energy, and Cost. Node_ID is the identification of member of the node in the cluster. Res_Energy is the residual energy of the node in the cluster. Cost is transmission cost between two nodes. TABLE 3. Is Head List, it is used to record information one neighboring cluster heads. The fields include Node_ID, Cluster_ID and Cost. Node_ID is the identification of the neighboring cluster head. Cluster_ID is the cluster number of the neighboring cluster head. Cost is transmission cost between two cluster heads.

<table><caption>TABLE 1. Sensor node information table</caption><thead><tr><td>Node_ID</td><td>Res_Energy</td><td>Head_ID</td><td>Cluster_ID</td><td>Next_Hop</td></tr></thead></table>

<table><caption>TABLE 2. Cluster_Table</caption><thead><tr><td>Node_ID</td><td>Res_Energy</td><td>Cost</td></tr></thead></table>

<table><caption>TABLE 3. Head_List</caption><thead><tr><td>Node_ID</td><td>Cluster_ID</td><td>Cost</td></tr></thead></table>
## 3.2 Clustering Phase

### a. Clustering

Before discussing the clustering step, first, we must be define the routing protocol parameters and variables.

**Rectangle Unit Block (Block):** This is a rectangular block. The user defined value of N divides the network into several blocks which are the same size and are not overlapping.

**Center of Block (BC):** After dividing the network into several grids, we will calculate the center coordinates of the grids resulting in a vector of coordinates. We assume Block_Center i (BCᵢ) is the i-th center coordinates of the block.

**Cluster:** Cluster can be regarded as a set C which includes several sensor nodes. We can represent a set C as C = {Sⱼ}, Sⱼ ∈ S, j=1,2,...,n. Where j is the number of sensor nodes. We assume the Cluster_ID is i which represent the cluster number of the grid. In any cluster (Cᵢ), if any member of the sensor nodes are not in a cluster, it is an invalid cluster, otherwise, it is valid cluster.

**Distribution:** We define a new parameter in a valid cluster Distribution it is used to evaluate the distribution of nodes in a valid cluster. The number of nodes within a valid cluster closer to BC are the best. The formula (5) is used to calculate the distribution of the cluster. Where d(Sᵢₘ, BCᵢ) is the distance between the member of the sensor nodes in cluster and the BC of the cluster and where N(Cᵢ) is the number of sensor nodes in the cluster. After defining these parameters and variables, the following details the description of each step.

#### Step 1: Network Gridding

After the deployment of the sensor nodes, we will make a grid of the network. In this paper, we assume that the sensor nodes in the network can be arranged to an M*M area, and assume every length of block is N. The network will be divided into (N/√N)² same size blocks. Where the user defined the N value and M value is the length of the sensor network.

#### Step 2: Calculate Center of Grid

Formula (6) calculates the center of the grid. $BC_i$ is the two-dimensional coordinate vector, where i=1,2,..., (N/√N)², this is used to indicate the number of the grid, and also is also the Cluster_ID. The numbering starts from the (0,0) position along the X axis towards the right, Sequenced 1, 2, ..., until numbered to the right- border of the sensor network, then back to left-border of the sensor network. In this moment, shift the Y-axis direction one unit block down, then repeat the sequencing step until the grid is complete. Then use the number of grids and formula (6) to get each center of grid.

#### Step 3: Calculate Distribution (Cᵢ) of Valid Cluster

In this step, we will calculate the Distribution of the valid cluster. First, we give a set VC that includes all valid clusters in the network. N(VC) expresses the number of valid clusters. We will only calculate the Distribution of clusters in the VC set. After each Distribution in each cluster has been calculated, we will start the cluster merging process.

$$ \text{Distribution}(C_i) = \frac{[\sum_{S_m \in S} d(S_m, BC_i)]}{N(C_i)} \quad (5) $$
$$BC_i = \left( \left[ \left( i-1 \right) \% \left( \frac{M}{N} \right) + \frac{1}{2} \right] \times \frac{N}{N}, \left[ \left( i-1 \right) / \left( \frac{M}{N} \right) + \frac{1}{2} \right] \times \frac{N}{N} \right) \quad (6)$$

### Step 4: Merge Valid Cluster

First, we choose the fewest number of nodes and the cluster with the largest Distribution value from the VC set. Assume a cluster from the VC set that meets the above conditions is $C_A$, where $C_A \in VC$, $A=1,2,...,(\frac{M}{N})^2$, then we will start the merge. Let the distance between $S_a$ and $S_b$ be minimal, where $S_a \in C_A$, $S_b \in C_B$, $B=1,2,...,(\frac{M}{N})^2$, $C_B \in VC$ and $C_B \neq C_A$. Then we add all the sensor nodes to $C_B$ from $C_A$. In other words, let all the Cluster_IDs of the sensor nodes from $C_A$ change to $C_B$, and remove from the $VCC_A$, resulting in one less $N(VC)$.

### Step 5: Clustering Finish

Assume the variable K is the user set up number of clusters in the network. The value of K will affect the efficiency of network, so we must decide the variable K according to the network size and number of nodes. The operation of clustering in step 4 will be repeated until $N(VC)=K$. After clustering finishes, the sink will send related information to the sensor node for an update.

## b. Cluster Head Selection

The main task of the cluster head is to fuse data that sensor nodes sensed within a cluster, receive other cluster heads' sensed data, and, send to sink, after clustering finishes and, cluster head must be selected from each cluster. To do so, the sink will broadcast a Head_Elect Message packet to every sensor node in each cluster in the network. When a sensor node gets this packet, it will generate a random variable P between 0 and 1, where P is used to differentiate between the same residual energy from other sensor nodes. After sensor node got a random variable P, then immediately to calculate itself residual energy. The residual energy is then calculated.

The member nodes of the same cluster compare each of their residual energies according to the transmission power to obtain cost between them. Sensor nodes with the most residual energy will be selected as the cluster head. If more than one sensor nodes have the same residual energy in the same cluster then the sensor node with the larger P value will be selected as cluster head. After each of the cluster heads of cluster has been selected, each cluster head will send a Head_Confirm packet to the sink. The packet format is shown in TABLE 4. Each Head_Confirm packet contains three fields, they are Header, Node_ID and Cluster_ID. The Header records the name of packet, Node_ID expresses the Node_ID of the sensor node that is the cluster head, Cluster_ID expresses the Cluster_ID of the cluster to where the cluster head belongs. After the sink received all the Head_Confirm packets, it will consolidate the information and forward it to each cluster head allowing them to, update their Head_List table.

<table><caption>TABLE 4. Head_Confirm packet</caption><thead><tr><td>Header</td><td>Node_ID</td><td>Cluster_ID</td></tr></thead></table>

## 3.3 Route

In our paper, the transmission route can be divided into two parts: inner-cluster transmission route and outer-cluster transmission route. Inner-cluster transmission route refers to the path between cluster head and sensor nodes within the same cluster. Outer-cluster transmission route refers to the path between cluster heads.
Our proposed path selection method is mainly based on transmission cost between the sensor nodes. So we use Bellman-Ford shortest path algorithm[6] for the route selection method. We arrange the network as a graph, and assume the sensor nodes in the network are the vertexes of graph and the transmission cost between nodes are edges of the graph. Through the Bellman-Ford algorithm we can calculate the lowest cost of each sensor node to the other.

### a. Inner-Cluster Transmission Route Build

Inner-cluster transmission routes are the path between sensor nodes within the same cluster. The sink broadcasts to all the sensors nodes their minimum path cost to the cluster head in their cluster using the Bellman-Ford algorithm according to member cost in the Cluster_Table. In (7), $C(i,j)$ defines the cost between node i and node j, where $P_t(i,j)$ is the transmission power of node i to node j during transmission. After the sensor node receives the minimum cost between the node and the cluster head, it then records the next hop target in the Next_Hop field. When the node wants to transmit data, it sends data to the sensor node based on Next_Hop field. During the transmission, if the sensor node dies or cluster head changes, the Bellman-Ford algorithm is invoked to re-calculate the minimum cost path and the Next_Hop field is updated.

$$C(i,j) = P_t(i,j) \qquad (7)$$

### b. Outer-Cluster Transmission Route Build

The outer-cluster transmission route and inner-cluster transmission route have the same algorithm, but in the outer-cluster, the send object changes to cluster head to cluster head. The cluster head receives the data that members sent in the cluster and, then it integrates the received data and forwards it to its neighboring cluster head. According to the Cost field of Head_List and through the use of the Bellman-ford algorithm, the cluster head selects the next hop. After the calculation, the cluster head will record the transmission object. If the cluster head has been replaced, then the new cluster head will request a member to re-calculate the minimum cost between cluster heads.

### c. Cluster Head Rotation Mechanism

The cluster head not only senses the environment but integrates the data from members of the same cluster, and transmits data to other cluster heads. In order to reduce the early death of sensor nodes, we add the cluster head rotation mechanism to distribute the energy consumption. We assume time divided into continuous periods of $T$, in the beginning $T$ the sink will send a Cluster_Head Rotation Message to the sensor network. After a normal node receives this message, they will immediately send their residual energy information to the cluster head. Then the cluster head will select the node of with the most residual energy to be the new cluster head. At the same time, the cluster head will broadcast to members within cluster the new identity of the cluster head and update Head_ID of the normal node and send Head_Confirm packet to the sink. The sink will gather all the new cluster head information, consolidate, and send the data to all the cluster heads so they can update Head_List table. During $T$, the sink will repeat the above action to replace the cluster head until the energy of members within cluster is less than the energy defined by the cluster head threshold.
# 5 Simulation and Analysis

This paper uses the Dev C++ simulation environment. The condition of the sensor network and its related values [8] is shown on TABLE 5. A round is defined by data that is transmitted to sink safely; a conclusion that is made from the average of 50 kinds of conditions. We can observe that MGCRP is better than LEACH and EBCRP via Fig.1 and Fig.2, The selection of cluster head principle of EBCRP is better than LEACH because it chooses the nodes which are closer to sink to be clusters. The design does not have the transmission distance limitation of clusters in LEACH, but the routing of EBCRP is a chain which is connected by nodes resulting in redundant data transmissions. In this paper, MGCRP combines nodes which are closer to others in a cluster and when the nodes are distributed unevenly, it shortens the distance between nodes and the cluster head to attain power savings. To not overload any one member, we add cluster head rotation mechanism, to equally to distribute energy consumption to the members in the cluster prolonging the network lifetime.

<table><caption>TABLE 5. Experimental Parameters</caption><thead><tr><td>Parameter</td><td>Value</td></tr></thead><tbody><tr><td>Sensing range (m²)</td><td>(0,0)-(100,100)</td></tr><tr><td>Sink location</td><td>(50,150)</td></tr><tr><td>Sensor node numbers (n)</td><td>100</td></tr><tr><td>Sensor node initial energy (E0)</td><td>0.5 J</td></tr><tr><td>E<sub>Tx</sub>, E<sub>Rx</sub></td><td>50 nJ/bit</td></tr><tr><td>ε<sub>FS</sub></td><td>10 pJ/(bit·n²)</td></tr><tr><td>E<sub>fuse</sub></td><td>5 nJ/(bit·single)</td></tr><tr><td>Data packet size</td><td>4000 bits</td></tr><tr><td>Grid length (N)</td><td>10 m</td></tr><tr><td>Cluster number (K)</td><td>5</td></tr></tbody></table>

<figure><img src="image_2.png" /><figcaption>**Figure 1.** Relation between the number of alive nodes and number of round with different routing protocol</figcaption></figure>
<figure><img src="image_3.png" /><figcaption>**Figure 2.** Relation between consumption of average energy and number of round with different routing protocol</figcaption></figure>

# 6 Conclusions

In this routing protocol, we grid the network and then combine these grids based on a user defined value. There are several advantages of this protocol show below. First, sensors will be allocated by high density in the same cluster no matter what the condition is. Second, we add the cluster head rotation mechanism, and it could allot workload equally to every node. Through effective clustering, the routing protocol which we proposed could save more energy and prolong the network lifetime.

# References

1. I. F. Akyildiz, S. Weilian, Y. Sankarasubramaniam, and E. Cayirci, "A survey on sensor networks, " *IEEE Communications Magazine*, vol. 40, No 8, pp. 102-114, Aug. 2002.

2. J. N. Al-Karaki and A. E. Kamal, "Routing techniques in wireless sensor networks: a survey, " *IEEE Wireless Communications*, vol. 11, No 6, pp. 6-28, Dec. 2004.

3. J. Qiangfeng and D. Manivannan, "Routing protocols for sensor networks," *Proceedings of First IEEE Consumer Communications and Networking Conference, 2004. CCNC 2004.*, pp.93-98, Jan. 2004.

4. W. R. Heinzelman, A. Chandrakasan, and H. Balakrishnan, "Energy-efficient communication protocol for wireless microsensor networks," *Proceedings of the 33rd Annual Hawaii International Conference on System Sciences*, pp.10 pp. vol.2, Jan. 2000.

5. X.-r. Bao, S. Zhang, D.-y. Xue, and Z.-t. Qie, "An Energy-Balanced Chain-Cluster Routing Protocol for Wireless Sensor Networks," *Proceedings of the 2010 2nd International Conference on Networks Security Wireless Communications and Trusted Computing (NSWCTC)*, pp.79-84, Apr. 2010.

6. D. Bertsekas and R. Gallager, *Data Networks*, 2nd ed. Englewood Cliffs, New Jersey: Prentice-Hall, 1992.

7. W. B. Heinzelman, A. P. Chandrakasan, and H. Balakrishnan, "An application-specific protocol architecture for wireless microsensor networks, " *IEEE Transactions on Wireless Communications*, vol. 1, No 4, pp. 660-670, Oct. 2002.

8. W. B. Heinzelman, A. P. Chandrakasan, and H. Balakrishnan, "An application-specific protocol architecture for wireless microsensor networks, " *IEEE Transactions on Wireless Communications*, vol. 1, No 4, pp. 660-670, Oct. 2002.