Sei sulla pagina 1di 7

Wireless Sensor

Network Simulation
Frameworks:
A Tutorial Review
By Madhupreetha L. Rajaram,
Elias Kougianos, Saraju P. Mohanty,
and Uma Choppali

MATLAB/Simulink bests the rest.

A
wireless sensor network (wsn) is a
distributed set of sensors deployed to
work together for collective sensing
and possible data processing. A WSN
can be used to monitor environmen-
tal behavior and structural integrity in a variety
of application fields, thus becoming an integral
part of the consumer electronics of smart
buildings in smart cities. Due to ever-increas-
ing population growth, along with limited nat-
ural resources, smart cities are expected to be
the wave of the future. For instance, WSNs
are widely used in industrial settings with
machine monitoring and play an important
role in monitoring the structural integrity of
large buildings and bridges. This article
focuses on existing WSN simulation frame-
works that could be integrated with real-
time hardware prototypes. We analyze and
compare various such simulation frame-
works, and we determine a suitable simu-
lation environment that supports specific
software packages.

INTRODUCTION
A typical sensor is used to sense environ-
mental properties, such as temperature,
pressure, stress, and vibration in the form
of electrical signals, which are then cali-
brated to measure the corresponding
physical properties [1]. WSNs are
deployed to sense variations in and transmit data
image licensed by graphic stock
through wireless networks, as depicted in Figure 1 [2].
These sensors and sensor networks are an integral part of
consumer electronics used for the development of smart cit-
Digital Object Identifier 10.1109/MCE.2016.2519051
ies, smart structures, smart transportation systems, and
Date of publication: 8 April 2016 smart health care.

2162-2248/162016IEEE April 2016 ^ IEEE Consumer Electronics Magazine 63


environment, since there are numerous
such platforms available for WSN simu-
lation. We analyzed a comprehensive
Internet WSN
Sink selection of WSN simulation frame-
Node works and paid particular attention to
those packages that can be interfaced
with actual hardware.
Sensor Node
WIRELESS SENSOR NETWORKS:
User STATE OF THE ART
The advancement of WSNs has led to
FIGURE 1. An illustration of a WSN. more accurate structural-integrity moni-
toring, data collection, and analysis of
A specific example of usage of a WSN for structural observed data. However, the data collection process is affected
health monitoring is shown in Figure 2. The collected data by various factors. Researchers have proposed different solu-
provide a better understanding of the structural materials tions and algorithms to improve the performance of WSNs.
and the capacity of the structure and can also be used to
generate alert warnings during natural calamities. To obtain POWER MANAGEMENT
complete and accurate information, a large number of sen- The sensor nodes are powered by a battery source, and the
sor nodes must be deployed in the areas of interest. During lifetime of the sensor node is determined by the energy stored
the process of sensing and transmitting data, issues such as in the battery. Hence, the effective use of the available power
power management, data collection, time synchronization, is a main challenge faced in sensor data collection. In [3], the
communication protocols, and congestion need to be researchers propose an algorithm for selecting the cluster
addressed. Researchers propose various algorithms to over- heads for a group of sensors to reduce the power consump-
come these issues. These algorithms can be verified with a tion. The algorithm was based on random head selection,
simulation modeling framework or an experimental setup. where minimum distance between the nodes was tabulated.
One approach to testing a design is through an experi- Then the node with the minimum hopping distance was
mental setup using actual components, but it is expensive determined and assigned as the cluster head, which reduces
and rigid in terms of exploratory research. On the other the energy required to hop the data over long distances.
hand, a simulation framework can reduce time, risk, and An optimizing algorithm for limited buffering and con-
cost. However, it is important to select a suitable simulation trolled mobile sink was proposed in [4]. The mobile sink that
collects the data by moving from one point to another
increases the wait time, and therefore can lead to buffer over-
flows. So an optimization algorithm to reduce wait time is
Due to ever-increasing population discussed, and the algorithm is implemented in the
growth, along with limited natural OMNeT++ simulator.
resources, smart cities are expected
DATA COLLECTION
to be the wave of the future. One of the most important operations of the sensor nodes is
data collection. Different data aggregation techniques have
been proposed for efficient data collection. In [5], the author
proposed a complete information collection mechanism by
deploying an agent in the WSN. This agent collaboration pro-
vides a means to coordinate with multiple sensor nodes to
Structure Vibrates
complete data collection, analysis, and distributed fault diag-
Sensor nosis. Different agents are assigned different operations, and
Sensor they coordinate with each other to complete the entire task, as
Building or Structure Transmits
Movement shown in Figure 3. The model is simulated in a network sim-
Data ulator to verify operation.

Receives and Records


Movement Data
COMMUNICATION PROTOCOLS
To obtain complete information on the area of interest, a large
Base Station Router number of sensor nodes are deployed. When all these sensor
(Data Analysis) nodes try to communicate with the base station or sink, data
congestion can occur. A new congestion control mechanism
FIGURE 2. An illustration of a WSN for structural health monitoring. was proposed in [6]. In this mechanism, the b uffer in each

64 IEEE Consumer Electronics Magazine ^ April 2016


node is adjusted on the basis of downstream data transmission
to minimize packet loss. The performance of the algorithm
was verified by simulating the model in MATLAB.
Data collected at sensor nodes need to be transmitted to the Local Model
Problem
base station or sink. This requires an efficient communication Solver
protocol. For this, the authors of [7] proposed a sleep-
scheduling algorithm to turn the radios on and off. The switch- Task List Solution
ing on and off of the radio is defined as a contiguous link Goal
scheduling problem and is simulated in a C++ simulator. A Other Model
hierarchical routing protocol, which is an optimized low-energy Scheduler
adaptive clustering (LEACH) protocol, was proposed in [8].
LEACH is a clustering-based protocol that aims to reduce the
energy on the basis of the assumption that all nodes have the Communication
same amount of energy. In actual practice, all nodes do not con-
Monitor
sume the same amount of energy; hence, in this algorithm, the
authors proposed an optimized LEACH. The algorithm allo-
Mobile Model
cates time slots for all the nodes. When the node does not trans-
mit data during its time slot, some other node utilizes the vacant
slot for transmission. This reduces the wait time for other FIGURE 3. A typical agent structure.
nodes, which results in efficient utilization of the available
resource. The performance of the algorithm was tested in
OMNeT++. A data-gathering tree was constructed and an energy- Sink
efficient scheduling algorithm was proposed in [9]. The algo-
rithm aims to reduce the state transitions and hence the energy
consumption. This algorithm uses a time division multiple P2
P1 Pn
access (TDMA) technique for scheduling. The activities of sub-
sets of the sensors are divided into different groups, and succes- Gn
G1 G2
sive time slots are scheduled. The entire network is divided into
different groups, as shown in Figure 4. In the network, each S1 S2 Sn
group consists of a parent node and children nodes. The chil-
dren nodes send data to the parent, and the parent sends infor-
mation later to the sink within the allotted time slot. The model C1 C C2 C Cn C
was simulated in NS-2.34 to verify the performance.
FIGURE 4. An illustration of a network model. P indicates a parent
TIME SYNCHRONIZATION node to which a group (G) of nodes sends the data aggregated by
The data transmitted to the base station is stamped with time the group sinks (S); C indicates the children nodes in each group.
information to provide details on when the data was sensed.
If each node operates at a different clock time, the time
stamped with data transmission will not be the same for all Root Root
0 0
nodes. Hence, it is important to synchronize the time for all
nodes. In [10], the authors proposed an algorithm for time
synchronization of neighboring nodes based on a gradient 1 3 2 3
time synchronization protocol (GTSP), as shown in F igure 5, 1
designed for accurate clock synchronization of neighboring 2
nodes in a network simulator. 6 4 6
5 4 5
WIRELESS SENSOR NETWORK Time-Based Gradient
SIMULATION: SELECTED FRAMEWORKS Synchronization Protocol Synchronization Protocol
The behavior of a system can be studied analytically, experi-
mentally with a simulation mode, or through a combination FIGURE 5. The Gradient Time Synchronization Protocol.
of these approaches. Analytical methods, however, cannot
provide complete details on the impact of power consumption short time. A simulation model can be designed on the basis
and other issues. Experimental analysis can provide more of different algorithms. It is important to determine an
accurate information, but this is achieved at a higher cost. algorithm that best fits the requirements of a WSN.
Therefore, simulation models serve as the best alternative to A wide variety of simulation platforms are available, but only
understanding the behavior of a system at low cost and in a a few simulators might be applicable for certain operations.

April 2016 ^ IEEE Consumer Electronics Magazine 65


NETWORK SIMULATOR (NS-2)
Network Simulator (NS-2) is a discrete-event, object-orient-
Sensors and sensor networks are ed, and general-purpose network simulator based on C++
an integral part of consumer language that can be used to simulate local and wide-area
electronics used for the networks [11][13]. It was developed to operate primarily in
Linux-based operating systems (OSs), such as Ubuntu. How-
development of smart cities, smart ever, it can also be installed in Windows OS with Cygwin
structures, smart transportation support. For analysis purposes, we installed NS-2 in Ubuntu.
There are three commands that need to be typed in the termi-
systems, and smart health care. nal to install the latest version: 1) sudo apt-get
install ns2, 2) sudo apt-get install nam, and
Among the available software tools are NS-2, OMNeT++, 3) sudo apt-get install xgraph. When installa-
PAWiS, GloMoSim/QualNet, OPNET, SENSE, J-Sim, Ptolemy tion is complete, ns can be typed in the terminal. A per-
II, Cell-DEVS, NesCT, GTnets, System C, Prowler, centage symbol is returned, which confirms the successful
NCTUns2.0, Jist/SWANS, SSFNet, TOSSIM, Atarraya, Avrora, installation of NS-2. A network animator (NAM) editor win-
ATEMU, EmStar, SENS, Shawn, PiccSIM, TrueTime 2.0 in dow, as shown in Figure 6, can be opened by typing nam in
MATLAB/Simulink, and native MATLAB/Simulink [11], [12]. the terminal. To design a model, a program can be written in
Each one could be used for different kinds of applications. the Tool Command Language (Tcl) and visualized through
the NAM editor. The performance is reliable for node sizes
DETAILS OF SELECTED SIMULATION FRAMEWORKS up to 100 nodes and degrades with increased node size.
There are more than 25 WSN frameworks available. We The disadvantages of NS-2 are the interdependency
short-listed and analyzed a few of these simulation environ- between the modules and that cosimulation with MATLAB
ments. The key features considered for the selection of a sim- requires special framework definitions [14]. Also, to imple-
ulation platform were the following: cosimulation with ment the ZigBee communication protocol, separate patch
MATLAB, operating system support, programming lan- files must be installed. Even though this network simulation
guage implementation and API, number of nodes that could can be used for verifying different algorithms, NS-2 cannot
be simultaneously simulated, documentation, latest-version be used easily for hardwaresoftware cosimulation in MAT-
availability, ZigBee support, and potential issues during LAB, as it requires separate framework definitions.
installation. Since the objective is focused on integrating the
software model and hardware prototype, MATLAB plays an OMNeT++
important role in the design. So the simulation environment OMNeT++ [11], [12], [15] is a modular simulation framework
must be capable of communicating with MATLAB/Simulink written in C++ that can be used for simulating ad-hoc net-
during real-time operation. works. Frameworks developed in OMNeT++ that can be used
for WSN analysis include MiXiM, Mobil-
ity Framework, media access control
(MAC) layers, Castalia, INET framework,
and NesCT. NesCT can be used for simu-
lating TinyOS sensor-based networks.
PAWiS is also an OMNeT++-based simu-
lator that captures a wide array of mod-
ules and provides support for mobility
and environmental dynamics [9].
OMNeT++ is a commercial software that
can be used for educational and research
purposes. The modules are written in the
Network Description (NED) program-
ming language. Cosimulation of MAT-
LAB and OMNeT++ can be achieved by
converting C/C++ code into objects and
compiling these objects in OMNeT++.
However, it does not support communica-
tion during real-time simulation.

PROWLER
Prowler is an event-driven wireless sen-
FIGURE 6. The NS-2 NAM editor window. sor network simulator designed to run on

66 IEEE Consumer Electronics Magazine ^ April 2016


MATLAB [11]. Simulation codes that implement routing pro-
tocols and other applications can be written in the MATLAB
language. This framework can be used for optimizing com-
MATLAB/Simulink is attractive
munication protocols [16]. Prowler can be installed in MAT- for WSN framework simulations.
LAB by simply adding the directory to the MATLAB
start-up path. The editor window can be opened by typing
prowler in the MATLAB c ommand w indow. A window main advantage is that the simulator can be integrated with
appears, as shown in Figure 7, where the data transferred Simulink and NS-2.34. But two separate computersone run-
between the nodes can be visualized. Some routing protocols, ning NS-2.34 and the other running MATLABare required.
such as flood 1D, flood 2D, span tree, and collision demo, can For analysis, we installed NS-2.34 in a Virtual machine and
be verified through Prowler. However, it cannot be used for MATLAB/Simulink in the host machine. Since NS-2.34 was an
developing a customized WSN framework. There is no clear older version, some bugs had to be rectified before installation.
documentation provided for developing user-defined models, After successfully installing NS-2.34, we installed the PiccSIM-
and no new versions have been released recently. Also, Prowl- NS-2.34 patch. But the patch files corrupted NS-2.34 with an
er does not support the ZigBee protocol. error. The simulator is no longer supported by the developer,
and we could not rectify the error in the patch.
ATARRAYA
Atarraya is an event-driven simulator that
can be used for teaching and researching
control topology algorithms and wireless
sensor protocols [17]. It is designed to
operate in the Windows OS. The simula-
tor can be installed by adding the directo-
ry path to the environmental variable.
After installation, the Atarraya simulation
panel, as shown in Figure 8, can be
opened by double-clicking the Atarraya.
jar file. Atarraya is written in Java. The
latest Oracle Java version must be
installed to use Atarraya.
The simulation panel consists of a
deployment panel, a protocol selection
panel, a visualization panel, a node stats
panel, and a report panel. In the deploy-
ment panel, the number of nodes and
their location and size can be selected.
The communication protocol can be FIGURE 7. The Prowler user interface.
selected from the protocol selection
panel, and the nodes can be visualized in
the visualization panel. The advantages
of Atarraya are that it supports different
topology construction and maintenance
and allows simulation of initial agent
topology with the available algorithm. In
addition, Atarraya supports simple and
walk-based mobility and energy models.
On the other hand, the simulator does not
support the ZigBee protocol and cannot
be integrated with MATLAB/Simulink.

PiccSIM
PiccSIM [18] is a simulation platform for
integrated communication, control design
simulation, implementation, and model-
ing. This toolkit can be used for cosimula-
tion of networked control systems. The FIGURE 8. The Atarraya simulation panel.

April 2016 ^ IEEE Consumer Electronics Magazine 67


Table 1. Comparative perspectives of simulation frameworks.

MATLAB/
Operating Programming Simulink ZigBee
Framework System Compiler Latest Update Language Node Size Integration Support
NS-2 Unix/Windows C++, JDK 1.6 NS-2.35/2013 Tcl/Object Tcl 100 nodes Yes Yes
with Cygwin (OTcl) Maximum
OMNeT++ Windows, OS C++11, JDK 1.7 OMNeT NED Language Yes Yes
X, Linux or later 4.6/2014
Prowler OS that Apple Xcode V1.25/2004 Graphical Based on Yes No
supports version 4.0 programming the type of
MATLAB or higher; tool (graphical application
Windows: C++, user interface)
JDK
Atarraya Windows, Java 6 1.3 beta/2011 Graphical user Can simulate No No
requires interface 1,000 nodes
graphical
user interface
formatting
for Linux
PiccSIM Windows, OS Apple Xcode PiccSIM Simu- Tcl/Otcl for Similar to NS-2 Yes Yes
X, Linux version 4.0 or link version network
higher; Win- 1.16/2013 modeling
dows:
C++, JDK
TrueTime Windows, OS Apple Xcode TrueTime 2.0 Graphical Limited Yes Yes
X, Linux version 4.0 beta 7/2012 Programming
or higher; tool
Windows: C++,
JDK, Microsoft
Visual Studio
MATLAB/ OS X, Win- Apple Xcode R2015a C, C++, Code: > 100 Yes
Simulink dows, Linux version 4.0 Fortran nodes;
or higher; Simulation:
Windows: Restricted
C++, JDK

and can act as a stand-alone network interface block. It


allows cosimulation of controller task execution in real-time,
There are more than 25 WSN network transmission, and continuous plant dynamics. The
frameworks available. We short- disadvantage with TrueTime is that clear documentation for
listed and analyzed a few of these programming the kernel blocks is not available, which made
it difficult to use this framework.
simulation environments.
MATLAB/SIMULINK
MATLAB/Simulink [20] is a software package for numeric
TRUETIME computation and analysis that is developed and maintained by
TrueTime is a real-time control system-based framework that Mathworks Inc. The software is flexible and reliable. Simu-
operates in MATLAB/Simulink [19] and is written in the link is a software package for modeling, simulating, and ana-
C++ and MEX languages. TrueTime can be installed in lyzing dynamic systems. The software can be installed in the
MATLAB by adding its path to the PATH environmental major OSs such as Windows, Mac OS X, and Linux. Simulink
variable and the MATLAB start-up path. To compile pro- supports a wide variety of toolkits, such as digital signal pro-
grams in TrueTime, Microsoft Visual Studio must be cessing toolkits, communication toolkits, control systems, and
installed. The TrueTime package is composed of network embedded controller toolkits. As a result, it enables users to
blocks such as Ethernet, controller area network, TDMA and make customized designs with MATLAB/Simulink seamless-
Frequency Division Multiple Access, Round Robin, Switched ly. The key advantage of MATLAB/Simulink is that all these
Ethernet, FlexRay, and PROFINET. It also consists of wire- toolkits are documented with examples. Another benefit of
less network blocks such as WLAN 802.11b and 802.15.4 MATLAB/Simulink is the automatic code generation feature,
ZigBee technology. TrueTime supports battery power sources which promotes integration of real-time processors with the

68 IEEE Consumer Electronics Magazine ^ April 2016


Uma Choppali (umachoppali@gmail.com) is an adjunct
faculty member in the Department of Engineering Technolo-
We found that MATLAB/Simulink gy at the University of North Texas. She earned her Ph.D.
met the most important design degree in material science and engineering from the Universi-
specifications, such as customized ty of North Texas in 2006. She holds a masters degree from
the Indian Institute of Technology in Bombay, India, and has
node design, ZigBee, and authored ten peer-reviewed publications.
cosimulation with hardware.
REFERENCES
[1] S. P. Mohanty, Nanoelectronic Mixed-Signal System Design. New
simulation model. With Simulink, customized node communi- York: McGraw-Hill Education, 2015.
cation through the ZigBee protocol can be developed. With [2] M. L. Rajaram, Comparative analysis and implementation of high
the code generation capabilities of MATLAB, the simula- data rate wireless sensor network simulation frameworks, masters the-
sis, Dept. Eng. Technol., Univ. North Texas, 2015.
tion model can be integrated easily with hardware models. [3] G. Zhang, G. Liu, W. Chen, and C. Yang, Quantitative analysis of
As a result, MATLAB/Simulink is attractive for WSN cluster-head selection for wireless sensor networks, in Proc. World
framework simulations [1], [2]. Automation Congr. (WAC), 2012, pp. 277281.
[4] T. Rault, A. Bouabdallah, and Y. Challal, WSN lifetime optimization
through controlled sink mobility and packet buffering, in Proc. Global
SUMMARY AND CONCLUSIONS
Inform. Infrastructure Symp., Oct. 2013, vol. 201, pp. 16.
This article focused on comparing WSN simulation frame- [5] Y. Lei, Research and implementation of WSN-based data acqui-
works that need to be integrated with an actual hardware sition and analysis system using agent collaboration, in Proc. 2nd
platform. We analyzed various frameworks that can be used Int. Conf. Power Electron. and Intelligent Transportation Syst.,
for simulating WSNs. Specifically, we analyzed in detail 2009, pp. 235237.
software such as NS-2, OMNeT++, Prowler, Atarraya, Picc- [6] V. Michopoulos, L. Guan, and I. Phillips, A new congestion control
mechanism for WSNs, in Proc. 10th IEEE Int. Conf. Comput. and
SIM, Truetime, and MATLAB/Simulink. We compared and Inform. Technol., 2010, pp. 709714.
studied these simulators thoroughly on the basis of specific [7] J. Ma, W. Lou, and X.-Y. Li, Contiguous link scheduling for data
criteria. An important design requirement is the cosimula- aggregation in wireless sensor networks, IEEE Trans. Parallel Distrib.
tion capability with the real-time processors and the support Syst., vol. 25, no. 7, pp. 16911701, July 2014.
for the ZigBee network protocol. So we eliminated the sim- [8] N. Fatima and S. Gambhir, Op-Leach: An optimized LEACH meth-
od for busty traffic in WSNs, in Proc. 4th Int. Conf. Advanced Comput-
ulators that did not meet these specifications. Finally, we ing and Commun. Technol., 2014, pp. 222229.
found that MATLAB/Simulink met the most important [9] P. Shrivastava and S. B. Pokle, An energy efficient scheduling strategy
design specifications, such as customized node design, Zig- for data collection in wireless sensor networks, in Proc. Int. Conf. Electron.
Bee, and cosimulation with hardware. Hence, MATLAB/ Syst., Signal Processing, and Computing Technol., 2014, pp. 170173.
Simulink can be used effectively for the framework design [10] P. Sommer and R. Wattenhofer, Gradient clock synchronization in
wireless sensor networks, in Proc. Int. Conf. Inform. Processing in Sen-
and simulation. A comparative perspective of the various sor Networks, 2009, pp. 3748.
packages examined in this work is given in Table 1. [11] S. A. Madani, J. Kazmi, and S. Mahlknecht. (2010). Wireless sensor
networks: Modeling and simulation. [Online]. Available: http://cdn.
ABOUT THE AUTHORS intechopen.com/pdfs-wm/11548.pdf (accessed 14 Dec. 2015).
[12] Q. I. Ali. (2012). Simulation framework of wireless sensor networks
Madhupreetha L. Rajaram (preeth.madhu05@gmail.com)
(WSN) using MATLAB/Simulink software. [Online]. Available: http://cdn.
earned her masters degree in electrical engineering technolo- intechopen.com/pdfs-wm/39337.pdf (accessed 14 Dec. 2015).
gy from the University of North Texas in 2015. [13] The Network Simulatorns-2. [Online]. Available: http://www.isi.
Elias Kougianos (eliask@unt.edu) is currently an associate edu/nsnam/ns/ (accessed 14 Dec. 2015).
professor of electrical engineering technology at the University [14] O. Heimlich, R. Sailer, and L. Budzisz, NMlab: Cosimulation
of North Texas. He earned his Ph.D. degree in electrical engi- framework for MATLAB and NS-2, in Proc. 2nd Int. Conf. Advances in
Syst. Simulation (SIMUL), 2010, pp. 152157.
neering from Louisiana State University in 1997. He is the [15] (2015). OMNeT++ discrete event simulator. [Online]. Available:
author or coauthor of more than 100 peer-reviewed journal and http://www.omnetpp.org (accessed 14 Dec. 2015).
conference publications and is a Senior Member of the IEEE. [16] G. Simon, P. Volgyesi, M. Marioti, and A. Ledeczi, Simulation-
Saraju P. Mohanty (saraju.mohanty@unt.edu) is a professor based optimization of communication protocols for large-scale wireless
in the Department of Computer Science and Engineering at the sensor networks, in Proc. Aerospace Conf., 2003, pp. 13391346.
[17] (2009). Attaraya: A topology control simulator for wireless sensor
University of North Texas and director of the NanoSystem networks. [Online]. Available: http://www.cse.usf.edu/~labrador/
Design Laboratory. He earned his Ph.D. degree in computer sci- Atarraya/ (accessed 14 Dec. 2015).
ence and engineering from the University of South Florida in [18] (2013). PiccSIM simulation of wireless control systems. [Online]. Avail-
2003 and his masters degree in systems science and automa- able: http://wsn.aalto.fi/en/tools/piccsim (accessed 14 Dec. 2015).
tion from the Indian Institute of Science in Bangalore, India, in [19] TrueTime: Simulation of networked and embedded control systems.
[Online]. Available: http://www.control.lth.se/truetime (accessed 14 Dec.
1999. He is the author of 200 peer-reviewed journal and confer- 2015.
ence publications and three books. He is an owner of four U.S. [20] MATLAB. [Online].Available: http://www.mathworks.com
patents. He is a Senior Member of the IEEE and ACM. (accessed 14 Dec. 2015).

April 2016 ^ IEEE Consumer Electronics Magazine 69

Potrebbero piacerti anche