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.

Chapter 6Links: Simple LinksThis is the second aspect of defining the topology. In the previous chapter (Chapter 5), we had described how to cre<strong>at</strong>e thenodes in the topology in <strong>ns</strong>. We now describe how to cre<strong>at</strong>e the links to connect the nodes <strong>and</strong> complete the topology. In thischapter, we restrict ourselves to describing the simple point to point links. <strong>ns</strong> supports a variety of other media, including anemul<strong>at</strong>ion of a multi-access LAN using a mesh of simple links, <strong>and</strong> other true simul<strong>at</strong>ion of wireless <strong>and</strong> broadcast media.<strong>The</strong>y will be described in a separ<strong>at</strong>e chapter. <strong>The</strong> CBQlink is derived from simple links <strong>and</strong> is a co<strong>ns</strong>iderably more complexform of link th<strong>at</strong> is also not described in this chapter.We begin by describing the comm<strong>and</strong>s to cre<strong>at</strong>e a link in this section. As with the node being composed of classifiers, a simplelink is built up from a sequence of connectors. We also briefly describe some of the connectors in a simple link. We thendescribe the i<strong>ns</strong>tance procedures th<strong>at</strong> oper<strong>at</strong>e on the various components of defined by some of these connectors (Section 6.1).We conclude the chapter with a description the connector object (Section 6.2), including brief descriptio<strong>ns</strong> of the commonlink connectors.<strong>The</strong> class Link is a st<strong>and</strong>alone class in OTcl, th<strong>at</strong> provides a few simple primitives. <strong>The</strong> class SimpleLink providesthe ability to connect two nodes with a point to point link. <strong>ns</strong> provides the i<strong>ns</strong>tance procedure simplex-link{} to form aunidirectional link from one node to another. <strong>The</strong> link is in the class SimpleLink. <strong>The</strong> following describes the syntax of thesimplex link:set <strong>ns</strong> [new Simul<strong>at</strong>or]$<strong>ns</strong> simplex-link 〈node0〉 〈node1〉 〈b<strong>and</strong>width〉 〈delay〉 〈queue_type〉<strong>The</strong> comm<strong>and</strong> cre<strong>at</strong>es a link from 〈node0〉 to 〈node1〉, with specified 〈b<strong>and</strong>width〉 <strong>and</strong> 〈delay〉 characteristics. <strong>The</strong>link uses a queue of type 〈queue_type〉. <strong>The</strong> procedure also adds a TTL checker to the link. Five i<strong>ns</strong>tance variables definethe link:head_ Entry point to the link, it points to the first object in the link.queue_ Reference to the main queue element of the link. Simple links usuallyhave one queue per link. Other more complex types of links may havemultiple queue elements in the link.link_ A reference to the element th<strong>at</strong> actually models the link, in terms of thedelay <strong>and</strong> b<strong>and</strong>width characteristics of the link.ttl_ Reference to the element th<strong>at</strong> manipul<strong>at</strong>es the ttl in every packet.drophead_ Reference to an object th<strong>at</strong> is the head of a queue of elements th<strong>at</strong> processlink drops.In addition, if the simul<strong>at</strong>or i<strong>ns</strong>tance variable, $traceAllFile_, is defined, the procedure will add trace elements th<strong>at</strong>63

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

Saved successfully!

Ooh no, something went wrong!