[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ns] How to set the queue buffer size?



hi,

The current version of ns supports IEEE 802.3 CSMA/CD medium access method
Hence replace 

 set opt(mac) Mac/Csma/Ca   

 in your lantest.tcl with
 
 set opt(mac) Mac/802_3

-alefiya

On Wed, 13 Sep 2000, Liu Qiang wrote:

> Dear Li,
>     I'm very glad for your help. I'm working with the Information and Network Group in ICT. I have another question and I don't konw if you have time to have a look.
>     When I tried the "/tcl/ex/lantest.tcl" tcl script there is an error as following:
> 
>         invalid command name "Mac/Csma/Cd"
>             while executing
>         "Mac/Csma/Cd create _o34"
>             invoked within
>         "Catch "$className create $0 $args" msg"
>             procedure "new" line 3
>             invoked from within
>                 .........
> 
>        Here's the script is,
>          
>         #!/bin/sh
>         # the next line finds ns \
>         nshome=`dirname $0`; [ ! -x $nshome/ns ] && [ -x ../../ns ] && nshome=../..
>         # the next line starts ns \
>         export nshome; exec $nshome/ns "$0" "$@"
> 
>         if [info exists env(nshome)] {
>              set nshome $env(nshome)
>             } elseif [file executable ../../ns] {
>              set nshome ../..
>         } elseif {[file executable ./ns] || [file executable ./ns.exe]} {
>          set nshome "[pwd]"
>         } else {
>              puts "$argv0 cannot find ns directory"
>              exit 1
>         }
>         set env(PATH) "$nshome/bin:$env(PATH)"
> 
>         set opt(tr) out
>         set opt(namtr) "lantest.nam"
>         set opt(seed) 0
>         set opt(stop) 20
>         set opt(node) 8
> 
>         set opt(qsize) 100
>         set opt(bw) 10Mb
>         set opt(delay) 1ms
>         set opt(ll) LL
>         set opt(ifq) Queue/DropTail
>         set opt(mac) Mac/Csma/Ca
>         set opt(chan) Channel
>         set opt(tcp) TCP/Reno
>         set opt(sink) TCPSink
> 
>         set opt(app) FTP
> 
> 
>         proc finish {} {
>          global env nshome pwd
>          global ns opt trfd
> 
>          $ns flush-trace
>          close $trfd
> 
>          exec ../../../nam-1/nam lantest.nam
> 
>          exit 0
>         }
> 
> 
>         proc create-trace {} {
>          global ns opt
> 
>          if [file exists $opt(tr)] {
>           catch "exec rm -f $opt(tr) $opt(tr)-bw [glob $opt(tr).*]"
>          }
> 
>          set trfd [open $opt(tr) w]
>          $ns trace-all $trfd
>          if {$opt(namtr) != ""} {
>           $ns namtrace-all [open $opt(namtr) w]
>          }
>          return $trfd
>         }
> 
> 
>         proc create-topology {} {
>          global ns opt
>          global lan node source node0
> 
>          set num $opt(node)
>          for {set i 0} {$i < $num} {incr i} {
>           set node($i) [$ns node]
>           lappend nodelist $node($i)
>           }
> 
>          set lan [$ns newLan $nodelist $opt(bw) $opt(delay) \
>            -llType $opt(ll) -ifqType $opt(ifq) \
>            -macType $opt(mac) -chanType $opt(chan)]
> 
>          set node0 [$ns node]
>          $ns duplex-link $node0 $node(0) 2Mb 2ms DropTail
> 
>          $ns duplex-link-op $node0 $node(0) orient right
> 
>          }
> 
>         ## MAIN ##
> 
>         set ns [new Simulator]
>         set trfd [create-trace]
> 
>         create-topology
> 
>         set tcp0 [$ns create-connection TCP/Reno $node0 TCPSink $node(7) 0]
>         $tcp0 set window_ 15
> 
>         set ftp0 [$tcp0 attach-app FTP]
> 
>         $ns at 0.0 "$ftp0 start"
> 
>         $ns at $opt(stop) "finish"
>         $ns run
>         
> 
>     Expect the reply!
> 
> Qiang Liu
> 
> Institute of Computing Technology,
> Chinese Academy of Sciences
> 
> ----- Original Message ----- 
> From: "Huike (Victor) Li" <[email protected]>
> To: "Liu Qiang" <[email protected]>
> Cc: <[email protected]>
> Sent: Wednesday, September 13, 2000 10:40 AM
> Subject: Re: [ns] How to set the queue buffer size?
> 
> 
> > 
> >     $ns queue-limit $n0 $n2 100
> > 
> > BTW, can I know which group you are working with in ICT? 
> >  
> > 
> > > Liu Qiang wrote:
> > > 
> > > hi all,
> > > 
> > >     I'm new to ns2. I tried to write a tcl script and there is a
> > > droptail queue link, I don't know how to set the queue buffer size.
> > > Expect the reply.
> > >     this following is the part of the script.
> > > 
> > >     $ns duplex-link $n0 $n2 1Mb 10ms DropTail
> > > 
> > >     thinks
> > > 
> > > Qiang Liu
> > > 
> > > Institute of Computing Technology,
> > > Chinese Academy of Sciences
> > 
> > -- 
> > Huike (Victor) Li
> > 
> > Department of E.E.E
> > University of Melbourne
> > Victoria 3051
> > Australia
> > Tel: +61 3 8344 9201
> > Fax: +61 3 8344 9188
> > 
>