Wireless Sensor Networks Simulation

34 downloads 0 Views 523KB Size Report
Environmental data are provided to simulate sensor readings. J-Sim [13]. Java-Sim began as a generic, open-source, component based, compositional network.
Journal of Electronic Design Technology ISSN: 2229-6980 (online), ISSN: 2321-4228 (print) Volume 5, Issue 2 www.stmjournals.com

Wireless Sensor Networks Simulation Sachin Gajjar1*, Mohanchur Sarkar2, Kankar Dasgupta3 1

Dept. of Computer Science and Engg., Nirma University Ahmedabad, Gujarat, India Space Application Centre, Indian Space Research Organisation, Ahmedabad, Gujarat, India 3 Indian Institute of Space Science and Technology, Thiruvananthapuram, India

2

Abstract The formidable growth of Wireless Sensor Network (WSN) research has raised challenging issues of examining the micro behaviour of proposed protocol and carrying out its performance evaluation. The methodologies to realize this is: mathematical modelling; experimentation and simulation. For WSNs, experimentation has financial constraints and mathematical modeling at times requires deep expertise in mathematics. Thus simulation has become the first choice for research in WSNs. There are several researchers using simulators but there is limited number of simulation studies in the literature. To bridge the gap, this paper discusses the elements of WSN simulation, parameters of an ideal WSN Simulator and briefly describes the most significant simulation frameworks available. The selection of the simulation frameworks is based on their popularity, simulation results published in literature, important characteristics and features.

Keywords: Wireless sensor Network simulation, Simulators, Comparative review *Author for Correspondence E-mail: [email protected]

INTRODUCTION The methodologies for performance evaluation of a proposed protocol, architecture or algorithm for Wireless Sensor Network (WSN) are: mathematical modelling; experimentation; simulation. Due to cost and time required in experimentation, often either mathematical modelling or simulation are used. At times detailed mathematical models get difficult and provide a limited insight for system design. Thus, simulation is the best choice for WSN research. However, limitations of simulators or common faults in simulation procedure, like lack of awareness of simulation features; underlying assumptions; inappropriate details of underlying models may lead to vague results. To this end this paper discusses elements of WSN simulation, parameters of an ideal WSN Simulator and briefly describes the most significant simulation frameworks available. The rest of the paper is organized as follows: The very first section discusses elements of WSN simulation, following section discusses parameters of ideal WSN Simulator, subsequent section presents various simulator

frameworks and last section gives conclusion with detailed comparative analysis of all the simulators discussed in the paper.

ELEMENTS OF WSN SIMULATION Using the discussions in [1–4] we identify the following as elements of a WSN simulator:  Entity: It is an abstraction of a specific subject of interest described by its attributes like objects that intermingle with one another resulting into change of state of the system. Typically they represent physical objects like nodes, data/control packets, or non-physical objects like simulation timer in WSN. For instance, a node is an entity with attributes such as position, current battery status etc.  System: It is a set of entities and relationship among them that attains a certain goal of the system. For example WSN can be defined by entities nodes, routers, links and Base Station (BS) to provide end-to-end connectivity.  Network Resources: In WSN they include bandwidth of transmission media, medium access time, and BS time. Sources are

JoEDT (2014) 1-8 © STM Journals 2014. All Rights Reserved

Page 1

Wireless Sensor Networks Simulation



 



limited resources and to be shared among set of entities. Events: They are involved in some actions throughout the simulation. This generates events triggering change in system states. Like when buffer of router is full, packet is engaged in waiting activity till it is processed by the routing algorithm. Event Scheduler: It maintains the list of events and their execution time with the help of a clock. Global Variables: It keeps track of common values of simulation that can be accessed by all functions or entity like busy time of transmission media or queue length in router. Random Number Generator: It introduces randomness to generate different results for different simulation runs. Process like packet arrival, waiting in queue, running routing algorithm can be modelled as random processes.

AN IDEAL SENSOR NETWORK SIMULATOR An ideal WSN simulator should posses following characteristics:  Simplicity: A good simulator should be simple and spend its complexity to serve purpose of goal of simulation study.  Credibility: A simulator is credible if it is validated and real world implementation of algorithm, protocol or architecture decisions can be based on it [4].  Documentation: It should clearly mention assumptions and simplifications, features available and also those not available in the simulator to shorten the learning curve of the user.  Efficiency: The simulator should be efficient so that the simulation runs are moderate compared to implementation complexity and also allow a methodical investigation.  Verification: Match between performance and simulation model must have been checked by different techniques.  Code Quality: Simulator implementation should maintain a certain coding style like procedures, objects etc. Techniques.  Availability: Simulator should be easily accessible and free so that a large user group can verify and validate it.

Gajjar et al.











Scalability: It is capability of simulator to handle large number of nodes with different configurations and large geographical area with sufficient speed and efficiently. Completeness: It is number of simulation components and protocols covered by the simulator with sufficient accuracy. Model: It is list of models supported by simulator. Some of the models are channel, battery, node models. Ease of real network implementation: It is simulator ability to allow developers to test and verify code that can directly run on real hardware with minimum changes. Open or Close packages: Simulator is open if it has support to change basic modules or add new ones or else it is closed.

SIMULATION FRAMEWORK FOR WSN Network Simulator NS2 [5,6] NS2, is an open-source and discrete event simulator based on REAL network simulator by University of California and Cornell University. NS2 consists of two key languages: C++ and Object-oriented Tool Command Language (OTcl) linked with TclCL. C++ defines the simulation objects, the OTcl sets up simulation by assembling and configuring the objects as well as scheduling discrete events. This design choice avoids unnecessary time consuming recompilations if changes are made to the simulation set-up. Users may develop their own C++ objects, and use an OTcl configuration interface to put together these objects. There is extensive support for simulating TCP/IP, routing, and multicast protocols over wired and wireless (local and satellite) networks. CMU Monarch project has extended NS2 to give wireless and mobility support. In NS2 Simulation, node is an object that interacts with other nodes. The interaction requires NS2 to check a large number of dependencies which further leads to large computation time and memory requirements. Data collection in NS-2 is by traces and monitors which log events related to packet transmission required to compute performance parameters like throughput or delay of traffic. Naval Research Laboratory, US has done NS2 extension for WSN where they add a phenom channel for modelling physical phenomena

JoEDT (2014) 1-8 © STM Journals 2014. All Rights Reserved

Page 2

Journal of Electronic Design Technology Volume 5, Issue 2 ISSN: 2229-6980 (online), ISSN: 2321-4228 (print)

like sensor and environment [7]. The Mannasim Framework extends NS-2 by introducing new modules for design, development and analysis of different WSN applications [8]. It consists of Script Generator Tool, a front-end for TCL simulation scripts easy creation. Network Simulator NS3 [9] NS–3 design goals were: (1) To make simulation models implementation close to actual implementations (2) To reduce discontinuities when moving from simulation to experiment through emulation support (3) To provide better debugging and alignment. To attain the first goal it does following: Uses C++ as programming language as its part to facilitate inclusion of C-based implementation code; has network device driver and sockets like the software protocol programs. To meet the second goal: It enables emulation capabilities by allowing ns–3 programs to be used on test beds with actual world devices and applications; It allows use of external tools like packet trace analysers and link to external libraries such as GNU Scientific Library or IT++. Finally for its third goal: Its architecture uses C++ based models for ease of debugging and a python-based scripting API to integrate with other python-based environments or programming models. NS–3 simulation programs can be written as either C++ main( ) programs or python scripts. It is free and open source project. OMNeT++ [10] Objective Modular Network Test-bed in C++ (OMNeT++) is a component-based simulator. It removes unnecessary interdependency between NS2 simulator modules which in turn makes it use memory efficiently, reduce software complexity and makes it faster compared to NS2. OMNET components are programmed in C++. NED a high-level language is used to assemble components into larger component and models. Simulation of mobile ad hoc networks and WSN is provided by mobility framework and Castalia. OMNeT++ model is a collection of hierarchically nested modules. System Module is the top-level module which contains one or more sub-modules each of which further contains other sub-modules. Simple modules

are implemented by users in C++ using OMNeT++ simulation class library. Complex data structure called messages with unique Ids or gates and connections are used for communication between modules. Messages symbolize frames or packets in a computer network. The local simulation time proceeds when a module receives messages from another module or from itself. A network description language is used to specify the structure and interface which implement the underlying behaviours of simple modules. Simulation executions are configured through initialization files that tracks generated events and ensure that messages are delivered to right modules at right time. A new simulator for WSN based on OMNeT++ is presented in [11]. It is demonstrated to be faster, memory efficient and scalable as compared to NS2. The work focuses on Simulations of IEEE 802.11 MAC layer and Directed Diffusion integrated with the Geographical and Energy Aware Routing protocol. Pawis Simulation framework based on OMNeT++ provides functionality to simulate the nodes with their internal structure and network between nodes [12]. It provides classes: to handle inter-node communication that considers spatial distribution and noise within the network, to support the simulation of CPU related issues (including interrupt handling, power saving modes) with user adjustment to match target platforms requirements and capabilities. Additionally it takes care of the bit error ratio and behaviour (timing, SNR) of transmissions. Environmental data are provided to simulate sensor readings. J-Sim [13] Java-Sim began as a generic, open-source, component based, compositional network simulation framework. Implementation in Java with autonomous component architecture made it a truly platform independent, extensible, and reusable. J-Sim provides a script interface that allows its integration with different script languages such as Perl, Tcl, or Python. Version 1.3 of J-Sim has been fully integrated with a Java implementation of Tcl interpreter, called Jacl, with the Tcl/Java extension. Classes are written in Java (C++ in NS2) and “glued” together using Tcl/Java (tcl in NS2). However, unlike ns-2,

JoEDT (2014) 1-8 © STM Journals 2014. All Rights Reserved

Page 3

Wireless Sensor Networks Simulation

classes/methods/fields in Java need not be explicitly exported in order to be accessed in Tcl environment. Instead, all the public classes/methods/fields in Java can be accessed (naturally) in the Tcl environment. J-Sim is implemented on top of autonomous component architecture (ACA) which is component based software architecture. The elementary objects in ACA are components. These components communicate with each another by sending and receiving data on their ports. How components handle and respond to data that arrive at a port is specified at system design time in contracts, but their binding does not take place until the system integration time when the system is being “composed.” The component architecture of J-Sim is loosely coupled, as contract binding carried out during system design time is separate from component binding carried out at system integration time. The data arriving at component’s port is immediately processed in an independent execution context like thread in Java. The interference between different data handled simultaneously by the same component is thus minimal, and is only subject to synchronization and mutual exclusion (in order to ensure the integrity of shared data). ACA adopts the concept of software IC due to the message-passing and independence execution model. The common features extracted from various layers of the protocol stack are used to form a comprehensive packet-switched internetworking framework (referred as INET) which is laid on top of ACA. In [14], a modelling and simulation framework for WSNs in J-Sim is presented. The components of simulation framework are nodes including base station, communication channels, mobility models and power models. The java classes defined in the simulation framework can be inherited to define new application-specific models. Sense [15] Sensor Network Simulator and Emulator (SENSE) is built on top of Component Oriented Simulation Toolkit (COST) which is a general purpose discrete event simulator [16]. Sensors are implemented as a group of static components. Its design aims to provide extensibility, reusability, and scalability.

Gajjar et al.

Component-based simulation gives extensibility and reusability. The simulation models are freed from interdependence found in object oriented architecture by componentport model, helping improve scalability by reducing memory use. Connections between components are in the form of inports and outports making simulation models extensible. A new component can be replaced by an old one provided they are having compatible interfaces. A component developed can be used across different simulations as long as their interface and semantics requirements match with each other. TOSSIM [17] TinyOS is a free, open source componentbased, event-driven operating system for sensor networks. It consists of a FIFO task scheduler and software components for sensing, radio communication, memory access, and other devices [18]. TOSSIM is scalable simulation environment for sensor networks based on TinyOS. It is component based discrete event simulator that compiles a TinyOS application into a native executable that runs on the host where simulation is run. This allows TOSSIM to be extremely scalable, supporting hundreds to thousands of nodes for simulation. The components of TOSSIM architecture include: support for compiling network topology graph, discrete event queue, and simulated hardware components like radio stack, sensors, and a communication infrastructure to communicate with external programs. TOSSIM provides run-time configurable debugging output in which execution of an application can be examined from different viewpoints without recompiling it. For visualization and control of simulation runs, TinyViz which is a java based GUI can be used. Debug messages, radio, UART packets etc. can be inspected with TinyViz. The simulation environment provides mechanisms to interact with network; monitor packet traffic, inject packets into the network. To estimate power consumption per node POWER TOSSIM [19], a scalable simulation environment for WSN is used. It is based on TOSSIM and draws much of its value from TinyOS tools. In PowerTOSSIM, TinyOS hardware peripheral components like radio, EEPROM, LEDs are designed to obtain trace

JoEDT (2014) 1-8 © STM Journals 2014. All Rights Reserved

Page 4

Journal of Electronic Design Technology Volume 5, Issue 2 ISSN: 2229-6980 (online), ISSN: 2321-4228 (print)

of activities of each device during the simulation run. PowerTOSSIM is said to achieve accuracy within 0.45–13% of true power consumption of nodes running an identical program for a run of 15 TinyOS applications. Avrora [20] Avrora is an instruction level simulator written in Java. Implementation in Java helps achieve flexibility and portability. It is designed to provide cycle-accurate simulation, multithreading, event queue and thread synchronization. It runs one thread per node; threads synchronization ensures that global timing and radio communications order is preserved during simulation. With sleep optimization by event queue model, programs that sleep for most of the time can run many times faster. ATEMU [21] ATMEU, a software emulator for AVR processor based systems includes support for peripheral devices like radio on MICA2 sensor node. It is binary compatible with MICA2 hardware, so TinyOS software developers can use it for code development. ATMEU emulator core can simulate heterogeneous nodes and can model radio communications interactions between them with extremely fine details. It uses the binary file that is loaded onto the target MICA2 node and AVR processor emulation engine to precisely model code execution on each sensor node. Thus overall, a small number of details of actual operation of a sensor node are abstracted out and hence it produces realistic results. Xatdb is a graphical gdb-like frontend that provides features for debugging and monitoring code execution for ATMEU sensor network emulator. It provides facilities for setting breakpoints, watchpoints, single stepping through either assembly or nesC code for multiple nodes in a sensor network.

Ptolemy II [23]. It is a derived class of Discrete Event (DE) modelling framework in Ptolemy II proposed to model sensor networks. It mostly preserves DE semantics, but mechanism for connecting components is changed. Connectivity is determined based on physical locations of components. Algorithm for deciding connectivity is encapsulated in the component as a channel model, and thus be developed by one who builds the model. Nodes can be modelled using Java; block diagrams using DE models; using dataflow models; finite-state machines or continuoustime models of Ptolemy II. It supports actororiented definition of nodes; transmission media like acoustic channels, and wired subsystems.

CONCLUSION Table 1 compares all the simulation frameworks discussed in the paper. Some of the other simulators not talked about in the paper are openWNS [24], IKR SimLib [25], JisT [26], DSIM [27], SENS [28], Prowler [29], TOSSF [30], Shawn [31], Dingo [32], EmStar [33] and SensorSim [34]. The researchers can make decisions for selecting the simulator or emulator for their work and simulator developers can look for the limitations of the popular simulators and overcome them. For WSN research it is desirable that simulation and experimentation should be a bundled set, such that researcher could flawlessly alternate between both methods. Generally, a simulator is more useful for issues which are viewed from high level like studying effect of routing, data link and transport layer protocols, topology control, data aggregation. On the other hand emulation is more useful for fine-grained low-level results like sensor algorithms etc. Simulators having component-based architectures offer scalability, but are difficult to implement in a modularized way. Object oriented architecture offer ease of incorporating new algorithms for different protocols but scalability is an issue.

VisualSense [22] VisualSense is an open source simulation and modelling framework for WSN that builds on

JoEDT (2014) 1-8 © STM Journals 2014. All Rights Reserved

Page 5

Wireless Sensor Networks Simulation

Gajjar et al.

Table 1: Comparison of Simulators.

JoEDT (2014) 1-8 © STM Journals 2014. All Rights Reserved

Page 6

Journal of Electronic Design Technology Volume 5, Issue 2 ISSN: 2229-6980 (online), ISSN: 2321-4228 (print)

REFERENCES 1. White K. P., Ingalls R. G., Introduction to Simulation, Proc. of Winter Simulation Conference, 12–23p, 2009. 2. Banks J., Carson II J. S., Nelson B. L., et al. Discrete-Event System Simulation, Prentice Hall Publications, Upper Saddle River, NJ, 2005. 3. Averill M. Law, Simulation Modeling and Analysis, McGrawHill Publications, 2007. 4. Klaus Wehrle, Mesut Gunes, James Gross, Modeling and Tools for Network Simulation, Springer Publications, 2010. 5. The Network Simulator NS-2, [Online] Available at: http://www.isi.edu/nsnam/ns/. 6. Teerawat Issariyakul, Ekram Hossain, Introduction to Network Simulator NS2, Springer Publications, 2009. 7. Ian Downard, Simulating Sensor Networks in ns-2, [Online] Available at: http://cs.itd.nrl.navy.mil/pubs/docs/ nrlsensorsim04.pdf 8. The Mannasim Simulation environment, [Online] Available at: http://www.mannasim.dcc.ufmg.br/. 9. The Network Simulator NS-3, [Online] Available at: http://www.nsnam.org. 10. The OMNET ++ Network Simulation framework, [Online] Available at: http://www.omnetpp.org. 11. Mallanda C., Suri A., Kunchakarra V., et al. Simulating Wireless Sensor Networks with OMNeT++, [Online] Available at: http://csc.lsu.edu/sensor_web/sensor_simu lator/ SensorSimulator-ACMComputers.pdf 12. Weber D., Glaser J., Mahlknecht S., Discrete Event Simulation Framework for Power Aware Wireless Sensor Networks, Proc. of 5th International Conference on Industrial Informatics, 335–340p, 2007. 13. The J-Sim Network Simulator [Online] Available at: http://www.j-sim.zcu.cz/ 14. Sobeih A., Chen W., Hou J. C., et al. JSim: A Simulation Environment for Wireless Sensor Networks, Proc. of 38th Annual Symposium on Simulation, 175– 187p, 2005. 15. Chen G., Branch J., Pflug M. J., et al. SENSE: A Wireless Sensor Network Simulator, Advances in Pervasive

16.

17.

18.

19.

20.

21.

22.

23.

24.

25.

26.

JoEDT (2014) 1-8 © STM Journals 2014. All Rights Reserved

Computing and Networking, Springer Publications, 249–266p, 2005. Gilbert Chen, Boleslaw K. Szymanski, Reusing Simulation Components: COST: A Component-Oriented Discrete Event Simulator, Proc. of 34th Winter Simulation Conference, 776–782p, 2002. Philip Levis, Nelson Lee, Matt Welsh, et al. TOSSIM: Accurate and Scalable Simulation of Entire TinyOS Applications, Proc. of 1st International Conference on Embedded Networked Sensor Systems, 126–137p, 2003. The TinyOS Operating System for Wireless Sensor Networks [Online] Available at: http://www.tinyos.net/ Victor Shnayder, Mark Hempstead, Borrong Chen, et al. Simulating the Power Consumption of Large-scale Sensor Network Applications, Proc. of 2nd International Conference on Embedded Networked Sensor Systems, 188–200p, 2004. Ben L. Titzer, Daniel K. Lee, Jens Palsberg, Avrora: Scalable Sensor Network Simulation with Precise Timing, Proc. of 4th International Symposium on Information Processing in Sensor Networks, 2007. Polley J., Blazakis D., McGee J., et al. ATEMU: A Fine-Grained Sensor Network Simulator, Proc. of 1st International Conference on Sensor and Ad hoc Communications and Networks, 145– 152p, 2004. Baldwin P., Kohli S., Lee E., et al. Modeling of Sensor Nets in Ptolemy II, Proc. of 3rd International Symposium on Information Processing in Sensor Networks, 359–368p, 2004. Eker J., Janneck J. W., Lee E. A., et al. Taming Heterogeneity-the Ptolemy Approach, Proc. of the IEEE, 91: 127– 144p, 2003. openWNS: The Open Wireless Network Simulator [Online] Available at: http://www.openwns.org. IKR Simulation and Emulation Library [Online]. Available at: http://www.ikr.unistuttgart.de/IKRSimLib. Rimon Barr, Zygmunt Haas, Robbert van Renesse, JiST: An Efficient Approach to Simulation using Virtual Machines, CRC

Page 7

Wireless Sensor Networks Simulation

27.

28.

29.

30.

31.

Press, Softw. Pract. Exp. 2005; 35(6): 539–576p. Chen G., Szymanski B., DSIM: Scaling Time Warp to 1,033 Processors, Proc. of 37th Winter Simulation Conference, 346– 355p, 2005. Sundresh, Sameer, WooYoung Kim, et al. SENS: A Sensor, Environment and Network Simulator, Proc. of 37th Annual Simulation Symposium 2004. [Online]. Available at: http://osl.cs.uiuc.edu/sens/ Prowler: Probabilistic Wireless Network Simulator [Online]. Available at: http://www.isis.vanderbilt.edu/Projects/ne st/prowler/ Perrone L.F., Nicol D.M., A Scalable Simulator for TinyOS Applications, Proc. of the Winter Simulation Conference, 1: 679–687p, 2002. Fekete S.P., Kroller A., Fischer S., et al. Shawn: The Fast, Highly Customizable

Gajjar et al.

Sensor Network Simulator, Proc. of 4th International Conference on Networked Sensing Systems, 299–305p, 2007. 32. Dingo Wireless Sensor Networks Simulator [Online] Available at: http://dingowsn.googlecode.com/svn/trunk/docs/index .html 33. Girod L., Emstar: A Software Environment for Developing and Deploying Heterogeneous SensorActuator Networks, ACM T. Senor Netw. 3: 13–23p, 2007. 34. Park S., Savvides A., Srivastava M.B., SensorSim: A Simulation Framework for Sensor Networks, Proc. of 3rd ACM Workshop on Modeling, Analysis and Simulation of Wireless and Mobile Systems, 2000.

JoEDT (2014) 1-8 © STM Journals 2014. All Rights Reserved

Page 8