A Real-Time MATLAB based GUI for node placement and a shortest

“International Journal for Science and Emerging
ISSN No. (Online):2250-3641
Technologies with Latest Trends” 7(1): 11-15 (2013)
ISSN No. (Print): 2277-8136
A Real-Time MATLAB based GUI for node placement and a shortestpath alternate route path algorithm in Wireless Sensor Networks
Chetan Chugh* and Ramneek Singh**
*A.P. (Department of Electronics and Communication Engg.) DAV Institute of Engg & Tech.
**A.P. (Department of Electronics and Communication Engg.) DAV Institute of Engg & Tech.
Jalandhar, Punjab, India.
(Received 15 April 2013 Accepted 19 April 2013)
Abstract: This paper gives a concise pictorial view of wireless sensor node deployment in Matlab. Wireless Sensor
Networks (WSNs) have been widely considered as one of the most important technologies for the twenty first
century. Enabled by recent
advances in microelectronic mechanical systems (MEMS) and wireless
communication technologies, tiny, cheap, and smart sensors deployed in a physical area and networked through
wireless links and the Internet provide unprecedented opportunities for a variety of civilian and military
applications, for example, environmental monitoring, battle field surveillance, and industry process control .This
paper provides the path between source and destination nodes for efficient data delivery. The malicious nodes
have been selected on manual basis. The alternate shortest route has been found using Dijstra algorithm.
Also, an algorithm for public key cryptography i.e. RSA algorithm has been implemented to prevent the nodes
from intrusion attacks.
Keywords: Wireless sensor networks, RSA, Dijstra, GUI, MATLAB, Intrusion.
1. Introduction to
sensor networks.
Wireless
Wireless Sensor Networks (WSNs)[1] have
been widely considered as one of the most
important technologies for the twenty-first
century. Enabled by recent advances in
microelectronicmechanical
systems
(MEMS) and wireless communication
technologies, tiny, cheap, and smart sensors
deployed in a physical area and networked
through wireless links and the Internet
provide unprecedented opportunities for a
variety of civilian and military applications,
for example, environmental monitoring,
battle field surveillance, and industry
process control. Distinguished from
traditional
wireless
communication
networks, for example, cellular systems and
mobile ad hoc networks (MANET), WSNs
have unique characteristics, for example,
denser level of node deployment, higher
unreliability of sensor nodes, and severe
energy,
computation, and storage constraints,
which present many new challenges in the
development and application of WSNs.
1.1 Network Characteristics
A WSN typically consists of a large number
of low-cost, low-power, and multifunctional sensor nodes that are deployed in
a region of interest. These sensor nodes are
small in size, but are equipped with sensors,
embedded microprocessors, and radio
transceivers, and therefore have not only
sensing capability, but also data processing
and communicating capabilities. They
communicate over a short distance via a
wireless medium and collaborate to
accomplish a common task, for example,
environment
monitoring,
battlefield
surveillance, and industrial process control.
Compared
with
traditional
wireless
communication networks, for example,
cellular systems and MANET, sensor
networks have the following unique
characteristics and constraints:
12
• Dense Node Deployment. Sensor nodes
are usually densely deployed in a field of
interest. The number of sensor nodes in a
sensor network can be several orders of
magnitude higher than that in a MANET.
• Battery-Powered Sensor Nodes. Sensor
nodes are usually powered by battery. In
most situations, they are deployed in a harsh
or hostile environment, where it is very
difficult or even impossible to change or
recharge the batteries.
• Severe Energy, Computation, and Storage
Constraints. Sensor nodes are highly limited
in energy, computation, and storage
capacities.
• Self-Configurable. Sensor nodes are
usually randomly deployed without careful
planning and engineering. Once deployed,
sensor nodes have to autonomously
configure themselves into a communication
network.
• Application Specific. Sensor networks are
application specific. A network is usually
designed and deployed for a specific
application. The design requirements of a
network change with its application.
• Unreliable Sensor Nodes. Sensor nodes are
usually deployed in harsh or hostile
environments
and
operate
without
attendance. They are prone to physical
damages or failures.
• Frequent Topology Change. Network
topology changes frequently due to node
failure, damage, addition, energy depletion,
or channel fading.
• No Global Identification. Due to the large
number of sensor nodes, it is
usually not possible to build a global
addressing scheme for a sensor network
because it would introduce a high overhead
for the identification
maintenance.
• Many-to-One Traffic Pattern. In most
sensor network applications, the data sensed
by sensor nodes flow from multiple source
sensor nodes to a particular sink, exhibiting
a many-to-one traffic pattern.
• Data Redundancy. In most sensor network
applications, sensor nodes are densely
deployed in a region of interest and
collaborate to accomplish a common sensing
task. Thus, the data sensed by multiple
sensor nodes typically have a certain level of
Chugh and Singh
correlation or redundancy.
1.2 Sensor Node Structure
A sensor node [2] typically consists of four
basic components: a sensing unit, a
processing unit, a communication unit, and a
power unit, which is shown in Fig1. The
sensing unit usually consists of one or more
sensors and analog to digital converters
(ADCs). The sensors observe the physical
phenomenon and generate analog signals
based on the observed phenomenon. The
ADCs convert the analog signals into digital
signals, which are then fed to the processing
unit. The processing unit usually consists of
a microcontroller or microprocessor with
memory, which provides intelligent control
to the sensor node. The communication unit
consists of a short range radio for
performing data transmission and reception
over a radio channel. The power unit
consists of a battery for supplying power to
drive all other components in the system. In
addition, a sensor node can also be equipped
with some other units, depending on specific
applications. For example, a global
positioning system (GPS) may be needed in
some applications that require location
information for network operation. All these
units should be built into a small module
with low power consumption and low
production cost.
Fig 1. Sensor Node
2. Introduction to Dijstra Algorithm
Dijkstra's algorithm [11] , conceived by
Dutch
computer
scientist
Edger
Dijkstarin is a graph search algorithm that
solves the single-source shortest path
problem for a graph with non negative edge
path costs, outputting a shortest path tree.
Chugh and Singh
This algorithm is often used in routing. For a
given source vertex (node) in the graph, the
algorithm finds the path with lowest cost (i.e
.the shortest path) between that vertex and
every other vertex. It can also be used for
finding costs of shortest paths from a single
vertex to a single destination vertex by
stopping the algorithm once the shortest path
to the destination vertex has been
determined. For example, if the vertices of
the graph represent cities and edge path
costs represent driving distances between
pairs of cities connected by a direct road,
Dijkstra's algorithm can be used to find the
shortest route between one city and all other
cities.
3. Graphical User Interface
(GUI) implementation of sensor
nodes in MATLAB.
The graphical user interface [12] for access
to sensor nodes has been implemented in
MATLAB.
The nodes have been randomly deployed
with number of nodes limited to 10. The
source node and the destination nodes are to
be chosen using drop-down menus available
in GUI. The graphical user interface shows
the data path between source and destination
nodes tracing various nodes, the actual trace
path
being
determined
by
Dijkstra's algorithm.
13
actual data path if he/she wants to disrupt
the data path from node 2 to node 7. Such a
secure mechanism prevents any kind of
compromise against data security.
4. Applying Dijstra algorithm
for route discovery.
The Dijkstra's algorithm is used to find the
shortest route between
source and
destination nodes. The Dijkstra's algorithm
is implemented in steps as shown below.
4.1 Steps for Dijkstra's algorithm
Let the node at which we are starting be
called the initial node. Let the distance of
node Y be the distance from the initial
node to Y. Dijkstra's algorithm will assign
some initial distance values and will try to
improve them step by step
Assign to every node a tentative distance
value: set it to zero for our initial node and
to infinity for all other nodes.
Mark all nodes unvisited. Set the initial node
as current. Create a set of the unvisited
nodes called the unvisited set consisting of
all the nodes except the initial node.
The interface also features a drop-down
menu to manually select the malicious node.
Malicious stands for a node which is
compromised i.e. being attacked by an
intruder. Also a malicious node could also
be called a failure node which has been
unable to function due to various reasons
including environmental factors etc.
For the current node [6] , consider all of its
unvisited
neighbors
and
calculate
their tentative distances. For example, if the
current node A is marked with a tentative
distance of 6, and the edge connecting it
with a neighbor B has length 2, then the
distance to B (through A) will be 6+2=8. If
this distance is less than the previously
recorded tentative distance of B, then
overwrite that distance. Even though a
neighbor has been examined, it is not
marked as "visited" at this time, and it
remains in the unvisited set.
The GUI also shows the public-key
cryptography
implemented
on
the
numbering of nodes. If the node 2 sends the
data to node 7, the numbering of nodes have
been encrypted to show for example node 29
sending the data to node 34. The
intermediate nodes’ numbering is also
encrypted using RSA algorithm. In this
way, the intruder will not be able to trace the
When we are done considering all of the
neighbors of the current node, mark the
current node as visited and remove it from
the unvisited set. A visited node will never
be checked again; its distance recorded now
is final and minimal.
If the destination node has been marked
visited (when planning a route between two
specific nodes) or if the smallest tentative
14
distance among the nodes in the unvisited
set is infinity (when planning a complete
traversal), then stop. The algorithm has
finished. Set the unvisited node marked with
the smallest tentative distance as next
"current node" and go back to step 3.
The Flowchart for Dijstra algorithm is
shown in figure.2
Chugh and Singh
because it is assumed that only the key is
known to the receiver.
Incase of RSA algorithm, both the plaintext and the cipher-text are integers
between 0 to (n-1) for some n.
The steps for RSA algorithm are
Step 1 : Select two prime nos – p & q
Step 2 : Calculate n as product of p & q,
i.e. n=pq
Step 3 : Calculate m as product of (p-1)
& (q-1) i.e. m = (p-1)(q-1)
Step 4 : Select any integer e<m such
that it is co-prime to m, i.e
gcd(e,m) =1
Step 5 : Calculate d such that de mod m
= 1 , i.e. d = e-1 mod m
Step 6: The public key is {e,n)
The private key is {d,n}
6. Results and discussions
The Graphical user interface for
wireless sensor nodes has been
developed. The figure below shows the
snapshot for a network consisting of 10
nodes in MATLAB.
Fig 2. Flowchart for Dijkstra's algorithm.
5. Applying RSA algorithm for
public key encryption.
The RSA algorithm is used to implement
public key cryptography. This is done on
numbering of nodes. i.e node 2 data
destined for node 7 is being spoofed as if
node 29 is sending data to node 32. RSA
algorithm uses two different keys:
Public
Key-Known
to
every
communicating entity in the network .
Private Key:-Known uniquely to the
user.
Generally, the receiver's public key is
used for encrypting information and is
sent to the receiver who decrypts it by
his unique private key (known only to
him). This ensures confidentiality
Figure 3: Wireless sensor network of
10 nodes
Also shown is the drop down menus for
selecting source and destination nodes.
The below figure depicts the data path
from source to destination nodes
selected by applying Dijkstra's algorithm.
The data is sent from node 3 to node 5 via
node4.
Chugh and Singh
15
networks: a survey." Network Protocols
and Algorithms 2.2 (2010): 27-53.
2. Habib, Asif. "Sensor network security
issues at network layer." Advances in
Space Technologies, 2008. ICAST 2008.
2nd International Conference on. IEEE,
2008.
Figure 4 : Data path using Dijkstra's
algorithm
Another
figure
shows
the
implementation of RSA algorithm. The
nodes have been renumbered i.e node 3
has been encypted to node 66, node 4 to
node 93,node 5 to node 110.
Figure 5: RSA encryption result
6. Conclusion
This work has successfully created a
graphical user interface for wireless
sensor networks. Also the manual
selection of source node, destination
node and malicious nodes provide an
insight of best short route algorithm for
data delivery. Also, the RSA algorithm
running in the backend provides a good
means to prevent the nodes/path from
intrusion
.The
work
contributes
sufficiently towards creating a user
friendly environment for network users.
7.
References
1. Mulligan, Raymond, and Habib M.
Ammari. "Coverage in wireless sensor
3. Aschenbruck, Nils, et al. "A security
architecture and modular intrusion
detection system for WSNs." Networked
Sensing Systems (INSS), 2012 Ninth
International Conference on. IEEE,
2012.
4. Haiyun Luo, Petros Zerfos, Jiejun
Kong, Songwu Lu, Lixia Zhang, “Selfsecuring Ad Hoc Wireless Networks,”
IEEE ISCC (IEEE Symposium on
Computers and Communications) 2002,
Italy.
5. Du, Wenliang, Lei Fang, and Ning
Peng. "Lad: Localization anomaly
detection
for
wireless
sensor
networks." Journal of Parallel and
Distributed Computing66.7 (2006): 874886.
6. Pires Jr, Waldir Ribeiro, et al.
"Malicious node detection in wireless
sensor
networks." Parallel
and
Distributed Processing Symposium,
2004. Proceedings. 18th International.
IEEE, 2004.
7. Curiae, D-L., et al. "Malicious node
detection in wireless sensor networks
using
an
autoregression
technique." Networking and Services,
2007. ICNS. Third International
Conference on. IEEE, 2007.
8. Panos, Christoforos, Christos Xenakis,
and Ioannis Stavrakakis. "A Novel
Intrusion
Detection
System
for
MANETs." Security and Cryptography
(SECRYPT), Proceedings of the 2010
16
International
2010.
Chugh and Singh
Conference
on.
IEEE,
9. Yi, Ping, Yue Wu, and Jianhua Li.
"Malicious node detection in Ad Hoc
networks
using
timed
automata." Wireless, Mobile and Sensor
Networks, 2007.(CCWMSN07). IET
Conference on. IET, 2007.
10. Atakli, Idris M., et al. "Malicious
node detection in wireless sensor
networks
using
weighted
trust
evaluation." Proceedings of the 2008
Spring simulation multiconference.
Society for Computer Simulation
International.
11. Musznicki, Bartosz, Mikolaj
Tomczak, and Piotr Zwierzykowski.
"Dijkstra-based localized multicast
routing
in
Wireless
Sensor
Networks."Communication
Systems,
Networks & Digital Signal Processing
(CSNDSP), 2012 8th International
Symposium on. IEEE, 2012.
12. Abuarqoub, Abdelrahman, et al.
"Simulation Issues in Wireless Sensor
Networks: A Survey." SENSORCOMM
2012,
The
Sixth
International
Conference on Sensor Technologies and
Applications. 2012.
.