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.

14.10 Comm<strong>and</strong>s <strong>at</strong> a glance<strong>The</strong> following is a list of lan rel<strong>at</strong>ed comm<strong>and</strong>s commonly used in simul<strong>at</strong>ion scripts:$<strong>ns</strong>_ make-lan Cre<strong>at</strong>es a lan from a set of nodes given by . B<strong>and</strong>width, delay characteristics along with the link-layer, Interfacequeue, Mac layer <strong>and</strong> channel type for the lan also needs to be defined. Default values used are as follows: .. LL.. Queue/DropTail.. Mac.. Channel <strong>and</strong>.. Phy/WiredPhy$<strong>ns</strong>_ newLan This comm<strong>and</strong> cre<strong>at</strong>es a lan similar to make-lan described above. But this comm<strong>and</strong> can be used for finer control whereasmake-lan is a more convinient <strong>and</strong> easier comm<strong>and</strong>. For example newLan maybe used to cre<strong>at</strong>e a lan with hierarchicaladdresses. See <strong>ns</strong>/tcl/ex/vlantest-hier.tcl, vlantest-mcst.tcl, lantest.tcl, mac-test.tcl for usage of newLan. <strong>The</strong> possibleargument types th<strong>at</strong> can be passed are LL, ifq, MAC, channel, phy <strong>and</strong> address.$lannode cost This assig<strong>ns</strong> a cost of c/2 to each of the (uni-directional) links in the lan.$lannode cost?Retur<strong>ns</strong> the cost of (bi-directional) links in the lan, i.e c.Internal procedures :$lannode addNode Lan is implemented as a virtual node. <strong>The</strong> LanNode mimics a real node <strong>and</strong> uses an address (id) from node’s address space.This comm<strong>and</strong> adds a list of to the lan represented by lannode. <strong>The</strong> b<strong>and</strong>width, delay <strong>and</strong> network characteristics ofnodes are given by the above arguments. This is an internal comm<strong>and</strong> used by make-lan <strong>and</strong> newLan.$lannode idRetur<strong>ns</strong> the virtual node’s id.$lannode node-addrRetur<strong>ns</strong> virtual nodes’s address.$lannode dump-namconfigThis comm<strong>and</strong> cre<strong>at</strong>es a given lan layout in nam. This function may be changed to redefine the lan layout in a different way.$lannode is-lan?This comm<strong>and</strong> always retur<strong>ns</strong> 1, since the node here is a virtual node representing a lan. <strong>The</strong> corresponding comm<strong>and</strong> forbase class Node $node is-lan? always retur<strong>ns</strong> a 0.140

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

Saved successfully!

Ooh no, something went wrong!