[]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 dsdvbefore 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 ONThe 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 ONWhile 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 -resetThis 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.
Tom Henderson 2014-12-17