You are on page 1of 60

EFFECT OF NODE TO BEACON RATIO ON

ACCURACY IN LOCALIZATION OF WIRELESS


SENSOR NETWORK

A DISSERTATION REPORT

Submitted By
MONA GUPTA
Enrollment no-162B002

Under the guidance of: Mr. Nileshkumar R. Patel

May-2018

Submitted in partial fulfillment for the award of the Degree


of
MASTER OF TECHNOLOGY
IN
COMPUTER SCIENCE AND ENGINEERING

Department of Computer Science & Engineering


JAYPEE UNIVERSITY OF ENGINEERING AND TECHNOLOGY
A-B ROAD, RAGHOGARH, DIST. GUNA - 473226, M.P., INDIA
DECLARATION BY THE STUDENT

I hereby declare that the work reported in the M Tech Dissertation entitled as
“Effect of Node to Beacon Ratio on Accuracy in Localization of Wireless
Sensor Networks”, in partial fulfillment for the award of degree of Master of
Technology, submitted at Jaypee University of Engineering and Technology, Guna,
as per best of my knowledge and belief there is no infringement of intellectual
property right and copyright. In case of any violation I will solely be responsible.

Signature of student
(Mona Gupta)
Department of computer science & Engineering
Jaypee University of Engineering and Technology
Guna(M.P.)

i
CERTIFICATE

This is to certify that the thesis entitled “Effect of node to beacon ratio in
localization of wireless sensor network”, submitted by Mona Gupta (162B002)
to the Department of Computer science Engineering, Jaypee University of
Engineering and Technology, Guna has been carried out under my supervision. As
per best of my knowledge and belief there is no infringement of intellectual
property right and copyright. Also, this work has not been submitted partially or
wholly to any other University or Institute for the award of this or any other degree
or diploma. In case of any violation concern student will solely be responsible.

Signature of supervisor

(Nileshkumar R. Patel)

Assistant Professor,

Department of CSE

Date: _ /_ /_

ii
ACKNOWLEDGEMENT

The work posed in this thesis is by far the most substantial attainment in my life
and it would be unimaginable without people who affirmed me and believed in me.
First and foremost I evince my profound reverence and deep regards to my guide
Mr. Nileshkumar R. Patel, Assistant Professor, Department of Computer
Science and Engineering for exemplary guidance, supervising and constant
encouragement throughout the course of this thesis. A gentleman embodied, in true
form and spirit, I consider it to my good fortune to have consociated with him.

I would like to evince a deep sense of gratitude to estimable Prof. Shishir Kumar
HOD, Department of Computer Science and Engineering & Dean(A & R),
Head of the Department of Computer Science Engineering for providing us with
best facilities and his timely suggestions

I want to thank all other faculty members of Department of Computer Science


Engineering for their constant support and encouragement during my research. I
would like to thank all my friends who made my journey at JUET Guna an
indelible and gratifying experience.

Finally, my heartfelt gratitude towards my family for their tireless love and support
throughout my life. They taught me the value of hard work by their own life
example. They gave me tremendous support during my stay in JUET Guna.

Signature of Student
(Mona Gupta)
Date: _ / _ / _

iii
ABSTRACT

Wireless sensor network is one of the main areas of research in the world of
networking systems today and a study of networking systems is incomplete without
an understanding of the location of sensor nodes. This was the main reason for
selecting a project focusing on this field.

There is lot of research in the field of localization. Localization is used in many


applications such as packet tracing, tracking, monitoring and many more.

With the range of application scenario, it is challenging task to design a localization


module for a wireless sensor network consisting of sensor node with limited
capacity in term of power, processing and storage etc.

By reducing the communication done by a node, we can enhance the lifetime of a


node as communication overhead is the major contributor towards energy
consumption.

Computation overhead also has a significant role in enhancing or decreasing the


lifetime of a node. Accuracy of the estimation is also a critical issue that must be
considered while designing any algorithm. Several checks were implemented to
keep accuracy level of the estimation high and to reduce the error of estimation.
This paper simply presents the effect of node to beacon ratio on accuracy. How
accuracy will affect the location accuracy when we change the beacon number in
the deployed area.

iv
LIST OF FIGURES

Description Page no.


Fig No.
Fig 2.1 Beacon node and unknown node 4

Fig 2.2 Wireless sensor network 5

Fig 2.3 Protocol stack of different layer 6

Fig 2.4 Architecture of special node 7

Fig 2.5 Application of Sensor network 8

Fig 3.1 Three component of localization system 10

Fig 3.2 (a)ToA (b)ToA using RTT (c)TDoA 11

Fig 3.3 Angle of Arrival 13

Fig 3.4 Distance calculation using Hop count 14

Fig 3.5 Taxonomy of Localization technique 15

Fig 3.6 Taxonomy of range free localization technique 16

Fig 4.1 Geometric technique for localization(GAB) 22

Fig 4.2 Localization by using CAB. 24

Fig 5.1 Architecture of NS2 27

Fig 5.2 The new modules added to the ns-2 27

Fig 5.3 The structure of the extended ns-2 29

Fig 5.4 Node configuration 31

Fig 5.5 Node deployment in network 35

Fig 5.6 Network topology after sometime of simulation 35

Fig 5.7 Mean location error v/s Beacon nodes 36

v
LIST OF TABLE

Table-No Figure Name Page No


Table-1 Comparative study of localization of WSN 19

Table-2 Simulation Parameter 33

Table-3 Scenario-1 35

Table-4 Scenario-2 35

vi
ABBREVIATIONS

WSN Wireless Sensor Network


GPS Global Positioning System
AoA Angle of Arrival
ToA Time of Arrival
TDoA Time Difference of Arrival
RSSI Received Signal Strength Indicator
DV Distance Vector
APS Ad-Hoc Positioning System
NS-2 Network Simulator 2
TCL Tool Command Language
NAM Network Animator

vii
TABLE OF CONTENTS

Certificate i

Declaration By The Student ii

Acknowledgement iii

Abstract iv

List of figures v

Abbreviation vi

1 INTRODUCTION

1.1 Objective of project 2

1.2 Organization of thesis 2

2 WIRELESS SENSOR NETWORK

2.1 Wireless Sensor network 3

2.2 Protocol Stack of WSN 4

2.3 Key Issue of WSN 5

2.4 Type of Sensor Nodes 6

2.5 Architecture of Sensor Node 7

2.4 Application of WSN 7

3 LOCALIZATION IN WSN

3.1 Localization System

3.1.1 Distance estimation 9

3.1.2 Position Computation 9

3.1.3 Localization Algorithm 10

3.2 Stages of Localization

viii
3.2.1 Time of Arrival 11

3.2.2 Time Difference of Arrival 12

3.2.3 Received signal strength of indication 13

3.2.4 Angle of Arrival 14

3.2.5 Hop Count 14

3.3 Localization Technique

3.3.1 Centralized localization Technique 15

3.3.2 Distributed Localization Technique 16

3.3.3 Range Based Localization Technique 17

3.3.4 Range Free Localization Technique 18

3.4 Limitations in Localization Technique 19

4 LITERATURE SURVEY

4.1 A Range Based Localization System in Multihop Wireless Sensor 21


Networks: Distributed Cooperative Approach

4.2 A Range Free Geometric Technique for Localization of Wireless 22


Sensor Network (WSN) Based on Controlled Communication
Range

4.3 Concentric Anchor Beacon Localization Algorithm for Wireless 24


Sensor Networks

5 NETWORK SIMULATION OVERVIEW

5.1 The extended ns-2 26

5.2 The complete Class hierarchy of new module 28

5.3 The structure of the new ns-2 29

5.4 Guidelines for running the simulation 30

5.5 Simulation Parameter 34

ix
6 CONCLUSION & FUTURE WORK 37

7 REFERENCES 38

8 APPENDIX A 41

9 PERSONAL DETAIL 49

x
CHAPTER 1

INTRODUCTION

A wireless network is a decentralized network. Wireless network has three types .Since it
does not rely on pre existing infrastructure .This make network “Anywhere and anytime
computing”. Fig 1.1 shows classification of wireless ad-hoc network.

Wireless adhoc network

Wireless mess network Wireless sensor network mobile adhoc network

Fig 1.1 Classification of Wireless Ad-hoc Network

Now days, Wireless Sensor Networks (WSN) are emerging as a challenging and interesting
area. Wireless Sensor Network is made of a large number of heterogeneous or homogeneous
sensor nodes which communicates through wireless medium and works together to sense or
monitor the environment. The number of sensor nodes in a network can vary from hundreds
to thousands. The node senses data from environment and sends these data to the gateway
node. Mostly WSNs are used for applications such as military surveillance and disaster
monitoring. WSNs are multi-hop networks, which depend on the intermediate nodes to relay
the data packet to the destination. These nodes are equipped with lesser memory, limited
battery power, little computation capability, small range of communication and need a
secured and efficient routing path to forward the incoming packet delay by data aggregation)
and multipath sensor networks to increase the resilience and reliability of the network. The
localization information is crucial for the operation of WSN [1].

The general goal is to make wireless sensor network is capable to sense the surroundings,
compute some task and communicate with each other to attain some objective like monitoring
some phenomenon, target tracking, forest fire detection, and battlefield surveillance.

1
1.1 Objective

The localization algorithm should have adaptation quality to the change in the number of
beacon nodes. If the number of available beacon nodes changes, the algorithm should still be
able to provide location estimates. However, the accuracy of node estimates will change with
the change in number of available beacon nodes. In general, with a higher number of beacon
nodes, a localization algorithm is able to compute more accurate estimates of node positions. I
will opt for scenarios making vary the anchors number and the sensors number and find the
effect of that variation on accuracy in localization.

1.2 Organization of Thesis

Chapter two of this thesis describe about Wireless networks. Third chapter provide
Localization in wireless sensor network and fourth chapter describes literature survey and
fifth chapter describe about network simulation tool and last chapter include conclusion and
future work.

2
CHAPTER 2

WIRELESS NETWORKS

2.1 Wireless sensor network

Wireless sensor network made up of large number of static and mobile sensor nodes that are
small, intelligent, and cheap, multi functional..These sensor nodes form a wireless network.
These sensor nodes can sense the environmental condition and gather information and data
from environment and transmit the sensed data to the user. These sensor nodes can connect
with some wireless interface through which they can communicate to each other. Sensor
nodes are used to monitor physical and environmental conditions such as temperature , sound
,pressure and pass their data to other location Wireless sensor network was motivated by
military application but now a day’s wireless sensor network are using in many applications
such as monitoring ,health monitoring ,target tracking and so on Battery is the main power
source in sensor node..

WSN can be two types:

Unstructured WSN: An unstructured WSN has many nodes or dense connection between
nodes. Failure detection in unstructured WSN is very difficult due to dense network

Structure WSN : In structured WSN all or some sensor nodes are deployed in pre-planned
manner and In this we can deploy some nodes with lower network maintenance and cost
performance of WSN is depends on various factors such as node localization, deployment,
routing, synchronization, data aggregation etc.

During deployment Nodes in WSN are not aware of their location. Location awareness is
necessary. Without Knowing the location of Node collected data is useless

Beacon Node

Unknown Node

Monitor Area

Fig 2.1 Beacon node and unknown node

3
The general goal is to make wireless sensor network that is capable to sense the surroundings,
compute some task and communicate with each other to attain some objective like monitoring
some phenomenon, target tracking, forest fire detection, and battlefield surveillance. In the
majority of the applications, location information of every node is needed. However, in a
large amount of cases, sensor nodes are deployed randomly right through some region. Thus,
the first task is to find out the location of the nodes. To find out the physical location of sensor
node in WSN operation is crucial problem because of its use in (i) identification of the origin
of sensor reading, (ii) energy aware geographic routing, (iii) self organization and self
configuration of networks. Apart from the above, in various applications the location itself is
information of interest. There is one easy way i.e. manual configuration but this is impractical
in large scale deployment. Simple wireless sensor network is shown in figure 2.2.

Fig 2.2 Wireless Sensor Network

2.2 Protocol stack of wireless sensor network.

Protocol stack of WSN has 5 layers:


(i) physical layer,
(ii) data-link layer,
(iii) network layer,
(iv) transport layer,
(v) application layer
An overview of protocol stack and the functions performed by each layer is depicted in the fig
2.3.

4
Fig 2.3 protocol stack of different layers

2.3 Key issues in wireless sensor network

(i) Energy Efficiency: Sensor nodes have limited battery capacity. This puts a
constraint for other applications and on the lifetime of sensor node. Major sources
of battery drainage include: (i) continuous sensing, (ii) transmission and reception
modes of radio. Therefore algorithms are developed to increase the energy
efficiency and this includes techniques of data compression, data fusion (removal
of data redundancy), rotation of cluster heads, and adaptive mechanisms for radio
operations.
(ii) Routing: Topology of WSN changes too frequently; as new nodes are added or
some nodes die due to meagre resources. Therefore, to increase the connectivity,
coverage, and remain updated of network topology, neighbour information should
be disseminated timely.
(iii) Time Synchronization: Synchronizing time in sensor nodes serves as a basic
prerequisite for various applications and protocols such as Time division multiple
access (TDMA), Time difference of Arrival (TDoA), Time of arrival (ToA) and so
on. Basic property of WSNs, i.e., co-operation in communication, computation,
sensing and actuation of different nodes solely depends on the time
synchronization among nodes
(iv) Fault-Tolerance: Reliability in WSNs is often affected by various faults arising
from environmental hazards, battery depletion, and hardware malfunctioning.

5
Individual node failures should not affect the global performance of WSNs. In
such cases, purpose of WSN is achieved by techniques such as load balancing, etc.
Nodes should have the capability of self-testing, self-calibrating, and self-
recovering and so on.
(v) Localization: For WSN, localization of node is one of the most important issue.
Information collected by a sensor node becomes useful when its location is known.
After finding the location of node geographical routing is possible and other issues
like spatial querying and load balancing, tracking can also be achieved.
(vi) Security: This is one of the critical issues in WSN deployments - where the
purpose is to get battle-field awareness or vigilance in confidential data monitoring
systems. In such cases, a node can be compromised at any layer if the security is
not properly implemented say:
(a) At application layer - to send the bogus data,
(b) At network layer - to change the routing information,
(c) At data-link layer - to schedule data transfer at inappropriate time slots
resulting in network jam.

And in such cases WSN should enable: (i) intrusion detection to prevent the integrity of
collected information, (ii) authentication system - to keep information privacy.

2.4 Type of sensor node:

Beacon Node: Location of beacon nodes are known with the help of GPS or Manual
Configuration. Beacon node broadcast its information to other nodes using beacon message.
Beacon node are used to estimate the distance of unknown node

Unknown Node: whose location is unknown? Many localization techniques are used to
estimate the distance of unknown node. Unknown node use position of beacons to estimate
their position.

Special nodes: Special nodes are localized with respect to anchor nodes.

Processor
Memory
Analogue /Digital circuit
Power Source
Fig 2.4 Architecture of special node

6
2.5 Architecture of sensor network

Fig 2.5 Architecture of sensor network

2.6 Applications of wireless sensor network

Application of WSN depends on the field of their deployment. There are many applications

 Area monitoring
 Environmental monitoring
 Disaster Relief Applications
 Health and medical monitoring
 Industrial monitoring
 Military (enemy tracking)
 Business (human tracking)
 Habitat
 Public/transport tracking

Area Monitoring: Sensor nodes are deployed in areas where some actions are to be
monitored; like the position of the enemy can be monitored by sensor nodes, and this
information is send to the base station for further processing. Sensor nodes can also be used to
monitor vehicle movement.

7
Environmental monitoring: Wireless sensor network have many applications in
environment like forest and ocean. Sensor network are deployed in forest to detect fire or any
other activity and also monitor animal activities.

Disaster Relief Applications: The most often mentioned application of WSN is disaster relief
application. For example in wildfire detection, sensor nodes that are equipped with
thermometers can observe the current temperature of the surroundings and produces a
temperature map of the area. Based on this data, alert can be generated before the actual
disaster situation appears. Another example is of sensing moisture value, speed of wind and
pressure to forecast rain probabilities within a specific region.

Medical and Healthcare Monitoring: Condition of patient can be monitored by medical


sensor nodes. Patient’s conditions, blood pressure, sugar level etc can be monitored by Doctor
with the help of sensor nodes.

Industrial monitoring: Sensor nodes are used to monitor the activities of industries .Sensor
monitors the process of making goods.

Military (enemy tracking): Military applications require sensor networks to detect enemy
troupes and many other military operations. For military operations, it is essential that sensor
nodes should be cheap enough so that there should not be an issue if sensor node gets
destroyed during its operation [4]

Public/transport tracking: Range of applications of WSN in Traffic Management System is


very vast. Sensors may be deployed to sense the traffic at particular locality and action plans
can be created to reduce traffic from congested areas using the data provided by the sensors .

8
CHAPTER 3
LOCALIZATION IN WIRELESS SENSOR NETWORK

3.1 Localization system


The objective of localization is to find the physical coordinates of sensor nodes. These
coordinates can be of two types either global or relative. Localization is achieved with the
help of a few location aware nodes usually referred as seeds/anchor nodes/beacon nodes.
These anchor nodes are either manually programmed with their physical position or use the
global positioning system (GPS) to determine their location [2].
There are three different stages in localization as shown in Figure3.1.

Fig 3.1 Three components of localization system

3.1.1 Distance/angle estimation

For computing location of node distance/angle calculate the physical relationship between two
nodes. Different type of approaches can be used for this purpose like directional antennas [5],
radio frequency (RF) fingerprinting (communication neighbour authentication) [6],
connectivity (in range) [7], and distance bounding [8]. Practically, these approaches use
several techniques, including RSS, ToA, and time difference of arrival (TDoA), angle of
arrival (AoA) or round-trip time (RTT).

3.1.2 Position computation

Position computation determines the node’s position based on available data or information
about the distance calculated from the previous step distance/angle estimation and position of
references. Recognized techniques are used in position estimation like triangulation [9],
Trilateration [10] and multilateration [11]. In the triangulation technique, an unknown
9
measure AoA of at least three beacons and then uses the simple geometric relationships to
estimate its position. One potential problem of the AoA approach is the expense of equipment
to obtain precise angle estimates [12]. Trilateration also uses the geometry of a triangle to
estimate nodes' position. However, instead of using AoA, it uses the location of and the
distance to at least three beacons. The multilateration technique estimates location by solving
the mathematical intersection of multiple hyperbolas [13]; it is also based on the location of
and the distance to three or more beacons. The proposed localisation algorithm follows the
multilateration technique.

3.1.3 Localisation algorithm

Localisation algorithm is the primary component of a localisation system. This algorithm is


used to manipulate the information and data to enable the sensor nodes to estimate node’s
position. These algorithms can be centralised (global) or distributed. The centralised
algorithms [14] are powerful and estimate the nodes’ position with high accuracy. However,
they have a high communication and computational requirement, which is usually not
available in WSNs. To reduce the communication overhead, various distributed localisation
algorithms have been proposed, which decompose the global estimation system into sub-
systems and then iterate over these sub-systems. Several iterative techniques have been
followed. For instance, [15] uses references’ location information and local computation to
localise unknown nodes iteratively, while [16] uses shortest-path approximation to the
reference node to approximate Euclidean distances. The third technique uses local refinement
[17], which requires an initial solution. The disadvantage of iterative techniques is the effect
of error propagation and accumulation, which is less prominent in centralised algorithms.

3.1.4 Multilateration method

By using this method, with the help of at least three beacons an unknown node can estimate
their location. As shown in Figure 3.2, a node has m number of reachable beacons with some
information like location of beacon j and dj is the measured distance to it. Let us assume
that(𝑥 , 𝑦 ) is the approximated position of the sensor node, the error of the measured distance
to beacon j are showing in eq. 3.1.

Error = dj – (𝑥 − 𝑥𝑗) + (𝑦 − 𝑦𝑗) ) ……………. 3.1

10
Fig: 3.2 Multilateration

3.2 Stages of localization

This refers to the measurement of distance or angle between the transmitter and receiver node.
Distance/Angle estimation is the pre-requisite for remaining two phases of localization
Different techniques for distance/angle estimation include: time of arrival (ToA), time
difference of arrival (TDoA), received signal strength indicator (RSSI), and angle of arrival
(AoA).

3.2.1 Time of Arrival

This technique estimates the distance by calculating the time required by a signal to traverse
from transmitter to receiver. Types of signal used includes: RF, acoustic, infrared and
ultrasound. GPS enabled devices use this technique for distance estimation [18].

11
Figure 3.3 (a) ToA, (b) ToA using RTT, (c) TDoA

Let node A be the sender and B the receiver, ta is the time at which a signal is transmitted
from A and tb be the time at which it is received at B, and v be the velocity of signal. Distance
d between A and B is estimated as:

d = (tb −ta) × v ......... (3.2)

Since, nodes are mostly not synchronized; distance between nodes at various instances as
calculated above may vary. Also, the signal (mostly ultrasound signals) speed may vary. This
is because they are often affected by temperature, humidity and pressure. Therefore, to
remove the problem of synchronization ToA is reformed with round trip time (RTT). This is
shown in figure 3.3(b). Node A transmits a signal at ta1 and node B receives at Distance d is
calculated as:

d = (((ta2 −ta1) − (tb2 −tb1)) × v)/2.......... (3.3)

3.2.2 Time Difference of Arrival

It uses two different signals say RF and ultrasound signal of different velocity. This removes
the need of synchronization between the nodes. In TDoA, each node has a speaker and a
microphone. It is shown in figure 3.3(c). Node A transmits a radio signal with velocity v 1 at
ta1 and node B received the signal at t b1. Distance d calculated as

d = (tb1 −ta1) ×v1 .......... (3.4)

After some delay (possibly 0) node A transmit an ultrasound signal with velocity v 2 at ta2 and
node B received the signal at tb2. Distance d calculated as

12
d = (tb2 −ta2) × v2 .......... (3.5)

Solving equation 3.4 and 3.5 we get d as

d = (tb2 −ta2) − (tb1 −ta1)) × [ v1 ×v2 /v1 −v2] ....... (3.6)

3.2.3 Received signal strength of indication:

Radio signal attenuates as the distance between the sender and receiver increases. With the
increase in distance, strength of radio signal decreases exponentially. The attenuation in signal
strength is measured by the receivers received signal strength indicator (RSSI) circuit. RSSI
estimates the distance covered by a signal to the receiver by measuring the

Pr (d) = PλGtGrλ2/ 4π*2dnL ........... (3.7)

Where Pλ is the transmitted power, Gt and Gr is the antenna gain of the transmitter and
receiver respectively, L means system loss, and λ is the system wavelength. Usually G t, Gr,
and L are set to 1.

Pr (d) = Pr (d0) + 10·η·log (d / d0) + Xσ ……...... (3.8)

where d is distance from transmitter to receiver, η is path loss exponent that measures the rate
at which the RSSI decreases with distance, Xσ is zero mean distributed random variable
whose mean value is zero and it reflects the change of received signal power in certain
distance, d0 is reference distance and usually equal to one meter, Pr (d0) is the calculated
power at a reference distance d0 from the transmitter.

Pr = Pt/ dη .......... (3.9)

From the above equations 3.7 & 3.8 & 3.9 we get,

Pr (dBm) = A−10·η·log (d) ............. (3.10)

Where Pr is the received signal power, A is signal power at a distance of one meter. Using the
above equation we can easily calculate the distance. Accuracy of RSSI depends on the path
loss model.

13
3.2.4 Angle of Arrival

Angle of Arrival (AoA) determines the direction/angle of propagation of received signal. It


uses radio or microphone arrays to estimate the direction of transmitting node.

Fig 3.4 Angle of arrival

Usually, a sensor is associated with two or more extra components such as antennas for radio
signals, microphones for acoustic signals. Location of each component with respect to the
sensor is known. In Figure - 2.3 to estimate AoA a four element Y shaped microphone is
used. AoA is estimated from the difference in arrival time of signal at each of the array
element.

Disadvantages of AoA includes: (i) Hardware cost

3.2.5 Hop count:


Sensors are deployed in a fashion such that each node remains in the range of its neighbour
nodes, that is a node lies within the range R of its neighbouring node. Knowing the number of
hops (hop count) and length of one hop (hop length) the distance d between any two nodes is
computed as

d = (hop count)* (hop length)........... (3.11)

14
Fig 3.5 Distance calculation using hop count

3.3 Localization techniques

There are different possibilities how to divide the computation between sensor nodes and how
to choose the localization algorithms. On the basis of computation model the localization
techniques can be broadly categorized into centralized and decentralized or distributed
techniques. The taxonomy of the localization techniques is shown in figure 3.5.

Localization Techniques
.

Centralised Localization Techniques Distributed Localization Techniques

Range based Techniques Range Free Techniques

Fig 3.5 Taxonomy of localization techniques

3.3.1. Centralized Localization Techniques

In the centralized localization all the measurements are collected at central base station (BS),
where the computation takes place. After that the results are forwarded back to the nodes. The
data transmission in the network causes latency, more consumption of energy and bandwidth.
The benefits of this technique are that they eliminate the problem of computation in every
node. The drawback of this scheme is lack of ability to access data in proper way as well as
inadequate scaling. It is more accessible for small scale networks. Because of existence of
15
global information, it is more accurate than other algorithm. The popular centralized
localizations algorithms are: Multi Dimensional Scaling-Mobile Assisted Programming
(MDSMAP), Semi Definite Programming (SDP), Simulated Annealing based Localization
(LBSA).

3.3.2. Distributed Localization Techniques

In distributed localization sensor nodes estimate their location themselves and communicate
with other nodes to get their own location in network. On the basis of range measurements,
the distributed localization has two types: range based and range free localization techniques.

3.3.3 Range Based Localization Techniques

The range based techniques require the distance or angle between nodes to estimating the
positions. Range based techniques compute the precise distance between transmitting and
receiving nodes on the basis of distance estimation methods Thus these techniques contains
diverse distance estimation methods to compute the inter node distance or range to measure
their locality and then to calculate the position with help of some principles of geometry.

3.3.4 Range Free Localization Techniques

In range free schemes, special hardware for distance estimation are not used. So its low cost
and simplicity in estimation of distance have attracted the attention of people in recent years.
The taxonomy of range free schemes is shown in fig 3.6

Range free Techniques

APIT DV-Hop Multi-Hop Centroid Gradient

Fig 3.7 Taxonomy of range free localization technique

3.3.4.1 Approximate point in triangle:


APIT is an area based range free scheme which assumes that some of nodes those are aware
of their positions outfitted with high powered transmitters. APIT is located in area to carry out
position estimation by separating the area into triangular zones between anchors. Each node’s

16
presence inside or outside the triangle regions allows declining the viable location until and
unless every possible sets have reached to an acceptable accuracy.

3.3.4.2 Dv-hop

DV-Hop localization uses similar mechanism to the classical distance vector routing method.
One anchor node broadcasts a message which contains the anchors’ positions with hop count.
Each receiving node keeps the minimum value, which it receives. After that it ignores the
other message with higher values. Messages broadcasted out with hop count values
incremented at every middle hop. In this scheme, all nodes in the network and other anchors
obtain the shortest distance in hops. The overall single hop distance in anchor i can be
computed with the following equation:

∑ ( ) ( )
𝐻𝑜𝑝𝑒 𝑆𝑖𝑧𝑒 = ∑
…………… (3.12)

Where anchor j is at location (xi, yj) and hj is the distance in hops from j to i. anchors
propagate the estimated hop size to the closest nodes. The triangulation is used location
estimation of unknown nodes. In this algorithm for 2 Dimensional deployment of network,
minimum 3 anchor’s locations are used.

3.3.4.3 Multi hop

Multi Hop techniques are able to compute a connectivity graph. The multi dimensional
scaling (MDS) uses connectivity information considering the nodes are within the
communication range

3.3.4.4 Centroid

Centroid scheme uses proximity based grained localization algorithm. In centroid localization
algorithm node’s location is computed on the basis of several reference node positions. The
centroid localization algorithm uses the location (xi , yi) of anchor nodes (reference node).
After receiving the information, unknown node estimate their position by using following
formula:
⋯ ⋯
(𝑋 ,𝑌 ) = ( , ) ............ (3.13)

17
Where (𝑋 , 𝑌 ) represents the estimation of position sensor node and N represents the
number of anchor nodes.

3.3.5. Gradient

In gradient algorithm, unknown nodes obtain their locations through multilateration. It also
uses hop count which is initially set to zero and incremented as it propagates to other nearby
nodes.

3.4 Limitations in Localization Techniques

Sensor network localization is an active research area and has numerous issues so still has a
lot of scope for research community. Some of the issues need to be addressed are:

3.4.1 Cost effective algorithms: During the design of localization algorithm, designer must
keep in mind the cost incurred in hardware and deployment. GPS is not suitable because of its
cost and size of hardware.

3.4.2 Robust algorithms for mobile sensor networks: Mobile sensors are much useful in
some environments because of mobility and coverage facility. Hence, development of new
algorithms is needed to accommodate these mobile nodes.

3.4.3 Algorithms for 3 Dimensional spaces: For many WSN applications, accurate location
information is crucial. The more of the proposed algorithms are applicable to 2D space. some
of the application needs 3 D positioning of WSNs.

3.4.4 Accuracy: If there is incorrect estimation of node position, then localization accuracy is
compromised. Designer must keep in mind that accuracy is very much important factor in
sensor localization.

3.4.5 Scalability: In large scale deployment, it is generally desirable to enlarge the


monitoring area amid nodes. So careful observations are required to check the scalability of
localization techniques.

18
CHAPTER 4
LITERATURE SURVEY

4.1 A Range Based Localization System in Multihop Wireless Sensor


Networks: Distributed Cooperative Approach [19]

 In this paper range based localization system model describes that involves distributed
computing in a collaborative manner.
 The motive of this work is to make modification in a range based localization
algorithm to utilize more resources optimally with improved performance by changing
the inherent methods of position estimation.
 Work of this research paper basically the work of a media access control scheme
(MAC) in the localization module is investigated.
 A MAC is basically used to save the energy by reducing collisions and retransmission
of range packets.
 To analyze the performance spectrum using different application scenarios simulation
of the localization method performed and conclude of this paper is that this method or
approach increases the effectiveness of localization in wireless sensor networks.
 In the simulation process, sensor network localization model like the range, topology,
channel, mobility, propagation schemes etc. were considered and the performance was
finally analyzed.

Table-1 Comparative study of localization of WSN


Comparison of localization of WSN
Network size/beacon to
Sl. Localization method used in Avg error(%of radio
node ratio/radio
number. wireless sensor network range)/coverage
range(R)
1 Organizing a Global Coordinate
System from Local Information
6R x 6R/10-25%/R .2R to .4R/100%
on an Ad Hoc Sensor
Network[20]

2 Dynamic fine grained localization


2 to 4m/100%
in ad-hoc network of sensor[21] 100x100/10-30%/10m

3 2.18 m in RSS case and


Relative location estimation in
1.23 m in TOA
wireless sensor network[22] 9x9/4:40/R
case/100%

19
4 20 x 20/K2 sensor arranged Up to 3 m error that is
Cooperative localization in in K rows and K cols and 4 lower bound on RMS
wireless sensor network[23] anchors are placed in localization(Cramer’s rao

experiment area/R bound rule)/100 %

5 Simulated annealing based Up to 1 % when radio


localization in WSN[21] 10x10/20:200/1.1-1.9 range is 1.8 m

6 Range based mobility assisted


.45R/location coverage
cooperative technique in 100 x100/25 Nodes/25 m
Up to 90 %
WSN[25]

7 An Improved DV-Hop
50 x50/5–30 % of total .45R to .75R/100 %
Localization Algorithm for
nodes/10 m coverage
Wireless Sensor Networks[26]

8 RSSI based localization


100x100/48 Nodes and From 2.2 to 4.5 m (RSSI
algorithms for indoor wireless
beacons from 5 to 25/R based)
sensor networks[27]

9 Range based cooperative and


.2R in (time of arrival
localization algorithms for
100 x100/around 30 %/25 m based ranging) and .4R in
Zigbee and 802.15.4a in
(RSSI based ranging)
WSN[28]

10 .4R/100 % nodes
Localization by cross entropy 200x200/around 30 % of
localized
method in WSN[29] nodes/20 m

11 A Range Free Geometric


Technique for Localization of 200x200/9-10%beacon
Wireless Sensor Network (WSN) nodes/rangemax=30=30&ra
5-5.5m/82-92%
Based on Controlled nge1=15
Communication Range[30]

20
4.2 A Range Free Geometric Technique for Localization of Wireless Sensor
Network (WSN) Based on Controlled Communication Range [30].
 In this paper, by proposing a new localization scheme geometric anchor beacon
(GAB), density dependent accuracy of localization was overcome.
 The proposed method GAB is based on analytical geometry of an arc.
 In the proposed method (GAB), the Cramer’s rule is used, where the position of the
sensor nodes are estimated by intersecting point of two perpendicular bisectors of the
chords.
 Results of Simulation show that, GAB shows less estimation error than any other
range-free localization schemes such as Centroid, CAB, Convex, and APIT.
 The localization scheme is divided into four phases showing in figure 4.1 as follows:
(a) Anchor nodes differentiation using RSSI.
(b) Sensor node residence area formation.
(c) Random approximation of arc parameters.
(d) Estimate the sensor node’s position with the help of geometric conjecture

Fig 4.1 Four phase of localization scheme GAB

21
 After finding residence area of sensor node, they found the intersection point of two
perpendicular bisector of chord. And that intersection point is the position o sensor
node.
 The performance of GAB is compared at various degree of beacon node deployment
between the proposed GAB with CAB, APIT, Centroid and Convex. It is observed
that the mean estimation error is reduced when the percentage of beacon/anchor
deployment is increased. The scheme performs well even at the lower percentage of
anchor deployment. The estimation error is below 6 m, If the anchor deployment is 3
% at DOI = 0.05. The mean position estimation error is below 5.3 m when the anchor
deployment percentage is 9 %.

22
4.3 Concentric Anchor Beacon Localization Algorithm for Wireless Sensor
Networks [31]

 In this paper, For wireless sensor networks they have proposed a concentric anchor
beacon (CAB) localization algorithm
 CAB is a distributed range-free approach and it uses a small percentage of anchor
nodes and each anchor emits several beacon signals at different power levels and they
also contain information about anchor’s position, and the maximum distance that the
beacon can travel.
 Nodes listen and record the beacons from the anchors than can be heard as well as the
corresponding power levels. And the information received by each beacon heard,
nodes can determine within which annular ring they are located. Each node uses the
approximated center of intersection of the rings as its position estimate.
 In addition, they have also proposed two heuristics, namely CAB with Equal Area
(CAB-EA) and CAB with Equal Width (CABEW), to determine the transmitting
power levels of the beacons.
 The proposed CAB localization algorithm is advantageous in two ways firstly; CAB is
cost effective as it does not require specialized range-determining hardware in the
sensor nodes and Secondly, CAB is distributed and energy efficient.

Fig 4.2 Localization by using CAB.

 Fig.4.2 shows an example with a sensor node surrounded by three anchors Each
anchor transmits beacons at two different power levels.
 The described algorithm is applicable to both CABEA and CAB-EW. Each anchor
transmits the beacon signals at varying power levels consecutively. The time between
two beacon transmissions follows a general distribution with the mean equal to T.1
23
 Each beacon signal packet includes the anchor’s ID, the anchor’s location, the
transmitting power level Pi information, and the estimated maximum distance that the
beacon signal can be heard.
 Each node listens for beacons and collects the anchor’s information. For each beacon
heard, the sensor node determines within which region of the anchor’s concentric
transmission circles it lays.

24
CHAPTER 5

NETWORK SIMULATION OVERVIEW

Ns-2 [32] is specially designed for research in networks and an open-source event-driven. NS-
2 is an object oriented and discrete event driven simulator which is used for simulation of
wireless network and wired network. Ns2 is written in c++ with OTcL as a front end. There
are two hierarchy i.e. compiled hierarchy and interpreted hierarchy. Both hierarchies are
linked together with the help of an OTcl/C++ interface [33].

Ns use two languages because simulator has two different kinds of things it needs to do. On
one hand, detailed simulations of protocols require a systems programming language which
can efficiently manipulate bytes, packet headers, and implement algorithms that run over
large data sets.

Ns-2 has several tools and modules that researchers can use to develop localisation schemes.
The researchers can modify the existing modules, or create new modules from the very
beginning by changing in existing c++ files and by adding new files. Therefore, the ns-2
simulator will be used to implement and to evaluate the proposed localisation algorithm.

Our basic advice is to use OTcl:

 OTcL is fast to run but slower to change


 You can do what you want by manipulating existing C++ objects and use C++:
 If you are doing anything that requires processing each packet of a flow
 If you have to change the behaviour of an existing C++ class in ways that weren’t
anticipated

Fig: 5.1 Architecture of NS2

25
5.1 The extended ns-2
Ns-2 has several kinds of flexible modules for energy-constrained wireless ad-hoc networks,
which encourage researchers to use ns-2 to find out the characteristics of Wireless Sensor
Networks. However, to implement and evaluate the proposed localisation algorithm, the
current ns-2 version (ns-2.34) can be extended and new modules will be added to existing
Ns2. Figure 5.2 showing the new classes that were added to the ns-2. These classes can be
divided into two types standalone classes and compiled hierarchy classes. Standalone classes
are MMSE, Position and nearest position and refine position classes. These classes are used
only from the C++ domain. Compiled hierarchy classes are LocDisApp, LocReqAgent and
LocResAgent classes. In order to access these classes from the OTcl domain, they should be
linked to the corresponding interpreted hierarchy classes, Application/ LocDis, Agent
/LocReq and Agent/ LocRes, respectively.

Fig: 5.2 the new modules added to the ns-2

5.2 The complete class hierarchy of the new modules


The complete procedures of the localisation process are as follows:

 Output Timer schedules by the LocDisApp class with a certain delay to track the result
into a trace file.
 The ReqTimer scheduled by LocDisApp with a certain delay, which regulate how
frequently the node broadcasts a location request packet.
 The LocDisApp invokes the broadcast( ) method to broadcast a “location request”
packet at the expiration time of ReqTimer( ) and schedule the Estimate Timer to

26
estimate the location after a specific delay and reschedules the ReqTimer.
LocReqAgent constructs a packet which is called “location request” packet
(PT_LOCREQ), which includes the required accuracy level, and then it broadcasts the
packet to the neighbouring nodes.
 The LocResAgent of the references that receive the “location request” packet requests
from the LocDisApp the location information of the node, which is the node's location
and the node's probability of accuracy. LocResAgent establish a new “location
response” packet (PT_LOCRES), which contain the information about location and
forward this information back to the node who made request.
 The LocResAgent of the requesting node receives the “location response” packets
from neighbouring nodes and then forward them to LocDisApp for further processing.
 LocDisApp fetches the required information from the received packet like the address,
location and the probability of accuracy the power of the sending reference node and
then ResData vector stores this information .
 At the expiration time of Estimate Timer the LocDisApp invokes the refine method’s
method called estimate ( ).
 Refine position method calculates the location of node with the data stored in the
ResData vector.

5.3 Rebuilding NS-2 after adding new modules:

 Add new modules as required in existing location folder.


 Perform the required changes in makefile.in.
 Run make.
 Run sudo make install

27
5.3 The structure of the new ns-2

NS-2

location

COMMON

Packet.h
Locationdiscovery.cc,
Location.h h
Locationreponce.cc,h
Mobilenode.cc,h
Locationrequest.cc,h

Locationpacket.h
tcl
Mmse.cc,h

Position.cc,h
lib

Nearestposition.cc,h
Ns-packet.tcl
Refineposition.cc,h
Ns-default.tcl
Support.h
Ns-lib.tcl

Ns-node.tcl

Ns-namsupp.tcl

Fig 5.3 The structure of the extended ns-2

Figure 5.3 Shows the structure of the extended ns-2, where the files under the “location”
folder represent the new files that were added to ns-2, while the other files (left-hand side) are
the modified files.

The new classes are carried out in the files under the “location” folder in ns2. Some other files
were modified as follows:

28
 ns2/common/packet.h: In the locationpacket.h file these two pachet type
PT_LOCREQ and PT_LOCRES were created with the help of two structures
(hdr_locreq and hdr_locres).
 ns2/common/location.h: the class Location define Location.h file. Location class is
used to represent the location coordination (X, Y and Z) of nodes.
 ns2/common/mobilenode.cc, .h: Two methods were added to these files
1. Object to the topography
2. to record the results in the trace file.
 The result can be the number of references used, probability of accuracy, location
error and remaining energy.
 tcl/lib/ns-packet.tcl: In this file OTcl class name were included to activate the new
header clases and these classes are “PacketHeader/LocReq” &
“PacketHeader/LocRes” and so in active protocol list “LocReq” & “LocRes” were
added.
 tcl/lib/ns-node.tcl: Node can be beacon, unknown and reference. For specify the type
of nodes, a new instvar, and a new instproc were created.
 tcl/lib/ns-lib.tcl: To enable the simulator and to deal with the node attribute, an
instproc was created to set the instvar “attribute_”.

5.5 Guidelines for running the simulation

For extended ns-2 new knowledge of ns-2 does not needed , basic knowledge is required to
run a simple wireless network in ns-2 if you know that how to write a simple OTcl script for
simulation. For configuring the localisation simulation, some guidelines are given in this
section and show how to configure nodes in network to simulate localization. However, you
can see [32] for some tutorials about how to create wireless networks.
At the starting of the simulation there are only two types of nodes:

Beacons and Unknowns Node

Beacon Nodes: that is aware about their location through manually configuration or GPS .

Unknown Nodes: that is not aware about their location

Each type of nodes has a different configuration, as shown in Figure 5.4. Beacon nodes aware
about their location, so only LocResAgent are attached with Beacons. Unknown nodes are not
ware about their location so they should be attached with LocReqAgent and LocReqAgent.

29
LocReqAgent is allowed them to broadcast "location request" messages. After estimating
their position, unknowns could become a reference for other nodes, and so they are also
attached with LocResAgent. Both the agent LocResAgent and LocReqAgent should be
attached to LocDisApp.

LocDisApp LocDisApp

LocReqAgent LocReqAgen LocReqAgent

Ui aj

Fig 5.4 Node configuration

Before creating the nodes it is necessary to specify the nodes' configuration, such as the
routing protocol, MAC type and so on. In addition to these configurations it is also necessary
to specify the attribute of the nodes, which can be done using some command which is
defined in TCL file in the next page

TCL Script

“node-config”

set val(nn) 100 # number of mobile nodes

set val(nu) 70 ; # number of unknown nodes

set val(nb) 30 ; # number of beacon nodes # Beacon nodes:

# configuration of nodes

set val(attr) BEACON ; # node attribute

$ns_ node-config –attribute

$val(attr)

# Node creation

30
for {set i 0} {$i < $val(nb)} {incr i}

set node_($i) [$ns_ node]

# configuration of nodes

set val(attr) UNKNOWN

$ns_ node-config –attribute $val(attr)

# creation of nodes

for {set i $val(nb)} {$i < $val(nn) } {incr i}

set node_($i) [$ns_ node]

The next step is to create the required agents for unknowns and beacons and application based
on the configuration. Beacon nodes require only LocResAgent and LocDisApp; this can be
done as shown below:

# Beacon nodes require only response agent


for {set i 0} {$i < $val(nb)} {incr i}

# attach the response agent


set lres_($i) [new Agent/LocRes]

$ns_ attach-agent

$node_($i) $lres_($i)

# attech the location-discovery application


set ldis_($i) [new Application/LocDis]

$ldis_($i) attach-agent $lres_($i) }

Unknown nodes also require LocReqAgent, as shown below:

# Unknown nodes require both request and response agent

for {set i $val(nb)} {$i < $val(nn) } {incr i}

31
{ # attach the request agent

set lreq_($i) [new Agent/LocReq]

$ns_ attach-agent $node_($i) $lreq_($i)

# attach the response agent

set lres_($i) [new Agent/LocRes]

$ns_ attach-agent $node_($i) $lres_($i)

# Setup the location-discovery application

set ldis_($i) [new Application/LocDis]

$ldis_($i) attach-agent $lreq_($i)

$ldis_($i) attach-agent $lres_($i) }

Finally, the location-discovery applications should be started at a specific time:

# Start the locdis applications

for {set i 0} {$i < $val(nn)} {incr i}

{ $ldis_($i) set random_ 1

$ldis_($i) set subset_ 3

$ldis_($i) set showColor_ 1

$ns_ at 0.0 "$ldis_($i) start" }

32
5.5 Simulation Parameter & Results:

Table-2: Simulation Parameter

Scenario Parameter Value


Node Radio Range 40
Simulation Area 100*100
Radio Propagation Ideal, No Path Loss
*Number Of Sensors – n Decided in specific Scenario
*Number of Anchors – m Decided in specific Scenario
Initial Energy of the Node 2 joule
Receiver Antenna Gain 1
Transmitter Antenna Gain 1
Simulation Time 600 seconds
Initial Energy of the Node 2 joule Transmitter Antenna Gain 1
Transmission Range of Node 50 meter

These are the parameters we set for all scenarios. Only number of Beacon and Sensor node
will be change according to specific scenario.

Scenario 1:

For the first scenario we already mention the value of parameters in table 1. We have to give
the value for number of Beacons and total numbers of sensor nodes are 100.

Number of Sensors (n) - 90

Number of Beacons (m) – 10

Fig 5.5 represents the network topology in which blue nodes are beacon and yellow nodes are
unknown nodes.

33
Fig 5.5 Node deployment in network

Yellow node represents Unknown Nodes

Blue Nodes represent beacon nodes in network

Reference Node

Fig 5.6 represents topology after simulation run in which yellow nodes become red
because they obtain their location and became reference node.

Fig 5.6 Network topology after sometime of simulation

34
Let us suppose normal node communicate with beacon nodes and estimate their position by
using refine algorithm and refine the value of position until high accuracy and less error
achieved. The Error is the distance between estimated position and actual position. In
scenario 1 result are obtained for a number of anchor varying from 10 to 50 and total number
of nodes are 100. The Simulation results are

Table-3 Scenario 1

Anchor Nodes Results using Refine Position


Mean Location Error Accuracy
10 0.597064 99.4029
20 0.401412 99.5985
30 0.35690 99.6431
40 0.311762 99.6882
50 0.295634 99.7043

Scenario 2
For the scenario 2, the particular parameters values are the following ones: the total number of
sensors is "n=70", and number anchors nearby "m" is varied from 10 to 40.

Table-4 Scenario 2

Anchor Nodes Results using Refine Position


Mean Location error Accuracy
10 0.498306 99.5016
20 0.368262 99.6317
30 0.343138 99.6568
40 0.315876 99.6841

35
Mean Error vs Beacon Node
0.5 0.498306
M 0.48
e 0.46
a 0.44
n
0.42
0.4
E
0.38
r 0.368262
0.36
r
0.34 0.343138
o
0.32 0.315876
r
0.3
10 20 30 40
Mean Error 0.498306 0.368262 0.343138 0.315876
Beacon Node

Fig 5.7 Mean error v/s beacon nodes

Fig 5.7 showing the mean error v/s beacon nodes. When we are increasing the number of
beacons Mean Error will continuously decrease.

36
CHAPTER 6

CONCLUSION & FUTURE WORK


Different localization algorithms available focuses on different issues of localization such as
errors, number of beacons, number of settled nodes, GPS usage or energy consumption or
based on combination of different issues. For sensor networks, localization of nodes is a
major issue because it is important to know the location of node for immediate actions.
Localization is important for sensors to know their location and more accurate value is more
important to find more accuracy.

To improve the accuracy, nodes with lesser errors are used for computations. Further, amount
of data in the network is also reduced by restricting high error nodes from responding to a
request.

So from the above tables and graph it can be concluded that when we are increasing number
of anchor nodes, mean location error is continuously decreasing and accuracy is increasing. In
future, Scope for further analysis to improving the accuracy is also present in the existing
approach .There can be more scope in accuracy improvement.

37
References:

[1] Yick, J., Mukherjee, B., & Ghosal, D. (2008). Wireless sensor network survey.
Computer networks, 52(12), 2292-2330.
[2] Nabil Ali Alrajeh, Maryam Bashir, andBilal Shams (2013). Localization Techniques
in Wireless Sensor Networks(1-9)
[3] Jun-gang ZHENG, De-ping ZHAO, and Zhong-tang CHEN(2016). Node Localization
Techniques in Wireless Sensor Networks.
[4] Hussain, M. A., & kyung Sup, K. (2009, February). WSN research activities for
military application. In Advanced Communication Technology, 2009. ICACT 2009.
11th International Conference on (Vol. 1, pp. 271-274). IEEE
[5] L. Hu & Evans, D. (2004, February). Using Directional Antennas to Prevent
Wormhole Attacks. In NDSS (pp. 241-245).
[6] Rasmussen, K. B., & Capkun, S. (2007, September). Implications of radio
fingerprinting on the security of sensor networks. In Security and Privacy in
Communications Networks and the Workshops, 2007. SecureComm 2007. Third
International Conference on (pp. 331-340). IEEE.
[7] Maheshwari, R., Gao, J., & Das, S. R. (2007, May). Detecting wormhole attacks in
wireless networks using connectivity information. In INFOCOM 2007. 26th IEEE
International Conference on Computer Communications. IEEE (pp. 107-115). IEEE.
[8] 28Meadows, C., Syverson, P., & Chang, L. (2006, August). Towards more efficient
distance bounding protocols for use in sensor networks. In Securecomm and
Workshops, 2006 (pp. 1-5). IEEE.
[9] Cheng, K. Y., Tam, V., & Lui, K. S. (2005, October). Improving aps with anchor
selection in anisotropic sensor networks. In Autonomic and Autonomous Systems and
International Conference on Networking and Services, 2005. ICAS-ICNS 2005. Joint
International Conference on (pp. 49-49). IEEE.
[10] Tian, S., Zhang, X., Wang, X., Sun, P., & Zhang, H. (2007, November).A selective
anchor node localization algorithm for wireless sensor networks. In Convergence
Information Technology, 2007. International Conference on (pp. 358-362), IEEE.
[11] Liu, J., Zhang, Y., & Zhao, F. (2006, May). Robust distributed node localization
with error management. In Proceedings of the 7th ACM international symposium on
Mobile ad hoc networking and computing (pp. 250-261). ACM.

38
[12] Priyantha, N. B., Balakrishnan, H., Demaine, E., & Teller, S. (2003, November).
Anchor-free distributed localization in sensor networks. In Proceedings of the 1st
international conference on Embedded networked sensor systems (pp. 340-341).
ACM.
[13] Shi, Q., He, C., Chen, H., & Jiang, L. (2010). Distributed wireless sensor network
localization via sequential greedy optimization algorithm. IEEE Transactions on
Signal Processing, 58(6), 3328-3340.
[14] Shang, Y., Rumi, W., Zhang, Y., & Fromherz, M. (2004). Localization from
connectivity in sensor networks. IEEE Transactions on parallel and distributed
systems, 15(11), 961-974.
[15] Biswas, P., & Ye, Y. (2004, April). Semidefinite programming for ad hoc wireless
sensor network localization. In Proceedings of the 3rd international symposium on
Information processing in sensor networks (pp. 46-54). ACM.
[16] Niculescu, D., & Nath, B. (2001). Ad hoc positioning system (APS). In Global
Telecommunications Conference, 2001. GLOBECOM'01. IEEE (Vol. 5, pp. 2926-
2931). IEEE.
[17] Costa, J. A., Patwari, N., & Hero III, A. O. (2006). Distributed weighted multi
dimensional scaling for node localization in sensor networks. ACM Transactions on
Sensor Networks (TOSN), 2(1), 39-64.
[18] Jun-gang ZHENG, De-ping ZHAO, and Zhong-tang CHEN(2016). Node
Localization Techniques in Wireless Sensor Networks.
[19] Suman Pandey, Shirshu Varma (2015). A Range Based Localization System in
Multihop Wireless Sensor Networks: A Distributed Cooperative Approach(615-634)
[20] Nagpal, R., Shrobe, H., & Bachrach, J. (2003). Organizing a global coordinate
system from local information on an ad hoc sensor network.
[21] Savvides, A., Han, C.-C., & Strivastava, M. B. (2001). Dynamic fine-grained
localization in ad-hoc networks of sensors.
[22] Patwari, N., Hero, A. O., Perkins, M., Correal, N. S., & O’Dea, R. J. (2003). Relative
location estimation in wireless sensor networks
[23] Patwari, N., Ash, J. N., Kyperountas, S., Hero, A. O., Moses, R. L., & Correal, N. S.
(2005). Locating the nodes: cooperative localization in wireless sensor networks.
IEEE Signal processing magazine, 22(4), 54-69.
[24] Kannan, A. A., Mao, G., & Vucetic, B. (2006). Simulated annealing based
localization in WSN. Journal of Computers.

39
[25] Chen, H., Huang, P., So, H. C., Luo, X., & Deng, P. (2008). Range based mobility
assisted cooperative technique in WSN.
[26] Chen, H., Sezaki, K., Deng, P., So, H. C. (2008). Range free improved DV-hop
localization algorithm in WSN.
[27] Zanca, G., Zorzi, F., Zanella, A., & Zorzi, M. (2008). RSSI based localization
algorithms for indoor wireless sensor networks
[28] Moragreg, A., Ibars, C. (2010). Range based cooperative and localization algorithms
for Zigbee and 802.15.4a in WSN. N
[29] Azim, M. A., Aung, Z., Xiao, W. M., & Khadkikar, V. (2012). Localization by cross
entropy method in WSN.
[30] Munesh Singh,Pabitra Mohan Khilar(2016). A Range Free Geometric Technique for
Localization of Wireless Sensor Network (WSN) Based on Controlled
Communication Range.
[31] Vijayanth Vivekanandan and Vincent W. S. Wong(2007). Concentric Anchor
Beacon Localization Algorithm for Wireless Sensor Networks.
[32] "The network simulator - ns-2," 12 February 2010,
http://nsnam.isi.edu/nsnam/index.php/User_Information. Last accessed on 26
November 2010
[33] K.Fall and K.Varadhan, "The Ns Manual," 9 May 2010,

40
APPENDIX A

TCL Script:

if {$argc != 2}

puts stderr "ERROR! Command syntax: ns loc4.tcl SEED METHOD (SEED =

0, 1, 2, ... METHOD = 1, 2 or 3)"

exit 1

Else

set val(seed) [lindex $argv 0]

set val(method) [lindex $argv 1]

#Set Parameters

et val(chan) Channel/WirelessChannel;# channel type

set val(prop) Propagation/FreeSpace ;# radio-propagation model

set val(netif) Phy/WirelessPhy ;# network interface type

set val(mac) Mac/Simple ;# MAC type

set val(ifq) Queue/DropTail/PriQueue;# interface queue type

set val(ll) LL ;# link layer type

set val(ant) Antenna/OmniAntenna ;# antenna model

set val(ifqlen) 50 ;# max packet in ifq

set val(nn) 76 ;# number of mobilenodes

set val(nu) 64 ;# number of unknown nodes

set val(nb) 12 ;# number of beacon nodes

set val(rp) AODV ;# routing protocol

41
set val(x) 200 ;# X dimension of topography

set val(y) 200 ;# Y dimension of topography

set val(stop) 600.0 ;# stop time

set val(attr) UNKNOWN ;# node attribute

set val(p_tx) 0.281838 ;# transmitting power(watts)

set val(p_rx) 0.281838 ;# receiving power in watts

set val(p_idel) 0.0 ;# idle power

set val(e_mod) EnergyModel ;# energy model

set val(e_init) 2.0 ;# initial energy in Joules

set val(th_rx) 7.69113e-08 ;# receive sensitivity threshold

set val(th_cx) 5.3352e-6 ;# carrier sense threshold

set val(g_tx) 1 ;# transmitter antenna gain

set val(g_rx) 1 ;# receiver antenna gain

set val(u_inc) 200 ;# unknown region width

set val(b_inc) 200 ;# beacon region width

# Initialize Global Variables

set ns_ [new Simulator]

set tracefd [open locationfinal.tr w]

$ns_ trace-all $tracefd

set namtrace [open namfinal.nam w]

$ns_ namtrace-all-wireless $namtrace $val(x) $val(y)

# set up topography object

set topo [new Topography]

$topo load_flatgrid $val(x) $val(y)

# Create God

create-god $val(nn)

# Create channel #1
42
set chan_1_ [new $val(chan)]

# configure netif

$val(netif) set RXThresh_ $val(th_rx)

$val(netif) set CXThresh_ $val(th_cx)

$val(netif) set Gt_ $val(g_tx)

$val(netif) set Gr_ $val(g_rx)

# configure node

$ns_ node-config -adhocRouting $val(rp) \

-llType $val(ll) \

-macType $val(mac) \

-ifqType $val(ifq) \

-ifqLen $val(ifqlen) \

-antType $val(ant) \

-propType $val(prop) \

-phyType $val(netif) \

-attribute $val(attr) \

-channel $chan_1_ \

-topoInstance $topo \

-energyModel $val(e_mod) \

-rxPower $val(p_rx) \

-txPower $val(p_tx) \

-initialEnergy $val(e_init) \

-agentTrace OFF \

-routerTrace OFF \

-macTrace OFF \

-movementTrace OFF

# unknown nodes
43
for {set i 0} {$i < $val(nu)} {incr i} {

set node_($i) [$ns_ node]

$node_($i) color white

# beacon nodes

set val(attr) BEACON

$ns_ node-config -attribute $val(attr)

for {set i $val(nu)} {$i < $val(nn)} {incr i} {

set node_($i) [$ns_ node]

$node_($i) color blue

# disable random motion

for {set i 0} {$i < $val(nn) } {incr i} {

$node_($i) random-motion 0

# Provide random initial position:

set Rng1 [new RNG]

$Rng1 seed $val(seed)

set Rexp [new RandomVariable/Uniform]

$Rexp use-rng $Rng1

$Rexp set min_ 0.0

set n 0

# unknown nodes

set row [expr $val(y) / $val(u_inc)]

set column [expr $val(x) / $val(u_inc)]

set sub_nodes [expr $val(nu) / ($row * $column)]

$Rexp set max_ $val(u_inc)


44
for {set i 0} {$i < $row} {incr i} {

for {set j 0} {$j < $column} {incr j} {

for {set k 0} {$k < $sub_nodes} {incr k} {

$node_($n) set X_ [expr $j * $val(u_inc) + [$Rexp value]]

$node_($n) set Y_ [expr $i * $val(u_inc) + [$Rexp value]]

incr n

# beacon nodes

set row [expr $val(y) / $val(b_inc)]

set column [expr $val(x) / $val(b_inc)]

set sub_nodes [expr $val(nb) / ($row * $column)]

$Rexp set max_ $val(b_inc)

for {set i 0} {$i < $row} {incr i} {

for {set j 0} {$j < $column} {incr j} {

set arrayX(0) [expr $j * $val(b_inc) + [$Rexp value]]

set arrayY(0) [expr $i * $val(b_inc) + [$Rexp value]]

$node_($n) set X_ $arrayX(0)

$node_($n) set Y_ $arrayY(0)

incr n

set k 1

while {$k < $sub_nodes} {

set rx [$Rexp value]

set ry [$Rexp value]

set reject 0
45
for {set l 0} {$l < $k} {incr l} {

if { [expr abs($arrayX($l) - $rx)] < 5} {

if { [expr abs($arrayY($l) - $ry)] < 5} {

set reject 1

break

if {$reject == 1} {

continue

set arrayX($k) [expr $j * $val(b_inc) + $rx]

set arrayY($k) [expr $i * $val(b_inc) + $ry]

$node_($n) set X_ $arrayX($k)

$node_($n) set Y_ $arrayY($k)

incr k

incr n

# unknown nodes have both request and response agent

for {set i 0} {$i < $val(nu)} {incr i} {

#Setup the request agent

set lreq_($i) [new Agent/LocReq]

$ns_ attach-agent $node_($i) $lreq_($i)

#Setup the response agent

set lres_($i) [new Agent/LocRes]


46
$ns_ attach-agent $node_($i) $lres_($i)

#Setup the location discovery application

set ldis_($i) [new Application/LocDiscovery]

$ldis_($i) attach-agent $lreq_($i)

$ldis_($i) attach-agent $lres_($i)

# beacon nodes have only response agent

for {set i $val(nu)} {$i < $val(nn)} {incr i} {

#Setup the response agent

set lres_($i) [new Agent/LocRes]

$ns_ attach-agent $node_($i) $lres_($i)

#Setup the location discovery application

set ldis_($i) [new Application/LocDiscovery]

$ldis_($i) attach-agent $lres_($i)

# start the locdis applications

for {set i 0} {$i < $val(nn)} {incr i} {

$ldis_($i) set random_ 1

$ldis_($i) set method_ $val(method)

$ldis_($i) set distanceError_ 1

$ns_ at 0.0 "$ldis_($i) start"

# Define node initial position in nam

for {set i 0} {$i < $val(nn)} {incr i} {

$ns_ initial_node_pos $node_($i) 3

# Tell nodes when the simulation end


47
for {set i 0} {$i < $val(nn) } {incr i} {

$ns_ at $val(stop) "$node_($i) reset";

$ns_ at $val(stop) "stop"

$ns_ at [expr $val(stop) + 0.01] "puts \"NS EXITING...\" ; $ns_ halt"

proc stop {} {

global ns_ tracefd namtrace val

$ns_ flush-trace

close $tracefd

close $namtrace

$ns_ at $val(stop) "$ns_ nam-end-wireless $val(stop)"

exec nam namfinal.nam &

exit 0

puts "Starting Simulation..."

$ns_ run

48
PERSONAL DETAILS

Name : Mona Gupta


Enrollment Number : 162B002
Course : Masters of Technology
Branch : Computer science & Engineering
E-mail : gmona340@gmail.com
Address : Gail complex Vijaypur
Guna(M.P.)
Contact Number : 7771009006

49

You might also like