namtrace error in ns2
When I try to run ex1.tcl file, I get the following error:
rita@rita-S400CA:~/Desktop$ ns ex1.tcl
can't read "namtrace": no such variable
while executing
"$namtrace-all $nf"
(file "ex1.tcl" line 3)
ex1.tcl file contains:
set ns [new Simulator]
set nf [open out.nam w]
$namtrace-all $nf
proc finish {} {
global ns nf
$ns flush-trace
close $nf
exec nam out.nam &
exit 0
}
set n0 [$ns node]
set n1 [$ns node]
$ns duplex-link $n0 $n1 1Mb 10ms DropTail
$ns at 5.0 "finish"
$ns run
Any solution to this error?
|