06-09-2012, 03:36 PM
Castalia
Castalia - User Manual.pdf (Size: 1.34 MB / Downloads: 103)
Introduction
Castalia is a simulator for Wireless Sensor Networks (WSN), Body Area Networks (BAN) and generally networks of low-power embedded devices. It is based on the OMNeT++ platform and can be used by researchers and developers who want to test their distributed algorithms and/or protocols in realistic wireless channel and radio models, with a realistic node behaviour especially relating to access of the radio. Castalia can also be used to evaluate different platform characteristics for specific applications, since it is highly parametric, and can simulate a wide range of platforms.
Why a new simulator?
There is a variety of simulators that WSN researchers are using to cover their needs. Simulators that emulate a common processor found in sensor nodes (to test actual binary code written for certain platforms), simulators written in C++ or Matlab to test some first order property of an algorithm, or simulators used in traditional data networks modified in some way to serve the WSN community. So why try to build a new one?
It all started from our own needs in a WSN project. We wanted to test some communication patterns in simulation before moving in real systems. In order to do so we wanted accurate enough radio/channel models so that the simulation results would become meaningful and guide us in our search. We knew of the work by Zuniga et al. [1] that explained empirically measured data from WSN platforms (more specifically packet reception rate as a function of distance) by combining known wireless channel and radio models. We found that all the available WSN simulators were falling short of the current state of the art modelling done in sensor networks. Especially in communication where the impact to the result can be significant [5], models remain simplistic or unsuitable for short range low power communications despite the existence of proper models developed the last couple of years. This was the major reason we decided to build our own simulator. We used OMNeT++ as the base to build a reliable and fast event-driven simulator. Using OMNeT++ meant that we could just focus on the models and overall design and not on the event-driven simulation engine. Shortly after, we have decided to "up the ante", capture realistic node behaviour beyond the channel and build an open expandable and reliable simulator that has a chance of becoming a de facto standard for certain WSN simulation needs. More specifically, the need for early stage, platform-independent, algorithm/protocol validation. Since its initial inception and creation, Castalia has moved to new territories: BAN is another exciting area where realistic and reliable network-level simulators are needed. NICTA has a large scale project in BAN, participating at the same time in the IEEE standards BAN task group. With our expertise in physical layer design, measurements and modeling, we have set out to make Castalia the most realistic BAN network simulator, by modelling the temporal variations and average path losses based on real on-body measurements.
Overview
Castalia is using OMNeT++ as its base so it is suggested that you have a fair understanding of the basic concepts of OMNeT although this is not required, especially if you want to use Castalia in a basic way (i.e., without building your own protocols/applications)
OMNeT‟s basic concepts are modules and messages. A simple module is the basic unit of execution. It accepts messages from other modules or itself, and according to the message, it executes a piece of code. The code can keep state that is altered when messages are received and can send (or schedule) new messages. There are also composite modules. A composite module is just a construction of simple and/or other composite modules.
Understanding the configuration file
As described in Chapter 2, Castalia has a modular structure with many interconnecting modules. Each one of the modules has one or more parameters that affect its behavior. An NED file (file with extension .ned in the Castalia source code) defines the basic structure of a module by defining its input/output gates and its parameters. In the NED file we can also define default values for the parameters. A configuration file (usually named omnetpp.ini and residing in the Simulations dir tree) assigns values to parameters, or just reassigns them to a different value from their default one. This way we can build a great variety of simulation scenarios.