|
Algorithm 3. The routing protocol |
-
1.
Assuming that the sensing data from node is forwarded along its optimal path on the spanning tree to the mobile sink;
-
2.
When an intermediate node receives the sensing data:
-
3.
if (its father node is in working status)
-
4.
Forward the sensing data to ;
-
5.
employs this routing protocol to forward the data;
-
6.
else //is in sleeping status
-
7.
if ( has neighbors on the spanning tree)
-
8.
for each neighbor
do
-
9.
Calculate according to Equation (14);
-
10.
Calculate the PC of the path --;
-
11.
end for
-
12.
Select the neighbor that on a path with a max value of PC as the forwarder;
-
13.
Forward the sensing data to this forwarder;
-
14.
The forwarder employs this routing protocol to forward the data;
-
15.
else
-
16.
Stop forwarding this data;
-
17.
end if
-
18.
end if
|