$ns_ rtmodel model model-params args
This command defines the dynamic model (currently implemented models are:
Deterministic, Exponential, Manual or Trace) to be applied to nodes and
links in the topology. The first two arguments consists of the rtmodel and
the parameter to configure the model. <args> stands for different type of
arguments expected with different dynamic model types. This returns a
handle to a model object corresponding to the specified model.
- In the Deterministic model <model-params> is <start-time>,
<up-interval>, <down-interval>, <finish-time>. Starting from start-time
the link is made up for up-interval and down for down-interval till
finish-time is reached. The default values for start-time, up-interval,
downinterval are 0.5s, 2.0s, 1.0s respectively. finishtime defaults to the
end of the simulation. The start-time defaults to 0.5s in order to let the
routing protocol computation quiesce.
- If the Exponential model is used model-params is of the form
<up-interval>, <down-interval> where the link up-time is an exponential
distribution around the mean upinterval and the link down-time is an
exponential distribution around the mean down-interval. Default values for
up-interval and down-interval are 10s and 1s respectively.
- If the Manual distribution is used model-params is <at> <op> where
at
specifies the time at which the operation op should occur. op is one of
up, down. The Manual distribution could be specified alternately using the
rtmodel-at method described later in the section.
- If Trace is specified as the model the link/node dynamics is read
from a
Tracefile. The model-params argument would in this case be the file-handle
of the Tracefile that has the dynamics information. The tracefile format
is identical to the trace output generated by the trace-dynamics link
method (see TRACE AND MONITORING METHODS SECTION).
$ns_ rtmodel-delete model
This command takes the handle of the routemodel <model> as an argument,
removes it from the list of rtmodels maintained by simulator and deletes
the model.
$ns_ rtmodel-at at op args
This command is a special interface to the Manual model of network dynamics.
It takes the time <at>, type of operation <op> and node or link on which
to apply the operation <args> as the arguments. At time <at>, the operation <op>
which maybe up or down is applied to a node or link.
$rtmodel trace ns f optional:op
This enables tracing of dynamics effected by this model in the links. <ns>
is an instance of the simulator, <f> the output file to write the traces to
and <op> is an optional argument that may be used to define a type of
operation (like nam). This is a wrapper for the class Link procedure
trace-dynamics.
$link trace-dynamics ns f optional:op
This is a class link instance procedure that is used to setup tracing of
dynamics in that particular link. The arguments are same as that of class
rtModel's procedure trace described above.
$link dynamic
This command inserts a DynamicLink object at the head of the queue and signals
to all connectors in the link that the link is now dynamic.
Internal procedures:
$ns_ rtmodel-configure
This is an internal procedure that configures all dynamic models that are
present in the list of models maintained by the simulator.