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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

mrtObject class <strong>The</strong>re is one mrtObject (aka Arbiter) object per multicast capable node. This object supports the abilityfor a node to run multiple multicast routing protocols by maintaining an array of multicast protocols indexed by the incominginterface. Thus, if there are several multicast protocols <strong>at</strong> a node, each interface is owned by just one protocol. <strong>The</strong>refore,this object supports the ability for a node to run multiple multicast routing protocols. <strong>The</strong> node uses the arbiter to performprotocol actio<strong>ns</strong>, either to a specific protocol i<strong>ns</strong>tance active <strong>at</strong> th<strong>at</strong> node, or to all protocol i<strong>ns</strong>tances <strong>at</strong> th<strong>at</strong> node.addproto{i<strong>ns</strong>tance, [iiflist]}getType{protocol}all-mprotos{op, args}start{}stop{}notify{dummy}dump-mroutes{file-h<strong>and</strong>le, [grp], [src]}join-group{G, S}leave-group{G, S}upcall{code, s, g, iif}drop{rep, s, g, iif}adds the h<strong>and</strong>le for a protocol i<strong>ns</strong>tance to its array of protocols. <strong>The</strong> secondoptional argument is the incoming interface list controlled by the protocol.If this argument is an empty list or not specified, the protocol is assumed torun on all interfaces (just one protocol).retur<strong>ns</strong> the h<strong>and</strong>le to the protocol i<strong>ns</strong>tance active <strong>at</strong> th<strong>at</strong> node th<strong>at</strong> m<strong>at</strong>chesthe specified type (first <strong>and</strong> only argument). This function is often used toloc<strong>at</strong>e a protocol’s peer <strong>at</strong> another node. An empty string is returned if theprotocol of the given type could not be found.internal routine to execute “op” with “args” on all protocol i<strong>ns</strong>tances active<strong>at</strong> th<strong>at</strong> node.start/stop execution of all protocols.is called when a topology change occurs. <strong>The</strong> dummy argument is currentlynot used.dump multicast routes to specified file-h<strong>and</strong>le.signals all protocol i<strong>ns</strong>tances to join 〈S, G〉.signals all protocol i<strong>ns</strong>tances to leave 〈S, G〉.signalled by node on forwarding errors in classifier; this routine in tur<strong>ns</strong>ignals the protocol i<strong>ns</strong>tance th<strong>at</strong> ow<strong>ns</strong> the incoming interface (iif) byinvoking the appropri<strong>at</strong>e h<strong>and</strong>le function for th<strong>at</strong> particular code.Called on packet drop, possibly to prune an interface.In addition, the mrtObject class supports the concept of well known groups, i.e., those groups th<strong>at</strong> do not require explicitprotocol support. Two well known groups, ALL_ROUTERS <strong>and</strong> ALL_PIM_ROUTERS are predefined in <strong>ns</strong>.<strong>The</strong> class mrtObject defines two class procedures to set <strong>and</strong> get inform<strong>at</strong>ion about these well known groups.registerWellKnownGroups{name}getWellKnownGroup{name}assig<strong>ns</strong> name a well known group address.retur<strong>ns</strong> the address alloc<strong>at</strong>ed to well known group, name. If name is not registeredas a well known group, then it retur<strong>ns</strong> the address for ALL_ROUTERS.McastProtocol classfunctio<strong>ns</strong>:start{}, stop{}getSt<strong>at</strong>us{}getType{}upcall{code args}This is the base class for the implement<strong>at</strong>ion of all the multicast protocols. It contai<strong>ns</strong> basic multicastSet the st<strong>at</strong>us_ of execution of this protocol i<strong>ns</strong>tance.return the st<strong>at</strong>us of execution of this protocol i<strong>ns</strong>tance.return the type of protocol executed by this i<strong>ns</strong>tance.invoked when the node classifier signals an error, either due to a cache-miss or a wrong-iif forincoming packet. This routine invokes the protocol specific h<strong>and</strong>le, h<strong>and</strong>le-〈code〉{} withspecified args to h<strong>and</strong>le the signal.A few words about interfaces. Multicast implement<strong>at</strong>ion in <strong>ns</strong> assumes duplex links i.e. if there is a simplex link from node 1to node 2, there must be a reverse simplex link from node 2 to node 1. To be able to tell from which link a packet was received,multicast simul<strong>at</strong>or configures links with an interface labeller <strong>at</strong> the end of each link, which labels packets with a particular265

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

Saved successfully!

Ooh no, something went wrong!