XML Configuration File Creation for WSNet

De Ensiwiki
Aller à : navigation, rechercher

Tux.png  Linux 

WSNet
"Projet de Spécialité 2010" Routing simulation with WSNet
Team Alexandre Euriat, Benjamin Morin, William Ogeard, Rémi Poux
Professor Franck Rousseau
Location Grenoble INP Ensimag
Date June 2010


Introduction

The WSNet simulator uses an XML file to configure a simulation. This file contains all the setup informations needed for the simulation. It specifies, the number of nodes to simulate, the duration (the time to simulate), the libraries used for the propagation and the modulation, the routing protocol used, etc.

Architecture of a configuration file

The simulation configuration file is specified to the simulator using the command option -c. Example:

wsnet -c config.xml 

This XML configuration file is composed of five main sections: global parameters, entities, environment, bundles and node.

Notes about the units

• time: the time unit is the nano-second. However, a time parameter can be passed with a unit modifier as "s", "ms", "us" and "ns".
Example: duration="200s", birth="10s".
• distance: distances must be given in meters unless specified differently by the model.
• size: packet size must be given in bytes unless specified differently by the model.

Notes about the random values

Most of the parameters (distance, duration, time, destination, x, y, z), accept the "random" value. In most cases, a random value is drawn in a range chosen by the simulator as a function of the parameter type. For example, a random time will be taken between 0 and the simulation duration.

Global parameters

The definition of a simulation is done using the following syntax:

<simulation nodes="number-of-nodes" duration="simulation-duration" x="size" y="size" z="size" />

The parameters are the following:
• nodes: number of nodes during the simulation.
• duration: specifies the duration of the simulation. The duration format is : Xs, Xms, Xus, Xns for second, millisecond, microsecond and nano-second, respectively.
• x: width of the simulation area.
• y: length of the simulation area.
• z: height of the simulation area.

Example : the following example defines a simulation with 50 nodes in a 500x500x100 simulation area. The duration of the simulation is 10s.

<simulation nodes="50" duration="10s" x="500" y="500" z="100" />

Entities

An entity is an instantiation of a dynamic library. The definition of an entity is done using the following syntax:

<entity name="entity-name" library="dynamic-library-name" >
<init parameter-name="value" parameter-name="value" ... />
<default parameter-name="value" parameter-name="value" ... />
</entity >

The parameters are the following:
• name: the name of the entity.
• library: the name of the dynamic library to instantiate.
• init: specifies the values for the global-parameters of the entity (optional).
• default: specifies default values for the node-parameters of the entity (optional).
A given dynamic library can be instanciated several times in different entities. Each of these entities may have different global-parameter values and node-parameter default values.

Examples :
The following example defines the entity position which instanciates the library mobility_static. By default, nodes are randomly placed in x and y coordinates and with a height of 0.

<entity name="position" library="mobility_static" >
<default x="random" y="random" z="0" />
</entity >

The following example defines the entity propagation which instanciates the library propagation_shadowing with a pathloss of 3.

<entity name="propagation" library="propagation_shadowing" >
<init pathloss="3" />
</entity >

Environment

The environment block describes the radio medium and the physical environment of the simulation. The definition of the environment is done using the following syntax and order.

<environment >
<propagation entity="entity-name" range="range" />
<interferences entity="entity-name" />
<monitoring entity="entity-name" />
<modulation entity="entity-name" />
<...>
<with entity="entity-name" />
<...>
</environment >

The parameters are the following:
• propagation: the name of a propagation entity.
• interferences: the name of an interferences entity.
• monitoring: the name of a monitoring entity.
• modulation: the name of one modulation entity.
• with: the name of one environment entity (optional).

Example : the following example defines an environment with a shadowing propagation model, orthogonal interferences and bpsk modulation

<environment >
<propagation entity="shadowing-propagation" range="200" />
<interferences entity="orthogonal-interferences" />
<monitor entity="nrj" />
<modulation entity="bpsk-modulation" />
<modulation entity="oqpsk-modulation" />
<with entity="fire" />
</environment >

Bundle

A bundle is a node architecture. The definition of a bundle is done using the following syntax:

<bundle name="bundle-name" default="{true,false}" birth="time" />
<mobility entity="entity-name" />
<energy entity="entity-name" />
<antenna entity="entity-name" >
<up entity="entity-name" />
<...>
</antenna >
<with entity="entity-name" >
<default parameter-name="value" parameter-name="value" ... >
<up entity="entity-name" />
<...>
<down entity="entity-name" />
<...>
</with >
<with entity="entity-name" >
<up entity="entity-name" />
<...>
<down entity="entity-name" />
<...>
</with >
...
< /bundle >

The parameters are the following:
• name: name of the bundle.
• default: specifies whether this bundle is the default one or not (optional). The value can be true or false (which is the default value).
• birth: default birth value for nodes (optional). The default value is 0.
• mobility: specifies which mobility entity is used for the bundle.
• energy: specifies which battery entity is used for the bundle.
• antenna: specifies which antenna entity is used for the bundle.

The with option specifies the entities involved in the bundle (other than mobility, antenna and energy). This option may appear several times. Entity represent the entity name, and:
• up: specifies an uplink in the bundle from the current entity to the specified one.
• down: specifies a downlink in the bundle from the current entity to the specified one.
• default: specifies default values for node-parameters of the entity, overriding the ones given in the entity definition.

Example : the following example defines a node architecture with one application, one routing protocol, one mac protocol, one radio and one antenna. It defines the uplinks and downlinks between these entities and specifies default values for some node-parameters of some entities. It also says that the node has physical sensors to measure the temperature and the light.

<bundle name="sensor" default="true" />
<mobility entity="static" />
<antenna entity="omnidirectional" >
<up entity="radio" />
</antenna >
<with entity="radio" >
<up entity="mac" />
<down entity="antenna" />
</with >
<with entity="mac" >
<up entity="routing" />
<down entity="radio" />
</with >
<with entity="routing" >
<up entity="app" />
<down entity="mac" />
</with >
<with entity="app" >
<default period="1s" >
<down entity="routing" />
</with >
</bundle >

Node

A node instanciates a bundle. Definition of a node is done using the following syntax:

<node id="node-id" as="bundle-name" birth="birth-time" >
<for entity="entity-name" parameter-name="value" ... />
<...>
</node>

The parameters are the following:
• id: node id.
• as: bundle name which the node instantiates.
• birth: birth date of node (optional). The default value is bundle birth value.
• for: is used to override the parameters of an entity defined in the bundle (optional).
Not all nodes need to be defined in the config file. If not defined otherwise, a node instantiates the bundle which has the attribute default set to true. The values of the node-parameters are then the default ones as defined in the entity and bundle definitions.

Example : the following example specifies that the node whose id is 0 instantiates the bundle sensor:

<node id="0" as="sensor" birth="10s" >
<for entity="app" period="500ms" />
</node>

A complete example

You can directly download from HERE a complete example of a XML configuration file.
This example specifies a complete simulation configuration. We use an omnidirectionnal antenna and the routic protocol greedy_ideal.

Credits

INRIA Simulation configuration tutorial

Home page

Ensiwiki WSNet home page