[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ns] How should i use Traffic Trace ?
Hi,
i am getting segfault when i try to use
Application/Traffic/Trace objects:
i get the same error either when i run tcl/ex/tg.tcl
or when i try to use Lee Breslau's Star Wars trace
file; the following lines are dumped:
warning: no class variable Tracefile::debug_
see tcl-object.tcl in tclcl for info about
this warning.
could not stat starwars.nsformat
ns: finish:
(_o3 cmd line 1)
invoked from within
"_o3 cmd flush trace"
invoked from within
"catch "$self cmd $args" ret"
(procedure "_o3" line 2)
(SplitObject unknown line 2)
invoked from within
"$ns flush trace"
(procedure "finish" line 4)
invoked from within
"finish"
(i am running ns-2.1b8 under linux red-hat)
I'd be quite grateful if you could give me a hand
Thanks a lot ;-)
Here is my script:
set ns [new Simulator]
set n0 [$ns node]
set n1 [$ns node]
set n2 [$ns node]
set n3 [$ns node]
set n4 [$ns node]
set n5 [$ns node]
set f [open aj/star.tr w]
$ns trace-all $f
set nf [open aj/star.nam w]
$ns namtrace-all $nf
$ns duplex-link $n0 $n1 1.5Mb 10ms DropTail
$ns duplex-link $n0 $n2 10Mb 5ms DropTail
$ns duplex-link $n0 $n3 10Mb 5ms DropTail
$ns duplex-link $n0 $n4 10Mb 5ms DropTail
$ns duplex-link $n0 $n5 10Mb 5ms DropTail
set tfile [new Tracefile]
$tfile filename starwars.nsformat
set s4 [new Agent/UDP]
$ns attach-agent $n4 $s4
set null1 [new Agent/Null]
$ns attach-agent $n1 $null1
$ns connect $s4 $null1
set trace [new Application/Traffic/Trace]
$trace attach-tracefile $tfile
$trace attach-agent $s4
$ns at 1.0 "$trace start"
$ns at 10.0 "$trace stop"
$ns at 12.0 "finish"
proc finish {} {
global ns nf f
$ns flush trace
close $f
close $nf
exec nam aj/provatrace.nam &
exit 0
}
$ns run
______________________________________________________________________
Do You Yahoo!?
Il tuo indirizzo gratis e per sempre @yahoo.it su http://mail.yahoo.it