The ns Manual (formerly ns Notes and Documentation)1 - NM Lab at ...

The ns Manual (formerly ns Notes and Documentation)1 - NM Lab at ... The ns Manual (formerly ns Notes and Documentation)1 - NM Lab at ...

nmlab.korea.ac.kr
from nmlab.korea.ac.kr More from this publisher
12.07.2015 Views

30.2.4 The internal variablesClass mrtObjectprotocols_mask-wkgroupswkgroupsAn array of handles of protocol instances active at the node at which this protocol operatesindexed by incoming interface.Class variable—defines the mask used to identify well known groups.Class array variable—array of allocated well known groups addresses, indexed by the groupname. wkgroups(Allocd) is a special variable indicating the highest currently allocated wellknown group.McastProtocolstatus_type_SimulatormultiSim_MrtHandle_takes values “up” or “down”, to indicate the status of execution of the protocol instance.contains the type (class name) of protocol executed by this instance, e.g., DM, or ST.1 if multicast simulation is enabled, 0 otherwise.handle to the centralised multicast simulation object.Nodeswitch_multiclassifier_replicator_Agents_outLink_inLink_Link and SimpleLinkiif_head_NetworkInterfaceifacenum_handle for classifier that looks at the high bit of the destination address in each packet to determinewhether it is a multicast packet (bit = 1) or a unicast packet (bit = 0).handle to classifier that performs the 〈s, g, iif〉 match.array indexed by 〈s, g〉 of handles that replicate a multicast packet on to the required links.array indexed by multicast group of the list of agents at the local node that listen to the specificgroup.Cached list of outgoing interfaces at this node.Cached list of incoming interfaces at this node.handle for the NetworkInterface object placed on this link.first object on the link, a no-op connector. However, this object contains the instance variable,link_, that points to the container Link object.Class variable—holds the next available interface number.30.3 Commands at a glanceFollowing 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_ multicastThis 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.271

$ns_ mrtproto This command specifies the type of multicast protocol to be used like DM, CtrMcast etc. As an additionalargument, the list of nodes that will run an instance of detailed routing protocol (other than centralised mcast) canalso be passed.$ns_ mrtproto-iifs This command allows a finer control than mrtproto. Since multiple mcast protocols can be run at a node, this commandspecifies which mcast protocol to run at which of the incoming interfaces given by in the .Node allocaddrThis returns a new/unused multicast address that may be used to assign a multicast address to a group.Node expandaddrTHIS COMMAND IS OBSOLETE NOW This command expands the address space from 16 bits to 30 bits. However thiscommand has been replaced by "ns_ set-address-format-expanded".$node_ join-group This command is used when the at the node joins a particular group .$node_ leave-group This is used when the at the nodes decides to leave the group .Internal methods:$ns_ run-mcastThis command starts multicast routing at all nodes.$ns_ clear-mcastThis stopd mcast routing at all nodes.$node_ enable-mcast This allows special mcast supporting mechanisms (like a mcast classifier) to be added to the mcast-enabled node. isthe 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 andNetworkInterface and Multicast classifier methods specific to multicast routing. All mcast related files may be found underns/tcl/mcast directory.Centralised Multicast A handle to the CtrMcastComp object is returned when the protocol is specified as ‘CtrMcast’ inmrtproto. Ctrmcast methods are:$ctrmcastcomp switch-treetype group-addrSwitch 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 This sets the RPs.$ctrmcastcomp set_c_bsr This sets the BSR, specified as list of node:priority.$ctrmcastcomp get_c_rp Returns the RP for the group as seen by the node node for the multicast group with address group-addr. Note thatdifferent nodes may see different RPs for the group if the network is partitioned as the nodes might be in differentpartitions.$ctrmcastcomp get_c_bsr 272

$<strong>ns</strong>_ mrtproto This comm<strong>and</strong> specifies the type of multicast protocol to be used like DM, CtrMcast etc. As an additionalargument, the list of nodes th<strong>at</strong> will run an i<strong>ns</strong>tance of detailed routing protocol (other than centralised mcast) canalso be passed.$<strong>ns</strong>_ mrtproto-iifs This comm<strong>and</strong> allows a finer control than mrtproto. Since multiple mcast protocols can be run <strong>at</strong> a node, this comm<strong>and</strong>specifies which mcast protocol to run <strong>at</strong> which of the incoming interfaces given by in the .Node allocaddrThis retur<strong>ns</strong> a new/unused multicast address th<strong>at</strong> may be used to assign a multicast address to a group.Node exp<strong>and</strong>addrTHIS COMMAND IS OBSOLETE NOW This comm<strong>and</strong> exp<strong>and</strong>s the address space from 16 bits to 30 bits. However thiscomm<strong>and</strong> has been replaced by "<strong>ns</strong>_ set-address-form<strong>at</strong>-exp<strong>and</strong>ed".$node_ join-group This comm<strong>and</strong> is used when the <strong>at</strong> the node joi<strong>ns</strong> a particular group .$node_ leave-group This is used when the <strong>at</strong> the nodes decides to leave the group .Internal methods:$<strong>ns</strong>_ run-mcastThis comm<strong>and</strong> starts multicast routing <strong>at</strong> all nodes.$<strong>ns</strong>_ clear-mcastThis stopd mcast routing <strong>at</strong> all nodes.$node_ enable-mcast This allows special mcast supporting mechanisms (like a mcast classifier) to be added to the mcast-enabled node. isthe a h<strong>and</strong>le to the simul<strong>at</strong>or object.In addition to the internal methods listed here there are other methods specific to protocols like centralized mcast (CtrMcast),de<strong>ns</strong>e mode (DM), shared tree mode (ST) or bi-directional shared tree mode (BST), Node <strong>and</strong> Link class methods <strong>and</strong>NetworkInterface <strong>and</strong> Multicast classifier methods specific to multicast routing. All mcast rel<strong>at</strong>ed files may be found under<strong>ns</strong>/tcl/mcast directory.Centralised Multicast A h<strong>and</strong>le to the CtrMcastComp object is returned when the protocol is specified as ‘CtrMcast’ inmrtproto. Ctrmcast methods are:$ctrmcastcomp switch-treetype group-addrSwitch from the Rendezvous Point rooted shared tree to source-specific trees for the group specified by group-addr.Note th<strong>at</strong> this method cannot be used to switch from source-specific trees back to a shared tree for a multicast group.$ctrmcastcomp set_c_rp This sets the RPs.$ctrmcastcomp set_c_bsr This sets the BSR, specified as list of node:priority.$ctrmcastcomp get_c_rp Retur<strong>ns</strong> the RP for the group as seen by the node node for the multicast group with address group-addr. Note th<strong>at</strong>different nodes may see different RPs for the group if the network is partitioned as the nodes might be in differentpartitio<strong>ns</strong>.$ctrmcastcomp get_c_bsr 272

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!