31.3 Commands at a glance

Following is a list of commands used for multicast simulations:

set ns [new Simulator -mcast on]
This turns the multicast flag on for the the given simulation, at the time of creation of the simulator object.

ns_ multicast
This like the command above turns the multicast flag on.

ns_ multicast?
This returns true if multicast flag has been turned on for the simulation and returns false if multicast is not turned on.

$ns_ mrtproto mproto optional:nodelist
This command specifies the type of multicast protocol <mproto> to be used like DM, CtrMcast etc. As an additional argument, the list of nodes <nodelist> that will run an instance of detailed routing protocol (other than centralised mcast) can also be passed.

$ns_ mrtproto-iifs mproto node iifs
This command allows a finer control than mrtproto. Since multiple mcast protocols can be run at a node, this command specifies which mcast protocol <mproto> to run at which of the incoming interfaces given by <iifs> in the <node>.

Node allocaddr
This returns a new/unused multicast address that may be used to assign a multicast address to a group.

Node expandaddr
THIS COMMAND IS OBSOLETE NOW This command expands the address space from 16 bits to 30 bits. However this command has been replaced by "ns_ set-address-format-expanded".

$node_ join-group agent grp
This command is used when the <agent> at the node joins a particular group <grp>.

$node_ leave-group agent grp
This is used when the <agent> at the nodes decides to leave the group <grp>.

Internal methods:

$ns_ run-mcast
This command starts multicast routing at all nodes.

$ns_ clear-mcast
This stopd mcast routing at all nodes.

$node_ enable-mcast sim
This allows special mcast supporting mechanisms (like a mcast classifier) to be added to the mcast-enabled node. <sim> is the a handle to the simulator object.

In addition to the internal methods listed here there are other methods specific to protocols like centralized mcast (CtrMcast), dense mode (DM), shared tree mode (ST) or bi-directional shared tree mode (BST), Node and Link class methods and NetworkInterface and Multicast classifier methods specific to multicast routing. All mcast related files may be found under ns/tcl/mcast directory.
Centralised Multicast
A handle to the CtrMcastComp object is returned when the protocol is specified as `CtrMcast' in mrtproto. Ctrmcast methods are:

$ctrmcastcomp switch-treetype group-addr
Switch from the Rendezvous Point rooted shared tree to source-specific trees for the group specified by group-addr. Note that this method cannot be used to switch from source-specific trees back to a shared tree for a multicast group.

$ctrmcastcomp set_c_rp node-list
This sets the RPs.

$ctrmcastcomp set_c_bsr node0:0 node1:1
This sets the BSR, specified as list of node:priority.

$ctrmcastcomp get_c_rp node group
Returns the RP for the group as seen by the node node for the multicast group with address group-addr. Note that different nodes may see different RPs for the group if the network is partitioned as the nodes might be in different partitions.

$ctrmcastcomp get_c_bsr node
Returns the current BSR for the group.

$ctrmcastcomp compute-mroutes
This recomputes multicast routes in the event of network dynamics or a change in unicast routes.

Dense Mode
The dense mode (DM) protocol can be run as PIM-DM (default) or DVMRP depending on the class variable CacheMissMode. There are no methods specific to this mcast protocol object. Class variables are:
Timeout value for prune state at nodes. defaults to 0.5sec.
Used to set PIM-DM or DVMRP type forwarding rules.

Shared Tree
There are no methods for this class. Variables are:
RP_ indexed by group determines which node is the RP for a particular group.

Bidirectional Shared Tree
There are no methods for this class. Variable is same as that of Shared Tree described above.

Tom Henderson 2011-11-05