An AFSA-Inspired Vector Energy Routing Algorithm Based on Fluid Mechanics

This paper probes into the issue of short network lifetime caused by unbalanced routing energy consumption of wireless sensor network, and discovers that the reason for the problem is unbalanced network load. To tackle the issue, the author constructs a load-balanced vector field by the non-viscous fluid model in fluid mechanics, and optimizes the vector field-based energy routing by artificial fish-swarm algorithm (AFSA). On this basis, the author builds up an AFSA-inspired vector field-based energy routing algorithm based on fluid mechanics. Besides, the author conducts simulation analysis of the algorithm and common routing algorithms. Through comparison, it is discovered that the routing algorithm proposed by this paper has higher energy efficiency than the traditional routing algorithms, which prolongs the lifetime of the wireless sensor network.


INTRODUCTION
In a wireless sensor network, the routing protocol is used to determine the routing of the network and to complete the communication between nodes. Wireless sensor network (WSN) routing protocol has two main functions: one is to build an optimal path between the source node and the destination node to deliver optimal packets, and the other is to forward packets correctly along the path. There is a big difference between WSN routing protocol and that of general computer network, ad-hoc network, WLAN. The performance of WSN is measured by two important indices: energy consumption control and load balance. Based on energy considerations, load balance is of great significance on the application and development of sensors [1][2][3].
Typical routing protocols include ad-hoc on-demand distance vector (AODV) [4], sensor driven and cost-aware ant routing (SC) [5], flood forward routing (FF), flood piggyback routing (FP) [6], basic ant based routing (BABR) [7], and message-initiated constraint-based routing for adaptive spanning tree [8]. Taken into account in all of these protocols, improvement of energy efficiency is also the goal of this paper.
Literature [9] proposes to analyse WSN with electromagnetic field, and Literature [10] explores the moving method for WSN nodes. Inspired by this literature, this paper uses fluid mechanics model to analyse WSN routing protocol, simulates the packet flow in the sensor network, and, on this basis, sets up a vector field model based on viscous fluid.
Based on the vector field model of viscous fluid, this paper introduces the artificial fish-swarm algorithm (AFSA) [11] to optimize the viscous fluid-based vector field routing model. With the optimal routing model, the author puts forward a vector-based energy efficient routing algorithm, and compares it with classical routing algorithms through simulation.

VISCOUS FLUID-BASED VECTOR FIELD MODEL
Unlike the ideal fluid, the actual fluid has viscosity and is therefore known as viscous fluid [12,13]. Viscosity is defined as the relative movement of fluid micelles, which results in friction. The differential equation of viscous fluid is called Navier-Stokes equation (N-S equation).
During packet delivery in WSN, packets are forwarded to the sink node by a series of intermediate nodes along the routing direction. In fluid mechanics, there is a similar process, in which the fluid flows from the source to the sink along the streamline. Therefore, the fluid model can be used to simulate the packet flow in WSN.
See Eq. (1) for the vector form of N-S equation.
In the system of rectangular coordinates, the twodimensional components of N-S equation are expressed as: where v is the viscosity coefficient (the value of the constant is set as 1 to facilitate calculation), f x is the component force in the x direction, and f y is the component force in the y direction. This gives the following Eq.: Eq. (3) is mainly used to analyse the relationship between fluid motion and force, where u is the fluid velocity, f is the force acting on the fluid, and p is the intensity of pressure. In consideration of the characteristics of the motion in WSN, the formula is simplified into Eq. (4): where 2 ∇ is a Laplace operator (quadratic differential operator) [14,15]. f is analysed as follows: it is regarded as the intensity of packet flow in the sensor network; with more packets in its surroundings, the source node has a higher intensity of load flow. This gives the N-S equation of sensor network load flow field, as shown in Eq. (5).
The boundary condition should also be taken into account to solve the load flow field, which is a closed Neumann condition or Dirichlet condition [16]. Mathematically, the N-S equation is an elliptic-based second-order partial differential equation. As shown in Eq. (7), G  must be set as 0 to prevent overflow. In this condition, it is deducted that: On the basis of the viscous fluid model, the vector field model as shown in Eq. (8) is obtained by the addition of the boundary condition.
In Eq. (8), as long as the distribution of the field strength at each point between the source node and the destination node is identified, one can obtain the source node density distribution function, and thereby simulate the load flow field of the WSN.

AFSA
AFSA is an optimization algorithm in reference to the behaviour of fish swarm. The key of the algorithm lies in simulating the foraging, clustering and rear-end collision, and getting the global optimal solution rapidly through the common search of the fish swarm [11]. Similar to other swarm intelligence algorithms like intelligent particle swarm optimization and ant colony optimization, the AFSA is also a swarm artificial intelligence stochastic optimization algorithm, which has the advantages of less strict requirements on initial parameters, strong robustness, simple operation and strong global search ability.
Suppose that there are N artificial fish in a ndimensional target search space. The state of each artificial fish can be expressed as vector X = (x1, x 2 , …, x n ), where x i (i = 1, 2, …, n) is the variable. The food concentration at the current location of the artificial fish is expressed as Y = f(X), where Y is the objective function, d ij = ||X i − X j || is the distance between individual artificial fish, visual is the sensing range of the artificial fish, step is the moving step length of the artificial fish, δ is the crowding factor, and try_number is the maximum number of times the artificial fish tries to find food each time.
Artificial fish detect the surrounding situation through their visual sense, as shown in Fig. 1. Xi is the current location of the artificial fish, X h is the cluster head location, R C is the visual distance, X V is the visual location at a certain moment. If a location within the vision is better than the current location, the fish will move in this direction to the next location X next , otherwise, it will continue to cruise within the visual range.

Figure 1 Illustration of the field of view of artificial fish
Similar to the rear-end and foraging behaviours of artificial fish, the nodes in the WSN move in or search for the direction towards the location of larger network coverage. The current network coverage can be regarded as the food concentration at the current location of the artificial fish.
As one of the basic features of fish, the artificial fish normally stays in a location of a lot of food. Thus, the basic idea of AFSA is to find the global optimal solution by simulating the basic feature.

AFSA-INSPIRED ENERGY-EFFICIENT ROUTING MODEL
Combining the AFSA with the path-search algorithm, a hybrid algorithm for viscous-fluid routing is constructed. By introducing the idea of area partitioning, the whole network node search region is divided into several subregions, with each sub-region containing several network nodes. The node density can be correlated with food concentration, that is, a location of higher node density has higher food concentration, and the direction of path search should be consistent with the increasing direction of food concentration. It is known that the density of information in the network ρ decreases from the source node (where ρ is positive) towards sink node (where ρ is negative). To ensure the consistency with the increasing direction of food concentration, the location of higher food concentration is defined as -ρ so that the AFSA would search for the local suboptimal solution in the direction towards -ρ, i.e. towards higher food concentration (higher node density). Use the AFSA to find the local sub-optimal solution of each region, and take the sub-optimal solution as the initial solution of the path search, and then search for the local optimal solution.
For the purpose of ensuring uniform attenuation of the energy of the sensor nodes in the network and maximizing the network lifetime, the initial energy carried by all the nodes in the whole sensor network is assumed to be uniformly distributed, and the load balance of the network communication is regarded as the target.
Consider a WSN that contains region A, assuming that the source node is located at (x, y) ∈ A, and the node releases messages at the rate of r(x, y) (unit: b/s/m 2 ). The message of the source node is transmitted to the sink node through multi-hop routing. Assume the coordinate position of the sink node is (x 0 , y 0 ) ∈ A. Based on the above assumptions, it is possible to define a feature function ρ(x, y) on region A to represent the density of the source message, as shown in Eq. (9).
where, δ(x) is the Dirac function, and w 0 is the sum of message transmission rates ( Expressed as ( ), ( ) where ˆî j x y where, x and y denote the horizontal and vertical axes in the system of rectangular coordinates, respectively, and î and ˆj denote the unit normal vectors of the vector along the x and y axes, respectively. The boundary of region A satisfies: where ∂A is the boundary of A. The boundary condition is subject to the following constraints, i.e. no message should flow out of the boundaries of the network region, meaning that messages in the network are not leaked out of the network. According to the unified initial energy allocation in this section, this paper tries to make D  as uniform as possible, aiming to find the energy-efficient routing of the network which ensures balanced and evenly distributed transmission of messages. This is an effective way to prevent the condition that some nodes in the network are not fully utilized while some other nodes are facing energy failure due to excessive use. The unified load distribution can be expressed as the cost minimization function below.
where av D  is the mean value of vector field D  on the set A, which can be simply defined as: In Eq. (14), the square cost function ensures that the load in the network is distributed as balanced as possible. The balanced distribution can prevent the condition that some regions of the network are overloaded while other regions' resources are not fully utilized. An interesting fact is: the form of the cost function is very similar to that of the energy definition of the electrostatic field. The above optimization issue can be summarized as follows:

DESIGN OF THE AFSA-INSPIRED ENERGY-EFFICIENT ROUTING ALGORITHM
As shown in Fig. 2, OP is the radius of the circle with O as the centre, and the arc PH is a part of the circumference. At the beginning of the search, assume that the adjacent azimuth does not exist, and look for the relay node S within the azimuth range and node communication distance of the node N(x, y), and try to minimize SOD, the included angle formed by node S. If a suitable node is found, the node N(x, y) would send a message to the node. If not, find an adjacent azimuth, and continue searching within the POK and HOL of the adjacent azimuth. The principle is still trying to minimize the resulting included angle. Keep expanding the adjacent azimuth till a suitable node is found. Because the load flow lines originates from the source node and terminates at the cluster head node, it is deducted that the message would eventually reach the cluster head node. As above, for any node N i in region A, the next hop node N i + 1 should satisfy the following requirements: 1. N i + 1 is within the communication radius of N i ; 2. The included angle formed by the straight line between N i + 1 and N i and the vector line of N i is minimized, i.e. N i + 1 is at the closest possible location of the vector line of N i . Design the next-hop routing algorithm of N i is designed based on the two requirements and expand the algorithm to the whole network. The resulting algorithm is called vector field-based energy routing algorithm.
Algorithm: vector field-based routing algorithm 1. The source node broadcasts the path request packet (Req) in the communication range.
2. The intermediate node checks the received path request packet and stores it locally to judge whether the node is already in a certain path; if so, go to step 4; otherwise, go to step 3. 3. Calculate whether the included angle between the vector direction of the local node and the vector direction of the packet (Delta) is smaller than the azimuth (Angle); if so, go to step 5; otherwise, go to step 4. 4. Ignore Req. 5. Send an acknowledgment to the previous hop node, and carry Delta and the local ID. 6. After receiving the acknowledgment (Ack), the previous hop node parses the ID corresponding to the smallest Delta and sends the routing confirmation Ack. 7. After receiving the Ack and parsing the ID carried in the message, the node compares the ID. If the ID is the local ID, go to step 8; otherwise, go to step 9. 8. Make the local node ID as the last item of the packet routing table, increase the packet hop count by 1, make the current node ID as the local node ID, update the local routing table and go to step 10. The number of packets is increased by 1, the current node address is changed to the node ID, and the local routing table is updated. 9. Ignore the Ack. 10. Continue broadcasting Req.

Figure 3 Simulation results of vector field-based routing algorithm
Translate the vector search pseudo-code into Matlab language and carry out simulation on Matlab platform. See Fig. 3 for the results. The lower left corner of the figure denotes the source node, and the upper right corner denotes the sink node. As shown in the figure, several vector paths appear between the source node and the sink node. The source node sends messages along these paths, which are forwarded by the intermediate nodes on these paths.

ROUTING SIMULATION AND ANALYSIS
The AFSA-inspired, vector field-based energyefficient routing algorithm based on viscous fluid can be abbreviated as VFE (vector field-based energy routing). In this section, Matlab 2012 and OMNeT 3.1 software are used to perform routing simulation and analysis. The simulation is a two-stage process. First, implement VFE in Matlab to get the routing link table of the entire network, which displays the information of the previous and next hops of every node. Second, establish a simulation scenario in OMNeT in accordance with the topological structure of network nodes and the routing link table, and configure the simulation parameters (simulation performance indices include the throughput, the success rate of delivery, energy consumption, energy efficiency, etc.). With the powerful simulation capability of OMNeT, conduct simulation with routing algorithms like AODV, SC, FF, FP, BABR, MCBR-AST, etc. and obtain the simulation data.

Setting of Simulation Parameters
Generally speaking, WSN nodes communicate with each other in the frequency band of 2.4 GHz. In the simulation region, the strength of signal received at a certain point depends on the locations of the surrounding transmitting nodes. The farther away the point is from the transmitting nodes, the stronger the signal it receives. Actually, the signal strength of the receiving node can be calculated by the signal transmission equation. The signal transmission equation used in the simulation is: Where P r,ideal ideal strength of the received signal, P t is the signal emission intensity, d is the distance between the transmitting node and the receiving node; n is the attenuation factor related to the environment, which typically falls in the range 2 ≤ n ≤ 4; α and β are random variables that obey the normal distributions N(0, σ α ) and N(0, σ β ) respectively. Physically speaking, α(i, j) reflects the interference signal brought by geographic location during signal transmission, while β(t) reflects how the transmitted signal fluctuates with time. If the strength of the signal sent by node j exceeds a certain reception threshold (P r (i, j) > ε) at the reception by node i, it is considered that node i and node j are capable of communicating with each other. In this simulation, the attenuation factor n = 2, the variances σ α = 0.45, σ β = 0.02, and the received signal threshold ε = −90 dbm. See Tab. 1 for other parameters used in the simulation.
WSN energy consumption occurs during the transmission of messages between nodes, and information processing and control. Most of the energy is consumed by message transmission. Only a little energy is consumed by node processing and information control. As it is impossible to acquire the energy consumption of all WSN nodes in time, it is acceptable to approximate the energy consumption of the whole sensor network with the energy consumption of packet transmission and reception. See Eq.
where E is energy consumption, Len is the packet length, V is the rate of packet transmission and reception. The maximum transmission distance between nodes is defined as 200 units, Len is set as 128 bits, and V as 250 kbit/s. The total number of packets at the sink node can be calculated if the nodes have the same initial energy value.

Simulation Results and Analysis
The nodes are deployed in random distribution. The deployment area is a square. To verify the performance of the routing algorithm, the nodes are distributed evenly with a single source node.
In this simulation scenario, the node deployment method is as illustrated in Fig. 4. 100 nodes are distributed randomly in the 100 × 100 square area. The red asterisk (10,10) at the lower left corner of the simulation region is the source node, the red box (90, 90) at the upper right corner of the simulation region is the sink node, and the blue circles are other nodes.  As shown in Fig. 5, VFE has higher throughput than four routing protocols (FF, BABR, AODV and SC). That is because VFE can transmit data on multiple paths at the same time while AODV has only one transmission path. In comparison to MCBR_AST and FP, VFE has slightly lower throughput. The simulation results demonstrate that PF (1.343) sends about three times the number of packets sent by AODV (403). Moreover, the throughputs of BABR, SC, and FF tend to increase over time, while the throughput of VFE is stable at around 3.75. As shown in Fig. 6, the successful delivery rate of VFE stays above 90% throughout the simulation process, which means more packets reach the destination node correctly. Starting from about 30 seconds, the successful delivery rate of VFE is close to 92%. By comparison, it is discovered that only two routing protocols (FP and MCBR-AST) have similar and slightly higher successful delivery rates than VFE. The other four routing protocols feature very low successful delivery rates at the beginning of the simulation. Besides, while the successful delivery rates of SC, FF and BABR increase with simulation time, the successful delivery rate of AODV decreases. VFE has a much higher successful delivery rate than the other four routing protocols (the biggest gap is 50%).
As shown in Fig. 7, the energy consumptions of all protocols increase with the simulation. FP has the largest network energy consumption and SC has the minimum, and VFE energy consumption is only slightly higher than SC. Meanwhile, the slopes of FP and AODV energy curves are higher than that of VFE, which means that the former two routing protocols have more incremental energy consumption over time.
As shown in Fig. 8, VFE boasts the highest energy efficiency curve. In other words, VFE is more energy efficient than any other routing protocols, which proves that the VFE proposed in this paper is an energy-efficient routing protocol. FP has the worst energy consumption performance and its curve is stable over time. SC and MCBR-AST differs slightly in energy efficiency performance. The energy efficiencies of SC, MCBR-AST, FF and BABR all increase with time. In contrast, the energy efficiency curve of AODV decreases slightly over time but with relatively small fluctuation throughout the simulation process. Tab. 2 summarizes the performance of these routing protocols in simulation scenario (1).
Based on the above simulation, it can be concluded that: VFE has a fairly good performance as illustrated by various evaluation indices. In particular, the routing protocol does better than others on energy efficiency, which proves that the vector field-based energy-efficient routing is highly energy efficient.

RESULTS AND DISCUSSION
The short life cycle of WSN is attributable to the rapid energy consumption of some nodes in the network, which leads to network failure. Because the unbalanced energy consumption of the network is caused by load imbalance, the key to lengthen network life cycle lies in balancing the network load.
This paper constructs a load-balanced vector field by introducing the non-viscous fluid model in fluid mechanics, and optimizes the vector field-based energy routing by artificial fish-swarm algorithm (AFSA). On this basis, the author builds up a vector field-based energy routing algorithm with balanced load. Through simulation analysis, it is discovered that the routing algorithm has higher energy efficiency than the traditional routing algorithms, which prolongs the lifetime of the network.