Professional Documents
Culture Documents
A DISSERTATION REPORT
Submitted By
MONA GUPTA
Enrollment no-162B002
May-2018
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
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.
iv
LIST OF FIGURES
v
LIST OF TABLE
Table-3 Scenario-1 35
Table-4 Scenario-2 35
vi
ABBREVIATIONS
vii
TABLE OF CONTENTS
Certificate i
Acknowledgement iii
Abstract iv
List of figures v
Abbreviation vi
1 INTRODUCTION
3 LOCALIZATION IN WSN
viii
3.2.1 Time of Arrival 11
4 LITERATURE SURVEY
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.
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.
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
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..
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
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.
4
Fig 2.3 protocol stack of different layers
(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.
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
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.
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]
8
CHAPTER 3
LOCALIZATION IN WIRELESS SENSOR NETWORK
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).
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.
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.
10
Fig: 3.2 Multilateration
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).
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:
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:
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
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)
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
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.
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.
From the above equations 3.7 & 3.8 & 3.9 we get,
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
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.
14
Fig 3.5 Distance calculation using hop count
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
.
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).
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.
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.
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
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.
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.
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.
18
CHAPTER 4
LITERATURE SURVEY
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.
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
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]
10 .4R/100 % nodes
Localization by cross entropy 200x200/around 30 % of
localized
method in WSN[29] nodes/20 m
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
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 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
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.
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.
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.
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
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_”.
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:
Beacon Nodes: that is aware about their location through manually configuration or GPS .
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
Ui aj
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”
# configuration of nodes
$val(attr)
# Node creation
30
for {set i 0} {$i < $val(nb)} {incr i}
# configuration of nodes
# creation of nodes
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:
$ns_ attach-agent
$node_($i) $lres_($i)
31
{ # attach the request agent
32
5.5 Simulation Parameter & Results:
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.
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
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.
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
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
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 showing the mean error v/s beacon nodes. When we are increasing the number of
beacons Mean Error will continuously decrease.
36
CHAPTER 6
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}
exit 1
Else
#Set Parameters
41
set val(x) 200 ;# X dimension of topography
# Create God
create-god $val(nn)
# Create channel #1
42
set chan_1_ [new $val(chan)]
# configure netif
# configure node
-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} {
# beacon nodes
$node_($i) random-motion 0
set n 0
# unknown nodes
incr n
# beacon nodes
incr n
set k 1
set reject 0
45
for {set l 0} {$l < $k} {incr l} {
set reject 1
break
if {$reject == 1} {
continue
incr k
incr n
proc stop {} {
$ns_ flush-trace
close $tracefd
close $namtrace
exit 0
$ns_ run
48
PERSONAL DETAILS
49