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

Re: Strange ns-allinone-2.1b5a.tar.gz Results



Lukas Ruf wrote:
> 
> Hi there,
> 
> I recently executed the example.tcl in ns-allinone-2.1b5/ns-2.1b5 by
>         ns example.tcl
> Things worked quite fine, i.e. no problems.
> But when I wanted to see the results by
>         nam out.tr
> something really strange to me happened:
> 
> ns-2.1b5> nam out.tr
> You are using the tracefile format older than 1.0a5
> which will not allow you to run namgraph
> nam: badly formatted event at offset 39 in out.tr
> nam: `+ 0 0 1 tcp 1000 ------- 1 0.0 1.0 0 0'
> ns-2.1b5>
> 
> Does anyone know, what I did wrong ? I fetched
>         ns-allinone-2.1b5a.tar.gz with 15393142 Bytes
> on Monday last. The installation and the validation run without
> problems.
> 
> Any help would be gratefully appreciated.
> 
> cheers,
> Lukas
> --
>         *** ALWAYS MAILTO: "Lukas Ruf <[email protected]>" ***
> Lukas Ruf // Neugutstr. 9 // 8002 Zurich // Switzerland // +41-1-2813545
>     (PGP2.6.3) Fingerprint = 37CF 3AB4 B0F7 0AF5 C308 4188 8C10 86FE
Hi Lukas,

nam expects to read input from a .nam file, and not a .tr file.
I have appended below a few lines from a .nam file and a .tr
file for the same simulation. You will observe the difference. 
I will also send you a simple script that has takes both a nam
trace and a regular .tr file for xgraph. You can use it as a template,
if you wish. 

Did you take a look at Marc Greis's introductory tutorial on ns-2? If
not, take a look at it. It's at

http://titan.cs.uni-bonn.de/~greis/ns/ns.html

Cheers,
Jayanth


out3.tr

+ 0 0 1 cbr 500 ------- 1 0.0 3.0 0 0
- 0 0 1 cbr 500 ------- 1 0.0 3.0 0 0
+ 0 1 2 cbr 500 ------- 0 1.0 3.0 0 1
- 0 1 2 cbr 500 ------- 0 1.0 3.0 0 1
r 0.0028 1 2 cbr 500 ------- 0 1.0 3.0 0 1


out3.nam


h -t 0 -s 0 -d 2 -p cbr -e 125 -c 1 -i 0 -a 1 -x {0.0 3.0 -1 -------
null}
+ -t 0.001 -s 0 -d 2 -p cbr -e 125 -c 1 -i 1 -a 1 -x {0.0 3.0 1 -------
null}
- -t 0.001 -s 0 -d 2 -p cbr -e 125 -c 1 -i 1 -a 1 -x {0.0 3.0 1 -------
null}
h -t 0.001 -s 0 -d 2 -p cbr -e 125 -c 1 -i 1 -a 1 -x {0.0 3.0 -1 -------
null}



Scripting instructions for generating a .nam file and processing
the same:
#Open a .nam file; the simulator object referenced by $ns is 
#assumed to have been created

set nf [open out.nam w]
$ns namtrace-all $nf

#The 'finish' procedure for post-processing the contents of
#out.nam

proc finish {} {
        global ns nf
        $ns flush-trace
        close $nf

        puts "running nam..."
        exec /usr/users/jayanth/NS/ns-allinone-2.1b4a/nam-1/nam out.nam
&

        exit 0
}





-- 
-----------------------------------------------------------------
Jayanth P. Mysore
Networks and Infrastructure Research, Motorola Labs 
Phone: (847)576-8561 		 e-mail:[email protected]