12.07.2015 Views

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 ...

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Module NameRtModule/BaseRtModule/McastRtModule/HierRtModule/<strong>Manual</strong>RtModule/VCRtModule/MPLSFunctionalityInterface to unicast routing protocols. Provide basic functionality to add/delete route <strong>and</strong><strong>at</strong>tach/detach agents.Interface to multicast routing protocols. Its only purpose is establishes multicast classifiers.All other multicast functionalities are implemented as i<strong>ns</strong>tprocs of Node. This should beconverted in the future.Hierarchical routing. It’s a wrapper for managing hierarchical classifiers <strong>and</strong> route i<strong>ns</strong>tall<strong>at</strong>ion.Can be combined with other routing protocols, e.g., ad hoc routing.<strong>Manual</strong> routing.Uses virtual classifier i<strong>ns</strong>tead of vanilla classifier.Implements MPLS functionality. This is the only existing module th<strong>at</strong> is completely selfcontained<strong>and</strong> does not pollute the Node namespace.Table 5.2: Available routing modules5.5.2 Node InterfaceTo connect to the above interfaces of routing module, a node provides a similar set of interfaces:• In order to know which module to register during cre<strong>at</strong>ion, the Node class keeps a list of modules as a class variable.<strong>The</strong> default value of this list contai<strong>ns</strong> only the base routing module. <strong>The</strong> Node class provides the following two procsto manipul<strong>at</strong>e this module list:Node::enable-module{[name]}Node::disable-module{[name]}If module RtModule/[name] exists, this proc puts [name] into the modulelist.If [name] is in the module list, remove it from the list.When a node is cre<strong>at</strong>ed, it goes through the module list of the Node class, cre<strong>at</strong>es all modules included in the list, <strong>and</strong>register these modules <strong>at</strong> the node.After a node is cre<strong>at</strong>ed, one may use the following i<strong>ns</strong>tprocs to list modules registered <strong>at</strong> the node, or to get a h<strong>and</strong>le ofa module with a particular name:Node::list-modules{}Node::get-module{[name]}Return a list of the h<strong>and</strong>les (shadow objects) of all registered modules.Return a h<strong>and</strong>le of the registered module whose name m<strong>at</strong>ches the given one. Noticeth<strong>at</strong> any routing module can only have a single i<strong>ns</strong>tance registered <strong>at</strong> any node.• To allow routing modules register their interests of routing upd<strong>at</strong>es, a node object provide the following i<strong>ns</strong>tprocs:Node::route-notify{module}Node::unreg-route-notify{module}Add module into route upd<strong>at</strong>e notific<strong>at</strong>ion list.Remove module from route upd<strong>at</strong>e notific<strong>at</strong>ion list.Similarly, the following i<strong>ns</strong>tprocs provide hooks on the <strong>at</strong>tachment of tra<strong>ns</strong>port agents:Node::port-notify{module}Node::unreg-port-notify{module}Add module into agent <strong>at</strong>tachment notific<strong>at</strong>ion list.Remove module from agent <strong>at</strong>tachment notific<strong>at</strong>ion list.Notice th<strong>at</strong> in all of these i<strong>ns</strong>tprocs, parameter module should be a module h<strong>and</strong>le i<strong>ns</strong>tead of a module name.• Node provides the following i<strong>ns</strong>tprocs to manipul<strong>at</strong>e its address <strong>and</strong> port classifiers:– Node::i<strong>ns</strong>ert-entry{module, clsfr, hook} i<strong>ns</strong>erts classifier clsfr into the entry point of the node. It alsoassoci<strong>at</strong>es the new classifier with module so th<strong>at</strong> if this classifier is removed l<strong>at</strong>er, module will be unregistered.If hook is specified as a number, the existing classifier will be i<strong>ns</strong>erted into slot hook of the new classifier. Inthis way, one may establish a “chain” of classifiers; see Figure 5.2 for an example. NOTE: clsfr needs NOT60

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

Saved successfully!

Ooh no, something went wrong!