5.3 Node Configuration Interface

\framebox{
\begin{minipage}{\textwidth}
{\bf NOTE}: This API, especially its i...
...
and satellite simulation.
[Sep 15, 2000; updated June 2001].
\end{minipage}}

[]Simulator::node-config accommodates flexible and modular construction of different node definitions within the same base Node class. For instance, to create a mobile node capable of wireless communication, one no longer needs a specialized node creation command, e.g., []dsdv-create-mobile-node; instead, one changes default configuration parameters, such as

$ns node-config -adhocRouting dsdv
before actually creating the node with the command: $ns node. Together with routing modules, this allows one to combine ``arbitrary'' routing functionalities within a single node without resorting to multiple inheritance and other fancy object gimmicks. We will describe this in more detail in Section 5.5. The functions and procedures relevant to the new node APIs may be found in ~ns/tcl/lib/ns-node.tcl.

The node configuration interface consists of two parts. The first part deals with node configuration, while the second part actually creates nodes of the specified type. We have already seen the latter in Section 5.1, in this section we will describe the configuration part.

Node configuration essentially consists of defining the different node characteristics before creating them. They may consist of the type of addressing structure used in the simulation, defining the network components for mobilenodes, turning on or off the trace options at Agent/Router/MAC levels, selecting the type of adhoc routing protocol for wireless nodes or defining their energy model.

As an example, node-configuration for a wireless, mobile node that runs AODV as its adhoc routing protocol in a hierarchical topology would be as shown below. We decide to turn tracing on at the agent and router level only. Also we assume a topology has been instantiated with "set topo [new Topography]". The node-config command would look like the following:

  \$ns_ node-config -addressType hierarchical \bs 
                   -adhocRouting AODV \bs
                   -llType LL \bs
                   -macType Mac/802_11 \bs 
                   -ifqType Queue/DropTail/PriQueue \bs
                   -ifqLen 50 \bs
                   -antType Antenna/OmniAntenna \bs 
                   -propType Propagation/TwoRayGround \bs
                   -phyType Phy/WirelessPhy \bs
                   -topologyInstance \$topo \bs
                   -channel Channel/WirelessChannel \bs 
                   -agentTrace ON \bs 
                   -routerTrace ON \bs
                   -macTrace OFF \bs
                   -movementTrace OFF

The default values for all the above options are NULL except -addressingType whose default value is flat. The option -reset can be used to reset all node-config parameters to their default value.

Note that the config command can be broken down into separate lines like

        \$ns_ node-config -addressingType hier
        \$ns_ node-config -macTrace ON
The options that need to be changed may only be called. For example after configuring for AODV mobilenodes as shown above (and after creating AODV mobilenodes), we may configure for AODV base-station nodes in the following way:
        \$ns_ node-config -wiredRouting ON
While all other features for base-station nodes and mobilenodes are same, the base-station nodes are capable of wired routing, while mobilenodes are not. In this way we can change node-configuration only when it is required.

All node instances created after a given node-configuration command will have the same property unless a part or all of the node-config command is executed with different parameter values. And all parameter values remain unchanged unless they are expicitly changed. So after creation of the AODV base-station and mobilenodes, if we want to create simple nodes, we will use the following node-configuration command:

        \$ns_ node-config -reset
This will set all parameter values to their default setting which basically defines configuration of a simple node.

Currently, this type of node configuration is oriented towards wireless and satellite nodes. Table 5.1 lists the available options for these kinds of nodes. The example scripts ~ns/tcl/ex/simple-wireless.tcl and ~ns/tcl/ex/sat-mixed.tcl provide usage examples.


Table 5.1: Available options for node configuration (see tcl/lib/ns-lib.tcl).
option available values default
general
addressType flat, hierarchical flat
MPLS ON, OFF OFF
both satellite- and wireless-oriented
wiredRouting ON, OFF OFF
llType LL, LL/Sat ""
macType Mac/802_11, Mac/Csma/Ca, Mac/Sat,
Mac/Sat/UnslottedAloha, Mac/Tdma ""
ifqType Queue/DropTail, Queue/DropTail/PriQueue ""
phyType Phy/WirelessPhy, Phy/Sat ""
wireless-oriented
adhocRouting DIFFUSION/RATE, DIFFUSION/PROB, DSDV,
DSR, FLOODING, OMNIMCAST, AODV, TORA, M-DART
PUMA ""
propType Propagation/TwoRayGround, Propagation/Shadowing ""
propInstance Propagation/TwoRayGround, Propagation/Shadowing ""
antType Antenna/OmniAntenna ""
channel Channel/WirelessChannel, Channel/Sat ""
topoInstance <topology file> ""
mobileIP ON, OFF OFF
energyModel EnergyModel ""
initialEnergy <value in Joules> ""
rxPower <value in W> ""
txPower <value in W> ""
idlePower <value in W> ""
agentTrace ON, OFF OFF
routerTrace ON, OFF OFF
macTrace ON, OFF OFF
movementTrace ON, OFF OFF
errProc UniformErrorProc ""
FECProc ? ?
toraDebug ON, OFF OFF
satellite-oriented
satNodeType polar, geo, terminal, geo-repeater ""
downlinkBW <bandwidth value, e.g. "2Mb"> ""


Tom Henderson 2011-11-05