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.

Linkhead_enqT_queue_ deqT_ link_ ttl_rcvT_drophead_drpT_Figure 6.1: Composite Co<strong>ns</strong>truction of a Unidirectional Linktrack when a packet is enqueued <strong>and</strong> dequeued from queue_. Furthermore, tracing interposes a drop trace element after thedrophead_. <strong>The</strong> following i<strong>ns</strong>tance variables track the trace elements:enqT_ Reference to the element th<strong>at</strong> traces packets entering queue_.deqT_ Reference to the element th<strong>at</strong> traces packets leaving queue_.drpT_ Reference to the element th<strong>at</strong> traces packets dropped from queue_.rcvT_ Reference to the element th<strong>at</strong> traces packets received by the next node.Note however, th<strong>at</strong> if the user enable tracing multiple times on the link, these i<strong>ns</strong>tance variables will only store a reference tothe last elements i<strong>ns</strong>erted.Other configur<strong>at</strong>ion mechanisms th<strong>at</strong> add components to a simple link are network interfaces (used in multicast routing),link dynamics models, <strong>and</strong> tracing <strong>and</strong> monitors. We give a brief overview of the rel<strong>at</strong>ed objects <strong>at</strong> the end of this chapter(Section 6.2), <strong>and</strong> discuss their functionality/implement<strong>at</strong>ion in other chapters.<strong>The</strong> i<strong>ns</strong>tance procedure duplex-link{} co<strong>ns</strong>tructs a bi-directional link from two simplex links.6.1 I<strong>ns</strong>tance Procedures for Links <strong>and</strong> SimpleLinksLink procedures <strong>The</strong> class Link is implemented entirely in Otcl. <strong>The</strong> OTcl SimpleLink class uses the C++LinkDelay class to simul<strong>at</strong>e packet delivery delays. <strong>The</strong> i<strong>ns</strong>tance procedures in the class Link are:64

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

Saved successfully!

Ooh no, something went wrong!