CHAPTER 3 HIERARCHICAL ENERGY TREE BASED ROUTING...

25
58 CHAPTER 3 HIERARCHICAL ENERGY TREE BASED ROUTING ALGORITHM FOR WIRELESS SENSOR NETWORKS A novel routing algorithm called HETRA is proposed in this research. This chapter discusses the proposed Routing Algorithm HETRA in detail and analyses how this algorithm could be energy efficient by improving the overall NLT. The proposed routing algorithm uses a HET, which is constructed using the available energy in each node of the network. The aim is to have a routing algorithm with an improved energy efficiency and prolonged NLT with proper congestion control. A novel congestion control algorithm called exponential congestion control algorithm is also proposed and is discussed in Chapter 4. The combination of the proposed routing algorithm and congestion control algorithm is simulated and experimented using ns2 and the performance of the combination is compared with other combinations of Routing algorithms such as AODV, DSDV and DSR and congestion control algorithms such as TCP/Tahoe, Reno, New Reno, MIMD and PIPD. This performance is evaluated using the simulated WSN with fixed node distribution patterns. 3.1 WIRELESS SENSOR NETWORKS WSN involves more and more into our life. The importance is increased due to the massive development on the hardware and communication abilities. This increases demand from the clients (companies, governments and organizations) to provide a better or new solution for their

Transcript of CHAPTER 3 HIERARCHICAL ENERGY TREE BASED ROUTING...

Page 1: CHAPTER 3 HIERARCHICAL ENERGY TREE BASED ROUTING …shodhganga.inflibnet.ac.in/bitstream/10603/13410/8/08_chapter 3.pdf · 3.2 ROUTING ALGORITHMS FOR WIRELESS SENSOR NETWORKS Due

58

CHAPTER 3

HIERARCHICAL ENERGY TREE BASED ROUTING

ALGORITHM FOR WIRELESS SENSOR NETWORKS

A novel routing algorithm called HETRA is proposed in this

research. This chapter discusses the proposed Routing Algorithm HETRA in

detail and analyses how this algorithm could be energy efficient by improving

the overall NLT. The proposed routing algorithm uses a HET, which is

constructed using the available energy in each node of the network. The aim

is to have a routing algorithm with an improved energy efficiency and

prolonged NLT with proper congestion control. A novel congestion control

algorithm called exponential congestion control algorithm is also proposed

and is discussed in Chapter 4. The combination of the proposed routing

algorithm and congestion control algorithm is simulated and experimented

using ns2 and the performance of the combination is compared with other

combinations of Routing algorithms such as AODV, DSDV and DSR and

congestion control algorithms such as TCP/Tahoe, Reno, New Reno, MIMD

and PIPD. This performance is evaluated using the simulated WSN with fixed

node distribution patterns.

3.1 WIRELESS SENSOR NETWORKS

WSN involves more and more into our life. The importance is

increased due to the massive development on the hardware and

communication abilities. This increases demand from the clients (companies,

governments and organizations) to provide a better or new solution for their

Page 2: CHAPTER 3 HIERARCHICAL ENERGY TREE BASED ROUTING …shodhganga.inflibnet.ac.in/bitstream/10603/13410/8/08_chapter 3.pdf · 3.2 ROUTING ALGORITHMS FOR WIRELESS SENSOR NETWORKS Due

59

applications. The target solution will save resources, human life, cut down the

cost, get better management and provide new services. But still, the solution

has not been reached completely. For all of these reasons, WSN is one of the

hottest research areas and needs an enormous research effort.

3.2 ROUTING ALGORITHMS FOR WIRELESS SENSOR

NETWORKS

Due to the recent technological advances, manufacturing of small

and low cost sensors has become technically and economically feasible. The

sensing electronics measure ambient conditions related to the environment

surrounding the sensor and transform them into an electric signal. Processing

such a signal reveals some properties about objects located and/or events

happening in the vicinity of the sensor. A large number of these disposable

sensors can be networked in many applications that require unattended

operations. A Wireless Sensor Network (WSN) contains hundreds or

thousands of these sensor nodes. These sensors have the ability to

communicate either among each other or directly to an external base-station.

A greater number of sensors allow for sensing over larger geographical

regions with greater accuracy. Basically, each node comprises sensing,

processing, transmission, mobilizer, position finding system and power units

(some of these components are optional like the mobilizer). Sensor nodes are

usually scattered in a sensor field, which is an area where the sensor nodes are

deployed. The deployment of these sensor nodes plays a vital role in the

overall performance of the WSN.

Sensor nodes coordinate among themselves to produce high-quality

information about the physical environment. Each sensor node bases its

decision on its mission, the information it currently has, and its knowledge of

its computing, communication, and energy resources. Each of these scattered

sensor nodes has the capability to collect and route data either to other sensors

Page 3: CHAPTER 3 HIERARCHICAL ENERGY TREE BASED ROUTING …shodhganga.inflibnet.ac.in/bitstream/10603/13410/8/08_chapter 3.pdf · 3.2 ROUTING ALGORITHMS FOR WIRELESS SENSOR NETWORKS Due

60

or to an external BS(s). A BS may be a fixed node or a mobile node capable

of connecting the sensor network to an existing communication networks.

Networking unattended sensor nodes may have a profound effect on the

efficiency of many military and civil applications such as target field imaging,

intrusion detection, weather monitoring, security and tactical surveillance,

distributed computing, detecting ambient conditions such as temperature,

movement, sound, light, or the presence of certain objects, inventory control,

and disaster management. Deployment of a sensor network in these

applications can be in a random fashion (e.g., dropped from an airplane) or

can be planted manually (e.g., fire alarm sensors in a facility). For example, in

a disaster management application, a large number of sensors can be dropped

from a helicopter. Networking these sensors can assist rescue operations by

locating survivors, identifying risky areas and making the rescue team more

aware of the overall situation in the disaster area. But the applications like fire

alarm sensors in a building may be manually placed. The placement of these

sensor nodes may follow a certain pattern in order to have a better coverage of

the entire sensor field with minimum number of sensor nodes.

In the past few years, an intensive research that addresses the

potential of collaboration among sensors in data gathering and processing and

in the coordination and management of the sensing activity with random and

fixed node placement are conducted. However, sensor nodes are constrained

in energy supply and bandwidth. Thus, innovative techniques that eliminate

energy inefficiencies that would shorten the lifetime of the network are highly

required. Such constraints combined with a typical deployment of a large

number of sensor nodes in some node distribution patterns pose many

challenges to the design and management of WSNs and necessitate energy-

awareness at all layers of the networking protocol stack. For example, at the

network layer, it is highly desirable to find methods for energy-efficient route

Page 4: CHAPTER 3 HIERARCHICAL ENERGY TREE BASED ROUTING …shodhganga.inflibnet.ac.in/bitstream/10603/13410/8/08_chapter 3.pdf · 3.2 ROUTING ALGORITHMS FOR WIRELESS SENSOR NETWORKS Due

61

discovery and relaying of data from the sensor nodes to the BS so that lifetime

of the network is maximized.

Routing in WSNs is very challenging due to the inherent

characteristics that distinguish these networks from other wireless networks

like MANETs or cellular networks. First, due to the relatively large number of

sensor nodes, it is not possible to build a global addressing scheme for the

deployment of a large number of sensor nodes as the overhead of

Identification (ID) maintenance is high. Thus, traditional IP-based protocols

may not be applied to WSNs. Furthermore, sensor nodes that are deployed in

an ad hoc manner need to be self-organizing as the ad hoc deployment of

these nodes require the system to form connections and cope with the

resultant nodal distribution especially that the operation of the sensor

networks is unattended. Sometimes in WSNs, getting the data is more

important than knowing the IDs of which nodes sent the data. Second, in

contrast to typical communication networks, almost all applications of sensor

networks require the flow of sensed data from multiple sources to a particular

BS. This, however, does not prevent the flow of data to be in other forms

(e.g., multicast or peer to peer). Third, sensor nodes are tightly constrained in

terms of energy, processing, and storage capacities. Thus, they require careful

resource management. Fourth, in most applications, nodes in WSNs are

generally stationary after deployment except for, may be, a few mobile nodes.

Nodes in other traditional wireless networks are free to move, which results in

unpredictable and frequent topological changes. However, in some

applications, some sensor nodes may be allowed to move and change their

location (although with very low mobility).

Fourth, sensor networks are application specific, i.e., design

requirements of a sensor network change with application. For example, the

challenging problem of low-latency precision tactical surveillance is different

Page 5: CHAPTER 3 HIERARCHICAL ENERGY TREE BASED ROUTING …shodhganga.inflibnet.ac.in/bitstream/10603/13410/8/08_chapter 3.pdf · 3.2 ROUTING ALGORITHMS FOR WIRELESS SENSOR NETWORKS Due

62

from that required for a periodic weather-monitoring task. Fifth, position

awareness of sensor nodes is important since data collection is normally based

on the location. Currently, it is not feasible to use GPS hardware for this

purpose. Finally, data collected by many sensors in WSNs is typically based

on common phenomena, hence there is a high probability of this data having

some redundancy. Such redundancy needs to be exploited by the routing

protocols to improve energy and bandwidth utilization. Usually, WSNs are

data-centric networks in the sense that data is requested based on certain

attributes, i.e., attribute-based addressing. An attribute-based address is

composed of a set of attribute-value pair query. For example, if the query is

something like [temperature > 60F], then sensor nodes that sense temperature

> 60F only need to respond and report their readings.

Due to such differences, many new algorithms are being proposed

for the routing problem in WSNs. These routing mechanisms must take into

consideration the inherent features of WSNs along with the application and

architecture requirements. The task of finding and maintaining routes in

WSNs is nontrivial since energy restrictions and sudden changes in node

status (e.g., failure) cause frequent and unpredictable topological changes. To

minimize energy consumption, many routing techniques are being proposed

for WSNs that employ some well-known routing tactics as well as tactics

special to WSNs, e.g., data aggregation and in-network processing, clustering,

different node role assignment, node placement patterns and data-centric

methods are employed. Almost all of the routing protocols can be classified

according to the network structure as flat, hierarchical, or location-based.

Furthermore, these protocols can be classified into multipath-based, query-

based, negotiation-based, QoS-based, and coherent-based depending on the

protocol operation. In flat networks, all nodes play the same role while

hierarchical protocols aim at clustering the nodes so that cluster heads can do

some aggregation and reduction of data in order to save energy. Location-

Page 6: CHAPTER 3 HIERARCHICAL ENERGY TREE BASED ROUTING …shodhganga.inflibnet.ac.in/bitstream/10603/13410/8/08_chapter 3.pdf · 3.2 ROUTING ALGORITHMS FOR WIRELESS SENSOR NETWORKS Due

63

based protocols utilize the position information to relay the data to the desired

region rather than to the whole network. The last category includes routing

approaches that are based on the protocol operation, which vary according to

the approach used in the protocol.

Distributed WSN consist of a large number of small, low-cost and

low-power nodes that coordinate with one another for environmental sensing.

The sensor nodes are severely restricted in power, memory and computational

resources.

The nodes can be densely deployed in close proximity to the

phenomenon to be observed. They can be deployed in hostile environments

where the nodes may not be physically accessible and are subject to

tampering. Nodes can be added to and deleted from the network at any time,

resulting in unpredictable changes to the topology of the network. This

research work presents a routing protocol for sensor networks to improve the

energy efficiency and hence the NLT.

Network lifetime is a novel performance metric which is derived in

need to evaluate the networks that are composed of nodes with non-

replenishable energy sources. WSNs are the primary examples of such

networks, in which the main concern is elongating the network lifetime.

Optimal WSN design is highly dependent on the application

scenario context. Correct quantification of the application specific network

lifetime is a must to further optimize the design. The focus is also given on

proposing some better schemes of node placement to increase the energy

efficiency and hence the NLT.

To realistically and correctly quantify the lifetime, we propose a

utility based lifetime measurement parameter called DANLT Product. With

this parameter, a more representative lifetime metric which maps the complete

Page 7: CHAPTER 3 HIERARCHICAL ENERGY TREE BASED ROUTING …shodhganga.inflibnet.ac.in/bitstream/10603/13410/8/08_chapter 3.pdf · 3.2 ROUTING ALGORITHMS FOR WIRELESS SENSOR NETWORKS Due

64

network behavior into a numeric value is obtained. This is in contrast with

metrics which focus solely on certain milestones of the network functionality

to quantify the lifetime which include the first node death and the last node

death.

3.3 DESIGN ISSUES OF ROUTING PROTOCOLS

Initially WSN was mainly motivated by military applications. Later

on, the civilian application domain of WSN has been considered, such as

environmental and species monitoring, production and healthcare, smart home

etc. These WSNs may consist of heterogeneous and mobile sensor nodes, the

network topology, may be as simple as a star topology; the scale and density

of a network varies depending on the application. To meet this general trend

towards diversification, the following important design issues of the sensor

network have to be considered.

3.3.1 Fault Tolerance

Some sensor nodes may fail or be blocked due to lack of power,

have physical damage or environmental interference. The failure of sensor

nodes should not affect the overall task of the sensor network. This is the

reliability or fault tolerance issue. Fault tolerance is the ability to sustain

sensor network functionalities without any interruption due to sensor node

failures. In fixed node distribution patterns proposed in chapter 6, the NLT

could be extended as the nodes are evenly utilized.

3.3.2 Scalability

The number of sensor nodes deployed in the sensing area may be in

the order of hundreds, thousands or more and routing schemes must be

scalable enough to respond to the events.

Page 8: CHAPTER 3 HIERARCHICAL ENERGY TREE BASED ROUTING …shodhganga.inflibnet.ac.in/bitstream/10603/13410/8/08_chapter 3.pdf · 3.2 ROUTING ALGORITHMS FOR WIRELESS SENSOR NETWORKS Due

65

3.3.3 Production Costs

Since the sensor networks consist of a large number of sensor

nodes, the cost of a single node is very important to justify the overall cost of

the networks and hence the cost of each sensor node has to be kept low.

3.3.4 Operating Environment

A sensor network can be set up in the interior of a large machinery,

at the bottom of an ocean, in a biologically or chemically contaminated field,

in a battle field beyond the enemy lines, in a home or a large building, in a

large warehouse, attached to animals, attached to fast moving vehicles, in

forest areas for habitat monitoring etc (Mainwaring et al 2002). Hence, the

environment is also an important design parameter for the WSN.

3.3.5 Energy Efficiency

Since the transmission power of a wireless radio is proportional to

the distance squared or even higher order in the presence of obstacles, multi-

hop routing will consume less energy than direct communication. This RF

power is the dominant energy among all the energy consumed by a sensor

node. However, multi-hop routing introduces significant overhead for

topology management and medium access control (Wu et al 2000). Direct

routing would perform well enough if all the nodes were very close to the

sink. Sensor nodes are equipped with limited power source (<0.5 Ah 1.2V).

Node lifetime and hence, the NLT is strongly dependent on its battery

lifetime.

3.3.6 Data Aggregation/Fusion

Since sensor nodes might generate significant redundant data,

similar packets from multiple nodes can be aggregated so that the number of

Page 9: CHAPTER 3 HIERARCHICAL ENERGY TREE BASED ROUTING …shodhganga.inflibnet.ac.in/bitstream/10603/13410/8/08_chapter 3.pdf · 3.2 ROUTING ALGORITHMS FOR WIRELESS SENSOR NETWORKS Due

66

transmissions would be reduced. Data aggregation is the combination of data

from different sources by using functions such as suppression (eliminating

duplicates), min, max and average. As computation would be less energy

consuming than communication, substantial energy savings can be obtained

through data aggregation. This technique has been used to achieve energy

efficiency and traffic optimization in a number of routing protocols.

3.3.7 Quality of Service (QoS)

The QoS means the quality service required by the application. It

could be the length of life time, the data reliable, energy efficiency, and

location-awareness and collaborative-processing. These factors will affect the

design or selection of routing protocols for a particular application. In some

applications, (e.g. some military applications) the data should be delivered

within a certain period of time from the moment it is sensed.

3.3.8 Node Placement Patterns

Node placement pattern is application dependent and affects the

performance of the routing protocol. The placement of nodes is either

deterministic / fixed node distribution pattern or self-organizing. In

deterministic / fixed node distribution patterns, the sensors are manually

placed and data is routed through pre-determined paths. However in

self-organizing systems, the sensor nodes are scattered randomly creating an

infrastructure in an Ad-hoc manner. In that infrastructure, the position of the

sink or the cluster head is also crucial in terms of energy efficiency and

performance. When the distribution of nodes is not uniform, optimal

positioning of cluster head becomes a pressing issue to enable energy efficient

network operation.

Page 10: CHAPTER 3 HIERARCHICAL ENERGY TREE BASED ROUTING …shodhganga.inflibnet.ac.in/bitstream/10603/13410/8/08_chapter 3.pdf · 3.2 ROUTING ALGORITHMS FOR WIRELESS SENSOR NETWORKS Due

67

This research work proposes a routing algorithm that takes care of

remaining energy in each sensor node. This algorithm is presented in the next

section. This algorithm is further augmented by the congestion control

algorithm for reducing the number packet drops and hence the number of

retransmissions. This reduction in retransmissions will save much energy and

hence will extend the overall NLT. The proposed algorithm TCP/Exp is

presented and analysed in chapter 4. Further, the fixed node distribution

patterns which could improve the network performance are discussed in

chapter 5.

3.4 HIERARCHICAL ENERGY TREE BASED ROUTING

ALGORITHM FOR WIRELESS SENSOR NETWORKS

The HETRA extends the set of parameters used for taking a routing

decision with the inclusion of the energy remaining in the nodes. Energy is an

absolute value measured in watt-hour. In addition to the energy used as

routing metric, they are also used to place the nodes in a hierarchical tree of

three levels of nodes. This is used to categorize the links connecting these

nodes as unidirectional or bidirectional. Nodes include such parameters as

periodic location update packets, which in our implementation corresponds to

an overhead of two octets added to the header.

In order to increase path robustness with efficient energy

utilization, the proposed routing metric favors relatively stable paths. To this

aim, we use the distance from the destination and energy remaining in each

node. The distance component chooses forwarding nodes located closer to the

destination, but considering that the next hop must be within the transmission

range and preferably not too close to its perimeter. Energy that remains in

each node after the transmission of a packet is the other metric used for

routing. Higher the remaining energy, more probable is the participation of

the node in forwarding the packet.

Page 11: CHAPTER 3 HIERARCHICAL ENERGY TREE BASED ROUTING …shodhganga.inflibnet.ac.in/bitstream/10603/13410/8/08_chapter 3.pdf · 3.2 ROUTING ALGORITHMS FOR WIRELESS SENSOR NETWORKS Due

68

3.4.1 HET

HET is constructed by placing each node of the sensor network in

one of the two levels. For each node, based on the energy update information

received from neighbors, a level is fixed in the HET. One HET is constructed

for the entire network and a copy this is sent to each node during update

operation. The destination node is kept as the root node (level 0) of the tree.

All the remaining nodes are divided into two categories based on their

remaining energy. A threshold of 25% of the initial energy is used to evaluate

the energy level in HET. If the node has energy above the threshold, they are

placed in level 1. The remaining nodes are placed in level 2 as shown in

Figure 3.1.

Figure 3.1 Hierarchical Energy Tree

Nodes in level 1 are assumed with bidirectional links and nodes in

level2 are assumed with unidirectional links. The level 2 nodes are attached to

the nodes at level 1 if they are the neighbors. So HET after construction will

contain the information of the energy level, link characteristics and

neighborhood details. The HET so constructed is used along with the routing

metric to determine the routing. The HET construction algorithm is given

Page 12: CHAPTER 3 HIERARCHICAL ENERGY TREE BASED ROUTING …shodhganga.inflibnet.ac.in/bitstream/10603/13410/8/08_chapter 3.pdf · 3.2 ROUTING ALGORITHMS FOR WIRELESS SENSOR NETWORKS Due

69

below. The construction of HET is explained with an example in the next

section.

Input : Number of Sensor Nodes n;

Initial Energy Level Ei;

Destination Node D(p);

position of node p;

Node identification id;

List of nodes L{SNi (id,E,p)};

HET_construct()

{

HET_initiate(L0{}, L1{}, L2{});

for (every t sec)

{

Energy_request (L{SNi (id,E,p)});

HET_update ( L1{}, L2{});

}

}

HET_initiate(L0{}, L1{}, L2{})

{

Add D(p) L0{};

for i= 1 to n

{

Add SNi L1{};

Set E(SNi) = Ei;

Link SNi D(p);

}

Set L2{} NULL;

}

Page 13: CHAPTER 3 HIERARCHICAL ENERGY TREE BASED ROUTING …shodhganga.inflibnet.ac.in/bitstream/10603/13410/8/08_chapter 3.pdf · 3.2 ROUTING ALGORITHMS FOR WIRELESS SENSOR NETWORKS Due

70

HET_update (L0{}, L1{}, L2{})

{

for each node in L1{}

{

if (E(SNL1) < ET

then {

X = Neighbour(SNL1);

Link SNL1 X;

L1{} L1{} – SNL1;

L2{} L2{} + SNL1;

}

}

3.4.2 Using HET

HETRA is a reactive energy-driven routing protocol and only those

nodes having sufficient energy (level 1 nodes in HET) requests information

for making routing decisions. A node broadcasts a beacon-request packet to

neighbors seeking location information. In response, a neighbor node sends

back a beacon including its location via either a broadcast packet or a unicast

packet as specified in the request packet. Bidirectional or unidirectional

neighbors are discovered by the energy that remains in the nodes. Level 2

nodes have energy less than a threshold and hence they are assigned with

unidirectional links. Level 1 nodes have energy more than the threshold and

hence they are assigned with bidirectional links.

The Level 2 nodes have very small energy. They are restricted to

participate in receiving only. These nodes consume less energy for receiving.

When they are made to involve for transmission also, the energy will get

Page 14: CHAPTER 3 HIERARCHICAL ENERGY TREE BASED ROUTING …shodhganga.inflibnet.ac.in/bitstream/10603/13410/8/08_chapter 3.pdf · 3.2 ROUTING ALGORITHMS FOR WIRELESS SENSOR NETWORKS Due

71

reduced faster and will result into complete drain out of the entire energy.

This may result into the network split. The network split will lead to the

complete die out of the network. Hence preserving some energy with the

nodes will avoid network split. These Level 2 nodes may be used for both

transmission and reception during emergency situation like earth quake etc.

As the earth quake may damage many of the Level 1 nodes, the Level 2

nodes may be used for transmission and reception. Thus the Level 2 nodes

increase the efficiency of the network, by providing better connectivity for

transmission of sensed data needed for avoiding more damages or emergency

situations.

A forwarding node is always trying to select the neighbor closest to

the destination as the next hop. The neighbor information is obtained from the

HET. Forwarding fails when reaching a node which has no neighbors closer

to the destination. Then the packet is forwarded using the tree constructed

based on neighbor information of bidirectional links.

An example WSN is assumed to explain the construction and

updating of the Hierarchical Energy Tree. The WSN assumed is shown in

Figure 3.2. The Network consists of 14 sensor nodes, 1 base station node and

a phenomenon node. The Sensor nodes are intended for sensing and

transmitting the sensed data to the data collecting centre. Here the base station

node is the data collecting centre. The phenomenon node is used to simulate

the physical phenomenon to be sensed and reported. This phenomenon node

is made to move across the entire sensing field. This movement simulates the

situation that the physical phenomenon is occurring at different parts of the

sensing field. The sensor nodes are initially assumed with energy of

0.5 Joules.

Page 15: CHAPTER 3 HIERARCHICAL ENERGY TREE BASED ROUTING …shodhganga.inflibnet.ac.in/bitstream/10603/13410/8/08_chapter 3.pdf · 3.2 ROUTING ALGORITHMS FOR WIRELESS SENSOR NETWORKS Due

72

Figure 3.2 Example of WSN

After a data is sensed by the sensor node, it is transmitted towards

the base station node through the intermediate nodes. The data packet will

reach the final destination i.e. the base station node after passing through the

intermediate nodes. The nodes which are involved in forwarding the data

packets will consume the energy available with the sensor nodes for receiving

and retransmitting the data packets towards the base station node. Initially the

HET is constructed with the base station node as the root node and all the

nodes of the WSN as the nodes in Level 1 nodes.

In order to form the HET and update the HET after every

transmissions and receptions, the remaining energy in each node is obtained

by getting the information about the remaining energy using the route

discovery packets send from the base station node to all the nodes. The

wireless links used to transmit the route discovery packet is shown in

Figure 3.3 HET is updated through reply packets and the remaining energy

information.

Page 16: CHAPTER 3 HIERARCHICAL ENERGY TREE BASED ROUTING …shodhganga.inflibnet.ac.in/bitstream/10603/13410/8/08_chapter 3.pdf · 3.2 ROUTING ALGORITHMS FOR WIRELESS SENSOR NETWORKS Due

73

Figure 3.3 Wireless links used to transmit the route discovery packet

All the sensor nodes shown in Figure 3.3 are assumed with an

initial energy of 0.5 Joules. It is also assumed that the energy required for

sensing and transmission of each data packet is 0.025 Joules. The energy

required for receiving and internal processing is very small compared to the

energy required for transmission. Figure 3.4 shows the initial energy

configuration of a HET formed for the WSN shown in Figure 3.3. As the

initial energy of all the nodes before starting the process of sensing and

transmission is the same, i.e. 0.5 Joules, all the nodes are assigned to the

Level 1 in HET and are attached to the base station node as shown in

Figure 3.4.

Suppose the node 1 senses the data and transmits it through nodes 2

and 3 to the base station node, their energy level is reduced by 0.025 Joules

(as all the 3 nodes are involved in transmission) and becomes 0.475 Joules.

This energy level is still above the threshold level of 0.125 Joules, the

Page 17: CHAPTER 3 HIERARCHICAL ENERGY TREE BASED ROUTING …shodhganga.inflibnet.ac.in/bitstream/10603/13410/8/08_chapter 3.pdf · 3.2 ROUTING ALGORITHMS FOR WIRELESS SENSOR NETWORKS Due

74

nodes 1, 2 and 3 are assigned to the same level 1 and attached to the base

station node. If the network senses a large number of data and transmits data

packets, then more number of sensor nodes are involved in transmission and

correspondingly their energy level gets reduced.

The energy level information of these nodes are updated at the base

station node by the reply packets. If more number of data packets are

transmitted through node 3, then its energy level will be reduced below the

threshold energy level of 0.125 Joules. At this stage, node 3 is assigned to

level 2. As the node 3 is neighbor to node 2, node 3 is attached to node 2 in

the updated configuration of HET. Similarly, if node 8 and node 13 are

involved in more number of data transmissions, their energy level gets

reduced below the threshold level. AS node 8 is neighbor to node 9 and node

13 is neighbor to node 14, they are attached to node 9 and 13 respectively and

assigned to level 2. This updated energy level configuration is shown in

Figure 3.5.

Figure 3.4 Initial energy configuration of a HET

Page 18: CHAPTER 3 HIERARCHICAL ENERGY TREE BASED ROUTING …shodhganga.inflibnet.ac.in/bitstream/10603/13410/8/08_chapter 3.pdf · 3.2 ROUTING ALGORITHMS FOR WIRELESS SENSOR NETWORKS Due

75

Figure 3.5 Updated HET after some transmission

Further, sensed data packet transmissions may reduce the energy

remaining in each node. This will change the status of the nodes and change

some more nodes from level 1 to level 2. The updated HET may be as shown

in Figure 3.6.

Figure 3.6 Updated HET after some transmission

Page 19: CHAPTER 3 HIERARCHICAL ENERGY TREE BASED ROUTING …shodhganga.inflibnet.ac.in/bitstream/10603/13410/8/08_chapter 3.pdf · 3.2 ROUTING ALGORITHMS FOR WIRELESS SENSOR NETWORKS Due

76

These figures are referred by the sensor nodes to decide whether the

nodes are used for receiving only (Level 2 nodes) or for both receiving and

transmitting (Level 1 nodes).

3.5 IMPLEMENTATION OF HETRA IN ns2

HETRA is implemented and added as a novel wireless sensor

network routing protocol in ns2. Since ns2 is an open source, any addition

can be incorporated to ns2 easily. The procedure to add new routing protocols

is detailed in ns manual (Simulator 2000). Three new programs that

incorporate the structure of hetra are added to the ns2. These are hetra.cc,

hetra.h and hetra.tcl. The program hetra.h includes basic header files needed

for constructing a node with all basic attributes, to make the node a mobile

node with the necessary attributes. These header files are already defined in

ns2.

The program hetra.cc adds additional features such as constructing

the hierarchical tree using the remaining energy of each node. The routing

used is fixed routing, but the hierarchical structure is constructed every 2 sec

in the simulation performed. But in practical applications, the refreshing time

for changing the hierarchical tree construction may be in the order of minutes.

This is due to the nature of application as the changes in sensed data may vary

slowly and hence the change in energy consumed is also low.

The Program hetra.tcl provides the necessary mobility features

needed for the mobile ad hoc nodes. This program also decides the

characteristics of transmitter and receiver. This in addition to the routing

provided by the hetra.cc defines the energy consumption characteristics of the

HETRA nodes.

After including these files, the ns2 is reinstalled so that these files

get compiled and included in the basic routing algorithms already defined in

Page 20: CHAPTER 3 HIERARCHICAL ENERGY TREE BASED ROUTING …shodhganga.inflibnet.ac.in/bitstream/10603/13410/8/08_chapter 3.pdf · 3.2 ROUTING ALGORITHMS FOR WIRELESS SENSOR NETWORKS Due

77

ns2. The routing algorithm may be called by the tcl program very similar to

DSDV, AODV and DSR. HETRA is the name to be used to call the new

routing algorithm.

3.6 COMPARISON OF HETRA WITH DSDV, DSR, AODV

MANETS and sensor networks are two classes of wireless ad hoc

networks with resource constraints. MANETS typically consist of devices that

have high capabilities, mobile and operate in coalitions. Sensor networks are

typically deployed in specific geographical regions for tracking, monitoring

and sensing. Both these wireless networks are characterized by their ad hoc

nature that lack pre-deployed infrastructure for computing and

communication.

A great variety of routing protocols have been developed especially

for WSN. On the other hand ad-hoc routing protocols are also being

developed in a slightly different context under the general heading MANET.

Even though there are different restrictions and requirements for these two

types of networks, ad-hoc routing protocols actually developed for MANETs

could be adapted to WSNs or at least deserve to be discussed in that context.

AODV, DSDV and DSR are the protocols that are taken into consideration

for adoption in WSN. Hence, in evaluating the performance of the HETRA

routing algorithm, an analysis is performed by comparing the performance of

HETRA with the algorithms AODV, DSDV and DSR.

3.7 SIMPLE SIMULATION OF WSN WITH HETRA USING ns2

The HETRA routing algorithm once implemented in ns2 may be

used by any network simulation as the routing algorithm for the

transmissions. The Wireless sensor network may be simulated by writing the

tcl program and execute in ns2. The simulated WSN may be assumed to

consist of a number of sensor nodes, a base station node and a physical

Page 21: CHAPTER 3 HIERARCHICAL ENERGY TREE BASED ROUTING …shodhganga.inflibnet.ac.in/bitstream/10603/13410/8/08_chapter 3.pdf · 3.2 ROUTING ALGORITHMS FOR WIRELESS SENSOR NETWORKS Due

78

phenomenon node. This may be placed in a sensor field covering a particular

area.

Now to check the HETRA routing algorithm, a WSN is simulated

with about 55 nodes. These nodes are placed in a random placement pattern

covering the area of 250 500 m. The simulated network is shown in

Figure 3.7. The figure is nam generated display of the simulation performed

in ns2.

The simulation is now performed by assuming the occurrence of

physical phenomenon at any point in the sensor field of 250 500 m. This

phenomenon node is now attached with a TCP source and an ftp agent is

attached to this source for continuous transmission of data packets. Hence,

when this phenomenon node moves over the sensor field area, the data

packets transmitted from this phenomenon node is assumed as the sensed

data. This sensed data is now transmitted towards the base station node.

Figure 3.7 Example of WSN simulated with HETRA using ns2

Page 22: CHAPTER 3 HIERARCHICAL ENERGY TREE BASED ROUTING …shodhganga.inflibnet.ac.in/bitstream/10603/13410/8/08_chapter 3.pdf · 3.2 ROUTING ALGORITHMS FOR WIRELESS SENSOR NETWORKS Due

79

The simulation program is written to find the number of data

packets received at the base station node. The throughput of the transmission

is also evaluated. The simulation is repeated for different simulation times.

The simulation is repeated for the simulation times of 5, 10, 15, 20, 25 and

30 seconds. The corresponding data packets received is evaluated. These

values are depicted in Figure 3.8. This figure indicates that the packets are

properly routed to the base station node by HETRA and the number of data

packets received increases with the increase in simulation time. This figure

infer that the routing algorithm behaves very similar to other routing

algorithms in increasing the number of data packets with the increase in

simulation time.

Number of Data Packets Delivered

0

1000

2000

3000

4000

5000

6000

7000

5 10 15 20 25 30

Simulation Time in seconds

Nu

mb

er

of

Data

Packets

Figure 3.8 Number of data packets delivered in different Simulation

Times

The simulated WSN as discussed above is also analysed for the

NLT. The trace file format is shown in Figure 2.16. Since awk script is very

Page 23: CHAPTER 3 HIERARCHICAL ENERGY TREE BASED ROUTING …shodhganga.inflibnet.ac.in/bitstream/10603/13410/8/08_chapter 3.pdf · 3.2 ROUTING ALGORITHMS FOR WIRELESS SENSOR NETWORKS Due

80

efficient in matching data file which has the form of line records and is very

convenient in extracting numeric variables from strings, it is also easy to do

the computation as C programming language does. So, awk script is used to

analyse the trace file and compute the performance evaluation of the proposed

congestion control and routing algorithms. Hence, from the pseudocode, it is

easy to see that the awk script get the trace file line by line. The following

statement works as a filter when it is tried to get a line from the trace file. It

can easily draw out the packet one wants to count, such as TCP packets,

AODV routing control packets, DSR routing control packets, and so on.

set awkCode {

BEGIN { print "" >> "aodv1"; }

{if ($7 == "tcp" && $1 == "s" || $1 == "r")

{time = $2;

energy = $14*1;}

print time, energy >> "aodv1";}}

exec awk $awkCode aodv.tr

Hence, by using the tcl programs and the other supporting programs

as mentioned above, NLT of the WSN may be determined for the simulated

network topology. The energy versus time algorithm for one such simulation

with an initial energy of 1.5 Joules for the sensor node is shown in

Figure 3.9. This figure indicates that the energy level of the nodes of WSN

gets reduced from 1.5 Joules to 0 Joules in a time of about 21 seconds. The

lifetime of the WSN using HETRA with an initial energy of 1.5 Joules is

therefore 21 seconds. The value of this NLT with initial energy of 0.25, 0.5,

0.75, 1.0, 1.25 and 1.5 Joules is depicted in Figure 3.10. The figure shows that

the NLT is directly proportional to the initial energy level of the sensor nodes.

Page 24: CHAPTER 3 HIERARCHICAL ENERGY TREE BASED ROUTING …shodhganga.inflibnet.ac.in/bitstream/10603/13410/8/08_chapter 3.pdf · 3.2 ROUTING ALGORITHMS FOR WIRELESS SENSOR NETWORKS Due

81

Figure 3.9 Energy versus time with initial energy of 1.5 Joules

Network Life Time with Different Initial Energy

0

5

10

15

20

25

0.25 0.5 0.75 1 1.25 1.5

Initial Energy in Joules

Netw

ork

Lif

e T

ime i

n s

eco

nd

s

Figure 3.10 NLT with different initial energy

The design and implementation of the HETRA is detailed in this

chapter. A simple simulation is detailed and the results show that the HETRA

Page 25: CHAPTER 3 HIERARCHICAL ENERGY TREE BASED ROUTING …shodhganga.inflibnet.ac.in/bitstream/10603/13410/8/08_chapter 3.pdf · 3.2 ROUTING ALGORITHMS FOR WIRELESS SENSOR NETWORKS Due

82

behaves similar to other algorithms as far as the sensing and transmission of

data is concerned. This will be compared with the classical algorithms and the

results discussed in Chapter 6. The next chapter discusses the proposed

congestion control algorithm TCp/Exp, its implementation details and the

basic characteristics.