Вы находитесь на странице: 1из 85

IMPLEMENTATION OF AN ENERGY EFFICIENT CLUSTERING

BASED DATA COLLECTION IN WIRELESS SENSOR NETWORK


Thesis
Submitted to Karunya University
for the award of the Degree of

MASTER OF PHILOSOPHY (M.Phil)


IN
COMPUTER APPLICATIONS
By

MATHIBALA .V
(RR11CA2001)

Under the Supervision of

Mrs. Seiya Susan Thomas


Assistant Professor
Department of Computer Applications

DEPARTMENT OF COMPUTER APPLICATIONS


School of Computer Science and Technology

(Declared as Deemed to be University under Sec.3 of the UGC Act, 1956)

COIMBATORE - 641114
INDIA

DECEMBER 2012
CERTIFICATE

This is to certify that the thesis, entitled “IMPLEMENTATION OF AN ENERGY

EFFICIENT CLUSTERING BASED DATA COLLECTION IN WIRELESS SENSOR

NETWORK” submitted to Karunya University, in partial fulfillment of the

requirements for the award of the Degree of Master of Philosophy in Computer

Applications is a record of original research work done by V.MATHIBALA

(RR11CA2001), during the period of her study in the Department of Computer

Applications at Karunya University, under my supervision and guidance and the

thesis has not formed the basis for the award of any Degree/Diploma/Associate

ship/Fellowship or other similar title to any candidate of any University.

Countersigned Signature of the Guide

Head of the Department

I
DECLARATION

I, V.MATHIBALA hereby declare that the thesis entitled, “IMPLEMENTATION

OF AN ENERGY EFFICIENT CLUSTREING BASED DATA COLLECTION IN

WIRELESS SENSOR NETWORK” submitted to Karunya University, in partial

fulfillment of the requirements for the award of the Degree of Master of Philosophy in

Computer Applications is a record of original and independent research work done

by me under the supervision and guidance of Mrs. Seiya Susan Thomas., Assistant

Professor, Department of Computer Applications, Karunya University, and it has not

formed the basis for the award of any Degree/Diploma/Associate ship/Fellowship or

other similar title to any candidate of any University.

Signature of the Candidate

II
ACKNOWLEDGEMENT

First and foremost, I would like to thank My Lord and Saviour Jesus

Christ with a humble heart, for being with me and providing me the strength to

take up this research work and complete it with his grace.

I sincerely thank his Excellency Dr. Paul Dhinakaran, Founder and

Chancellor, Karunya University for providing spiritual and technical support

with the best infrastructure and sponsoring me to carry out the research

meticulously.

I respectfully thank our former Vice Chancellor Dr. Paul P. Appasamy,

Vice Chancellor in charge Dr. E. J. James and our Registrar, Dr. C. Joseph

Kennady for their encouragement to pursue this project.

I express my sincere thanks to Dr. S. Darius Gnanaraj, Dean Research,

Karunya University, for his encouragement to climb higher in my research

work. I also thank my Director School of Computer science and Technology,

Dr. R. Elijah Blessing for all his inspiration and support during this research

work.

I would express my gratitude and thanks to Mrs. Dr .V. Thavavel, the

Head of Department of Computer Applications.

III
I am heartily thankful to my supervisor, Mrs. Seiya Susan Thomas,

Assistant Professor, Department of computer Applications, whose

encouragement, guidance and support has enabled me to carry out the

research work.

I thank the entire team of staff individually from the Department of

Computer Applications for all their support. My special thanks go to Mrs. S.

UmaMaheswari M.Tech, Mrs. Mary Suresh Mathew M.Sc for their valuable

suggestions, moral support and encouragement.

I thank, Mrs. Lilly Puspham, Ms. A. Renuka, Ms. P. Shobana, and Ms.

R.Nivea, Ms.Kalpana, Ms.Kiruba, Ms.Hensapaul, Mr.S.Selvin for their prayers

and encouragement and continuous motivation throughout my course time.

I Express gratitude to my Father Mr. K. A. Vinoba, Mother Mrs. V.

Stella and Sister Mrs. V. Kavitha for their prayers and encouragement.

I thank the Central library, Karunya University for providing me the

resources required to carry out my research.

(MATHIBALA .V)

IV
ABSTRACT
A wireless sensor network is a network that is made of hundreds or thousands of
sensor nodes which are densely deployed in an unattended environment with the
capabilities of sensing, wireless communications and computations which collects and
disseminates environmental data. For many applications in wireless sensor networks,
users may want to continuously extract data from the networks for analysis later.
However, accurate data extraction is difficult and it is often too costly to obtain all sensor
readings, as well as not necessary in the sense that the readings themselves only represent
samples of the true state of the world.

Energy conservation is crucial to the prolonged lifetime of a sensor network.


Energy consumption can be reduced for data collections from sensor nodes using
prediction. The prediction based algorithms are based on the observation that the sensor
capable of local computation generates the possibility of training and using predictors in
a distributed way.

An energy efficient framework for clustering based data collection in wireless


sensor networks can be done by adaptively integrating enabling/disabling prediction
scheme its can be with sleep/awake. A cluster head represents all sensor nodes in the
cluster and collects data values from its members. The prediction capability implies that
the sensors do not need to transmit the data values if they differ from a predicated value
by less than a certain threshold. Therefore, there is no need for the cluster members to
stay awake to obtain data values, most of which will be discarded anyway to allow
sleep/wake scheduling. If prediction is disabled it simply transmits the data values. The
performance of power saving in clustering based prediction is evaluated by creating a
network scenario in NS-2.33 simulator.

V
CONTENTS
CERTIFICATE I

DECLARATION II

ACKNOWLEDGEMENT III

ABSTRACT V

LIST OF FIGURES IX

LIST OF TABLES IX

ABBREVATIONS X

1.Introduction 1

1.1 Wireless Sensor Networks 1

1.2. Overview of a Wireless Sensor Networks Communication


3
Architecture

1.2.1. Sensor nodes 4

1.2.2. Gateways 4

1.2.3 Task Managers 4

1.3. Ad-Hoc Network 5

2 .Literature Review 6

2.1. Wireless sensor networks characteristics 6

2.2 Energy Consideration In Wireless Networks 6

2.3 Energy Consumption and Predictor 7

2.4. Clustering 8

2.5. Clustering Protocol 9

2.5.1. Leach Protocol 10

2.5.2. Heed Protocol 13

VI
3. Methodology and System Development 14

3.1. Objective 14

3.2. Proposed Methodology 15

3.3. General Hardware/ Software Description 16

3.3.1. Hardware Specification 16

3.3.2. Software Specification 16

3.3.3. Linux 17

3.3.4. C++ 18

3.3.5. Network Animator (NAM) 18

3.3.6.Network Simulator (NS) 19

3.3.7. User’s View of NS-2 20

3.3.8. The Network Simulator 2.33(NS2) 20

3.3.9. Structure of NS2 21

3.3.10. Functionalities of NS 2.33 22

3.4. Mobile Networking In NS 2.33 23

3.4.1. Routing Protocol 24

3.4.2. Mobile Node: Creating Wireless topology 25

3.5. Node Configuration Interface 28

3.5.1. Sensor Networks 30

3.5.2. Network Components 31

3.5.3. Class TCL 32

3.5.4. Obtain a Reference to the class TCL instance 32

3.5.5. Invoking OTCL Procedures 32

3.6. Design And Development 33

3.6.1. PHASE 1. Topology formation 33

3.6.2. Power Control Mechanisms 34

3.6.3 Power Management Mechanisms 36

VII
3.6.4. Impact of clustering protocol on energy consumption 36

3.6.5. Data Aggregation 38

3.6.6. PHASE 2: Including Sleep/Awake Algorithm 39

3.6.7. PHASE3: Adaptive scheme to enable/disable prediction 42


Operations
4. Implementation and Simulation Results 46

4.1. Cluster Model 46

4.2. Cluster Head 47

4.3. The Scenario with Packet Loss 47

4.4. Adaptive Update for System Input Changes 48

4.5. Performance Evaluation 48

4.6. Graphical Results 49

5. Conclusion 50

6. Scope for Enhancements 51

APPENDIX 52

APPENDIX I : SCREEN SHOTS 52

APPENDIX II : SAMPLE CODE 56

REFERENCES 66

VIII
LIST OF FIGURES

No Figure Name Page No

Figure 1.1 Basic Architecture Of Wireless Sensor Network 2

Figure 1.2 Illustration of sensor network and backbone Infrastructure 3

Figure 2.1 The Leach clustering Communication Hierarchy for WSN 11

Figure 3.1 Block Diagram of Architecture of NS-2 20

Figure 3.2 Simplified User’s View of NS 21

Figure 3.3 OTCL And C++;the Duality 23

Figure 3.4 OTCL Class Hierarchies 31

Figure 3.5 Maximum distance Between Member Nodes 37

Figure 3.6 Maximum distance Between Cluster Head 37

LIST OF TABLE

No Table Name Page No

Table 3.1 Available options for node configuration 29

IX
ABBREVIATIONS
ARP Address Resolution Protocol

CH Cluster Head

CHADV Cluster Head Advertisement Message

DSDV Destination-Sequenced Distance Vector

DSR Dynamic Source routing

FCH Feature Of cluster

MAC Medium Access Control

MANETs Mobile Ad hoc Networks

NS-3 Network Simulator

NAM Network Animator

TCL Tool command Language

TORA Temporary ordered Routing Algorithm

OTCL Object Tool Command Language

OLSR Optimized Link State Routing

WLANs Wireless Local Area Networks

WSNs Wireless Sensor Networks

ZRP Zone based Hybrid Routing Protocol

OLSR Optimized Link State Routing

X
RCH Radius Of This Cluster

RD Route Discovery

RREP Route Reply

RREQ Route Request Packet

SSR Successive Survivable Routing

UDP User Datagram Protocol

ZRP Zone based Hybrid Routing Protocol

XI
XII
IMPLEMENTATION OF AN ENERGY EFFICIENT CLUSTERING BASED DATA COLLECTION IN WSN

CHAPTER 1

INTRODUCTION
1.1WIRELESS SENSOR NETWORKS

Wireless sensor network (WSN) refers to a group of spatially dispersed and


dedicated sensors for monitoring and recording the physical conditions. Wireless Sensor
Network comprises of numerous sensors and they are interlinked or connected with each
other for performing the same function collectively or cooperatively. It is a network that
is made of hundreds or thousands of sensor nodes which are densely deployed in an
unattended environment with the capabilities of sensing, wireless communications and
computations. These spatially distributed autonomous devices cooperatively monitor
physical and environmental conditions, such as temperature, sound, vibration, pressure,
motion or pollutants, at different locations.

Wireless sensor networks have critical applications in the scientific, medical,


commercial and military domains. Examples of these applications include environmental
monitoring, smart homes and offices, surveillance, and intelligent transportation systems.
It also has significant usages in biomedical field. As social reliance on wireless sensor
network technology increases, they can expect the size and complexity of individual
networks as well as the number of networks to increase dramatically.

Wireless sensor networks are typically used in highly dynamic, and hostile
environments with no human existence (unlike conventional data networks), and
therefore, they must be tolerant to the failure and loss of connectivity of individual node.
The sensor nodes should be intelligent to recover from failures with minimum human
involvement. Networks should support process of autonomous formation of connectivity,
addressing, and routing structure. Architecture of

1
IMPLEMENTATION OF AN ENERGY EFFICIENT CLUSTERING BASED DATA COLLECTION IN WSN

wireless sensor network is designed taking all these factors into consideration. The
architecture consists of

a. The sensor nodes that form the sensor network. Their main objectives are
making discrete, local measurement about phenomenon surrounding these sensors,
forming a wireless network by communicating over a wireless medium, and
collect data and route data back to the user via sink (Base Station).

b. The sink (Base Station) communicates with the user via internet or satellite
communication. It is located near the sensor field or well-equipped nodes of the
sensor network. Collected data from the sensor field routed back to the sink by a
multi-hop infrastructure less architecture through the sink. The basic architecture
of Wireless sensor Network is shown in Figure1.1.

Figure 1.1: Basic Architecture of Wireless Sensor Network.

2
IMPLEMENTATION OF AN ENERGY EFFICIENT CLUSTERING BASED DATA COLLECTION IN WSN

1.2. OVERVIEW OF A WIRELESS SENSOR NETWORKS


COMMUNICATION ARCHITECTURE

Wireless sensor networks consist of individual nodes that are able to interact with
the environment by sensing or controlling physical parameters. These nodes have to
collaborate to fulfill their tasks. The nodes are interlinked together, and by using wireless
links each node is able to communicate and collaborate with each other [24].In Figure1.
2, the wireless sensor network infrastructure in shown which comprises of the standard
components like sensor nodes (used as source, sink/actuators), gateways, Internet, and
satellite link, etc.

Figure 1.2: Illustration of sensor network and backbone infrastructure

3
IMPLEMENTATION OF AN ENERGY EFFICIENT CLUSTERING BASED DATA COLLECTION IN WSN

1.2.1 Sensor nodes

Sensor nodes are the network components that will be sensing and delivering the
data. Depending on the routing algorithms used, sensor nodes will initiate transmission
according to measures and/or a query originated from the Task Manager. According to
the system application requirements, nodes may do some computations. After
computations, it can pass its data to its neighboring nodes or simply pass the data as it is
to the Task Manager. The sensor node can act as a source or sink/actuator in the sensor
field. The definition of a source is to sense and deliver the desired information. Hence, a
source reports the state of the environment. On the other hand, a sink/actuator is a node
that is interested in some information a sensor in the network might be able to deliver.

1.2.2 Gateways

Gateways allow the scientists/system managers to interface nodes to personal


computers (PCs), personal digital assistants (PDAs), Internet and existing networks and
protocols. In a nutshell, gateways act as a proxy for the sensor network on the Internet.
According to [1], gateways can be classified as active, passive, and hybrid. Active
gateway allows the sensor nodes to actively send its data to the gateway server. Passive
gateway operates by sending a request to sensor nodes. Hybrid gateway combines
capabilities of the active and passive gateways.

1.2.3 Task Managers

The Task Manager will connect to the gateways via some media like Internet or
satellite link [32]. Task Managers comprise of data service and client data browsing and
processing. These Task Managers can be visualized as the information retrieval and
processing platform. All information (raw, filtered, processed) data coming from sensor
4
IMPLEMENTATION OF AN ENERGY EFFICIENT CLUSTERING BASED DATA COLLECTION IN WSN

nodes is stored in the task managers for analysis. Users can use any display interface (i.e.
PDA, computers) to retrieve/analyze these information locally or remotely.

5
IMPLEMENTATION OF AN ENERGY EFFICIENT CLUSTERING BASED DATA COLLECTION IN WSN

CHAPTER 2

LITERATURE REVIEW

2.1. WIRELESS SENSOR NETWORKS CHARACTERISTICS


WSN includes two kinds of nodes:
1. Sensor nodes with limited energy can sense their own residual energy
and have the same architecture.
2. One Base Station (BS) without energy restriction is far away from the
area of sensor nodes.
All sensor nodes are mobile. They use the direct transmission or (multi-hop)
transmission to communicate with the BS. Sensor nodes sense environment at a fixed
rate and always have data to send to the BS. Sensor nodes can revise the transmission
power of wireless transmitter according to the distance. The lifespan of WSN is the total
amount of time before the first sensor node runs out of power.

2.2 ENERGY CONSIDERATION IN WIRELESS NETWORKS

Energy conservation is a critical issue in the design of sensor networks since the
sensor nodes are battery-powered. WSN has been considered as a promising method for
reliably monitoring both civil and military environments under hazardous conditions.
Due to such condition, the power supply for sensor in the network cannot be usually
rechargeable or replaceable. The design of protocols and applications for such networks
has to be energy aware in order to prolong the lifetime of the network because it is quite
difficult to recharge node batteries. A node in WSN depends on batteries for their energy
source. However, since a battery’s lifetime is limited, the power resource is at a premium.
But wireless signal transmission, reception, retransmission, and beaconing operations all
consume battery power. Energy efficiency in mobile nodes can be achieved through
6
IMPLEMENTATION OF AN ENERGY EFFICIENT CLUSTERING BASED DATA COLLECTION IN WSN

improvement in various levels, including the communication terminal (i.e. processors,


BUS, PCMCIA, form factor etc.), protocols (i.e. broadcast and uni-cast protocols), and
application layers [16]. For example, the power management feature in 802.11 cards
allows two modes of operation, the active mode and power save mode. During the active
mode, the wireless card is always ready to transmit or receive frames in accordance with
the specifications of the 802.11 medium access control protocols. In the power save
mode, nodes are temporarily put to sleep and are awake only in scheduled time intervals
for short durations.

The computing components used in a mobile node, such as processors, memory


and input/output devices; usually have low capacity and limited processing power [33].
Therefore, algorithms for communication protocols need to be lightweight in terms of
computational and storage requirements. The existing research on energy consumption
of sensors is usually based on either theoretical models or computer simulations. One
widely cited model of energy consumption has been used extensively as a guide for
simulations and the design of low power consumption communication protocols [12].

2.3 Energy Consumption and Predictor

A sensor network consists of a set of autonomous sensor nodes which


spontaneously create communication links, and then, collectively perform tasks without
help from any central servers. In sensor networks, accurate data extraction is difficult; it
is often too costly to obtain all sensor readings, as well as not necessary in the sense that
the readings themselves only represent samples of the true state of the world. As such,
one technique so called prediction emerges to exploit the temporal correlation of sensor
data. Technology trends in recent years have resulted in sensors’ increasing processing
power and capacity [17]. Implementing more sophisticated distributed algorithms in a
sensor network becomes possible.

7
IMPLEMENTATION OF AN ENERGY EFFICIENT CLUSTERING BASED DATA COLLECTION IN WSN

Predictor is one of the important techniques, which uses the past input values from
the sensors in order to perform the prediction operations. The existence of such prediction
capability implies that the sensors do not need to transmit the data values if they differ
from a predicted value by less than a certain prespecified threshold, or error bound. A
simple approach to developing a predictor in sensor networks is simply to transmit the
data from all sensors to the base station (i.e., the sink), which has been realized in many
previous studies [22], [34], and [10]. Predictor training and prediction operations are
carried out by the base station only, but not the sensor nodes, despite their increasing
computing capacity.

This solution while practical has many disadvantages, such as a high energy
consumption incurred by transmitting the raw data to the base station, the need for
wireless link bandwidth, and potential high latency.

2.4. Clustering

Cluster can be formed by the set of sensor nodes in a geographical area, where
data locality exists among the sensor nodes, and clusters are dynamically split/merged to
maintain good locality within each cluster. All sensor nodes in a cluster are called cluster
members, including one elected cluster head. The cluster head collects and aggregates
information from sensors in its own cluster and passes on information to the Base Station.
Cluster head performs data aggregation and BS receives compressed data. By rotating the
cluster-head randomly, energy consumption is expected to be uniformly distributed. The
clustering based localized prediction can be used to reduce energy consumption incurred
by transmitting the raw data to the base station.

A cluster head also a sensor node maintains a set of history data of each sensor
node within a cluster. Clustering based local prediction in sensor networks faces a couple
of new challenges. First, since the cost of training a predictor is nontrivial, trade-off
between communication and computation has to be carefully investigated. To support
8
IMPLEMENTATION OF AN ENERGY EFFICIENT CLUSTERING BASED DATA COLLECTION IN WSN

prediction techniques, energy is consumed on communication (e.g., sending and


receiving sensor data) and computation (e.g., processing sensor data and calculating a
predicted value). For heterogeneous WSNs (HWSN) a very critical task for clustering
protocols is to select the cluster head so that least energy is consumed, and prolong the
lifetime. Clustering algorithms can be classified based on two main criterions, according
to the energy efficiency and stability. Selection of cluster head in energy efficient
techniques generally depends on the initial energy, residual energy, average energy of the
network, or energy consumption rate or combination of these. The stable selection
protocols for clustered HWSN prolong the time interval before the death of first node
called stability period. In this algorithm they can be reduce the number of communication
between the sensors nodes for cluster head selection, so that the energy consumption for
cluster head selection can be further reduce.

2.5. Clustering Protocol

Sensor nodes typically use irreplaceable power with the limited capacity, the
node’s capacity of computing, communicating, and storage is very limited, which
requires WSN protocols need to conserve energy as the main objective of maximizing the
network lifetime. A number of protocols have been proposed to reduce useful energy
consumption. These protocols can be classified into three classes. Protocols in the first
class control the transmission power level at each node to increase network capacity
while keeping the network connected [18], [25]. Protocols in the second class make
routing decisions based on power optimization goals, e.g., [15], [20], [9], [11]. Protocols
in the third class control the network topology by determining which nodes should
participate in the network operation (be awake) and which should not (remain asleep) [5],
[38], [6]. Nodes in this case, however, require knowledge of their locations via GPS-
capable antennae or via message exchange. Hierarchical (clustering) techniques can aid
in reducing useful energy consumption [11]. Clustering is particularly useful for
applications that require scalability to hundreds or thousands of nodes. Scalability in this
9
IMPLEMENTATION OF AN ENERGY EFFICIENT CLUSTERING BASED DATA COLLECTION IN WSN

context implies the need for load balancing, efficient resource utilization, and data
aggregation. Protocols like leach and heed are introduced to achieve energy efficiency
due to clustering.

2.5.1 Leach Protocol

LEACH (Low Energy Adaptive Clustering Hierarchy) [11] is a self-organizing,


adaptive clustering-based protocol that uses randomized rotation of cluster heads to
evenly distribute the energy load among the sensor nodes in the network. LEACH based
on two basic assumptions: (a) base station is fixed and located far away from the sensors,
and (b) all nodes in the network are homogeneous and energy-constrained. The idea
behind LEACH is to form clusters of the sensor nodes depending on the received signal
strength and use local cluster heads as routers to route data to the base station.

It employs a hierarchical clustering done based on information received by the BS.


The BS periodically changes both the cluster membership and the cluster-head (CH) to
conserve energy. The CH collects and aggregates information from sensors in its own
cluster and passes on information to the BS, by rotating the cluster-head randomly,
energy consumption is expected to be uniformly distributed. However, LEACH possibly
chooses too many cluster heads at a time or randomly selects the cluster heads far away
from the BS without considering nodes' residual energy. As a result, some cluster heads
drain their energy early thus reducing the lifespan of WSN .In each round of the cluster
formation, network needs to follow the two steps to select cluster head and transfer the
aggregated data. (i) Set-Up Phase, which is again subdivided in to Advertisement, cluster
Set-Up & Schedule Creation phases. (ii) Steady-State Phase, which provides data
transmission using Time Division Multiple Access (TDMA).

The selection of cluster head node in LEACH [25] has some deficiencies such as,

10
IMPLEMENTATION OF AN ENERGY EFFICIENT CLUSTERING BASED DATA COLLECTION IN WSN

 Some very big clusters and very small clusters may exist in the network at the
same time.

 Unreasonable cluster head selection while the nodes have different energy.

 Cluster member nodes deplete energy after cluster head was dead.

 The algorithm does not take into account the location of nodes.

 Ignores residual energy, geographic location and other information, which may
easily

Lead to cluster head node will rapidly fail.

 Motivated from this, so many clustering proposals are reported in the


literature,

Suggesting different strategies of cluster head selection and its role rotation.

Figure.2.1: The LEACH Clustering Communication hierarchy for WSN

LEACH is designed to minimize energy dissipation in sensor networks. LEACH


includes distributed cluster formation, local processing to reduce global communications,
as well as randomized rotation of the cluster heads so that the high energy consumption
11
IMPLEMENTATION OF AN ENERGY EFFICIENT CLUSTERING BASED DATA COLLECTION IN WSN

in communicating with the base station is shared by all sensor nodes in the sensor
network. It is shown that LEACH is scalable and achieves high energy efficiency for all
the sensor nodes. However, a key assumption is that all the nodes can communicate with
the base station directly, which can be restrictive for some sensor network configurations.
Compared with LEACH, to approach achieves higher scalability with the introduction of
a hierarchical structure, thus allowing the sensors that are multiple hops away from the
base station to successfully transmit the packets along the constructed topology tree. The
key features of LEACH are:

- Localized coordination and control for cluster set-up and operation.

- Randomized rotation of the cluster "base stations" or "cluster heads" and the
corresponding clusters.

- Local compression to reduce global communication.

In LEACH, the operation is separated into fixed-length rounds, where each round starts
with a setup phase followed by a steady-state phase. The duration of a round is
determined priori.

Although, LEACH has shown good features to sensor networks, it suffers from the
following drawbacks:

- It cannot be applied to time-constrained application as it results in a long latency.

- The nodes on the route a hot spot to the sink could drain their power fast. This problem
is known as "hot spot" problem.

- The number of clusters may not be fixed every round.

- It cannot be applied to large sensor networks.

12
IMPLEMENTATION OF AN ENERGY EFFICIENT CLUSTERING BASED DATA COLLECTION IN WSN

Therefore, for Autonomic wireless sensor networks with stable and fixed homogeneous
nodes the LEACH protocol will give good performance. For a Autonomic Sensor
Network with stationary, battery powered nodes it would be effective to use clustered
based protocol like LEACH, the most obvious reason is, its advantages such as reduced
control messages, bandwidth reusability, enhanced resource allocation, improved power
control and lest wastage of energy.

2.5.2 HEED Protocol

 HEED: A Hybrid, Energy-Efficient, Distributed clustering approach for ad-


hoc sensor networks[27].

 HEED was designed to select different cluster heads in a field according to the
amount of energy that is distributed in relation to a neighboring node.

 HEED: A hybrid energy efficient distributed.

Goals of HEED

Four primary goals

 Prolonged network life-time by distributing energy consumption.

 Terminating the clustering process within a constant number of iterations/steps.

 Minimizing control overhead.

 Producing well-distributed cluster heads and compact clusters.

13
IMPLEMENTATION OF AN ENERGY EFFICIENT CLUSTERING BASED DATA COLLECTION IN WSN

CHAPTER 3

METHODOLOGY AND SYSTEM DEVELOPMENT

3.1. OBJECTIVE

Energy conservation is crucial to the prolonged lifetime of a sensor network. WSN


users may want to continuously extract data from the networks for analysis. But it is often
too costly to obtain all sensor readings, as well as these readings themselves represent
samples of the true state of the world. Many approaches for energy-efficient monitoring
have been explored to minimize energy consumption. One class of techniques is
prediction-based algorithm. It is based on the observation that the sensors capable of local
computation can be used as using predictors in a distributed way [27,31].

A simple approach to developing a predictor in sensor networks is simply to


transmit the data from all sensors to the base station[10,23,34]. Predictor training and
prediction operations are carried out by the base station. This solution has many
disadvantages, such as a high energy consumption incurred by transmitting the raw data
to the base station, the need for wireless link bandwidth, and potential high latency. A
clustering based localized prediction is proposed in which a cluster head also a sensor
node maintains a set of history data of each sensor node within a cluster. Predictions
about future movement of a tracked object are calculated at both of a sensor node and its
cluster head. Information collected at a sensor node is not sent if the object’s movement
is consistent with the prediction. The use of the localized prediction techniques is highly
energy efficient due to the reduced length of routing path for transmitting sensor data.
With clustering, only cluster heads need to communicate with the base station via multi-
hop communication, they have been designed with particular attention to energy efficient
query processing. The main objective of this work is to simulate the clustering based
localized prediction and study the energy efficiency resulting out of it.

14
IMPLEMENTATION OF AN ENERGY EFFICIENT CLUSTERING BASED DATA COLLECTION IN WSN

3.2. PROPOSED METHODOLOGY

Localized prediction techniques are highly energy efficient due to the reduced
length of routing path for transmitting sensor data. Prediction operation can be
enabled/disabled to achieve energy efficiency. If the sensor nodes are disabled, the
prediction problem is reduced to estimating data distribution parameters. The framework
for clustering-based data collection consists of two Phases:

1) Clustering: Sensor nodes form clusters and cluster heads collect and maintain
data values.

2) Prediction: The communication cost is reduced by selectively sending data to the


cluster head, but the computation cost can be prohibitive and there is a tradeoff between
communication cost and computing cost energy consumption can be further reduce by
including sleep/awake algorithm. To simulate the above framework the following
modules have been designed:

1. Topology formation

2. Adaptive scheme to enable/disable prediction operations

3. Including Sleep/Awake Algorithm

1. Topology formation

This module describes the topology Control Problems can be further divided into two

categories: Sensor Coverage topology and sensor connectivity topology.

2. Adaptive scheme to enable/disable prediction operations

15
IMPLEMENTATION OF AN ENERGY EFFICIENT CLUSTERING BASED DATA COLLECTION IN WSN

This module is to predict the data values and based on the predicted value data is
sent to the base station this prediction operation can be enabled/disabled.

3. Including Sleep/Awake Algorithm

The nodes use a period of sleep/awake interval based on the prediction and
provide effective energy conservation.

3.3. General Hardware/ Software Description

3.3.1. Hardware Specification

To develop this system with IBM compatible personal computer with Pentium IV
processor was used.

Main processor : Pentium IV processor 1.13 GHz

Hard disk capacity : 40GB

Cache memory : 512 MB

3.3.2. Software Specification

Operating system : Fedora 8 (Linux)

Scripting language : Network Simulator 2.33

Protocol : C++

Scripting : Tool Command Language

3.3.3. Linux

Linux is a Unix-like computer operating system family that uses the Linux kernel .
A Linux system which includes system utilities and libraries from the GNU Project is
16
IMPLEMENTATION OF AN ENERGY EFFICIENT CLUSTERING BASED DATA COLLECTION IN WSN

sometimes referred to as GNU/Linux. Most development from 1984 to 1991 was done by
the GNU project. After 1991, the Linux kernel developers began working on it as well as
other enthusiasts. From the late-90s onward Linux also gained the support of corporations
such as IBM, Sun Microsystems, Hewlett-Packard, and Novell. Linux is a prominent
example of free software and of open source development. Since Linux source code is
available as an open source code it can be used, modify, and also redistribute it at free of
cost. Also the entire Linux operating system in some instances is available as free or open
source software.

In 1991, work on the Linux kernel was began by Linux Thorvaldsen. It was he
who created the Linux kernel as a replacement for the non-free Linux kernel originally.
Initially Linux was dependent on Minx user space. Later the Linux kernel developers and
the GNU project developers allowed Linux to work with GNU components also. At last
Linux operating system filled the major gap in running a complete and full fledged
functional operating system built from free software. In recent days Linux is used in
various domains like, from the embedded systems to supercomputers, and has gained a
stronghold in server installations. Thorvaldsen continues with his research development
of the Linux kernel. There was a need for development of third party components, which
were later developed by individuals and other corporations. Those third party components
comprises a vast body of work which may include both the kernel modules and as well as
the user-land applications and the related libraries. Linux vendors combine and distribute
the kernel, GNU components, and non-GNU components with additional package
management software in the form of Linux distributions.

3.3.4. C++

C++ programming language is a general-purpose, high-level programming


language with low-level facilities [2]. It is a multi-paradigm language as it supports
17
IMPLEMENTATION OF AN ENERGY EFFICIENT CLUSTERING BASED DATA COLLECTION IN WSN

procedural programming, data abstraction, object-oriented programming etc. Since the


1990s, C++ has become one of the most popular commercial programming languages.
C++ was developed as an enhancement to the C programming language in 1983 at Bell
Labs by Blarney Stroud strop. Enhancements started with the addition of classes, virtual
functions, operator overloading, multiple inheritance, templates, and exception handling.

3.3.5 Network Animator (NAM)

Nam is a Tcl /TK based animation tool for viewing network simulation traces and
real world packet trace data [26]. Basic idea behind the theory and design of NAM was
to create an animator which gives an output picture of the programmed concept. This
reads the large animation data set and uses in different network visualization situations.
NAM can also read simple animation event commands from a large trace file.

Main use of NAM file is to generate the trace file. The generated trace file
contains of the entire topology information like, for e.g., nodes, links, tracing the packet
movements etc. During an NS simulation user can produce topology configurations,
layout information, and packet traces using tracing events in NS. Once the simulation is
executed, the trace file is generated which intern is used by the NAM file for animation
purpose.

18
IMPLEMENTATION OF AN ENERGY EFFICIENT CLUSTERING BASED DATA COLLECTION IN WSN

3.3.6. Network Simulator (NS)

Network simulator (NS) is an object–oriented, discrete event simulator for


networking research. NS provides substantial support for simulation of TCP, routing and
multicast protocols over wired and wireless networks. The simulator is a result of an
ongoing effort of research and developed. Even though there is a considerable confidence
in NS, it is not a polished product yet and bugs are being discovered and corrected
continuously.

NS is written in C++, with an OTcl1 interpreter as a command and configuration


interface. The C++ part, which is fast to run but slower to change, is used for detailed
protocol implementation. The OTCL part, on the other hand, which runs much slower but
can be changed very fast quickly, is used for simulation configuration.

One of the advantages of this split-language program approach is that it allows for
fast generation of large scenarios. To simply use the simulator, it is sufficient to know
OTcl. On the other hand, one disadvantage is that modifying and extending the simulator
requires programming and debugging in both languages.

NS can simulate the following:

1. Topology: Wired, wireless

2. Scheduling Algorithms: RED, Drop Tail,

3. Transport Protocols: TCP, UDP

4. Routing: Static and dynamic routing

5. Application: FTP, HTTP, Telnet, Traffic generators

19
IMPLEMENTATION OF AN ENERGY EFFICIENT CLUSTERING BASED DATA COLLECTION IN WSN

3.3.7. User’s View of NS-2

Simulation -

OTCL Script OTCL Interpreter Simulation Results

C++ Libraries

Figure 3.1: Block diagram of Architecture of NS-2

3.3.8. The Network Simulator 2.33 (NS2)

Network Simulator (NS2) is a discrete event driven simulator developed at UC


Berkeley. It is part of the VINT project. The goal of NS2 is to support networking
research and education. It is suitable for designing new protocols, comparing different
protocols and traffic evaluations. NS2 is developed as a collaborative environment. It is
distributed freely and open source. A large amount of institutes and people in
development and research use, maintain and develop NS2.

This increases the confidence in it. Versions are available for FreeBSD, Linux,
Solaris, Windows and Mac OS X.

20
IMPLEMENTATION OF AN ENERGY EFFICIENT CLUSTERING BASED DATA COLLECTION IN WSN

3.3.9. Structure of NS2

NS2 is built using object oriented methods in C++ and OTCL (object oriented
variant of TCL.

Figure 3.2: Simplified User’s View of NS

Can see in Fig 3.2, NS2 interprets the simulation scripts written in OTCL. A user has to
set the different components (e.g. event scheduler objects, network components libraries
and setup module libraries) up in the simulation environment. The user writes his
simulation as a OTCL script, plumbs the network components together to the complete
simulation. If they need new network components, it is free to implement them and to
set them up in his simulation as well. The event scheduler as the other major component
besides network components triggers the events of the simulation (e.g. sends packets,
starts and stops tracing). Some parts of NS2 are written in C++ for efficiency reasons.
The data path (written in C++) is separated from the control path (written in OTCL). Data
path object are compiled and then made available to the OTCL interpreter through an
OTCL linkage which maps methods and member variables of the C++ object to methods
and variables of the linked OTCL object. The C++ objects are controlled by OTCL
objects. It is possible to add methods and member variables to a C++ linked OTCL
object.
21
IMPLEMENTATION OF AN ENERGY EFFICIENT CLUSTERING BASED DATA COLLECTION IN WSN

3.3.10. Functionalities of NS2.33

Functionalities for wired, wireless networks, tracing, and visualization are


available in NS2.

• Support for the wired world include

– Routing DV, LS, and PIM-SM.

– Transport protocols: TCP and UDP for uni-cast and SRM for multicast.

– Traffic sources: web, ftp, telnet, cbr (constant bit rate), stochastic, real audio.

– Different types of Queues: drop-tail, RED, FQ, SFQ, DRR.

– Quality of Service: Integrated Services and Differentiated Services.

– Emulation.

• Support for the wireless world include

– Ad hoc routing with different protocols, e.g. AODV, DSR, DSDV, TORA

– Wired-cum-wireless networks

– Mobile IP

– Directed diffusion

– Satellite

– Sensor-MAC

– Multiple propagation models (Free space, two-ray ground, shadowing)


22
IMPLEMENTATION OF AN ENERGY EFFICIENT CLUSTERING BASED DATA COLLECTION IN WSN

– Energy models

• Tracing

• Visualization

– Network Animator (NAM)

– Trace Graph

• Utilities

– Mobile Movement Generator

Figure 3.3: OTcl and C++: the duality

3.4. Wireless Networking In NS2.33


23
IMPLEMENTATION OF AN ENERGY EFFICIENT CLUSTERING BASED DATA COLLECTION IN WSN

This section describes the wireless model that was originally ported as CMU’s
Monarch group’s mobility extension to NS2. The first section covers the original
mobility model ported from CMU/Monarch group. In this section, cover the internals of a
mobile node, routing mechanisms and network components that are used to construct the
network stack for a mobile node. The components that are covered briefly are Channel,
Network interface, Radio propagation model, MAC protocols, Interface Queue, Link
layer and Address resolution protocol model (ARP). CMU trace support and Generation
of node movement and traffic scenario files are also covered in this section. The original
CMU model allows simulation of pure wireless LANs or multi-hop ad-hoc networks.
Further extensions were made to this model to allow combined simulation of wired and
wireless networks. Mobile IP was also extended to the wireless model.

3.4.1. Routing Protocol

The wireless model essentially consists of the Mobile Node at the core, with
additional supporting features that allows simulations of multi-hop ad-hoc networks,
wireless LANs etc. The Mobile Node object is a split object. The C++ class Mobile Node
is derived from parent class Node. A Mobile Node thus is the basic Node object with
added functionalities of a wireless and mobile node like ability to move within a given
topology, ability to receive and transmit signals to and from a wireless channel etc. A
major difference between them, though, is that a Mobile Node is not connected by means
of Links to other nodes or mobile nodes. In this section we shall describe the internals of
Mobile Node, its routing mechanisms, the routing protocols DSDV, AODV, TORA and
DSR, creation of network stack allowing channel access in Mobile Node, brief
description of each stack component, trace support and movement/traffic scenario
generation for wireless simulations. The point to consider is whether prediction is really
energy efficient or not. To solve this problem, a localized prediction model is developed
first. Very complex models are not practical in application due to the limited
computational capacity of sensor nodes. Fortunately, simple linear predictors are
24
IMPLEMENTATION OF AN ENERGY EFFICIENT CLUSTERING BASED DATA COLLECTION IN WSN

sufficient to capture the temporal correlation of realistic sensor data [23, 7]. If the
destination is found, node transmits data in the same way as in destination sequenced
distance vector (DSDV). If not, it start Route Discovery mechanism: Source node
broadcast the Route Request packet to its neighbor nodes, which in turns rebroadcast this
request to their neighbor nodes until finding possible way to the destination.

When intermediate node receives a Route Request (RREQ), it updates the route to
previous node and checks whether it satisfies the two conditions: (i) there is an available
entry which has the same destination with RREQ (ii) its sequence number is greater or
equal to sequence number of RREQ. If not, it rebroadcast RREQ. If yes, it generates a
RREP message to the source node. When Route Reply (RREP) is routed back, node in
the reverse path updates their routing table with the added next hop information. If a node
receives a RREQ that it has seen before (checked by the sequence number), it discards
the RREQ for preventing loop. If source node receives more than one RREP, the one
with greater sequence number will be chosen. For two RREPs with the same sequence
number, the one will less number of hops to destination will be chosen. When a route is
found, it is maintained by Route Maintenance mechanism: Each node periodically send
Hello packet to its neighbors for proving its availability. When Hello packet is not
received from a node in a time, link to that node is considered to be broken. The node
which does not receive Hello message will invalidate all of its related routes to the failed
node and inform other neighbor using this node by Route Error packet. The source if still
want to transmit data to the destination should restart Route Discovery to get a new path.
AODV has advantages of decreasing the overhead control messages, low processing,
quick adapt to net work topology change, more scalable up to 10000 mobile nodes.
However, the disadvantages are that AODV the packets. Also there is always a small
time delay at the begin of a new connection because the initiator must first find the route
to the target.

3.4.2. Mobile Node: Creating Wireless Topology


25
IMPLEMENTATION OF AN ENERGY EFFICIENT CLUSTERING BASED DATA COLLECTION IN WSN

Mobile Node is the basic ns Node object with added functionalities like
movement, ability to transmit and receive on a channel that allows it to be used to create
mobile, wireless simulation environments. The class Mobile Node is derived from the
base class Node. Mobile Node is a split object. The mobility features including node
movement, periodic position updates, maintaining topology boundary etc are
implemented in C++ while plumbing of network components within Mobile Node itself
(like classifiers, DMUX , LL, Mac, Channel etc) have been implemented in OTCL. The
functions and procedures described in this subsection can be found in ~ns/mobile
node.{cc,h}, ~ns/TCL/lib/ns-mobilenode.tcl, ~ns/TCL/mobility/dsdv.tcl,
~ns/TCL/mobility/dsr.tcl, ~ns/TCL/mobility/tora.tcl. Example scripts can be found in
~ns/TCL/ex/wireless-test.tcl and ~ns/TCL/ex/wireless.tcl. While the first example uses a
small topology of 3 nodes, the second example runs over a topology of 50 nodes. These
scripts can be run simply by typing.

$ns tcl/ex/wireless.tcl (or /wireless-test.tcl)

The five ad-hoc routing protocols that are currently supported are Destination
Sequence Distance Vector (DSDV), Dynamic Source Routing (DSR), Temporally
ordered Routing Algorithm (TORA), Ad hoc On-demand Distance Vector (AODV) and
Protocol for Unified Multicasting Through Announcements (PUMA). The primitive to
create a mobile node is described below. Please note that the old APIs for creating a
mobile node depended on which routing protocol was used, like

set m node [$opt(rp)-create-mobile-node $id]

where

$opt(rp)

26
IMPLEMENTATION OF AN ENERGY EFFICIENT CLUSTERING BASED DATA COLLECTION IN WSN

defines "dsdv", "aodv", "tora", "dsr" or "puma" and id is the index for the mobile node.
But the old API's use is being deprecated and the new API is described as follows.

$ns_ node-config –ad hoc Routing $opt(ad hoc Routing)

-llType $opt(ll)

-macType $opt(mac)

-ifqType $opt(ifq)

-ifqLen $opt(ifqlen)

-antType $opt(ant)

-propInstance [new $opt(prop)]

-phyType $opt(netif)

-channel [new $opt(chan)]

-topoInstance $topo

-wiredRouting OFF

-agentTrace ON

-routerTrace ON

-macTrace ON

The above API configures for a mobile node with all the given values of ad hoc-
routing protocol, network stack, channel, topography, propagation model, with wired
routing turned on or off (required for wired-cum-wireless scenarios) and tracing turned
on or off at different levels (router, mac, agent). Incase hierarchical addressing is being
27
IMPLEMENTATION OF AN ENERGY EFFICIENT CLUSTERING BASED DATA COLLECTION IN WSN

used, the heir address of the node needs to be passed as well. For more info about this
command (part of new node APIs) see chapter titled "Restructuring ns node and new
Node APIs" in ns Notes and Documentation.

3.5. Node Configuration Interface

All node instances created after a given node-configuration command will have
the same property unless a part or all of the nodeconfig command is executed with
different parameter values. And all parameter values remain unchanged unless they are
explicitly changed. So after creation of the AODV base-station and mobile nodes, if we
want to create simple nodes, we will use the following node-configuration command.

\$ns_ node-config -reset

This will set all parameter values to their default setting which basically defines
configuration of a simple node. Currently, this type of node configuration is oriented
towards wireless and satellite nodes. Table 3.1 lists the available options for these kinds
of nodes.

28
IMPLEMENTATION OF AN ENERGY EFFICIENT CLUSTERING BASED DATA COLLECTION IN WSN

Option available values Default


General
address Type flat, hierarchical Flat
MPLS ON, OFF OFF
both satellite- and wireless-oriented
wired Routing ON, OFF OFF
llType LL \ ""
macType Mac/802_11\
ifqType Queue/Drop Tail,/Pri Queue ""
ifqLen If qLen\ ""
phyType Phy/ Wireless Phy\ ""
wireless-oriented
adhocRouting DIFFUSION/RATE, DIFFUSION/PROB, DSDV,
energy model Energy model
PUMA ""
propType Propagation/TwoRayGround ""
propInstance Propagation/TwoRayGround, Propagation/Shadowing ""
antType Antenna/OmniAntenna ""
Channel Type Channel/WirelessChannel, ""
topoInstance $ topo\ ""
mobileIP ON, OFF OFF
energyModel EnergyModel ""
initialEnergy <value in Joules> ""
rxPower <value in W> ""
txPower <value in W> ""
idlePower <value in W> ""
agent Trace ON, OFF OFF
router Trace ON, OFF OFF
macTrace ON, OFF OFF

29
IMPLEMENTATION OF AN ENERGY EFFICIENT CLUSTERING BASED DATA COLLECTION IN WSN

movement Trace ON, OFF OFF


sleep Power <value in W> ""
initial Energy <value in W> ""
toraDebug ON, OFF OFF
satellite-oriented
satNodeType polar, geo, terminal, geo-repeater ""
downlinkBW <bandwidth value, e.g. "2Mb"> ""

Table 3.1: Available options for configuration

3.5.1. Sensor Networks

In WSN the greatest challenge is the development of long-lived sensor networks in


spite of energy-constraints of individual nodes. Hence energy conservation is one of the
primary requirements in WSN. Strict data delivery guarantee for individual packets is not
required in many WSN applications. Field deployment of sensor network applications,
such as environmental monitoring and animal tracking show that occasional loss of
sensor readings is tolerable provided the collective information from all the source nodes
can be obtained.

New approach is to deriving the energy efficiencies of some feasible reliability


schemes. Detailed performance evaluations and analyses provide a guideline for selecting
the optimal number of retransmissions for reliable data delivery Efficient Reliable Data
Collection (ERDC) algorithm to dynamically control the maximum number of
retransmissions to achieve energy savings. Dynamic programming concept is used to find
the optimal solution. Efficient Reliable Data Collection (ERDC) algorithms used to
dynamically control the maximum number of retransmissions to achieve energy savings.
Dynamic programming concept is used to find the optimal solution. Quality of Service
(QOS) requirements (e.g. bandwidth and delay constraints) for the different QOS based

30
IMPLEMENTATION OF AN ENERGY EFFICIENT CLUSTERING BASED DATA COLLECTION IN WSN

applications of WSNs raises significant challenges. More precisely, the networking


protocols need to cope up with energy constraints, while providing precise QOS
guarantee. Therefore, enabling QOS applications in sensor networks requires energy and
QOS awareness in different layers of the protocol stack, maximizes the network lifetime
through balancing energy consumption across multiple nodes, uses the concept of service
differentiation to allow delay sensitive traffic to reach the sink node within an acceptable
delay, reduces the end to end delay through spreading out the traffic across multiple
paths, and increases the throughput through introducing data redundancy (EQSR), uses
the residual energy node, available buffer size, and Signal-to-Noise Ratio (SINR) to
predict the best next hop through the paths construction phase. Based on the concept of
service differentiation, EQSR protocol employs a queuing model to handle both real-time
and non-real-time traffic. The emergence of these low cost and small size wireless sensor
devices has motivated intensive research in the last decade addressing the potential of
collaboration among sensors in data gathering and processing, which led to the invention
of Wireless Sensor Networks(WSNs).
3.5.2. Network Components

This section talks about the NS components, mostly compound network


components. Figure.3.4 shows a partial OTCL class hierarchy of NS, which will help
understanding the basic network components.

Figure 3.4: OTCL Class Hierarchies


31
IMPLEMENTATION OF AN ENERGY EFFICIENT CLUSTERING BASED DATA COLLECTION IN WSN

The root of the hierarchy is the TCL Object class that is the super class of all
OTCL library objects (scheduler, network components, timers and the other objects
including NAM related ones). As an ancestor class of TCL Object, NS Object class is the
super class of all basic network component objects that handle packets, which may
compose compound network objects such as nodes and links. The basic network
components are further divided into two subclasses, Connector and Classifier, based on
the number of the possible output DATA paths. The basic network and objects that have
only one output DATA path are under the Connector class, and switching objects that
have possible multiple output DATA paths are under the Classifier class.

3.5.3. Class Tcl


The class TCL encapsulates the actual instance of the OTCL interpreter and
provides the methods to access and communicate with that interpreter, code. The class
provides methods for the following operations.

a. Obtain a reference to the Tel instance


b. Invoke OTCL procedures through the interpreter
c. Retrieve, or pass back results to the interpreter
d. Report error situations and exit in an uniform manner
e. Store and lookup "TCL Objects"
f. Acquire direct access to the interpreter.
3.5.4 Obtain a Reference to the class TCL instance

A single instance of the class is declared in –tcl/Tcl.cc as a static member


variable. The statement required to access this instance is Tel& TEL = TCL::instance ();

3.5.5 Invoking OTCL Procedures


There are four different methods to invoke an OTCL command through the
instance, TCL. They differ essentially in their calling arguments. Each function passes a

32
IMPLEMENTATION OF AN ENERGY EFFICIENT CLUSTERING BASED DATA COLLECTION IN WSN

string to the interpreter that then evaluates the string in a global context. These methods
will return to the caller if the interpreter returns TCL_OK. On the other hand, if the
interpreter returns TCL_ERROR, the methods will call tkerror {}. The user can overload
this procedure to selectively disregard certain types of errors.

1. Passing Results to/from the Interpreter; When the interpreter invokes a C++
method, it expects the result back in the private member variable, tcl-> result.
2. Error Reporting and Exit; This method provides a uniform way to report errors
in the compiled code.
3.6. Design and Development
3.6.1. PHASE 1. Topology formation
Topology formation is important issue in WSN. Performance parameters such as
energy consumption, network life time data delivery delay, sensor field coverage depends
on network topology control Problems. This module describes the basic operation i.e.;
deployment of sensor nodes and neighbor node calculation and selection of cluster head
in WSN. To achieve a lasting and scalable WSN design, the following aspects have been
carefully taken into account in the design stage:
• Energy conservation.
• Limited bandwidth.
• Unstructured and time-varying network topology.
• Low-quality communications.
• Operation in hostile environments.
• Data processing.
• Scalability.
The network topology in WSNs can be changed by varying the nodes’ transmitting
range and adjusting the sleep/awake schedule of all nodes. Therefore, further energy can
be saved if the network topology can be maintained in an optimal manner.

33
IMPLEMENTATION OF AN ENERGY EFFICIENT CLUSTERING BASED DATA COLLECTION IN WSN

Topology controls problem can be divided into two categories: Sensor Coverage
topology and sensor connectivity topology. The coverage topology describes the
topology of sensor coverage and is concerned about how to maximize liable sensing area
while consuming less power. The connectivity topology on the other hand is more
concerned about network connectivity and emphasizes the message retrieve and delivery
in the network. Two kinds of mechanisms have been utilized to maintain an efficient
sensor connectivity topology: Power Control Mechanisms and Power Management
Mechanisms. The former controls the radio power level to achieve optimized
connectivity topology and the later maintains a good sleep/ awake schedule.
3.6.2. Power Control Mechanisms

The goal of power control mechanisms is to dynamically change the nodes’


transmitting range in order to maintain some property of the communication graph, while
reducing the energy consumed by node transceivers because they are one of the primary
sources of energy consumption in WSNs. Power control mechanisms are fundamental to
achieving good network energy efficiency. Power control is studied in homogeneous and
non-homogeneous scenarios which can be distinguished by examine if the nodes have the
same transmitting range or not. For homogeneous network, the CTR (Critical
Transmitting Range) problem has been investigated in theoretical ways as well as
practical viewpoints. A distributed protocol called COMPOW [25] attempts to determine
the minimum common transmitting range needed to ensure network connectivity. It
shows that setting the transmitting range to this value has the beneficial effects of
maximizing network capacity, reducing the contention to access the wireless channel, and
minimizing energy consumption. The tradeoff between the transmitting range and the
size of the largest connected component in the communication graph has been
investigated through simulation [30] and the experimental results presented show that, in
sparse two and three dimensional networks, the transmitting range can be reduced
significantly if weaker requirements on connectivity are acceptable. Halving the critical
transmitting range, the largest connected component has an average size of approximately
34
IMPLEMENTATION OF AN ENERGY EFFICIENT CLUSTERING BASED DATA COLLECTION IN WSN

0.9n. This means that a considerable amount of energy is spent to connect relatively few
nodes.
Non-homogeneous networks are more challenging because nodes are allowed to
have different transmitting ranges. The problem of assigning a transmitting range to
nodes in such a way that the resulting communication graph is strongly connected and the
energy cost is minimum is called the Range Assignment (RA) problem [29]. The
computational complexity of RA has been analyzed in [35, 36]. It is shown to be NP-hard
in the case of 2D and 3D networks. However the optimal solution can be approximated
within a factor of 2 using the range assignment generated in [19]. An important variant of
RA has been recently studied is based on the concept of symmetry of the communication
graph. Due to the high overhead [21]needed to handle unidirectional links in routing
protocols or MAC protocols which are naturally designed to work under the symmetric
assumption, Symmetric Range Assignment (SRA) shows more practical significance.
However, show that SRA remains NP-hard in 2D and 3D networks, and it even incurs a
considerable additional energy cost over RA [3]. Thus SRA can be refined to WSRA
(Weakly Symmetric Range Assignment) which weakens the requirement that the
communication graph contains only bidirectional links by allowing the existence of the
unidirectional links but requiring the symmetric sub graph of the communication graph
resulting from RA connected. In the released WSRA problem, only marginal effect on
the energy cost has been induced while the desired symmetry property has been kept.
Two polynomial approximation algorithms for WSRA [32] propose a lot of power
control approaches have been trying to design simple and practical protocols that build
and maintain a reasonably good topology [29]. A present a distributed power control
algorithm is presented that can leverages on location information to build a topology that
is proven to minimize the energy required to communicate with a given master node [28,
29]. Consider a two tired Wireless Sensor Network (WSN) consisting of sensor clusters
deployed around strategic locations and base-stations (BSs) whose locations are relatively
flexible.

35
IMPLEMENTATION OF AN ENERGY EFFICIENT CLUSTERING BASED DATA COLLECTION IN WSN

3.6.3 Power Management Mechanisms

Power management is concerned of which set of nodes should be turned


Enable/Disable and when, for the purpose of constructing energy saving topology to
prolong the network lifetime. It can utilize information available from all the layers in the
protocol stack. In GAF [38] nodes use location information to divide the field into fixed
square grids. The size of each grid stays constant, regardless of node density. Nodes
within a grid switch between sleeping and listening mode, with the guarantee that one
node in each grid stays up so that a dynamic routing backbone is maintained to forward
packets. [6] propose Span, a power saving topology maintenance algorithm for multi-hop
ad hoc wireless networks which adaptively elects coordinators from all nodes to form a
routing backbone and turn off other nodes’ radio receivers most of the time to conserve
power STEM approach [8], which exploits the time dimension rather than the node
density dimension to control a power saving topology of active nodes. They switch nodes
between two states, “transfer state” and “monitoring state”. Data are only forwarded in
the transfer state. In the monitoring state, nodes remain their radio off and will switch
into transfer state to be an initiator node on event detected. The extended study on
combining STEM and GAF shows the potential of further power saving by exploiting
both time dimension and node density dimension.
3.6.4. Impact of clustering protocol on energy consumption
The degree of energy consumption on each sensor node changes according to the
distance between cluster head and sink node, and depends on transmission methods
multi-hop or single-hop. In case of single-hop, cluster head transmits data to sink node
directly, hence the degree of energy consumption varies whether the cluster is the nearest
to the sink node or the farthest away from the sink node. Generally, the cluster which is
farthest away from sink node consumes more energy than other clusters. In case of multi-
hop, because of the data transmitted from all clusters by relay, the cluster nearest to the
sink consumes large amount of energy. Consequently, in cluster tree topology, the degree
of energy consumption vary based on the roles of sensor nodes, thus, cluster head which
36
IMPLEMENTATION OF AN ENERGY EFFICIENT CLUSTERING BASED DATA COLLECTION IN WSN

needs large amount of power must be distributed for energy-efficient networks. Fig. 3.5
and 3.6 show intra-cluster and inter-cluster range.

Figure 3.5: Maximum distance between member nodes

Figure 3.6: Maximum distance between cluster heads

Another parameter which affects the energy efficient network is time interval between
FND (time the first node died) and LND (time the last node died). Consequently
minimum time interval between FND and LND generates greatest energy efficient
network.

37
IMPLEMENTATION OF AN ENERGY EFFICIENT CLUSTERING BASED DATA COLLECTION IN WSN

3.6.5. Data Aggregation


Each cluster head will maintain the representative data values for all members in
the cluster. This approach eliminates the need for collecting all data values from
individual member when the sink wishes to obtain them. Instead, the cluster heads can
form a routing tree, along with a small number of non head nodes routed.
A traditional in network aggregation technique would require building a routing
tree to contain all sensor nodes and then the summary information is propagated towards
the sink. Each sensor node, on receiving the summary information from its downstream
descendants in the routing tree, can aggregate the summary information and further
propagate the aggregate. The proposed framework, avoids the need for rampant node-to-
node aggregation; rather, it uses faster and more efficient cluster-to-cluster aggregation.
The aggregation process starts at the remote cluster heads to-wards the sink. A remote
cluster head first sends packets containing the parameters of the local data distribution to
its parent. Intermediate cluster heads, upon receiving packets from other cluster heads,
will aggregate them (along with its own data). For the parameters estimation problem, the
input information includes both the values acquired from sensors within the local cluster,
and the values received from its children in the routing tree. A cluster head then uses the
mixture model and the Expectation Maximization algorithm, which is standard for
finding maximum likelihood estimates of parameters in probabilistic models. After
parameter estimation, the cluster next sends packets to its parent too. This distributed,
iterative process continues until the sink receives and aggregates the final results.
Data aggregation protocols aims at eliminating redundant data transmission and
thus improve the lifetime of energy constrained wireless sensor network. In wireless
sensor network, data transmission took place in multi-hop fashion where each node
forwards its data to the neighbor node which is nearer to sink. Since closely placed nodes
may sense same data, above approach cannot be considered as energy efficient. An
improvement over the above approach would be clustering where each node sends data to
cluster-head and then cluster-head perform aggregation on the received raw data and then
38
IMPLEMENTATION OF AN ENERGY EFFICIENT CLUSTERING BASED DATA COLLECTION IN WSN

send it to sink. Performing aggregation function over cluster-head still causes significant
energy wastage. In case of homogeneous sensor network cluster-head will soon die out
and again re-clustering has to be done which again cause energy consumption.

3.6.6. PHASE 2. Adaptive scheme to enable/disable prediction


Operations
Consider a cluster of sensor nodes, which can be awake or sleeping. If the sensor
nodes are sleeping, the prediction problem is reduced to estimating data distribution
parameters using history data. In this case the estimates are already available. If the
sensor nodes are awake, they continuously monitor an attribute x and generate a data
value at every time instance t . Without local prediction capability at the cluster head,
a sensor node has to send all data values to the cluster head that estimates data
distribution accordingly. With local prediction, however, a sensor node can selectively
send its data values to the cluster head[39].
One model for selective sending is   loss approximation. Given an error bound  0 a
sensor node sends its value x t
to the cluster head if x  xˆ
t t
 the where xˆt
is a

predicted representative data value to approximate the true data. The intuition of this
choice is that if a value is close to the predicted value there is not much benefit by
reporting it. If the value is much different from the predicted value, it is important to
consider it for computing the data distribution. To solve this problem, first develop a
localized prediction model. Very complex models are not practical in the application due
to the limited computational capacity of sensor nodes. Fortunately, simple linear
predictors are sufficient to capture the temporal correlation of realistic sensor data as [7,
23]. A history based linear predictor is one of popular approaches to predicting the future
based on past n measurement xˆ  p( x t 1 , x t  2 ,...., x t  n) . In particular, it has the properties: 1)

kxˆt  p(kx ,kx ,..., kx ) and 2) p'x (.)  c, where c is constant, and n p'x (.)  1
t 1 t 2 t n t i i 1
t i

39
IMPLEMENTATION OF AN ENERGY EFFICIENT CLUSTERING BASED DATA COLLECTION IN WSN

if the predictor is unbiased xt  c  wt  ip1 i x


t i ,
. One of the examples, autoregressive

model denoted by R p  is written as where  ,..., are the parameters of the model.
1 

Here, c is a constant always presumed to be zero and w is a white noise process with zero
t

mean and variance  .The process is covariance stationary if i  1. Accordingly, a p -


2

ˆt  i 1i xt i . The parameters can be calculated by Yule-Walker


p
order AR predictor is: x

equations [28] or using the least square method. The parameters are often updated on
every measurement and the estimation is carried out by both the cluster header and 2
cluster members to achieve synchronization. If the error tolerant  and correlation
coefficient  x ( j ) satisfy
  k 1
 m x  1   (1) the
1   j 1 j  x ( j )
p
 2k 

scheme with local prediction is more energy efficient, where the parameters are given as
in table (3.2). Equation (1) gives the error bound condition. This result says, if the
correlation coefficient is too small, prediction will not be accurate. As a result, sensor
data values are often not within the error bound and will still be transmitted to the cluster
head. Meanwhile, if the error bound is small, the condition is not easily satisfied either
and transmissions are still required. Together, this corollary tells that algorithm selection
should be determined based on both the desired error bound and the predictability of the
sensor data and from experimental results the effect on the parameter m is not
deterministic. While a large value of ‘m’ often leads to the condition of (1) hardly
satisfied and there by the prediction scheme at the node is prone to being disabled, it can
reduce the energy consumption as a long term predictor when the condition is satisfied.

Process at the Cluster Head:


if timeout after m  seconds
for each member i in the Cluster

40
IMPLEMENTATION OF AN ENERGY EFFICIENT CLUSTERING BASED DATA COLLECTION IN WSN

if Condition (1) holds


Send message to member i to enable prediction
else
Send message to member i to disable prediction
else
for each member i in this cluster
if receive a data value from member i
update the history data for member i
else
Perform Prediction to update the history data
Algorithm 3.1 Operations at the Cluster Head

Algorithm 3.1 shows the pseudo code description of the algorithms at the cluster
head the cluster head maintains a set (a circular array) of history data for each cluster
member. The algorithm shows the cluster head will continuously receive data values
from each cluster member to update the set of history data or when no data values are
received will use the predicted value instead for update. The cluster head also runs a
periodic process, to determine algorithm selection, with or without local prediction. The
decision is broadcast to all cluster members.
Process at the cluster members
if prediction is disabled or xi  xˆ i 

send the data value to the cluster head


update the history data using the data value
else
Perform prediction to update the history data
Algorithm 3.2 Operations at cluster members

41
IMPLEMENTATION OF AN ENERGY EFFICIENT CLUSTERING BASED DATA COLLECTION IN WSN

Algorithm 3.2 is the pseudo code description at each cluster node. Each cluster
member maintains a set of history data of its own. If “no local prediction”, is selected it
simply transmits the data values. If local prediction is turned on, the cluster member will
perform prediction on each data value. If the data value is not within the error bound, it
will be sent to the cluster head too. Meanwhile, the local set of history data should be
updated as well. In particular, if local prediction is enabled and the data value is within
the error bound, the predicted value not the actual value will be included in the set of
history data. The purpose is to maintain the consistency between local and the cluster
head.
3.6.7. PHASE 3: Including Sleep/Awake Algorithm
Variety of sleep/awake scheduling protocols has been proposed in the literature.
Most of them use a period sleep/awake interval and provide effective energy conservation
at the cost of delay and throughput. For example, for a source node to transmit data, it has
to know the sleep/awake schedule of the neighbor node and has to wait for the neighbor
to come into the active state. The same is repeated until the data reaches the final
destination thus resulting in unprecedented delays. This increase in delay is equal to the
product of the number of intermediate forwarders times the length of the wakeup
interval [34]. Such increase in end-to-end delay incurred due to latency energy trade off
has the potential to become major problem in many emerging delay-sensitive WSN
applications, which require fast response and real-time control.
Secondly, because of the multi-hop communication paradigm of WSNs, a node's
role in routing is important. Based on topology different nodes have different significance
in the network. For instance, a scenario where there is only one node acting as a bridge
between two distinct parts of the networks will have to forward all the traffic of one part
of the network. Thus, delay can be minimized by allocating sleep/awake schedule to the
nodes according to the traffic load determined by the node's importance in connectivity.
Giving a higher wake interval to heavily loaded nodes to ensure their availability when

42
IMPLEMENTATION OF AN ENERGY EFFICIENT CLUSTERING BASED DATA COLLECTION IN WSN

they are needed and giving a lower wake interval to lightly loaded nodes to save their
energy.

Thirdly, when an event occurs at any particular area in a WSN, generic


sleep/awake cycles of the nodes remain the same regardless of the frequency of the event
detection. It does not adapt itself based on frequency and location of events in terms of
changing their sleep/ awake interval. For this problem simple ideas of temporal and
spatial dependency are used. Temporal dependency in this context refers that when an
event occurs in sensing area of the node in one time slot, it is likely to occur in the
proceeding time slots. Thus, if the nodes can adapt and change its sleep cycle, it can
reduce the delay. Similarly, local dependency refers to the fact that, if an event
occurrence is reported by sensor node, there is a likelihood of event occurrence in its
neighbor hood nodes. Thus, nodes in the neighborhood of that node should adapt to that
traffic burst and change its sleep cycle. Thus, based on temporal dependency, the wake
interval of node where event occurs is increased while based on spatial dependency; the
wake interval of its neighbors is increased in the next time slot. These measures can
significantly reduce the delay.

The framework consists of a cluster of sensor nodes, which can be awake or


sleeping. If the sensor nodes are sleeping, the prediction problem is reduced to estimating
data distribution parameters using history data. In this case, this can be neglect of, if the
sensor nodes are awake, they continuously monitor an attribute x and generate a data
value xt at every time instance. Without local prediction capability at the cluster head, a
sensor node has to send all data values.
To the cluster head that estimates data distribution accordingly. With local
prediction, however, a sensor node can selectively send its data values to the cluster head.
This result says if the correlation co-efficient is too small, prediction will not be accurate.
As a result, sensor data values are often not within the error bound and will still be
transmitted to the cluster head. Meanwhile, if the error bound is small, the condition is
43
IMPLEMENTATION OF AN ENERGY EFFICIENT CLUSTERING BASED DATA COLLECTION IN WSN

not easily satisfied either and transmissions are still required. Together, this corollary tells
that algorithm selection should be determined based on both the desired error bound and
the predictability of the sensor data. While a large value of m often leads to the condition
of hardly satisfied and thereby the prediction scheme at the nodes are prone to being
disabled, it can reduce the energy consumption as a long term predictor when the
condition is satisfied.
Algorithms at the cluster head
while member i is awake
if timeout after m  seconds
if condition (2) holds
let member i power off for m f  seconds

while member i is sleeping


if timeout after m f  seconds

awake member i
Algorithm 3.3 Sleep/awake scheduling
Sleep/Awake scheduling is based on the following observation. For some
applications, the   approximation may not be strictly required. The applications may
tolerate few, if any, missing data values not within the error bound. If the confidence is
very high, e.g., above a specified threshold, say  threshold , the cluster members may never
report data values to the cluster head. Therefore, there is no paramount need for the
cluster members to stay awake to obtain data values, most of which will be discarded
anyway to allow sleep/wake scheduling for the cluster members equation (2) shows the
pseudo code description of the algorithms at the cluster head. The cluster head maintains
a set of history data for each cluster member. When a cluster member is awake, the
cluster head checks if the member’s data values are within the error bound with high
probability. If yes, the cluster head will send a message to power off the member. The
condition should be the confidence level  m is higher than the threshold  threshold i .e,

44
IMPLEMENTATION OF AN ENERGY EFFICIENT CLUSTERING BASED DATA COLLECTION IN WSN

 
   (2)
2 
m   1   thre shold
 1  j 1  j  x ( j )
p

 x

However, when the cluster members sleep, the cluster head will not receive any data
values and hence it is impossible to perform accurate prediction. For this reason, periodic
but infrequent collection of data from the cluster members is still necessary. The
frequency of this infrequent data collection is due optimization problem. If the frequency
is high, the cost of collecting data can also be high but if the frequency is low, the
prediction can be inaccurate and result in erroneous sleeping decisions. Let  be the time
interval between two consecutive reporting by a member. They set the duration of a sleep
period to m f   and when a cluster member wakes up; it will continuously perform data

reading for the next m   time. Initially, m f is set to m . It can be increased if condition

(2) consistently holds, or decreased if the condition does not hold.

 Error bound

xt Sensor reading at time instance t . x is the mean value and  x is


the variance

ˆ
x t The predicted data value of x t

P . Linear predictor

 Confidence level

 . The CDF of Gaussian white noise.  Phi is the variable.

m, p The order AR predictor


 The correlation co-efficient.
k The ratio between transmission cost and computation cost

Table 3.2: Parameters for Enable/Disable Prediction and Sleep/Awake Operation.

45
IMPLEMENTATION OF AN ENERGY EFFICIENT CLUSTERING BASED DATA COLLECTION IN WSN

CHAPTER 4
IMPLEMENTATION AND SIMULATION RESULTS

4.1. Cluster Model


A sensor network is partitioned into multiple sub networks, i.e., clusters. A cluster
can be formed by the set of sensor nodes in a geographical area, where data locality exists
among the sensor nodes, and clusters are dynamically sleep/awake to maintain good
locality within each cluster. All sensor nodes in a cluster are called cluster members,
including one elected cluster head. Within each cluster, the cluster head receives data
selectively reported by all cluster members, and performs local prediction on the data
distribution of the sensor data. Cluster members also perform prediction, and data values
are transmitted to the cluster head only if they are not within a specified error bound. In
this way, a cluster head can perceive an accurate view of all sensor data across the
cluster, while communication cost is drastically reduced. In the implementation nodes are
created with clusters, each cluster consisting of 8 cluster nodes and one cluster head.
The framework consists of a base station which stores the data received from the
cluster head. The cluster members send data to the cluster head and cluster head
communicate with the base station. The node can be enabled/disabled based on the
prediction operation. The simulation objet is introduced which is tracked on by its move
any of the clusters. So the processing cluster head alone will be enabled to maintain its
energy level for processes, the sum of the remaining cluster heads are disabled .The
cluster head informs the base station which cluster head is being processed and stores the
information in the base station. In this processes power is being saved compared to other
processing methodologies.

46
IMPLEMENTATION OF AN ENERGY EFFICIENT CLUSTERING BASED DATA COLLECTION IN WSN

4.2. Cluster Head

The nodes send data to the respective cluster-heads, which in turn compresses the
aggregated data and transmits it to the base station. For a WSN the following
assumptions are made:

• The base station is located far from the sensor nodes and is immobile.

• All nodes in the network are homogeneous and energy constrained.

• Symmetric propagation channel.

• Base station performs the cluster-head election.

• Nodes have location information that they send to the base station with respective
energy levels during set up phase.

• Nodes have little or no mobility.

4.3. The Scenario with Packet Loss

Failure may not be rare in Wireless Sensor Networks. Clearly, if an update


message is lost, the dual prediction (cluster head and cluster member) will not be correct.
In that case, each node will perform a different prediction, therefore, leading to a possible
misbehavior. This is a key issue that needs to be addressed in applications. One possible
solution is by the cluster member replying as ACK message to cluster head. As for the
packets containing sensor readings, as long as the packet loss rate is not significant and
approximation is acceptable, the impact of failure could not be crucial. A few packet loss
rates do not have significant impact on the final results and thus it is not considered.

47
IMPLEMENTATION OF AN ENERGY EFFICIENT CLUSTERING BASED DATA COLLECTION IN WSN

4.4. Adaptive Update for System Input Changes

A dynamic set of parameters is considered for the linear prediction because in


practice, for many applications the model parameters and the error bound could be
dynamics after setup. In that case, the cluster head, after receiving the updated system
input from the sink, should re estimate the model parameters and diffuse to the cluster
member and justment is performed locally.

4.5. Performance Evaluation

To evaluate the performance of proposed framework, conduct a series of


experiments. It have been implemented the simulator; quantify several performance
aspects of algorithms. The simulation parameters are set based on hardware
configurations ofMICA2 [32]. In the implementation 36 nodes are created with 4 clusters,
each cluster consisting of 8 cluster nodes and one cluster head, sensor node reports the
data every 30 seconds, to measure the energy consumption on the unit of 30 seconds.
During every 30 seconds, the energy consumption is 200 mJ for active power, and 50 mJ
for inactive power. For transmission, the energy consumption is 10 mJ /byte, proposed
framework is inserted on top of the data routing layer. This work, did not consider the
mobile sensors. The communication model used is unit disk modeling which is typically
used in many previous works.

48
IMPLEMENTATION OF AN ENERGY EFFICIENT CLUSTERING BASED DATA COLLECTION IN WSN

4.6. Graphical Result


The result from the simulation has shown below in the line graph with variable nodes.
The simulation shows that enable/disable with sleep/awake algorithm consumed less
energy when compared to the existing scheme.

Figure4.1. Average Energy Consumption

49
IMPLEMENTATION OF AN ENERGY EFFICIENT CLUSTERING BASED DATA COLLECTION IN WSN

CHAPTER 5

CONCLUSION

A Framework for clustering based data collection with prediction for wireless
sensor network has been described. The detailed analysis and description of its two main
components, adaptive scheme to enable/disable prediction and integration of sleep/awake
algorithms for nodes is presented. An energy-aware predictor is used to find the trade-off
between communication and prediction cost. By using sleep/awake Algorithm energy
consumption is reduced and network life time is increased.
The usefulness of the framework is demonstrated by accommodating moving
object into the area. Via performance evaluation, it has been shown that it achieves
energy efficiency when sensor data is spatially and temporally correlated. To summarize,
the framework demonstrates that it is viable framework to facilitate data collection in
large-scale wireless sensor networks.

50
IMPLEMENTATION OF AN ENERGY EFFICIENT CLUSTERING BASED DATA COLLECTION IN WSN

CHAPTER 6
SCOPE FOR ENHANCEMENTS

The current layout was designed to bring out protocol based on a constant power
assumed to every node in the network initially. So as a future work the design of the
protocol can be worked with new ideas as per the need of the networking, moreover the
basics may be same but design can be modified to achieve the network needs.
Developing the project further involves performing experiments with the sets of
parameters as the time has to realize, and possibly other sets according to the results of
the experiments and the interrogations they raise. Even the existing results should be
confirmed with longer and larger experiments for a better reliability. The experiments
could also involve other evaluations characteristics such as performance, scalability and
mobility handling.
There are several other future directions. First, there should be real testing in real
sensor networks. Second the possibility of using more efficient algorithms to reduce the
computational prediction and aggregation techniques. Third to include mobile nodes with
spilt/merge algorithms used for clustering. Fourth is to further improve the framework in
order to facilitate applications such as object tracking. It is believed that this work has
achieved its goals, still there are a lot of possibilities to develop it and work on.

51
IMPLEMENTATION OF AN ENERGY EFFICIENT CLUSTERING BASED DATA COLLECTION IN WSN

APPENDIX I:

SCREEN SHOTS

Base Station & Nodes Assumption

Broadcasting Of Nodes:

52
IMPLEMENTATION OF AN ENERGY EFFICIENT CLUSTERING BASED DATA COLLECTION IN WSN

Simulation with Nodes in Splitted Cluster Heads

Cluster Formation

53
IMPLEMENTATION OF AN ENERGY EFFICIENT CLUSTERING BASED DATA COLLECTION IN WSN

Prediction Operation can be Enable/Disable& objective Node Created

54
IMPLEMENTATION OF AN ENERGY EFFICIENT CLUSTERING BASED DATA COLLECTION IN WSN

Adaptive Scheme to Enable/Disable Prediction Operations

55
IMPLEMENTATION OF AN ENERGY EFFICIENT CLUSTERING BASED DATA COLLECTION IN WSN

APPENDIX II
SAMPLE SOURCE CODE
BROADCAST .TCL
BEGIN {
p=0
Pks=64
Itv=0.5
}
{
If (FILENAME=="btemp") {
Stnd=$1
Ednd=$2
Tm=$3
itval=$4
Src=$5
}
If (FILENAME=="NNode.tr”) {
If ($1>=0 && $1<=100) {
n [p, 1] =$1
n [p, 2]=$2
n[p,3]=$5
p++
}
}
}
END {
# Acending order
for(x=0;x<p;x++)
{
56
IMPLEMENTATION OF AN ENERGY EFFICIENT CLUSTERING BASED DATA COLLECTION IN WSN

for(y=x+1; y<p;y++)
{

if(n[x,3]>n[y,3] && n[x,1]==n[y,1])


{
temp1=n[x,3]
n[x,3]=n[y,3]
n[y,3]=temp1

temp2=n[x,2]
n[x,2]=n[y,2]
n[y,2]=temp2
}
}
}

for(x=0;x<p;x++)
{
print n[x,1]" - " n[x,2]" - " n[x,3]
}

x=0
y=0
a[0]=src

for(s=stnd;s<=x;s++) #indicate Route order


{
src=a[s]
for(j=stnd;j<p;j++)

57
IMPLEMENTATION OF AN ENERGY EFFICIENT CLUSTERING BASED DATA COLLECTION IN WSN

{
f=1
if(src==n[j,1])
{
for(s1=0;s1<=x;s1++) #check chain format
{
if(a[s1]==n[j,2])
f=0
}
if(f==1)
{
m[x,1]=n[j,1]
m[x,2]=n[j,2]
a[x+1]=n[j,2]
x++

}
}
}
}

Print into file


for (i=0; i<x; i++)
{
Print m [i, 1] "------" m [i, 2] >"temp"
print "set inf"y" [attach-CBR-traffic $node_ ("m [i, 1]") $sink ("m [i, 2]") "pks" "itv"]" >
"S_broadcast.tcl"
print "$ns_ at "tm" \"$inf"y" start\"" > "S_broadcast.tcl"
print "$ns_ at "tm+itval" \"$inf"y" stop\"" > "S_broadcast.tcl"
Print "$ns_ at "tm" \"$node_ ("m [i, 2]") color maroon\"" > "S_broadcast.tcl"

58
IMPLEMENTATION OF AN ENERGY EFFICIENT CLUSTERING BASED DATA COLLECTION IN WSN

Print "$ns_ at "tm" \"$node_ ("m [i, 1]") color blue\"" > "S_broadcast.tcl"
Print "$ns_ at "tm+itval" \"$node_ ("m [i, 2]") color purple\"" > "S_broadcast.tcl"

If (m [i, 1] ==0)
Print "$ns_ at "tm+itval" \"$node_ ("m [i, 1]") color blue\"" > "S_broadcast.tcl"
Else
Print "$ns_ at "tm+itval" \"$node_ ("m [i, 1]") color purple\"" > "S_broadcast.tcl"

print ("$ns_ at "tm+0.025" \"$ns_ trace-annotate \\\"Node - "m[i,1]" send the Broadcast
message to its neighbor - "m[i,2]" \\\"\"") > "S_broadcast.tcl"
Y++
Tm=tm+0.035
}
}
CLUSTER.TCL
BEGIN {
p=0
Pks=64
Itv=0.05
}
{

if (FILENAME=="atemp") {
Stnd=$1
ednd=$2
tm=$3
itval=$4
Src=$5
flg=$6
}

59
IMPLEMENTATION OF AN ENERGY EFFICIENT CLUSTERING BASED DATA COLLECTION IN WSN

if (FILENAME=="NNode.tr”) {
if($1>=0 && $1<=100) {
n[p,1]=$1
n [p,2]=$2
n [p, 3] =$5
n [p, 4] =$3
n [p, 5] =$4
P++
}
}
}

END {

For(x=0; x<p; x++)


{
nn[x,1]=n[x,1]
nn[x,2]=n[x,2]
nn[x,3]=n[x,3]
nn[x,4]=n[x,4]
nn[x,5]=n[x,5]
}

# Acending order
for(x=0;x<p;x++)
{
for(y=x+1;y<p;y++)
{

60
IMPLEMENTATION OF AN ENERGY EFFICIENT CLUSTERING BASED DATA COLLECTION IN WSN

if(n[x,3]>n[y,3] && n[x,1]==n[y,1])


{
temp1=n[x,2]
n[x,2]=n[y,2]
n[y,2]=temp1

temp2=n[x,3]
n[x,3]=n[y,3]
n[y,3]=temp2

temp3=n[x,4]
n[x,4]=n[y,4]
n[y,4]=temp3

temp4=n[x,5]
n[x,5]=n[y,5]
n[y,5]=temp4

}
}
}

#----------Finding cluster heads----------------


pp=0
for(x=0;x<p;x++)
{
if((n[x,4]==220 || n[x,4]==820) && (n[x,5]==225 || n[x,5]==645) )
clt[pp++]=n[x,1];

61
IMPLEMENTATION OF AN ENERGY EFFICIENT CLUSTERING BASED DATA COLLECTION IN WSN

if(flg==1)
{

print "$ns_ at "tm" \"$ns_ trace-annotate \\\"All Cluster Head Using Adaptive Scheme for
Enable/Disable Prediction Operations \\\"\"" > "cluster.tcl"

#----remove Duplicate nodes --------


w=0
for(x=0;x<pp-1;x++)
{
temp=clt[x]
pos=1
for(y=x+1;y<pp-1;y++)
{
if(temp==clt[y])
pos=0
}
if(pos==1)
mb[w++]=temp
}

#for(x=0;x<w;x++)
# print "----------"mb[x]

for(x=0;x<w;x++)
{

62
IMPLEMENTATION OF AN ENERGY EFFICIENT CLUSTERING BASED DATA COLLECTION IN WSN

for(y=0;y<p;y++)
{
if(n[y,1]==mb[x])
{
print "set inf"y" [attach-CBR-traffic $node_("mb[x]") $sink("n[y,2]") "pks" "itv"]" >
"cluster.tcl"
print "$ns_ at "tm" \"$inf"y" start\"" > "cluster.tcl"
print "$ns_ at "tm+itval" \"$inf"y" stop\"" > "cluster.tcl"

if(flg==0)
print ("$ns_ at "tm+0.025" \"$ns_ trace-annotate \\\"Node - "mb[x]" send the CHADV
message to its neighbor - "n[y,2]" \\\"\"") > "cluster.tcl"
if(flg==1)
print ("$ns_ at "tm+0.025" \"$ns_ trace-annotate \\\"Node - "mb[x]" send the Adaptive
Scheme message to its neighbor - "n[y,2]" \\\"\"") > "cluster.tcl"

tm=tm+0.035
}
}
}

if(flg==1)
{

#----get corner node --------


kl=0
for(y=0;y<w;y++)
for(x=0;x<p;x++)
if(nn[x,1]==mb[y])

63
IMPLEMENTATION OF AN ENERGY EFFICIENT CLUSTERING BASED DATA COLLECTION IN WSN

{
agg[kl++]=nn[x,2]
agg[kl++]=nn[x+2,2]
agg[kl++]=nn[x+5,2]
agg[kl++]=nn[x+7,2]
break
}

#for(y=0;y<kl;y++)
# print agg[y]

#----remove corner node and Cluster node --------


pos=1
p1=0
for(x=0;x<p;x++)
{
for(y=0;y<w;y++)
if(nn[x,1]==mb[y])
pos=0

for(y=0;y<kl;y++)
if(nn[x,1]==agg[y])
pos=0
if(pos==1)
fin[p1++]=nn[x,1]

pos=1
}
#----remove Duplicate nodes --------
w=0

64
IMPLEMENTATION OF AN ENERGY EFFICIENT CLUSTERING BASED DATA COLLECTION IN WSN

for(x=0;x<p1-1;x++)
{
temp=fin[x]
pos=1
for(y=x+1;y<p1-1;y++)
{
if(temp==fin[y])
pos=0
}
if(pos==1)
fnode[w++]=temp
}

for(x=0;x<w;x++)
{
if(fnode[x]!=0)
print "$ns_ at "tm" \"$node_("fnode[x]") color white\"" > "cluster.tcl"
}
}

65
IMPLEMENTATION OF AN ENERGY EFFICIENT CLUSTERING BASED DATA COLLECTION IN WSN

REFERENCES

[1] Arnau dov.V, (2005), “Unified Management of Heterogeneous Sensor Networks


in the Atlantis Framework,” Department of Computer Science, Brown University.
Walsaip Research project. Technical report(TR-NCIG-0501).
http://users.cis.fiu.edu/~meraz001/TR-NCIG-0501.pdf.

[2] Bjarne Stroustrup(January1982) Classes: “An Abstract Data Type Facility for the
C Language,”ACM SIGPLAN Notices.Revised version of [Stroustrup 1980].

[3] Blough . D. Leoncin. M i. Resta. G and Santi . P (2002), “On the Symmetric
Range Assignment Problem in Wireless Ad Hoc Networks,” In proceedings of
the2nd international IFIP Conference on Theoretical Computer Science pp 71-82.

[4] Calinescu .G, Mandoiu.I and Zelikov sky.A, (2002) “Symmetric Connectivity
with Minimum Power Consumption in Radio Networks,” in proceedings of the2nd
IFIP international Conference on Theoretical Computer Science.
kluwer,Dordrecht.IFIP conference proceedings, vol 223, pp.119-130

[5] Cerpa .A and Estrin .D, (2004) “ASCENT: Adaptive Self-Configuring Sensor
Networks topologies,” in Proceedings of IEEE Transcations on Mobile
Computing, pp272-285.

[6] Chen. B, Jamieson. K , Balakrishnan. H, and Morris. R, (September 2002) “Span:


An Energy-Efficient Coordination Algorithm for Topology Maintenance in Ad
Hoc Wireless Networks,” ACM Wireless Networks,journal, vol. 8, no. 5,pp481-
494.

66
IMPLEMENTATION OF AN ENERGY EFFICIENT CLUSTERING BASED DATA COLLECTION IN WSN

[7] Chu . D, Deshpande. A, Hellerstein. J. and Hong .W, (2006) “Approximate Data
Collection in Sensor Networks Using Probabilistic Models,” Proc. IEEE
International Conference. Data Eng. (ICDE),pp48-59.

[8] Clementi . A, Penna . P and Silvestre . R, (2000) “Hardness Results forth Power
Range Assignment Problem in Packet Radio Networks,” in proceedings of the
17thAnnual Symposium on Theoretical Aspects of Computer Science (STACS),
pages 651–660.

[9] Chang J.-H and L. Tassiulas, (Mar. 2000) “Energy conserving routing in wireless
ad-hoc networks,” in Proceedings of IEEE INFOCOM, Tel Aviv, Israel. pp 22-31.

[10] Goel. S and Imielinski. T (2001), “Prediction-Based Monitoring in Sensor


Networks: Taking Lessons from Mpeg,” Acme Sitcom Computer Comm. Rev.,
vol. 31, no. 5, pp. 82-98.

[11] Heinzelman .W. Chandrakasan .A, and Balakrishnan . H, ( October 2002) “An
Application-Specific Protocol Architecture for Wireless Micro sensor Networks,”
IEEE Transactions on Wireless Communications, Vol. 1, no. 4, pp. 660–670.

[12] Heinemann. W, Chandrakasan .A and Balakrishnan .H, (Jan, 2000) “Energy-


Efficient Communication Protocol for Wireless Micro sensor Networks,” In Proc.
33rd HICS, 4-7.Vol 2, pp. 10.

[13] Hill. J. Szewczyk. R, Woo. A, Holler. S, Culler. D, and. Pister. K, (November


2000) “ System Architecture Directions for Networked Sensors, proceeding of
ASPLOS-IX,”Cambridge, MA, USA.

[15] Intanagonwiwat .C, Govindan. R and Estrin. D (2000), “Directed Diffusion: A


Scalable and Robust Communication Paradigm for Sensor Networks,” in

67
IMPLEMENTATION OF AN ENERGY EFFICIENT CLUSTERING BASED DATA COLLECTION IN WSN

Proceedings of the ACM/IEEE International Conference on Mobile Computing


and Networking.

[16] Jamal-dean Abdulla, (April 2009) “Probabilistic Route Discovery for Wireless
Mobile Ad Hoc Networks (MANETs),” Phd thesis, University of
Glasgowhttp://eleanor.lib,gla.ac.uk/record=b2663808.http://theses.gla.ac.uk./id/ep
rint/719.

[17] Jiang Et Al Hongbo, Shudong Jin, Chonggang Wang, (June 2011), Prediction or
Not? “An Energy-Efficient Framework for Clustering Based Data Collection in
Wireless Sensor Networks,” IEEE Transactions on Parallel and Distributed
Systems, Vol. 22, No. 6.

[18] Kawadia. V and Kumar. P. R., (April 2003) “Power Control and Clustering in Ad
Hoc Networks,” In Proceedings of IEEE INFOCOM.vol-1 pp 459-469.

[19] Kirousis. L, Kranakis. E, Krizanc. D and Pelf. A (2000) “Power Consumption in


Packet Radio Networks,” Theoret Computer Science. pp. 289 – 305.

[20] Kulik. J, Heinemann...W, and Balakrishnan.V, (2002). “Negotiation-Based


Protocols for Disseminating Information in Wireless Sensor Networks,” ACM
Wireless Networks, vol.8, no. 2-3, pp. 169–185.

[21] Mahesh K. Marina and Samir Ranjan Das. S.R, (June 2002)In Proceedings of
the 3rd ACM International Symposium on “Mobile Ad Hoc Networking and
Computing, ”Mobile Ad-Hoc, Lausanne, Switzerland Source: DBLP ISBN 1-
58113-501-7, pp. 12-23.

[22] McConnell .S.M. and Skilli corn. D.B. (2005) “A Distributed Approach for
Prediction in procedding of 1st international workshop ondata mining in Sensor

68
IMPLEMENTATION OF AN ENERGY EFFICIENT CLUSTERING BASED DATA COLLECTION IN WSN

Networks,” As part of the SIAM International Conference on data mining,pp-28-


37.

[23] Meka. A and Singh. A. K (2006) “ Distributed spatial clustering in sensor


networks,” In Proceedings of Extending Data Base Technology pp.980-1000.

[24] Miguel Angel Erazo Villegas, Seok Yee Tang ,Yi Qian. “Wireless Sensor
Network Communication Architecture for Wide-Area Large Scale Soil Moisture
Estimation and Wetlands Monitoring Alsip,” Research Project, Technical Report,
Tr-Ncig-0501.

[25] Narayanaswamy. S, Kawadia. V, Sreenivas. R. S., and P. R. Kumar, (February


2002,) “Power Control in Ad-Hoc Networks: Theory, Architecture, Algorithm and
Implementation of the COMPOW protocol,” In proceedings of European
Wireless conference, pp. 156–162.

[26] NS2, NAM, - http://www.isi.edu/nsnam/ns/tutorial/nam.txt.

[27] Osama Younis and Sonia Fahmy. (2004). “HEED: A Hybrid Energy Efficient ,
Distributed Clustering Approach for Ad-hoc Sensor Networks,” IEEE
Transactions on Mobile Computing, volume 4, issue 4, pp. 366-379.

[28] Pourahmadi. M, (2001) “provides a foundation for times series analysis and
prediction theory for researchers and advanced students.” SciTech Book News,
John Wiley & Sons .Vol. 25, No. 4.

[29] Rodoplu. V and Meng.T, ( 1999.) “Minimum Energy Mobile Wireless


Networks,” IEEE J. Select areas Comm., pp. 1333 – 1344.

69
IMPLEMENTATION OF AN ENERGY EFFICIENT CLUSTERING BASED DATA COLLECTION IN WSN

[30] Santi. P. and D. M. Blough. ( 2003) “The Critical Transmitting Range for
Connectivity in Sparse Wireless Ad Hoc Networks,” IEEE Trans. Mobile
Computing, vol. 2, no. 1, pp. 25-39.

[31] Silberstein . A, Braynard . R, Filpus. G, Puggioni. G, Gelfand. A, Munagala K,


Yang J,( 2007) “Data-Driven Processing in Sensor Networks,” In CIDR Third
Biennial Conference on Innovative Data Systems Research, Asilomar, CA, USA.
www.cidrdb.org 2007. pp 10-21.

[32] Sims.M, goldman .C,V. lesser.(2005)“Self-Organization through Bottom-up


coalition formation,” I n Proceedings of the second international join conference
on Autonomous agents and multi agent systems,pp867-874.

[33] Toh C-K (2007), “Ad Hoc Mobile Wireless Networks-Protocols and Systems,
Pearson Education,” Edition-, ISBN- 978-8-1317-1510-9.

[34] Tulane. D and Madden. S, (2006) “An Energy-Efficient Querying Framework in


Sensor Networks for Detecting Node Similarities,” Proceedings of IEEE/ACM
International Conference. Modeling, Analysis, and Simulation of Wireless and
Mobile Systems (MSwim).

[35] W L Lee, Datta. A, Cardell Oliver. R, Flexi TP, (2008). “A flexible-schedule-


based TDMA protocol for fault-tolerant and energy-efficient wireless sensor
networks,” IEEE Trans Parallel Distribute System 19(6), pp 851–864.

[37] Younis. O, Krunz . M, and S. Rama subramanian, (May/June 2006) “Node


Clustering in Wireless Sensor Networks: Recent Developments and Deployment
Challenges”, IEEE Network, vol. 20, no. 3, pp. 20-25.

70
IMPLEMENTATION OF AN ENERGY EFFICIENT CLUSTERING BASED DATA COLLECTION IN WSN

[38] Xu .Y, Heinemann. J, and Estrin. D, (July 2001) “Geography-Informed Energy


Conservation for Ad Hoc Routing,” In Proceedings of the ACM/IEEE
International Conference on Mobile Computing and Networking Rome, Italy, pp.
70-84.

[39] Xu . Y. and W.-C. Lee, (2003) “ On Localized Prediction for Power Efficient
Object Tracking in Sensor Networks,” International Conference of Distributed
Computing Systems Workshop, pp. 434-439.

71

Вам также может понравиться