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 14Local Area Networks<strong>The</strong> characteristics of the wireless <strong>and</strong> local area networks (LAN) are inherently different from those of point-to-point links.A network co<strong>ns</strong>isting of multiple point-to-point links cannot capture the sharing <strong>and</strong> contention properties of a LAN. Tosimul<strong>at</strong>e these properties, we cre<strong>at</strong>ed a new type of a Node, called LanNode. <strong>The</strong> OTcl configur<strong>at</strong>io<strong>ns</strong> <strong>and</strong> interfaces forLanNode reside in the following two files in the main <strong>ns</strong> directory:tcl/lan/vlan.tcltcl/lan/<strong>ns</strong>-ll.tcltcl/lan/<strong>ns</strong>-mac.tcl14.1 Tcl configur<strong>at</strong>ion<strong>The</strong> interface for cre<strong>at</strong>ing <strong>and</strong> configuring a LAN slightly differs from those of point-to-point link. At the top level, theOTcl class Simul<strong>at</strong>or exports a new method called make-lan. <strong>The</strong> parameters to this method are similar to the methodduplex-link, except th<strong>at</strong> make-lan only accepts a list of nodes as a single parameter i<strong>ns</strong>tead of 2 parameters as induplex-link:Simul<strong>at</strong>or i<strong>ns</strong>tproc make-lan {nodes bw delay lltype ifqtype mactype chantype}<strong>The</strong> optional parameters to make-lan specify the type of objects to be cre<strong>at</strong>ed for the link layer (LL), the interface queue,the MAC layer (Mac), <strong>and</strong> the physical layer (Channel). Below is an example of how a new CSMA/CD (Ethernet) LAN iscre<strong>at</strong>ed.Example:$<strong>ns</strong> make-lan "$n1 $n2" $bw $delay LL Queue/DropTail Mac/Csma/Cdcre<strong>at</strong>es a LAN with basic link-layer, drop-tail queue, <strong>and</strong> CSMA/CD MAC.131

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

Saved successfully!

Ooh no, something went wrong!