Table of Contents

1. Installation of WSNet
1.1. WSNet1
1.2. WSNet2
2. Installation of WSim
3. WSNet configuration
3.1. WSNet1
3.2. WSNet2
4. Starting WSNet server
4.1. WSNet1
4.2. WSNet2
5. Starting WSim

1. Installation of WSNet

1.1. WSNet1

Since WSNet1 is not supported anymore, this version is available in the WSim sources, in /utils/wsnet1/.

Use the following commands to install WSNet1:

$./bootstrap
$./configure
$./make
$./sudo make install

You may get more configuration options by entering $./configure -h.

1.2. WSNet2

Please refer to the WSNet2 download webpage and WSNet2 installation webpage.

2. Installation of WSim

To use WSim with WSNet, no special configuration is required during the compilation of WSim. WSNet1 and WSNet2 interfaces are installed by default.

3. WSNet configuration

3.1. WSNet1

Since WSNet1 configuration is fixed, it doesn't require configuration file.

3.2. WSNet2

3.2.1. General

WSNet2 use an xml configuration file. Before reading next paragraph, please visit WSNet simulation configuration tutorial webpage.

Next sections develop some important points about WSNet2 configuration with WSim.

3.2.2. Simulation part

In the simulation xml tag, node variable must be set to the exact number of wsim nodes.

Still in the simulation xml tag, duration variable may be ommited if you need an infinite simulation time.

3.2.3. Worldsens

The worldsens option of the bundle tag is very important. It must be set to true for WSNet2 to register a node as a WSim node.

3.2.4. Modulations

In the Entities part, you have to specify witch modulations nodes are going to use. The simpliest way to proceed, is to put all modulation implemented in WSNet2. For instance :

<entity name="none" library="modulation_none">
</entity>
<entity name="fsk" library="modulation_fsk">
</entity>
<entity name="oqpsk" library="modulation_oqpsk">
</entity>
<!-- == Environment ===================================================== -->
<environment>
  <modulation entity="none"/>
  <modulation entity="fsk"/>
  <modulation entity="oqpsk"/>
  ...
</environment>

WSim has a matching table of modulations that is compared to WSNet modulations declared in the configuration file, to find the right modulation.

However the modulation requested by WSim (in fact by the WSim radio model) may not be available in WSNet2. In that case WSim will choose modulation_none library in priority, and if it is also not available, the first modulation entered in the WSNet2 configuration file.

Hence if you want to choose manually the modulation used by nodes, you have to enter only one modulation in the WSNet2 configuration file.

3.2.5. Nodes positions

It may be interesting to set each node position in order to make the simulation more accurate. To do so, you have to declare as many mobility entities as nodes. For example :

<!-- Node0 position entity -->
<entity name="static0" library="mobility_static" >
<default x="4" y="8" z="8"/>
</entity>
<!-- Node1 position entity -->
<entity name="static1" library="mobility_static" >
<default x="8" y="12" z="8"/>
</entity>
<!-- Node2 position entity -->
<entity name="static2" library="mobility_static" >
<default x="12" y="8" z="8"/>
</entity>
<!-- Node3 position entity -->
<entity name="static3" library="mobility_static" >
<default x="8" y="4" z="8"/>
</entity>

Each mobility entity tag is going to match one bundle tag. And finally you enter as many node tags as nodes. For example :

<!-- == Bundle ===================================================== -->
<bundle name="node0" worldsens="true" default="true" birth="0">
  <mobility entity="static0"/>
  ...
</bundle>

<bundle name="node1" worldsens="true" default="false" birth="0">
  <mobility entity="static1"/>
  ...
</bundle>

<bundle name="node2" worldsens="true" default="false" birth="0">
  <mobility entity="static2"/>
  ...
</bundle>

<bundle name="node3" worldsens="true" default="false" birth="0">
  <mobility entity="static3"/>
  ...
</bundle>


<!-- == Nodes ===================================================== -->
<node id="0" as="node0"/>
<node id="1" as="node1"/>
<node id="2" as="node2"/>
<node id="3" as="node3"/>

3.2.6. Signal propagation

Once you have set nodes positions you can modified signal properties to limit signal range. You do that with the propagation entity as shown :

<entity name="range" library="propagation_range" >
  <init  range="6"/>
</entity>

Here with propagation_range library, a signal node forms a 6 meters disk : a node receives packets from another node, only if they are less than 6 meters far.

<environment>
  <propagation entity="range" range="6"/>
  ...
</environment>

4. Starting WSNet server

4.1. WSNet1

If your PATH is correctly set, just enter :

$wsnet1

4.2. WSNet2

If your PATH is correctly set and if your xml configuration file is worldsens.xml, enter :

$wsnet -c worldsens.xml

5. Starting WSim

To launch WSim for WSNet, you have to specify the --node-id=[id] option.

To choose between WSNet1 and WSNet2, use the --wsnet1 option or the --wsnet2 option. If this option is not entered, WSim will choose WSNet1 by default (only if --node-id option is specified, otherwise WSim will run standalone).

If your PATH is correctly set, enter for instance:

$wsim-senslabv14 --wsnet2 --node-id=1 myprog.elf