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.

6.2 ConnectorsConnectors, unlink classifiers, only gener<strong>at</strong>e d<strong>at</strong>a for one recipient; either the packet is delivered to the target_ neighbor,or it is sent to he drop-target_.A connector will receive a packet, perform some function, <strong>and</strong> deliver the packet to its neighbor, or drop the packet. <strong>The</strong>reare a number of different types of connectors in <strong>ns</strong>. Each connector performs a different function.networkinterfaceDynaLinkDelayLinkQueuesTTLCheckerlabels packets with incoming interface identifier—it is used by some multicast routing protocols. <strong>The</strong>class variable “Simul<strong>at</strong>or NumberInterfaces_ 1” tells <strong>ns</strong> to add these interfaces, <strong>and</strong> then, it is addedto either end of the simplex link. Multicast routing protocols are discussed in a separ<strong>at</strong>e chapter(Chapter 30).Object th<strong>at</strong> g<strong>at</strong>es traffic depending on whether the link is up or down. It expects to be <strong>at</strong> the head of thelink, <strong>and</strong> is i<strong>ns</strong>erted on the link just prior to simul<strong>at</strong>ion start. It’s st<strong>at</strong>us_ variable control whetherthe link is up or down. <strong>The</strong> description of how the DynaLink object is used is in a separ<strong>at</strong>e chapter(Chapter 31).Object th<strong>at</strong> models the link’s delay <strong>and</strong> b<strong>and</strong>width characteristics. If the link is not dynamic, then thisobject simply schedules receive events for the dow<strong>ns</strong>tream object for each packet it receives <strong>at</strong> theappropri<strong>at</strong>e time for th<strong>at</strong> packet. However, if the link is dynamic, then it queues the packets internally,<strong>and</strong> schedules one receives event for itself for the next packet th<strong>at</strong> must be delivered. Thus, if thelink goes down <strong>at</strong> some point, this object’s reset() method is invoked, <strong>and</strong> the object will drop allpackets in tra<strong>ns</strong>it <strong>at</strong> the i<strong>ns</strong>tant of link failure. We discuss the specifics of this class in another chapter(Chapter 8).model the output buffers <strong>at</strong>tached to a link in a “real” router in a network. In <strong>ns</strong>, they are <strong>at</strong>tached to,<strong>and</strong> are co<strong>ns</strong>idered as part of the link. We discuss the details of queues <strong>and</strong> different types of queuesin <strong>ns</strong>in another chapter (Chapter 7).will decrement the ttl in each packet th<strong>at</strong> it receives. If th<strong>at</strong> ttl then has a positive value, the packet isforwarded to the next element on the link. In the simple links, TTLCheckers are autom<strong>at</strong>ically added,<strong>and</strong> are placed as the last element on the link, between the delay element, <strong>and</strong> the entry for the nextnode.6.3 Object hierarchy<strong>The</strong> base class used to represent links is called Link. Methods for this class are listed in the next section. Other link objectsderived from the base class are given as follows:• SimpleLink Object A SimpleLink object is used to represent a simple unidirectional link. <strong>The</strong>re are no st<strong>at</strong>e variablesor configur<strong>at</strong>ion parameters associ<strong>at</strong>ed with this object. Methods for this class are: $simplelink enable-mcast This tur<strong>ns</strong> on multicast for the link by cre<strong>at</strong>ing an incoming network interface for the destin<strong>at</strong>ion <strong>and</strong> adds an outgoinginterface for the source.$simplelink trace Build trace objects for this link <strong>and</strong> upd<strong>at</strong>e object linkage. If op is specified as "nam" cre<strong>at</strong>e nam trace files.$simplelink nam-trace Sets up nam tracing in the link.$simplelink trace-dynamics This sets up tracing specially for dynamic links. allows setting up of nam tracing as well.66

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

Saved successfully!

Ooh no, something went wrong!