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.

<strong>The</strong> i<strong>ns</strong>tance procedure delete-routes{} takes a node id, a list of interfaces, <strong>and</strong> a nullAgent. It removes each ofthe interfaces in the list from the i<strong>ns</strong>talled list of interfaces. If the entry did not previously use a multip<strong>at</strong>h classifier,then it must have had only one route, <strong>and</strong> the route entry is set to point to the nullAgent specified.Q: WHY DOES IT NOT POINT TO NULLAGENT IF THE ENTRIES IN THE MPATHCLASSIFIER GOES TOZERO?— <strong>The</strong> main exte<strong>ns</strong>ion to the class Link for unicast routing is to support the notion of link costs. <strong>The</strong> i<strong>ns</strong>tance variablecost_ contai<strong>ns</strong> the cost of the unidirectional link. <strong>The</strong> i<strong>ns</strong>tance procedures cost{} <strong>and</strong> cost?{} set <strong>and</strong> get the coston the link.Note th<strong>at</strong> cost{} takes the cost as argument. It is preferable to use the simul<strong>at</strong>or method to set the cost variable,similar to the simul<strong>at</strong>or i<strong>ns</strong>tance procedures to set the queue or delay on a link.— <strong>The</strong> class Classifier contai<strong>ns</strong> three new procedures, two of which overloads an existing i<strong>ns</strong>tproc-like, <strong>and</strong> theother two provide new functionality.<strong>The</strong> i<strong>ns</strong>tance procedure i<strong>ns</strong>tall{} overloads the existing i<strong>ns</strong>tproc-like of the same name. <strong>The</strong> procedure stores theentry being i<strong>ns</strong>talled in the i<strong>ns</strong>tance variable array, elements_, <strong>and</strong> then invokes the i<strong>ns</strong>tproc-like.<strong>The</strong> i<strong>ns</strong>tance procedure i<strong>ns</strong>tallNext{} also overloads the existing i<strong>ns</strong>tproc-like of the same name. This i<strong>ns</strong>tproclikesimply i<strong>ns</strong>talls the entry into the next available slot.<strong>The</strong> i<strong>ns</strong>tance procedure adjacents{} retur<strong>ns</strong> a list of 〈key, value〉 pairs of all elements i<strong>ns</strong>talled in the classifier.29.4.2 Interface to Network Dynamics <strong>and</strong> MulticastThis section describes the methods applied in unicast routing to respond to changes in the topology. <strong>The</strong> complete sequenceof actio<strong>ns</strong> th<strong>at</strong> cause the changes in the topology, <strong>and</strong> fire the appropri<strong>at</strong>e actio<strong>ns</strong> is described in a different section. <strong>The</strong>respo<strong>ns</strong>e to topology changes falls into two c<strong>at</strong>egories: actio<strong>ns</strong> taken by individual agents <strong>at</strong> each of the nodes, <strong>and</strong> actio<strong>ns</strong> tobe taken globally for the entire protocol.Detailed routing protocols such as the DV implement<strong>at</strong>ion require actio<strong>ns</strong> to be performed by individual protocol agents <strong>at</strong>the affected nodes. Centralized routing protocols such as st<strong>at</strong>ic <strong>and</strong> session routing fall into the l<strong>at</strong>ter c<strong>at</strong>egory exclusively.Detailed routing protocols could use such techniques to g<strong>at</strong>her st<strong>at</strong>istics rel<strong>at</strong>ed to the oper<strong>at</strong>ion of the routing protocol;however, no such code is currently implemented in <strong>ns</strong>.Actio<strong>ns</strong> <strong>at</strong> the individual nodes Following any change in the topology, the network dynamics models will first invokertObject::intf-changed{} <strong>at</strong> each of the affected nodes. For each of the unicast routing protocols oper<strong>at</strong>ing <strong>at</strong> th<strong>at</strong>node, rtObject::intf-changed{} will invoke each individual protocol’s i<strong>ns</strong>tance procedure, intf-changed{},followed by th<strong>at</strong> protocol’s compute-routes{}.After each protocol has computed its individual routes rtObject::intf-changed{} invokes compute-routes{}to possibly i<strong>ns</strong>tall new routes. If new routes were i<strong>ns</strong>talled in the node, rtObject::compute-routes{} will invokesend-upd<strong>at</strong>es{} for each of the protocols oper<strong>at</strong>ing <strong>at</strong> the node. <strong>The</strong> procedure will also flag the multicast route object ofthe route changes <strong>at</strong> the node, indic<strong>at</strong>ing the number of changes th<strong>at</strong> have been executed. rtObject::flag-multicast{}will, in turn, notify the multicast route object to take appropri<strong>at</strong>e action.<strong>The</strong> one exception to the interface between unicast <strong>and</strong> multicast routing is the interaction between dynamic de<strong>ns</strong>e modemulticast <strong>and</strong> detailed unicast routing. This dynamicDM implement<strong>at</strong>ion in <strong>ns</strong> assumes neighbor nodes will send an implicitupd<strong>at</strong>e whenever their routes change, without actually sending the upd<strong>at</strong>e. It then uses this implicit inform<strong>at</strong>ion to computeappropri<strong>at</strong>e parent-child rel<strong>at</strong>io<strong>ns</strong>hips for the multicast spanning trees. <strong>The</strong>refore, detailed unicast routing will invokertObject_ flag-multicast 1 whenever it receives a route upd<strong>at</strong>e as well, even if th<strong>at</strong> upd<strong>at</strong>e does not result in anychange in its own routing tables.257

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

Saved successfully!

Ooh no, something went wrong!