4.1. Energy Model
In this paper, the first order model [
13] is used as the energy model of the network. The dissipated energy in the transmitter node (
) and in the receiver node (
) with distance
for transmitting an
data packet can be calculated as follows:
where
is the dissipated energy (per bit) in either transmitter or receiver circuit, and depends on such electronic factors as digital coding, modulation, filtering and spreading of the signal.
is the number of bits. The distance threshold is defined as
. The transmission distance
, the free space
or multipath fading channel
are used for the transmitter amplifier.
In this model, the use of free space channel model or multipath fading channel model depends on the distance between the transmitter and receiver. If the distance is less than the threshold, the former one will be used, otherwise, the latter one.
Assume that there is one cluster made up with a cluster head node and
cluster member nodes. The transmission distance
between the cluster head and the sink node is larger than
and the distances between each normal node and the cluster head
are less than
, so, the energy consumption of this cluster head in one round can be calculated as:
where
represents the dissipated energy (per bit) in data aggregation.
is the energy consumption of receiving packets from
cluster members and data aggregation.
is the energy consumption of the cluster head for sending aggregated data to the sink node. The energy consumption of a non-cluster head node is:
where
is the energy consumption of a cluster member node for sending data to the cluster head.
Based on analysis above, the residual energy for node
in the current round
can be calculated by Equation (10):
where
is the residual energy for node
in the
round.
represents the set of cluster heads.
4.2. Proposed CFSFDP-E Algorithm
In WSNs, the routing protocols can be divided into flat protocols and hierarchy protocols. All the nodes will be divided into several clusters in a hierarchy protocol. For example, in LEACH, cluster heads are selected randomly and the remaining nodes will choose the clusters in which the distance between the node and cluster head is the smallest.
The CFSFDP algorithm can divide data points into clusters according to the local density and distance. Based on this algorithm, we propose an energy-balanced protocol called CFSFDP-Energy (CFSFDP-E) to form clusters in a WSN. In this paper, the premise is that the nodes in the WSN are deployed randomly and each node is location-fixed, energy-constrained and has the same capabilities. The BS is not subject to energy restrictions and has strong communication and computation capabilities. Sensor nodes can be regarded as special data points which have energy attributes. Therefore, it is possible to apply the CFSFDP clustering scheme in the WSN. However, due to the fixed location, the cluster centers will not be changed until the energy of nodes is exhausted. The first dead node will emerge earlier than that in LEACH, so we should take energy into consideration to select the nodes with high local density, high distance and high residual energy as cluster heads.
In order to consider the impact of residual energy, Equation (5) should be changed as follows:
where
,
is the local density and distance of node
in the current round
of WSN respectively, and
is the residual energy of node
. The number of cluster heads depends on the threshold
. In the CFSFDP clustering algorithm, the threshold is fixed. However, the threshold must be dynamic to follow the trend of energy changing in improved algorithm when considering energy. We will discuss the dynamic threshold in
Section 5.4.
The following is an example to explain our proposed CFSFDP-E algorithm. Suppose that there are six nodes
to be clustered, shown in
Figure 1. The local densities are in descending order and the distance of each node shown in
Table 1 are calculated by Equation (4). Then, according to the algorithm, since the local density of node
is the largest, the distance of this node should be the maximum value of all the distances. The farthest node from node
is node
. Then according to the descending order of local density,
should be the distance between node
and a node with higher local density, that is,
is
. Notice that in
Table 1, DESC means the local densities are in descending order and the distance of each node is determined by the value of local density.
Suppose that we only choose two nodes as cluster centers. In the CFSFDP algorithm, assuming that two points with the largest value are node and node , that is, the class of node is 1 and the class of node is 2, then other nodes can be clustered based on the descending order of local density. For example, node choose the same class as the node which has a higher local density and closest to itself. So, the class of node is 1 which is the same as node and the class of node is 1, 2, 2 respectively.
When considering residual energy in CFSFDP-E, the value will be changed. If the two nodes with the largest are node and node in the CFSFDP-E algorithm, the class of node obviously cannot be determined because node has the largest local density and we can’t find a node with higher local density than node . It doesn’t belong to any class if we still allocate nodes according to local density.
Due to the above problems, we consider how to allocate other normal nodes based on both local density and energy. We define a variable
called density-energy which can be calculated as follows:
Sort
value in descending order in
Table 2. However, the distance of each node is the same with
Table 1, which is still determined by its local density according to Equation (4). Suppose that the nodes with largest
value are node
and node
, then according to the descending order of
, we need to discuss about the class of node
. The class of node
should be the same as node
. But the node
hasn’t been allocated to any cluster, resulting in the class of node
can’t be determined, either.
From the analysis above, we can know that CFSFDP-E needs to multiply residual energy into the expression of
as Equation (11). The allocation of non-CHs should base on the order of density-energy instead of the local density in CFSFDP algorithm. Besides, the value of distance should also be determined by density-energy
in order to allocate all the nodes correctly. Therefore, the expression of distance should be revised to:
Table 3 shows the value of distance according to the
. The maximum
is
. The farthest distance from node
is node
, that is,
is
. Other
values can be calculated through Equation (13). The cluster heads are still node
and node
, so other unclassed nodes can be allocated into clusters according to the descending order of density-energy
. For example, the distance of node
is
, which means the nearest node to node
in other nodes that have a higher density-energy is node
. Hence the class of node
is 1, the same as that of node
. Similarly, the class of node
is 2, 1, 2.
4.3. Algorithm Description
The steps of the CFSFDP-E algorithm for each round can be divided into two phases. The first is clustering set-up phase, when all the sensor nodes should be clustered according to the CFSFDP-E algorithm. It will determine the CHs and CMs. The second phase is data transmission. Cluster members send data to their cluster heads and the cluster heads send data to the sink node. From the discussion above, the detailed steps of CFSFDP-E algorithm for one round can be described as follows:
4.3.1. Phase 1: Clustering Set-up Phase
- Step 1.
Parameter Initialization
- (1)
Set the number of nodes and maximum round for WSN;
- (2)
Set cutoff distance and threshold ;
- (3)
Calculate the distance between nodes;
- Step 2.
Determine whether the node is exhausted
Calculate every node’s residual energy through Equation (10). If the energy is exhausted, the node is dead. Only living nodes can go on following steps.
- Step 3.
Select CHs
Calculate every node’s local density, density-energy and distance through Equations (3), (12) and (13) in the current round , respectively. Based on these parameters, calculate of all the living nodes through Equation (11). If , the node will be chosen as cluster head.
- Step 4.
Allocate CMs.
Sort all calculated by Equation (12) in decreasing order. Assign the remaining nodes to the same cluster as its nearest neighbor with higher density-energy.
4.3.2. Phase 2: Steady-state Phase
This phase is the same as in LEACH [
9]. The cluster head node sets up a TDMA schedule and transmits the schedule to the nodes in its cluster. After all nodes in cluster have received the TDMA schedule, the steady-state operation will begin. All the normal nodes send their data to their own cluster heads and the energy of normal nodes will be consumed in this process. Once the cluster head receives all the data, it performs data aggregation to enhance the common signal and reduce the energy consumption. The aggregated data are sent to the sink node by routing path. Hence the energy consumption of cluster head contains receiving data from cluster members and sending aggregated data to sink node.
After the steady-state phase, the round ends. If total energy has not been exhausted or the current round hasn’t reached the maximum number of rounds, the next round will choose cluster heads and divide clusters by CFSFDP-E algorithm again, which will repeat Phase 1 and Phase 2.
Figure 2 is the flow chart of CFSFDP-E algorithm implemented in WSN.
represents the current round of the network.
The pseudo-code of the CFSFDP-E algorithm is as follows:
CFSFDP-E Algorithm |
1 Input: , , |
2 For each round |
3 For each node |
4 calculate its residual energy
|
5 If > 0 |
6 the node is still alive, calculate its local density
, distance and density-energy |
7 calculate
|
8 If > |
9 select node
as cluster head |
10 end |
11 else |
12 the node
is dead |
13 end |
14 Sort all the
in descending order |
15 Allocate normal nodes into several clusters based on the value of
|
16 Data transmission phase |
17 end |
18 end |