next up previous contents index
Next: 14. The (Revised) Addressing Up: 13. Local Area Networks Previous: 13.9 LANs and routing

   
13.10 Commands at a glance

The following is a list of lan related commands commonly used in simulation scripts:

$ns_ make-lan nodelist bw delay LL ifq MAC channel phy
Creates a lan from a set of nodes given by <nodelist>. Bandwidth, delay characteristics along with the link-layer, Interface queue, Mac layer and channel type for the lan also needs to be defined. Default values used are as follows:
<LL> .. LL
<ifq>.. Queue/DropTail
<MAC>.. Mac
<channel>.. Channel and
<phy>.. Phy/WiredPhy

$ns_ newLan nodelist BW delay args
This command creates a lan similar to make-lan described above. But this command can be used for finer control whereas make-lan is a more convinient and easier command. For example newLan maybe used to create a lan with hierarchical addresses. See /tcl/ex/vlantest-hier.tcl, vlantest-mcst.tcl, lantest.tcl, mac-test.tcl for usage of newLan. The possible argument types that can be passed are LL, ifq, MAC, channel, phy and address.

$lannode cost c
This assigns a cost of c/2 to each of the (uni-directional) links in the lan.

$lannode cost?
Returns the cost of (bi-directional) links in the lan, i.e c.

Internal procedures :

$lannode addNode nodes bw delay LL ifq MAC phy
Lan is implemented as a virtual node. The LanNode mimics a real node and uses an address (id) from node's address space. This command adds a list of <nodes> to the lan represented by lannode. The bandwidth, delay and network characteristics of nodes are given by the above arguments. This is an internal command used by make-lan and newLan.

$lannode id
Returns the virtual node's id.

$lannode node-addr
Returns virtual nodes's address.

$lannode dump-namconfig
This command creates a given lan layout in nam. This function may be changed to redefine the lan layout in a different way.

$lannode is-lan?
This command always returns 1, since the node here is a virtual node representing a lan. The corresponding command for base class Node $node is-lan? always returns a 0.


next up previous contents index
Next: 14. The (Revised) Addressing Up: 13. Local Area Networks Previous: 13.9 LANs and routing

2000-08-24