28
60 CHAPTER 5 TASK ALLOCATION AND ROUTING IN WSN 5.1 Introduction The lifetime of the sensor network can be improved by efficient assignment of task and routing. The task allocation inside the network plays a vital role in enhancement of lifetime because if the task distributed to different sensor nodes in WSN is unbalanced, it results in unbalanced use of energy. Due to the unbalanced utilization of energy inside the network, some sensor nodes come to end early as compared to others; it consequently breaks the communication links. As per the literature the task should be assigned to sensor nodes in some balanced manner which can increase the lifetime. One way to balance the task among the sensor nodes is schedule the sensor nodes according to some parameters and then assign the task. Due to the conditions that require the response from these sensor nodes in few seconds, some routing methods must be developed that respond in few seconds in distribution or collection of task. The key challenge to fulfill this goal is the battery power of sensor nodes and the presence of hurdles inside the region. The hurdles inside the WSN generate a problem of achieving a short length path for result collection. To overcome these problems, three methods are developed in this thesis. First method maintains clusters inside the WSN and assumes that the sensor nodes inside the clusters form a tree like structure. Second method, deploy and schedule the sensor nodes inside the region and on the basis of achieved scheduling distribute the task among the sensor nodes. Third method aims to provide the efficient route for collecting the task’s results. 5.2 Material and Methodology In this section different methodologies are discussed that are developed in the present work. 5.2.1 Tree Based Methodology Before providing the steps that are used to elaborate the methodology this section gives some models that are applied to achieve the tasks allocation. This section will discuss the network model, remaining battery model, task distribution model etc.

CHAPTER 5 TASK ALLOCATION AND ROUTING IN …shodhganga.inflibnet.ac.in/bitstream/10603/54411/6...Fig. 5.6 Distribution of Temperature (Celsius) 5.2.2 Task Distribution by Scheduling

  • Upload
    others

  • View
    5

  • Download
    0

Embed Size (px)

Citation preview

Page 1: CHAPTER 5 TASK ALLOCATION AND ROUTING IN …shodhganga.inflibnet.ac.in/bitstream/10603/54411/6...Fig. 5.6 Distribution of Temperature (Celsius) 5.2.2 Task Distribution by Scheduling

60

CHAPTER 5

TASK ALLOCATION AND ROUTING IN WSN

5.1 Introduction

The lifetime of the sensor network can be improved by efficient assignment of task and

routing. The task allocation inside the network plays a vital role in enhancement of lifetime

because if the task distributed to different sensor nodes in WSN is unbalanced, it results in

unbalanced use of energy. Due to the unbalanced utilization of energy inside the network,

some sensor nodes come to end early as compared to others; it consequently breaks the

communication links. As per the literature the task should be assigned to sensor nodes in

some balanced manner which can increase the lifetime. One way to balance the task among

the sensor nodes is schedule the sensor nodes according to some parameters and then assign

the task. Due to the conditions that require the response from these sensor nodes in few

seconds, some routing methods must be developed that respond in few seconds in distribution

or collection of task. The key challenge to fulfill this goal is the battery power of sensor

nodes and the presence of hurdles inside the region. The hurdles inside the WSN generate a

problem of achieving a short length path for result collection. To overcome these problems,

three methods are developed in this thesis. First method maintains clusters inside the WSN

and assumes that the sensor nodes inside the clusters form a tree like structure. Second

method, deploy and schedule the sensor nodes inside the region and on the basis of achieved

scheduling distribute the task among the sensor nodes. Third method aims to provide the

efficient route for collecting the task’s results.

5.2 Material and Methodology

In this section different methodologies are discussed that are developed in the present work.

5.2.1 Tree Based Methodology

Before providing the steps that are used to elaborate the methodology this section gives some

models that are applied to achieve the tasks allocation. This section will discuss the network

model, remaining battery model, task distribution model etc.

Page 2: CHAPTER 5 TASK ALLOCATION AND ROUTING IN …shodhganga.inflibnet.ac.in/bitstream/10603/54411/6...Fig. 5.6 Distribution of Temperature (Celsius) 5.2.2 Task Distribution by Scheduling

61

i) Network System Model

Network system consists of a set of clusters as N= {c1, c2, c3,…cn}and each cluster consists of

many sensor nodes as C={n1, n2, n3, …nt}. The size of the cluster is variant and the battery

power of these sensor nodes can be different but the computing power of the sensor nodes is

same. Suppose the battery power of these sensor nodes are given by the set B= {b1, b2, b3,…

bt} then the energy of the cluster can be given as ∑ . The network can be represented as

a graph of many nodes, the upper layer of graph consists of clusters and lower layer consists

of sensor nodes. The clusters are connected with each other by radio links and the sensor

nodes inside the cluster forms a tree like structure. The link Xuv means the cluster u can

communicate with the cluster v. The graph for upper layer(l1) can be modeled as Gl1={N,

X}, where X={X12,X34,X35,…Xpn}. The edge(link) Xbc represents that the cluster b can

directly communicate with cluster c. The graph for lower layer(l2) is modeled as Gl2= {C,Y},

where Y is a set {Y12,Y34,Y35…Yqt}. The link Ymn represents that the sensor node m can

communicate with sensor node n. An allocation matrix(A) mXn shows the amount of task

assigned to a particular cluster. If an entry (Aij) =0 is present in A, it shows that part of task i

is not allocated to cluster j and if Aij = x, shows that x percent task of task i is assigned to the

cluster j.

ii) Task Model

Suppose an application consists of many tasks such as {t1, t2, t3, … tn}. Each cluster inside the

network is monitored by one head node (H). The structure of the network inside a cluster is

like directed acyclic graph (DAG) and the root node of this DAG is the head node of that

cluster. Each cluster is assigned to complete some application and the tasks that come under

the application are managed by the head node of this cluster.

iii) Cluster Formation Phase

For constructing the cluster unsupervised learning is applied on a data set gathered from [92].

The original data set contains many fields such as date, time, epoch, moteid, temperature,

humidity, light, voltage. The data set is preprocessed to obtain the fields of temperature

(Celsius) and voltage (mA) and on this preprocessed data set k- means clustering is applied to

form the cluster. Initially, 2 clusters are taken but it does not provide balanced density of

sensor nodes. The clusters are increased from 2-3, 3-4 and 5. When the clusters are 5, it

provides nearly equal density at each cluster as shown in figure 5.1.

Page 3: CHAPTER 5 TASK ALLOCATION AND ROUTING IN …shodhganga.inflibnet.ac.in/bitstream/10603/54411/6...Fig. 5.6 Distribution of Temperature (Celsius) 5.2.2 Task Distribution by Scheduling

62

Fig. 5.1 Distribution of Sensor nodes

iv) Task Distribution Model

The application comprises of many tasks which are assigned to the sensor nodes inside the

cluster according to their remaining battery power (Rb). Suppose the task ti is assigned to a

sensor node (i) contains remaining battery power (Rbi) then the percentage of task assigned to

i is given by

. The assignment of the task to the sensor nodes at different level is

decided by the upper level. E.g. the nodes at level i are n1,n2; n1 contains x% of task and n2

contains y% of task assigned by the sensor node present in level i-1, suppose that the nodes

on level i+1 are n3,n4 and E is given as {(n1,n3),(n1,n4)}. Now the division of x% of task is

decided according to the remaining battery of the nodes n3(Rbn3) and n4 (Rbn4) as .

and

respectively. Figure 4.2 shows the task distribution process.

Page 4: CHAPTER 5 TASK ALLOCATION AND ROUTING IN …shodhganga.inflibnet.ac.in/bitstream/10603/54411/6...Fig. 5.6 Distribution of Temperature (Celsius) 5.2.2 Task Distribution by Scheduling

63

H

n4n3

n2n1

(x

*Rbn

3)

/100

(x*R

bn4)

/

100

x y

Fig. 5.2 Task Distribution

v) Remaining battery Model

The remaining battery of the network can be represented as a

set

. So the remaining battery of the network becomes

RBN=∑

. The Cluster’s battery power can be represented by a set

. The nodes at level, i informs about their remaining battery to their

parent level i-1. The remaining battery of the level i is calculated as ∑

,

where k= {1,2,3,4,…l}.where, total number of nodes at level i are l. The remaining battery

power of each node at level i

is calculated as

∑ ∑

, for x = i-1, i-2, i-3,…, z and

z is the level of the leaf node. At last, node H will calculate the total battery remaining inside

the cluster after getting the remaining battery power of its sensor nodes.

vi) Result Collection Model

The results of the tasks distributed inside the cluster are collected by cluster head and cluster

head send this result to base station (BS). The sensor nodes at lower level send its result to its

parent at upper level. Suppose the nodes at level i are ni1, ni2, ni3, ni4, these sensor nodes send

their results to sensor node at level i-1 without waiting for each other send process. The

sensor node at level i-1 collects the result (Resulti-1) and sends this result to sensor node at

level i-2.

||

||

(5.1)

The whole process of result collection is shown in figure 5.3.

Page 5: CHAPTER 5 TASK ALLOCATION AND ROUTING IN …shodhganga.inflibnet.ac.in/bitstream/10603/54411/6...Fig. 5.6 Distribution of Temperature (Celsius) 5.2.2 Task Distribution by Scheduling

64

n1

n6

n3

n5

n2

n3

n1

n6n5

n4n3

n1

n2

n7n6

n4

n2

n5

n4

n6

n3

n2

n1

n4

n5

BS

Fig. 5.3 Result Collection Process

vii) Task Allocation and Collection Algorithm

Algorithm 5.1:

Step 1: The Base Station, BS Allocates the task to each clusters on the basis of their

remaining Battery Power(RBC).The BS assign the task to cluster through their

Cluster Head (CH). The task Assigned to the cluster TC is given as

(5.2)

Here α is a constant, it depend upon the battery utilization in communication

(Cluster head communicates with all the nodes present in the cluster and α is the

cost of communication in the form of battery utilization that incur in,

communication of cluster head with other nodes present in the cluster ).

Step 2: H collect the information for the remaining battery of their child nodes; assign the

task according to their remaining battery power (RNC), the task assigned to a child

node is calculated as

(5.3)

The task assigned to the CH is given as

(5.4)

RBH is the remaining battery power of H,

Step 3: Now the child node of CH assigns the task to their child node and itself according

to their remaining battery power by using equation (5.3) and (5.4).

Page 6: CHAPTER 5 TASK ALLOCATION AND ROUTING IN …shodhganga.inflibnet.ac.in/bitstream/10603/54411/6...Fig. 5.6 Distribution of Temperature (Celsius) 5.2.2 Task Distribution by Scheduling

65

Step 4: Repeat Step-3 until the leaf node of the DAG does not come.

Step 5: After the distribution of Ttotal in the cluster the parent nodes collect the result from

their child nodes.

Step 6: Each parent node waits for a threshold time for getting the result from the child

node. Suppose the throughput of the processor of the nodes is η and the allocated

task to the node is TNC then the threshold time (τ).

, λ is the communication cost and ψ is the task partition cost.

Step 7: The cluster CH collects the task’s results from their child nodes and replies the

result to BS.

viii) Relation between Battery and Temperature

Due to the application of WSN in varying temperature regions, it needs to find the relation

between battery and temperature and by getting this information it becomes able to decide the

depletion rate of the battery. According to depletion rate of the battery the task assigned to

cluster head can be calculated by the formula

if the depletion

rate of the battery is more than the standard depletion rate, depends upon the deletion rate.

The relation between temperature (Celsius) and battery/ voltage (mA) is shown in figure 5.4.

The distribution of voltage/battery and temperature are given in figure 5.5 and figure 5.6

respectively.

Fig. 5.4 Relation between Battery/voltage and temperature

Page 7: CHAPTER 5 TASK ALLOCATION AND ROUTING IN …shodhganga.inflibnet.ac.in/bitstream/10603/54411/6...Fig. 5.6 Distribution of Temperature (Celsius) 5.2.2 Task Distribution by Scheduling

66

Fig. 5.5 Distribution of Battery/Voltage (mA)

Fig. 5.6 Distribution of Temperature (Celsius)

5.2.2 Task Distribution by Scheduling

In this methodology the sensor nodes are deployed, scheduled and then tasks are distributed

among the sensor nodes according to the schedule. The methodology applies the Teaching

Learning Based optimization to find the deployment location and schedule and then provide a

Page 8: CHAPTER 5 TASK ALLOCATION AND ROUTING IN …shodhganga.inflibnet.ac.in/bitstream/10603/54411/6...Fig. 5.6 Distribution of Temperature (Celsius) 5.2.2 Task Distribution by Scheduling

67

task distribution algorithm to assign the task among the sensor nodes on the basis of some

parameters.

a) Objective Function

Let the position of each Point of Interest (PoIi) of Group Gk is (xki,yki) and Position of sensor

(Sj) is . The batteries of sensor nodes are Bj, efficiency of sensor nodes are Ej then

∑ √ (5.5)

( )

(5.6)

Lower value of objective function provides optimal location with good efficiency.

b) Scheduling Algorithm

Algorithm 5.2:

Step 1: Apply the Grouping algorithm (Algorithm 5.4) to form the groups of POIs as

(G1, G2, G3, G4, G5, …Gn).Suppose the G1 = {PoI1, PoI5, PoI8}, G2= {PoI2,

PoI9, PoI20} and so on.

Step 2: Apply algorithm 5.3 in the result of step 1.

C. Algorithm 5.3

Step 1: Initialize the Optimization parameters such as Population size (Pn), Number of

Generations (Gn), Number of Design variables (Dn) and limits of design

variables (L, U).

Step 2: Initialize the Population. (Generate the random population according to the

Population size (number of sensors) and number of design variables (Groups)).

Sensors/Groups G1 G2 G3 . . . . Gn

S1 V11 V12 V13 . . . . V1N

S2 V21 V22 V23 . . . . V2N

. . . . . . . . .

. . . . . . . . .

Sn VN1 VN2 VN3 . . . . VNN

Page 9: CHAPTER 5 TASK ALLOCATION AND ROUTING IN …shodhganga.inflibnet.ac.in/bitstream/10603/54411/6...Fig. 5.6 Distribution of Temperature (Celsius) 5.2.2 Task Distribution by Scheduling

68

Step 3: Teacher Phase

(a) Calculate the mean population column-wise, Which will give the mean for

particular group as

.

(b) The best solution will act as the teacher for that iteration.

(c) Teacher will try to shift the mean from

, which will act

as the new mean as

(d) Find the difference between two means as

Where is the teaching factor and selected as 1 or 2. r is the random

number between 0 and 1.

(e) Now add the Diff to current solution to get the updated solution as

Step 4: Learner Phase

for each i in

Randomly select two groups as

if ( )

, where ri is in range [0,1].

else

Accept

if it gives better

c) Algorithm 5.4

It explores the steps that are applied to form the group of sensor nodes. The Flow Chart for

these steps is given in figure 5.7.

Page 10: CHAPTER 5 TASK ALLOCATION AND ROUTING IN …shodhganga.inflibnet.ac.in/bitstream/10603/54411/6...Fig. 5.6 Distribution of Temperature (Celsius) 5.2.2 Task Distribution by Scheduling

69

Fig. 5.7 Flow Chart for Grouping Algorithm

Further text discusses each step that is applied to form the group of sensor nodes.

i) Assignment of Number of Groups

Many sensor nodes are deployed to cover the region of interest. In this step, the numbers of

groups are provided that covers the whole area of interest. The pattern of group is assumed

hexagon. Let the area of interest is A then the number of groups (Cn) is given as

( √

)

⌉ (5.7)

ii) Centroid Calculation

Centroids are the points that resemble as the center point of any group. Each group inside the

region of interest consists of one centroid.

Step 1: Assign the number of centroids needed

Start

Assign number of

Groups (Cn)

Calculate Centroid

Distance from Sensor nodes to

Centroid

Group the Sensor nodes based

on minimum distance

Change in

any Group

Exit

YES

NO

Page 11: CHAPTER 5 TASK ALLOCATION AND ROUTING IN …shodhganga.inflibnet.ac.in/bitstream/10603/54411/6...Fig. 5.6 Distribution of Temperature (Celsius) 5.2.2 Task Distribution by Scheduling

70

Step 2: Randomly select the sensor nodes that are deployed in the region as centroids

Step 3: In this step the efficiency of different centroids in checked by the equation (5.5)

and (5.6)

iii) Calculation of Distance from Centroid to Sensor node

Let the position of sensor node is (xi,yi) and the location of centroid is (cxj, cyj) then the

distance(di) between sensor node and centroid is given as:

√| | | |

(5.8)

iv) Minimum Distance Calculation

In this step, put the sensor nodes in different groups on the basis of distance given by

equation (4.9).

∑ ∑

(5.9)

Where is the mean of points in

c) Task Distribution and Result Collection

An application must be divided into tasks to perform the collaborative processing inside the

WSN. There are many applications which require imprecise data and some applications of

WSN which require precise data. Such as fire tracking inside forest requires imprecise data

and traffic monitoring inside a city require precise data. Some applications also require

priority so the task distribution algorithm must work on the basis of the parameters as priority

and preciseness. As the scheduling algorithm provides a centroid node for each group which

cover a region of interest. As these centroid nodes cover whole region of interest, these active

centroid nodes only can provides the information about the event occur inside the region but

if the application requires precise information about event it can utilize the other sensor nodes

present inside the group after awakening them. This section provides an algorithm 5.5 which

distribute the task on the basis of precise or non-precise and priority or non-priority. Suppose,

the task (T) is to collect the information about the traffic of a city. T must be divided into

zones as {T1, T2, T3,…Tcn}. These tasks must be assigned among the zones.

Page 12: CHAPTER 5 TASK ALLOCATION AND ROUTING IN …shodhganga.inflibnet.ac.in/bitstream/10603/54411/6...Fig. 5.6 Distribution of Temperature (Celsius) 5.2.2 Task Distribution by Scheduling

71

Algorithm 5.5:

Step 1: Divide the task into different zones according to number of clusters

Step 2: Decide the priority and accuracy of data for each zones

Step 3: if the priority of any zone is high then

(a) Assign the sleep- sensor nodes in different clusters (Those comes in the path

from zone to base station) for forwarding the data

(i) If the accuracy required is low then

No assignment for other sensor nodes present in the zone

(ii) If accuracy required high then

Assign more sensor nodes in the zone to collect the data from the

environment.

Step 4: If the priority of any zone is low then

(a) Don’t assign any extra sensor node for forwarding the data

(i) If the accuracy required is low then

No assignment for other sensor nodes present in the zone

(ii) If accuracy required high then

Assign more sensor nodes in the zone to collect the data from

the environment

5.2.3 Routing of Task/ Query

In wireless sensor network many queries flow towards the region of interest for collecting

some sensed data. Some assumptions are taken in this methodology as:

The base station (BS) node is enabled with GPS system and by applying some

localization strategy the position of other sensor nodes can be accomplished.

The links between the sensor nodes are bidirectional.

a) Network System

The network consists of many sensor nodes which are able to communicate with others. The

sensor nodes sense the data from environment and send this data to other sensor nodes by

Page 13: CHAPTER 5 TASK ALLOCATION AND ROUTING IN …shodhganga.inflibnet.ac.in/bitstream/10603/54411/6...Fig. 5.6 Distribution of Temperature (Celsius) 5.2.2 Task Distribution by Scheduling

72

messaging. The sensor nodes contain a small memory for storing some value. The network

contains some regions which do not come under the coverage of any sensor nodes these

regions are called as hole. The network can be represented by Euclidean space and the sensor

nodes can be known as Euclidean points.

b) Developed Methodology

This section gives the different steps that are applied to fulfill the requirement of forwarding

the task/ query.

Step 1: Select any exterior node p in the network.

Step 2: Perform the flooding from an exterior node p in the network. Each node records

the minimum hop count from p. This can provide the shortest path tree from the

node p.

Step 3: Determine the nodes that form the JOIN. The JOIN is a point where different

homotopy type shortest path tree meets. If there are multiple JOINs inside a

network then there is more than one hole inside the network. It can be found by

the method given by Alstrup et al[93] for calculating the LCA. If there are two

points(s,t) on the JOIN with same LCA(s,t). If we move from s or t (consider the

edge between s and t) and go through LCA(s,t) with following the spanning tree,

we will get a cycle.

Step 4: Determine the two nodes in the JOIN with minimum Euclidean distance from

the node p.

Step 5: Determine the third node present in the inner boundary of the hole. It can be

found by using the geometric rules and Euclidean distance.

Step 6: Determine the nodes present in the inner boundary of the hole.

Step 7: Determine the nodes present in the outer boundary of the region.

Step 8: Now it provides the set of cycles that give the inner and outer boundary. Now

the medial axis between inner and outer boundary can be calculated.

In the further text these steps are discussed in more detail.

i) Shortest Path Tree Construction

The hop count field for each node is initialized ∞ excluding node p. Now the node p flood the

message which contains it ID and hop count (p’s hop count is 0). The node (z) that receives

the message increment its hop count by 1 and sets its ancestor node as p. Now z floods the

Page 14: CHAPTER 5 TASK ALLOCATION AND ROUTING IN …shodhganga.inflibnet.ac.in/bitstream/10603/54411/6...Fig. 5.6 Distribution of Temperature (Celsius) 5.2.2 Task Distribution by Scheduling

73

message to other nodes and other nodes increment their hop count by 1 and set the ancestor

node as z. Any node (predecessor) gets the message from its ancestor, first it calculates the

hop count value and compares new hop count value with its old hop count value if old hop

count value is less than the new hop count value then it maintains its hop count value without

any update. The process of construction of shortest path tree is given in figure 5.8 and

message format is given in figure 5.9.

Fig. 5.8 Construction of shortest path tree

Fig. 5.9 Message Format

For example, in the figure 5.8 node p is flooding the message (1||0) to its neighbors (r,s,t)

which are in its sensing range. After receiving the message from p, the neighbor nodes r, s

and t calculate the hop count value, which becomes 0+1=1, since 1 is less than ∞, the updated

value for hop count in nodes r, s and t is stored as 1. Now the node r floods the message (2 ||

1) to its neighbor’s x, y, p and s the neighbor nodes calculates the hop count values as follows

p’s hop count value= r’s hop count value(from received message) + 1= 1+1=2

s’s hop count value= r’s hop count value(from received message)+ 1= 1+1=2

x’s hop count value= r’s hop count value(from received message)+ 1=1+1=2

y’s hop count value= r’s hop count value(from received message)+ 1=1+1=2

Since the calculated hop count value for p is greater than the stored old value, so the hop

count value for p will not be change, the calculated hop count value for s is also greater than

Sender Hop Count Node_ID

Page 15: CHAPTER 5 TASK ALLOCATION AND ROUTING IN …shodhganga.inflibnet.ac.in/bitstream/10603/54411/6...Fig. 5.6 Distribution of Temperature (Celsius) 5.2.2 Task Distribution by Scheduling

74

the stored old value so it will also be not change. The calculated value of hop count for nodes

x and y will change because it is less than the stored old value.

ii) Determine the Nodes that Form the JOIN

The nodes where two branches of shortest path tree meets are known as JOIN nodes and the

space that comes under these nodes is known as JOIN.

Let the depth of the left shortest path tree branch (TL) is d1 and right shortest path tree branch

(TR) is d2. Suppose there are n1, n2, n3…nodes are present at depth d1,

nodes

are present at depth d2. The nodes that comes under each other sensing range are comes in the

JOIN nodes. If the edges among these nodes are added, it provides a graph, because these

nodes are present at the fork of either tree TL or TR. The Euclidean distance between p and n1,

n2, n3…or

is β, then β will always be greater than zero. Generally the value of

β is taken in some constant fraction of the diameter of the sensing range. Alstrup et al [93]

have given the method for getting the Least Common Ancestor (LCA). The LCA of the two

node in the

(will be far from the nodes

) will be the path

from to n1 and path from

to

are well separated. This process

can be applied to find more than one JOINs if present in the Euclidean space. The process of

JOIN formation is given in figure 5.10.

Fig. 5.10 JOIN Formation

iii) Nodes Present in the Inner Boundary of the Hole

Page 16: CHAPTER 5 TASK ALLOCATION AND ROUTING IN …shodhganga.inflibnet.ac.in/bitstream/10603/54411/6...Fig. 5.6 Distribution of Temperature (Celsius) 5.2.2 Task Distribution by Scheduling

75

Let the nodes that are present in the JOIN are n1, n2, n3, n4… Find the Euclidean distance

between p and n1, p and n2, p and n3, p and other nodes present in JOIN. Now find the two

lowest Euclidean distance nodes in JOIN. These nodes become the nodes in the

circumference of the hole. Now determine the node with highest depth that present in the line

between p and a with lowest Euclidean distant node in first JOIN in the shortest path tree

which becomes the third node on the circumference of the hole. If there are more than one

hole in the Euclidean space then there will be more than one JOIN, if the Euclidean space

contains two holes then there will be two JOINs. The two nodes on the circumference of the

second hole can be determined by getting the two lowest Euclidean distance node from p in

second JOIN and the third node in the circumference of the second hole can be determined by

finding the node with highest Euclidean distance in first JOIN. The process is shown in figure

5.11.

Fig. 5.11 Euclidean Space with three JOINS

Procedure for Determining the Third Node in JOIN (first)

Step 1: Start from the root node p, take the depth value d=0

Step 2: Find the equation of line (L) between p and a

Step 3: Find the next node node(Ln) in the shortest path tree that belongs in line L as

follows

(a) Put the coordinates value of Ln in L and get the value(V)

Page 17: CHAPTER 5 TASK ALLOCATION AND ROUTING IN …shodhganga.inflibnet.ac.in/bitstream/10603/54411/6...Fig. 5.6 Distribution of Temperature (Celsius) 5.2.2 Task Distribution by Scheduling

76

(b) if the value V becomes zero after +-C where C is a threshold

(c) then increment d and mark Ln as the next root

(d) repeat step 3 until we get the child node

Step 4: Mark the node Ln as the third node on the circumference of the first hole.

Now two cases are considered about the shape of hole to find the nodes in inner boundary of

hole.

Case 1: Shape of hole is a circle

Case 2: Shape of hole is any other polygon

CASE 1

Let the equation of the circle with the center at (h, k) is

(5.10)

Calculating the center of the circle and radius given the three point on the circumference as

Put x=x1 and y=y1 in equation (5.10) provides

(5.11)

Put x=x2 and y=y2 in equation (5.10)

(5.12)

Put x=x3 and y=y3 in equation (5.10)

(5.13)

The equation (5.11), (5.12) and (5.13) gives

(5.14)

(5.15)

Solve the equation (5.14)

(5.16)

Solve the equation (5.15)

(5.17)

Solve the equation (5.16) and (5.17) for the values of h and k

Page 18: CHAPTER 5 TASK ALLOCATION AND ROUTING IN …shodhganga.inflibnet.ac.in/bitstream/10603/54411/6...Fig. 5.6 Distribution of Temperature (Celsius) 5.2.2 Task Distribution by Scheduling

77

(5.18)

(5.19)

Put the value of h and k from equation (5.18), (5.19) and x=x1, y=y1in the circle equation

(5.10). It provides the radius of the circle.

Suppose the coverage radius of the sensor node is given as

Fig. 5.12 Calculation of Rotational Angle

In figure 5.12, suppose the distance,

Then,

(5.20)

Calculation of the point from the point s(x1, y1)

[ ] [ ] [

] [

] [

]

Fig. 5.13 Determine the point in the circumference of hole

Same way, the point can be calculated as

Page 19: CHAPTER 5 TASK ALLOCATION AND ROUTING IN …shodhganga.inflibnet.ac.in/bitstream/10603/54411/6...Fig. 5.6 Distribution of Temperature (Celsius) 5.2.2 Task Distribution by Scheduling

78

[ ] [ ] [

] [

] [

]

CASE 2

Consider the figure 5.8 with one hole.

// Input: Take a buffer as A

Step 1.Consider the Left shortest path tree branch

a. Find the value t1=d1-d -1.

b. Put the coordinates of node n1 in A.

c. Find the parent (P) of parent node of n1.

d. While t1≠ 0

e. Find the right most child of P put the coordinate value of right most child in A

f. t1=t1-1

g. Assign node P as the parent of P

Step 2.consider the right shortest path tree branch

a. Find the value t2=d2-d -1.

b. Put the coordinates of node n1’ in A.

c. Find the parent (P) of parent node of n1’.

d. While t2≠ 0

e. Find the left most child of P put the coordinate value of left most child in A

f. t2=t2-1

g. Assign node P as the parent of P

A contains the coordinates of the nodes present in circumference of the hole. If more than one

hole is present in the Euclidean space then apply the above algorithm for each pair of the

lowest Euclidean distance at each hole.

iv) Determine the Node Present in Exterior Boundary of Hole

To find the exterior boundary it needs to find the outer node, outer node is a node which

is far from the interior node in the Euclidean space. Following steps are applied to find

the exterior boundary.

// Input: take two buffer B and C

Start from the root node p in the tree

Find the val=max(d1,d2)

for i=1 to val do

Page 20: CHAPTER 5 TASK ALLOCATION AND ROUTING IN …shodhganga.inflibnet.ac.in/bitstream/10603/54411/6...Fig. 5.6 Distribution of Temperature (Celsius) 5.2.2 Task Distribution by Scheduling

79

Find the left most child(l) and right most child(r)

Put the Euclidean point of l in B and Euclidean point of r in C

The buffer B and C provides the nodes present in the exterior boundary of the Euclidean

space.

v) Determine the Medial Axis

The distance between nodes at interior boundary and exterior boundary is used to find the

medial axes. On the basis of these distances different regions are maintained by using voronoi

diagram. Let Di is the distance of a node from the inner boundary and Do is the distance of this

node from the outer boundary. If Di is greater than Do then this node will belong to the region

near to inner boundary. If Do is greater than the Di then this node will belong to the region near

the outer boundary. The medial axis contains the nodes which have equal Euclidean distance

from both inner and outer boundary. Only the mantissa part of a fractional number are

considered for Di and Do. If the difference between Di and Do is C and C<1 then consider the

Di and Do equal. This process provides the medial axis and the voronoi diagram for the

considered Euclidean space. This voronoi diagram and medial axis can be used to perform the

routing/ distribution inside the Euclidean space.

c) Query/ Task Dissemination and Collection

Each region inside the Euclidean space contains a master node (M); the master node receives

the data from the nodes inside the region. BS generates the query like, Query: send the wind

speed where the temperature is below 35.

The node (K) that receives the query from BS inside a region R, transfer the query towards

the master node in that particular region. The master node checks the condition in the query

message and transfers the query towards the neighboring regions. Steps of Query/task

dissemination and collection are given as follows:

for each region R

if condition==TRUE

(a) Check the timestamp(t) of the data

(i) If t<threshold then

Send the data towards the node K.

Node K transfers the data to BS.

(ii) Otherwise

Page 21: CHAPTER 5 TASK ALLOCATION AND ROUTING IN …shodhganga.inflibnet.ac.in/bitstream/10603/54411/6...Fig. 5.6 Distribution of Temperature (Celsius) 5.2.2 Task Distribution by Scheduling

80

Master node broadcast the message for gathering the required

data from the region, master node collect the data and forwards the

data towards the node K.

Node K transfers the data to BS.

The process of Query/ task dissemination and collection is shown in figure 5.14.

Fig. 5.14 Query/ Task Dissemination and Collection

5.3 Performance Results

This section discusses the performance of different methodologies that are applied to allocate

/ route the task among the sensor nodes present in the WSN.

5.3.1 Results of Tree based Methodology

To evaluate the performance of tree based methodology, throughput (number of task

completed per seconds) is taken as the parameter. A scenario is created in OPNET which

contains 64 sensor nodes and 5 clusters. The initial battery backups of clusters are 0.51, 0.21,

0.36, 0.14 and 0.04 joules respectively. To evaluate the throughput, the scenario is run for

600 seconds and provides the comparison between the throughput when developed method is

applied and when the developed method is not applied. When developed method is applied it

provides throughput as 9219.1683 bps and when developed method is not applied it provides

throughput as 6957.4125 bps. As the results show developed method provides 32.51%

increment in the throughput.

Page 22: CHAPTER 5 TASK ALLOCATION AND ROUTING IN …shodhganga.inflibnet.ac.in/bitstream/10603/54411/6...Fig. 5.6 Distribution of Temperature (Celsius) 5.2.2 Task Distribution by Scheduling

81

5.3.2 Results of Task Distribution by Scheduling

To evaluate the performance of this methodology, four scenarios are created in MATLAB

2013b as scenario 1 with 5000 sensor nodes, scenario 2 with 10000 sensor nodes, scenario 3

with 15000 sensor nodes and scenario 4 with 20000 sensor nodes in 103x10

3 m

2 area. Each

scenario generates 100 tasks for each group of sensor nodes present in the region. Figure

5.15, 5.16, 5.17 and 5.18 show the results. Each figure contains four graphs which show Task

Completed (%), Task Completion Time by Group, Battery used group-wise and Total Task

allocated to each group for scenario. The graph that shows the Task Completed(%)(suppose

in first iteration 20% task completed then in second iteration 80% task is given as input,

suppose in second iteration 60% task completed then in third iteration 25% task will be given

as input).

Fig. 5.15 Scenario 1

Page 23: CHAPTER 5 TASK ALLOCATION AND ROUTING IN …shodhganga.inflibnet.ac.in/bitstream/10603/54411/6...Fig. 5.6 Distribution of Temperature (Celsius) 5.2.2 Task Distribution by Scheduling

82

Fig. 5.16 Scenario 2

Fig. 5.17 Scenario 3

Page 24: CHAPTER 5 TASK ALLOCATION AND ROUTING IN …shodhganga.inflibnet.ac.in/bitstream/10603/54411/6...Fig. 5.6 Distribution of Temperature (Celsius) 5.2.2 Task Distribution by Scheduling

83

Fig. 5.18 Scenario 4

These four scenarios are also created in an area of 102x10

2 m

2 and compared the results

(lifetime of network) when developed method is applied and when the deployment is random.

The comparative results are given in table 5.1.

Table 5.1 Lifetime of WSN (Seconds)

Scenario

Random deployment After Application of

developed method

Improvement (%)

Area of the WSN

102X10

2 m

2

103X10

3

m2

102X10

2 m

2

103X10

3

m2

102X10

2 m

2 10

3X10

3 m

2

1 80.6666

74.422

133.0342

372.6300

64.92 400.70

2 78.0152

8.8263

159.2675

813.5500

104.15 9117.34

3 5.1304

30.498

449.8564

666.3600

8668.45 2084.93

4 6.9099

4.7640

217.0760

185.3583

3041.52 3790.81

5.3.3 Results of Routing of Task /Query

First, two analyses are presented to evaluate the performance of developed methodology as

Traffic and Energy Analysis.

Page 25: CHAPTER 5 TASK ALLOCATION AND ROUTING IN …shodhganga.inflibnet.ac.in/bitstream/10603/54411/6...Fig. 5.6 Distribution of Temperature (Celsius) 5.2.2 Task Distribution by Scheduling

84

a) Traffic Analysis

Let the scenario contains the regions {R1, R2, R3, R4…Rn}. For the purpose of simplicity it is

assumed that the each region contains maximum L levels of nodes and the total number of

nodes in a region are Ln. Suppose each node generates p messages and each message has the

same length as B bits. A region R have R’ neighboring regions. So the total number of

messages generated within a region is given as follows:

Case 1: if the current data is present at M (consider figure 5.14)

Total Traffic of Region (TOTAL_Traff_RGN)= 2L*p*B+2LR’*p*B

Case 2: if the instant data is not present at M (Consider figure 5.14)

Suppose, Rk= kR1 is the radius of k-hops coverage area of one sensor node. The area

of 1-hop coverage (A1) by a sensor node is πR12. Suppose the total area of the region is S,

since the total sensor nodes present in the region are Ln, so the number of sensor nodes per

unit area is given as L n/S.

So the number of sensor nodes present in k-hop distance (Nk) of one sensor node are Ln*

πRk2 /S = Ln* π k

2R1

2 /S. The area of k-hop ring (Ak) is given as Ak= πRk

2 – πRk-1

2 = π(Rk

2 –

Rk-12) = π(k

2R1

2- (k-1)

2R1

2) = πR1

2(k

2- k

2-1+2k) = πR1

2 (2k-1) =(2k-1)A1.

Suppose the maximum hop count in a region is L then the area from the k-hop ring to the L-

hop ring (Ak-h) is

(∑ ∑

) (

) ((

)

(

))

The traffic (TRAF_GENk) generated by each senor node present in the k-hop ring can be

calculated as (The nodes in the k-hop ring forward the message of outer rings and generate

the message itself).

TRAF_GENk=

Traffic generated by each 1-hop distance node is given as

TRAF_GEN1=

Page 26: CHAPTER 5 TASK ALLOCATION AND ROUTING IN …shodhganga.inflibnet.ac.in/bitstream/10603/54411/6...Fig. 5.6 Distribution of Temperature (Celsius) 5.2.2 Task Distribution by Scheduling

85

Traffic generated by each 2-hop distance node is given as

So the total number of messages generated by 1-hop ring is given as

(5.21)

So the total number of messages generated by a region of maximum L leveled node is given

as:

Total Traffic of the Region (Total_Traffic_RGN)=

(5.22)

b) Energy Analysis

Consider the following figure 5.19 for transmission and receiving the data. Suppose the

energy requirement for transmission is Etrans, energy for receiving is Ereceive and energy for

amplification is Eamp. So the energy requirement for transmitting the B bits of data for a

distance of r is

[ ] (5.23)

The energy requirement for receiving B bits of data for distance r is

[ ] (5.24)

So the total energy requirement is given as

[

] [ [ ]

[ ]] (5.25)

Page 27: CHAPTER 5 TASK ALLOCATION AND ROUTING IN …shodhganga.inflibnet.ac.in/bitstream/10603/54411/6...Fig. 5.6 Distribution of Temperature (Celsius) 5.2.2 Task Distribution by Scheduling

86

Fig. 5.19 Transmission and Receiving Model

To compare the results of developed methodology, a scenario is created with 20 sensor nodes

and 1 base station in OPNET and run for 3200 seconds and 7200 seconds. The developed

method is compared with AODV routing protocol for the following parameters:

Retransmission Attempts (Packets)

Network Load(bits/sec)

Data Dropped (bits/sec)

Throughput(bits/sec)

The comparative results are given in table 5.2.

Table 5.2 Comparative Results

S.No.

Parameters 3600 seconds 7200 seconds

AODV EECR AODV EECR

1 Retransmission Attempts

0.0283 0.0258 0.058744 0.039735

2 Network Load

16965.43 16109.24 16580.54 15832.77

3 Data Dropped

10.13861 10.13861 38.0198 20.27723

4 Throughput

29363.74 16099.1 29378.97 15812.5

5.4 Conclusion

Efficient task allocation inside the WSN can improve the lifetime of network. As WSNs are

established in disastrous area so it is impossible to recharge the battery of sensor nodes. This

type of area provides a variation in temperature. The task inside the network must be assigned

to sensor nodes in such a manner so that the lifetime of network enhanced. For the purpose of

solving these problems three methods are given in this section. The tree based methodology

Page 28: CHAPTER 5 TASK ALLOCATION AND ROUTING IN …shodhganga.inflibnet.ac.in/bitstream/10603/54411/6...Fig. 5.6 Distribution of Temperature (Celsius) 5.2.2 Task Distribution by Scheduling

87

provides enhancement in the connectivity and removes the unbalanced assignment of the

tasks/ query. It improves the throughput 32.51% as compared to the situation when this

methodology is not applied. Second methodology enhances the lifetime of the network 4.62x

for small scale problems and 16.19x for large scale problem when compared with random

deployment of the sensor nodes inside the WSN. Third methodology provides the results as

the density of the network increased by 33.33%, it provides 22.59% decrease in the

throughput and 25.55% decrease in the end to end delay. The developed method is compared

with AODV protocol as the results show it provides good results over AODV. The traffic

increases in the network approximately linear with respect to increase in the density of the

network. The growth of the power requirement increase in polynomial with increase in the

density of the network.