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.

add-iif{ifid link},add-oif{link if}get-all-oifs{}get-all-iifs{}iif2link{ifid}link2iif{link}oif2link{oif}link2oif{link}rpf-nbr{src}Invoked during link cre<strong>at</strong>ion to prep the node about its incoming interface label <strong>and</strong> outgoinginterface object.Retur<strong>ns</strong> all oifs for this node.Retur<strong>ns</strong> all iifs for this node.Retur<strong>ns</strong> the link object labelled with given interface label.Retur<strong>ns</strong> the incoming interface label for the given link.Retur<strong>ns</strong> the link object corresponding to the given outgoing interface.Retur<strong>ns</strong> the outgoing interface for the link (<strong>ns</strong> object th<strong>at</strong> is incident to the node).Retur<strong>ns</strong> a h<strong>and</strong>le to the neighbour node th<strong>at</strong> is its next hop to the specified src.getReps{s g} Retur<strong>ns</strong> a h<strong>and</strong>le to the replic<strong>at</strong>or th<strong>at</strong> m<strong>at</strong>ches 〈s, g〉. Either argument can be a wildcard (*).getReps-raw{s g} As above, but retur<strong>ns</strong> a list of 〈key, h<strong>and</strong>le〉 pairs.clearReps{s g} Removes all replic<strong>at</strong>ors associ<strong>at</strong>ed with 〈s, g〉.Class Link <strong>and</strong> SimpleLink This class provides methods to check the type of link, <strong>and</strong> the label it affixes on individualpackets th<strong>at</strong> traverse it. <strong>The</strong>re is one additional method to actually place the interface objects on this link. <strong>The</strong>se methods are:if-label?{}retur<strong>ns</strong> the interface label affixed by this link to packets th<strong>at</strong> traverse it.Class NetworkInterface This is a simple connector th<strong>at</strong> is placed on each link. It affixes its label id to each packet th<strong>at</strong>traverses it. <strong>The</strong> packet id is used by the destin<strong>at</strong>ion node incident on th<strong>at</strong> link to identify the link by which the packet reachedit. <strong>The</strong> label id is configured by the Link co<strong>ns</strong>tructor. This object is an internal object, <strong>and</strong> is not designed to be manipul<strong>at</strong>edby user level simul<strong>at</strong>ion scripts. <strong>The</strong> object only supports two methods:label{ifid}label{}assig<strong>ns</strong> ifid th<strong>at</strong> this object will affix to each packet.retur<strong>ns</strong> the label th<strong>at</strong> this object affixes to each packet.<strong>The</strong> global class variable, ifacenum_, specifies the next available ifid number.Class Multicast Classifier Classifier/Multicast maintai<strong>ns</strong> a multicast forwarding cache. <strong>The</strong>re is one multicastclassifier per node. <strong>The</strong> node stores a reference to this classifier in its i<strong>ns</strong>tance variable multiclassifier_. When thisclassifier receives a packet, it looks <strong>at</strong> the 〈source, group〉 inform<strong>at</strong>ion in the packet headers, <strong>and</strong> the interface th<strong>at</strong> the packetarrived from (the incoming interface or iif); does a lookup in the MFC <strong>and</strong> identifies the slot th<strong>at</strong> should be used to forwardth<strong>at</strong> packet. <strong>The</strong> slot will point to the appropri<strong>at</strong>e replic<strong>at</strong>or.However, if the classifier does not have an entry for this 〈source, group〉, or the iif for this entry is different, it will invoke anupcall new-group{} for the classifier, with one of two codes to identify the problem:• cache-miss indic<strong>at</strong>es th<strong>at</strong> the classifier did not find any 〈source, group〉 entries;• wrong-iif indic<strong>at</strong>es th<strong>at</strong> the classifier found 〈source, group〉 entries, but none m<strong>at</strong>ching the interface th<strong>at</strong> this packetarrived on.<strong>The</strong>se upcalls to TCL give it a chance to correct the situ<strong>at</strong>ion: i<strong>ns</strong>tall an appropri<strong>at</strong>e MFC–entry (for cache-miss) orchange the incoming interface for the existing MFC–entry (for wrong-iif). <strong>The</strong> return value of the upcall determines wh<strong>at</strong>classifier will do with the packet. If the return value is “1”, it will assume th<strong>at</strong> TCL upcall has appropri<strong>at</strong>ely modified MFC268

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

Saved successfully!

Ooh no, something went wrong!