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

Re: compilation problem.



Use trace-all and namtrace-all.

Nader

satish> Hi,
satish>    when i compile the tcl program in ~ns/tcl/ex/simple.tcl i
satish>    get the following error:
satish> 
satish> guru>ns simple.tcl
satish> _o2: unable to dispatch method traceall
satish>     while executing
satish> "$ns traceall $f "
satish>     (file "simple.tcl" line 5) 
satish> 
satish> can anyone help me with this problem???
satish> 
satish> the file(simple.tcl) is given below.
satish> 
satish> #simple.tcl
satish> set ns [new Simulator]
satish> set f [open out.tr w]
satish> $ns traceall $f
satish> set nf [open out.nam w]
satish> $ns namtraceall $nf
satish> 
satish> set n0 [$ns node]
satish> set n1 [$ns node]
satish> set n2 [$ns node]
satish> set n3 [$ns node]
satish> 
satish> $ns duplexlink $n0 $n2 5Mb 2ms DropTail
satish> $ns duplexlink $n1 $n2 5Mb 2ms DropTail
satish> $ns duplexlink $n2 $n3 1.5Mb 10ms DropTail
satish> 
satish> set udp0 [new Agent/UDP]
satish> $ns attachagent $n0 $udp0
satish> set cbr0 [new Application/Traffic/CBR]
satish> $cbr0 attachagent $udp0            
satish> $udp0 set class_ 0
satish> set null0 [new Agent/Null]
satish> $ns attachagent $n3 $null0
satish> $ns connect $udp0 $null0
satish> $ns at 1.0 "$cbr0 start"
satish> puts [$cbr0 set packetSize_]
satish> puts [$cbr0 set interval_]
satish> 
satish> set tcp [new Agent/TCP]
satish> $tcp set class_ 1
satish> $ns attachagent $n1 $tcp
satish> set sink [new Agent/TCPSink]
satish> $ns attachagent $n3 $sink
satish> set ftp [new Application/FTP] ;
satish> $ftp attachagent $tcp
satish> $ns at 1.2 "$ftp start"
satish> $ns connect $tcp $sink      
satish> $ns at 1.35 "$ns detachagent $n0 $tcp ; $ns detachagent $n3 $sink"
satish> 
satish> $ns at 3.0 "finish"
satish> proc finish {} {
satish> global ns f nf
satish> $ns flushtrace
satish> close $f
satish> close $nf
satish> puts "running nam..."
satish> exec nam out.nam &
satish> exit 0
satish> }
satish> 
satish> $ns run          
satish> 
satish> # end of simple.tcl
satish> 
satish> thanks.
satish> 
satish> satish
satish> 
satish>