Building a Network Topology for TOSSIM
Marco Zuniga, <mzunigaz@gmail.com>

 
Introduction

The specific behavior of the wireless link depends on two elements: the radio, and the environment (channel) where they are placed. Hence, in order to obtain better simulations, the characteristics of both elements should be provided. The model presented in this tutorial is part of a more general link-layer model proposed by the ANRG group at USC, and it is valid for static and low-dynamic environments.
 
Configuration File

The configuration file contains various channel, radio and topology parameters that can be modified. Any line starting with the percentage symbol (%) is treated as a comment. The format of the configuration file is as follows:

%%%%%%%%%%%%%%%%%%%%%%
% Channel Parameters
%%%%%%%%%%%%%%%%%%%%%%

PATH_LOSS_EXPONENT = 3.0;
SHADOWING_STANDARD_DEVIATION = 4.0;
D0 = 1.0;
PL_D0 = 55.0;

%%%%%%%%%%%%%%%%%%%%%%
% Radio Parameters
%%%%%%%%%%%%%%%%%%%%%%

NOISE_FLOOR = -105.0;

S11 = 3.7;
S12 = -3.3;
S21 = -3.3;
S22 = 6.0;

WHITE_GAUSSIAN_NOISE = 4;

%%%%%%%%%%%%%%%%%%%%%%
% Topology Parameters
%%%%%%%%%%%%%%%%%%%%%%
% available topologies :
% - GRID (1)
% - UNIFORM (2)
% - RANDOM (3)
% - FILE (4)

TOPOLOGY = 1;
GRID_UNIT = 1.0;
TOPOLOGY_FILE = topologyFile;

NUMBER_OF_NODES = 9;

TERRAIN_DIMENSIONS_X = 20.0;
TERRAIN_DIMENSIONS_Y = 20.0;

A sample file (configurationFile) is provided as the default configuration file. The next sections explain the different channel, radio and deployment parameters.
 
Channel Parameters

When a radio signal propagates it may be diffracted, reflected and scattered. These events have two important consequences on the signal strength. First, the signal strength decays exponentially with respect to distance. And second, for a given distance the signal strength is random and log-normally distributed.

The channel is modeled using the log-normal path loss model. This model has the following parameters:

  • PATH_LOSS_EXPONENT : rate at which signal decays.
  • SHADOWING_STANDARD_DEVIATION : randomness of received signal due to multipath.
  • D0 : reference distance (usually 1 meter). D0 also determines the minimum distance allowed between any pair of nodes.
  • PL_D0 : power decay in dB for the reference distance D0.

    Channel parameters for some scenarios with D0 = 1m are presented in the following table:

    PL_D0 (dB) PATH_LOSS_EXPONENTSHADOWING_STANDARD_DEVIATION (dB)
    Football Field 55.4 4.7 3.2
    Aisle of Building 52.1 3.3 5.5

    In "Near-ground wideband channel measurements", the authors present channel parameters for several scenarios. Usually, the PATH_LOSS_EXPONENT and the SHADOWING_STANDARD_DEVIATION take values between 2 and 6 for scenarios with LOS (line-of-sight) conditions.
     
    Radio Parameters

    Another important effect to be considered is link asymmetry. Link asymmetry have a static and a dynamic component. The dynamic component is due to thermal noise, which leads to a dynamic variation of a node's noise floor readings at runtime. This dynamic variation is usually modeled as a gaussian random variable with mean 0 and a standard deviation given by the parameter:

  • WHITE_GAUSSIAN_NOISE : standard deviation of additive white gaussian noise.

    The static component is caused by hardware variance (variance in the output power and baseline noise floor across nodes). When a user sets the output power of a node to a value P, the actual output power can be below or above P; similarly, the baseline noise floor of the radio is not fixed and has some variance around its mean value. Also, there might be some correlation between the variances of the output power and noise floor, for example, mica2 motes show that nodes with an output power higher than the set value ("better transmitters") usually have a lower noise floor ("better receivers"), and viceversa.

    Hardware variance can be modeled as a multidimensional Gaussian process, where a covariance matrix captures the variances of the output power, the noise floor, and their correlation. In this process, the baseline (average) noise floor in dBm is given by:

  • NOISE_FLOOR : radio noise floor in dBm.

    And the variances of the output power and noise floor on a per node basis are given by the covariance matrix S = [S11 S12; S21 S22] :

  • S11 : variance of noise floor
  • S12 : covariance between noise floor and output power (captures correlation)
  • S21 : equal to S12
  • S22 : variance of output power

    All the variances (elements of S) should be in dB. The values of the covariance matrix are hardware dependent (default values are given for MICA2 motes), but in general the smaller S11 and S22, the lower the impact on link asymmetry. S12 and S21 are usually negative, and it is important to recall the properties of a covariance matrix (linear algebra), where the absolute values of S21 (and S12) should be less than sqrt(S11xS22), i.e. |S21| < sqrt(S11xS22). In case symmetric links are desired, the user should set S11 and S22 to 0.

    Finally, it is important to mention that hardware measurements are required to obtain the radio parameters described above. However, the user can modify some of these parameters to study their impact on different protocols. As a general guideline we suggest not to increase the hardware variance too much (mica2 motes have been observed to have the highest levels of asymmetry). The next table presents some suggested values for radio parameters:


    [0 x; x 0] for symmetric links (x represents any number)
    SUGGESTED VALUES
    NOISE_FLOOR between -110 dBm and -104 dBm
    S = [S11 S12; S21 S22] [3.7 -3.3; -3.3 6.0] for high asymmetry levels
    [0.9 -0.7; -0.7 1.2] for low asymmetry levels
    WHITE_GAUSSIAN_NOISE between 4 dB and 5 dB

     
    Topology Parameters

    The TOPOLOGY parameter allows to test different deployments (described below). Each one of these deployments have a number identifying it, which should be assigned to the variable TOPOLOGY. The available type of deployments are:

  • GRID (1): nodes are placed on a square grid topology. The number of nodes has to be a square of an integer.
  • UNIFORM (2): based on the number of nodes (square of an integer), the physical terrain is divided into a number of cells. Within each cell, a node is placed randomly. This topology can be observed as a GRID with variations.
  • RANDOM (3): nodes are placed randomly within the physical terrain.
  • FILE (4): position of nodes is read from a user-defined topology file.

    For example, if a RANDOM deployment is desired, the parameter TOPOLOGY should be set to 3 (TOPOLOGY = 3;). When a user desires to specify the topology, TOPOLOGY should be set to 4, and the format of the deployment file provided by the user should be:

    nodeid Xcoordinate Ycoordinate

    Where the X and Y coordinates should be in meters, and the nodeid should start with 0. A topology file looks like:

    0 1.0 2.7
    1 3.0 5.6
    2 5.2 7.8

    A sample topology file is provided in topologyFile. Other topology parameters are:

  • NUMBER_OF_NODES : for grid and uniform topologies should be a perfect square, and it is not required when the topology is given by user (TOPOLOGY = 4;).
  • TERRAIN_DIMENSIONS_X : required only for uniform and random topologies.
  • TERRAIN_DIMENSIONS_Y : required only for uniform and random topologies. Also, for uniform topologies TERRAIN_DIMENSIONS_Y should be equal to TERRAIN_DIMENSIONS_X.
  • GRID_UNIT : internode distance of the grid, required only for grid topologies.
  • TOPOLOGY_FILE : name of topology file provided by user, required only for FILE topologies (TOPOLOGY = 4;).

    Please recall that no pair of nodes can be closer than D0. Hence, GRID_UNIT should be greater equal than D0 when GRID topologies are chosen (TOPOLOGY = 1;) , and the TOPOLOGY_FILE provided by the user should not violate this constraint either. For UNIFORM and RANDOM topologies the node density (NUMBER_OF_NODES / area) is not allowed to be higher than 0.5 nodes / D0^2.
     
    Sample Configuration Files
    Now, we provide some sample configuration files.

    Example 1: A chain topology defined by the user on file chainTopo, placed in the aisle of a building (channel parameters), with nodes having an average noise floor of -106 dBm, a standard deviation of 4.5 dB for the white gaussian noise and a high level of asymmetry. The resulting configuration file is:

    PATH_LOSS_EXPONENT = 3.3;
    SHADOWING_STANDARD_DEVIATION = 5.5;
    D0 = 1.0;
    PL_D0 = 52.1;

    NOISE_FLOOR = -106.0;
    S11 = 3.7;
    S12 = -3.3;
    S21 = -3.3;
    S22 = 6.0;
    WHITE_GAUSSIAN_NOISE = 4;

    TOPOLOGY = 4;
    TOPOLOGY_FILE = chainTopo;

    Example 2: A uniform topology with 49 nodes in a 100m by 100m terrain, placed in a football field (channel parameters), with nodes having an average noise floor of -105 dBm, a standard deviation of 4.0 dB for the white gaussian noise and a low level of asymmetry. The resulting configuration file is:

    PATH_LOSS_EXPONENT = 4.7;
    SHADOWING_STANDARD_DEVIATION = 3.2;
    D0 = 1.0;
    PL_D0 = 55.4;

    NOISE_FLOOR = -105.0;
    S11 = 0.9;
    S12 = -0.7;
    S21 = -0.7;
    S22 = 1.2;
    WHITE_GAUSSIAN_NOISE = 4;

    TOPOLOGY = 2;
    NUMBER_OF_NODES = 49;
    TERRAIN_DIMENSIONS_X = 100.0;
    TERRAIN_DIMENSIONS_Y = 100.0;

    Example 3: similar to example 2, however in this case a 64 node grid topology is deployed with an internode distance of 2m and symmetric links are assumed. The resulting configuration file is:

    PATH_LOSS_EXPONENT = 4.7;
    SHADOWING_STANDARD_DEVIATION = 3.2;
    D0 = 1.0;
    PL_D0 = 55.4;

    NOISE_FLOOR = -105.0;
    S11 = 0;
    S22 = 0;
    WHITE_GAUSSIAN_NOISE = 4;

    TOPOLOGY = 1;
    GRID_UNIT = 2.0;
    NUMBER_OF_NODES = 64;

     
    Usage

    To use the model just provide the following commands

    $ javac LinkLayerModel.java

    $ java LinkLayerModel configurationFileName

    The link gains will be written in a file called linkgain.out, which contains the gain for each link and the noise floor for each node (format:   "gain"   src   dest   linkgain |   "noise"   nid   nf   awgn), for example:

    gain 1 2 -58.3
    gain 2 1 -60.5
    gain 1 3 -72.8
    gain 3 1 -75.3
    gain 2 3 -77.9
    gain 3 2 -75.4
    noise 1 -107.3 5
    noise 2 -105.2 5
    noise 3 -103.1 5
    and the topology will be written in the file topology.out (format:   nodeid   xcoor   ycoor).