In this section, we will analyze the existing simulation tools according to classification scheme of the taxonomy presented in the ‘Taxonomy on WSN simulation tools’ section. The existing simulation tools are divided to four groups. Many simulators will be studied to demonstrate the common features of each category.
Network simulators with node models
Many general-purpose network simulators, such as NS-2 [
15], OMNeT++ [
32], OPNET [
39], GloMoSim [
40], and J-Sim [
13], have been utilized in WSN simulations. Some extensions have been applied to them to introduce the WSN specific characteristics. Besides the extensions to general-purpose network simulators, some WSN-specific network simulators have also been developed.
NS-2 [
15] is a discrete event, object-oriented, general-purpose network simulator. Simulations are written by C++ and OTcl (Object-oriented Tcl). In general, C++ is used for implementing protocols and extending the library. OTcl is used to create and control the simulation environment. Its extensibility has been a major contributor to its success, with protocol implementations being widely produced and developed by the research community. The performance of wireless LAN is studied in [
41,
42]. According to [
43], it is the most used simulator in mobile ad hoc network (MANET) research. Regarding WSN, it includes many
ad hoc and WSN-specific protocols [
8]. An IEEE 802.15.4 model is developed in [
44]. An energy-efficient routing in WSNs [
45] and directional routing in vehicular networks [
46] are evaluated using NS-2 simulations based on a simple energy model. However, NS-2 does not scale well in terms of memory usage and simulation time [
47]. It also lacks detailed support to measure the energy utilization of different hardware, software, and firmware components of a WSN node [
48]. SensorSim [
12] is built on top of an NS-2 802.11 network model. It models the sensor node in two parts: software model (function model) and hardware model. The power models of different hardware components have been implemented. The state of the hardware model is changed based on the function that is carried out by the software model. Therefore, the power consumption of the whole network can be simulated. In addition, SensorSim can be interacted with real nodes. However, the CPU and sensor models have not been implemented. Furthermore, IEEE 802.11 is designed for high-speed connectivity and not optimized for WSNs.
OMNeT++ [
32] is a component-based network simulator, with an Eclipse-based integrated development environment (IDE) and a graphical runtime environment. The IDE supports all stages of a simulation project: developing, building, configuring, and running simulation models and analyzing results. OMNeT++ consists of modules that communicate with message passing. Simple modules implement the atomic behavior of a model, e.g., a particular protocol. Multiple simple modules can be linked together and form a compound module. OMNeT++ provides the infrastructure to assemble simulations from these modules and configure them (NED language). OMNeT++ can be extended easily by interfaces for real-time simulation, emulation, parallel distributed simulation, SystemC integration, and so on. As OMNeT++ is becoming more popular, many contributions have been added to it. The Mobility Framework (MF) [
49] supports simulations of wireless and mobile networks within OMNeT++. MF includes an 802.11 model. It can be seen as the first start point of WSN modeling by OMNeT++. An IEEE 802.15.4 implementation by OMNeT++ can be found in [
50]. PAWiS [
48,
51] is an OMNeT++ based WSN simulator. Its architecture is similar to SensorSim. It can evaluate the power consumption of WSN systems with many levels of accuracy which can still be balanced with complexity. The model programmer has to insert special framework requests to the CPU module to simulate the execution time and power consumption. These requests include the estimated execution time of the firmware code on the CPU.
WSNet [
52] is a modular-based, event-driven, high-level wireless network simulator. It is composed of many blocks that model the properties of sensor nodes and radio medium. The sensor node model includes the hardware and software abstraction and node behavior modeling (e.g., mobility). WSNet can be used to evaluate the high-level design, such as traffic pattern, application dimensioning, and protocol parameter tuning. It is one of the two simulators in Worldsens [
52], an integrated environment for development and rapid prototyping of wireless sensor network applications. Worldsens also includes a low-level simulator to enable the refinement of WSN application development. The cycle accurate simulator, WSim, will be introduced in the ‘??’ section.
SENSE [
53] is another component-based simulator developed by C++. It models various network devices as a collection of components. Connections between each component are in the format of input and output ports. Packets are created, transmitted, and received by components through the ports. Through its component-based model, SENSE can be extended easily. A new component can replace an old one if they have compatible interfaces; inheritance is not required. SENSE also supports the parallel simulation, which is provided as an option to the users.
GloMoSim [
40] is a parallel simulator for WSNs. GloMoSim allows the users to select sequential or one of the three available parallel synchronization algorithms (null message protocol, conditional event protocol, and accelerated null message protocol). Once a parallel algorithm is selected, the analyst can additionally indicate the mapping strategy and number of processors. Taking advantage of parallel simulation, GloMoSim has been shown to scale to 10,000 nodes [
54]. QualNet [
55] is a commercial derivative of GloMoSim. It has extended GloMoSim to other networks, such as satellite, cellular, and sensor networks. ZigBee protocol model is also provided.
Prowler [
56] is an event-driven network simulator running in Matlab environment. Benefits gained from Matlab environment are easy prototyping of applications and GUI interface. Prowler is capable of simulating the radio transmission, propagation, and the MAC-layer operation in
ad hoc networks. The radio models are based on specific signal strength calculations combined with random errors. Prowler is well suited for protocol and algorithm development. However, it does not have sensor node energy modeling.
NetTopo [
57] is an integrated WSN-specific network simulator that provides the simulation of virtual WSN and the visualization of real testbeds. It also supports the interaction between the simulated WSN and real testbeds. Shawn [
17] is another open-source discrete event simulator written in C++. It is suitable for large-scale network simulations benefitting from the high-level abstraction.
Some customized simulators are developed to study some particular problems in WSNs. For example, the sensor placement problem [
58] and routing protocol design [
59] are studied by Matlab. Sometimes, the collected traces from the real deployments [
60,
61] are imported into the simulation models to reproduce the transmission behaviors of links and paths in WSNs. A discrete event simulator is developed in Java to study the MAC performance of WSNs [
62]. The data aggregation and coverage problems for WSNs are studied by C++ based simulations in [
63,
64]. The channel assignment problem is studied in [
65]. We classify these simulators as network simulators.
The main advantages of network simulator are that they usually have a rich library of the radio modules and protocol implementations. Many contributions to these tools are carried out ceaselessly. For example, the performances of NS-2 in the aspects of scalability and extensibility are improved by its successor, NS-3 [
66]. It also simplified the model implementation by choosing C++ as the sole development language, and the usage of Python scripting language can be optionally enable [
67]. However, the network simulators are dedicated to model the network. It may be not the best way to model the node system since they are normally incapable to model the concurrency within the node and provide a direct path to HW/SW synthesis [
33]. The energy consumption is usually based on some assumptions or estimations of the software execution, for example, the processor and RF transceiver of a sensor node have the same operating state, but in fact the processor can be in sleep mode when the RF transceiver is listening to the channel and woken up by the RF transceiver when the latter receives a packet. Most of the energy models for simulations at network level are not complete. The problems are the following:
-
Some energy models assume that the radio consumes the same power in idle listening as in receiving state and they are ignoring the energy consumption in sleeping state.
-
Few simulation models take into account the transition energy cost for switching between the radio operational states.
-
The energy consumption of the microcontroller is frequently not considered, or the power profile is very simple (just active and inactive states).
Node emulators with network models
Two kinds of node emulator, operating system emulator and instruction set simulator, are studied separately in this section. One special simulator providing both features will also be presented.
TOSSIM [
16] and PowerTOSSIM [
25] are two emulators designed to emulate the execution of TinyOS [
36]. Software development for WSN can be simplified by using these emulators. They permit developing algorithms, studying system behaviors, and observing interactions among the nodes in a controlled environment. The application code of TinyOS can be compiled to the simulation framework by only replacing a few low-level TinyOS components that deal with hardware. TOSSIM can capture the behavior of the network of thousands of TinyOS nodes at bit granularity. TOSSIM allows the developer to easily transition between running an application on motes and in the simulation environment. PowerTOSSIM is an extension to TOSSIM in evaluation of the power consumption. The main problem of such frameworks is that the user is constrained to a specific platform (typically MICA motes) and a single programming language (typically TinyOS/NesC) [
51]. In addition, TOSSIM loses the fine-grained timing and interrupts properties of the code that can be important when the application runs on the hardware and interacts with other nodes [
34].
ATEMU [
68] is an instruction-level, cycle-accurate emulator for WSN written in C. It simulates programs of each individual node with accuracy down to the clock cycle. Its core is an ISS. Along with support for the AVR processor, it also includes support for other peripheral devices on the MICA2 sensor node platform, such as the transceiver. ATEMU provides a GUI, called Xatdb, which provides users a complete system for debugging and monitoring the execution of their code. Avrora [
34], written in Java, improves the performance of ATEMU in the scalability aspect. Avrora can scale to networks of up to 10,000 nodes. Both ATEMU and Avrora provide a high behavioral and timing accuracy of the WSN programs. Moreover, they are both language and operating system independent. The main disadvantage of such frameworks is that they only support systems based on components that have already existed, e.g., memories and processors, like MICA motes. Unfortunately, they do not cover systems containing new hardware blocks.
WSim is the low-level simulator in Worldsens [
52]. It is based on cycle-accurate full platform simulation using microprocessor instruction driven timings. It provides many hardware block descriptions of components on the chip level. A sensor node platform can be built by describing the physical interconnection among these components. WSim can also handle real target binary code simulation and debugging. The time resolution can be at nanosecond level. By combining WSim and WSNet, Worldsens can provide a complete design flow of WSN application, from the high-level design choices down to the target code implementation, debug, and performance analysis.
Fummi et al. [
69] have developed an energy-aware simulator by integrating an ISS of the node’s microcontroller and a functional SystemC model of the network module on SCNSL [
33]. SCNSL is a networked embedded system simulator, which will be introduced in the ‘Node system simulator with network models’ section.
μ Csim is used as the ISS for the Intel 8051 microcontroller of the Texas Instruments CC2430F128 chip. Using ISS makes it possible to run the exact binary embedded software on the simulated hardware platform. The SystemC kernel is modified to communicate with the ISS through inter-process communication primitives (e.g., a socket or shared memory).
COOJA [
70] is a Java-based simulator that provides both the operating system emulation and the instruction set emulation in a single framework. The Contiki operating system [
38] can be compiled to the simulation framework. It executes native code by making Java Native Interface (JNI) calls from the Java environment to a compiled Contiki system. MSPSim [
71] is used as the instruction set simulator in the COOJA. MSPSim is also written in Java. It supports the Texas Instruments MSP430 microcontroller and includes some hardware peripherals such as sensor, communication ports, LEDs, and sound devices. Recently, the COOJAMSPSim platform [
72] has been extended to support the TinyOS. The interoperability testing of nodes with different operating systems is realized.
The main advantage of using such tools is that the code used for emulation can also run on the real node, which reduces the effort to rewrite the code. In addition, they often provide detailed information about resource utilization. The main problems are that they are always constrained to specific hardware platforms or operating systems. Because much detail of cycle-accurate level is considered, they cannot scale as well as the node system models at system level. Moreover, for new applications, it may take more time to develop the final executable code than to abstract the applications at the beginning of system design.
Node system simulator with network models
Wireless Sensor Network Simulator (WISENES) [
73] is developed in specification and description language (SDL) [
74], which is a high-level abstraction language widely used in communication protocol design and can be converted to C code automatically. The key feature of WISENES is that its simulation models are reusable in the embedded software design for the final system. However, WISENES only contributes to the software implementation. SDL is unsuitable to model synchronous digital circuits because the SDL system behavior is defined as a network of extended finite state machines that communicate with each other using asynchronous signals [
75]. On the other hand, SystemC provides native supports of HW/SW co-simulation.
Virk et al. [
76] have developed a SystemC-based modeling framework for WSN. It models the applications, real-time operating systems, sensors, processor, and transceiver at node level and signal propagations at network level. It is the first work using SystemC in WSN simulation, but the simulation result is simple. Only a MAC behavior (states of the sending and receiving tasks) waveform has been presented in [
76].
ATLeS-SN (Arizona Transaction-Level Simulator for Sensor Network) [
77] is a transaction-level modeling (TLM)-based sensor network simulation environment developed in SystemC. It models a sensor node in three components: application specification, network stack implementation, and sensor system. The physical channel is modeled as a component. It provides an interface that can be called from sensor nodes. ATLeS-SN demonstrated the feasibility of using TLM for sensor network application, but no standard networking protocol has been implemented.
The SNOPS framework [
78] is another TLM-based WSN simulator. A sensor node transmits or receives a data packet to or from an environment model by transaction exchanges. The SNOPS framework [
78] requires 49.7% less simulation time than PAWiS [
48].
SystemC Network Simulation Library (SCNSL) [
33] is a networked embedded system simulator, written in SystemC and C++. It includes three modules: node (SystemC), node-proxy (SystemC), and network (C++). During the initialization of simulation, each node registers its information (e.g., location, TX power, and RX sensitivity) at a network class which maintains the network topology and transmits packets to other nodes. The node-proxy is an interface between the network and nodes. By using node-proxy, nodes can be designed as pure SystemC modules so as to exploit all advantages of SystemC in HW/SW co-design and verification. SCNSL demonstrates a great perspective for system-level simulation of WSN system, but it still has some limitations such as node-level simulation without any specific hardware platform or energy model.
IDEA1 [
1,
79,
80] is based on the SCNSL library of alpha version. The network model of IDEA1 is inherited from SCNSL; however, many contributions have been developed. Emphasizing the modular design, IDEA1 models a sensor node exactly according to its hardware architecture. Each hardware component is modeled as an individual module. By doing this, the behaviors of hardware components can be accurately captured, which is the basis of energy consumption estimation. An energy model [
81] has been developed to enable the accurate energy consumption prediction. It has been calibrated by some experimental measurements. Both free space and International Telecommunication Union (ITU) indoor propagation models are implemented. The simulation results of IDEA1 have been validated by a testbed consisting of nine nodes and compared with NS-2. Based on the efficient simulation kernel of SystemC and optimized model implementation, the simulation speed of IDEA1 is twice faster than NS-2. Using IDEA1, the performance of IEEE 802.15.4 MAC protocols is studied in [
82] and a real application of WSNs on vibration measurements is studied in [
83].
These simulators scale better than node emulators since they usually model sensor node at system level. Additionally, new hardware and software modules can be easily added to the existing library. However, they are normally based on a special HW/SW description language which poses an extra learning burden to the new users.
Network simulators with node emulators
Two main simulators have been developed in this category. Park et al. [
84] have developed a unified network and node level simulation framework. They developed the Embedded Systems Power Simulator (ESyPS) by integrating sensor and radio modules into EMSIM [
85]. EMSIM is an energy simulation framework for embedded systems featured in StrongARM microprocessor and Linux OS. Then, they integrated the ESyPS with SensorSim [
12]. The framework can explore the interactions between network level and node level.
Another example is sQualNet [
86], which is a scalable and extensible sensor network simulation framework built on top of QualNet [
55]. It uses QualNet as the network simulator and provides the emulation of the SOS operating system [
37]. sQualNet allows using the QualNet’s detailed models of channel, propagation, mobility, etc. The user also can use the rich protocol suite for other kinds of networks to model heterogeneous sensor networks. sQualNet introduces a sensor stack parallel to the networking stack and provides accurate simulation models for various layers in the sensor and networking stack.
These two simulators integrate the advantages of both the network simulators and node emulators. They provide accurate results about the energy consumption of the whole network. However, they are both constrained to a particular hardware and operating system. Moreover, interactions between the network simulator and the node emulator have to be well maintained, which increases the simulation time and impacts the scalability.