[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: simple code-no outpuit-help!
Hi Sid
In the code given by you, There's no mention of opening a trace file(any
name) where ns can record the tracings. So try adding these lines:
set f [open trace.tr w]
$ns trace-all $f
And modify procedure finish{} as :
proc finish {} {
global ns nf f
$ns flush-trace
close $nf
close $f
exec nam out.nam &
exit 0
}
This will create the desired trace file (trace.tr) for you.
Hope this helps
Manpreet.
On Mon, 23 Nov 1998, Sid Takkella wrote:
> Hi :
>
> I have created a simple 2 node network and tcp agents to un an ftp applications. but there is no trace produced. can some one tell me what i am doing wrong.
>
> thanks
> Sid
> ----------------------code-----------------------
> set ns [new Simulator]
>
> set nf [open out.nam w]
>
> proc finish {} {
> global ns nf
> $ns flush-trace
> close $nf
> exec nam out.nam &
> exit 0
> }
>
> set node0 [$ns node]
> set node1 [$ns node]
>
> $ns duplex-link $node0 $node1 1Mb 10ms DropTail
>
> set src [new Agent/TCP/FullTcp]
> set sink [new Agent/TCP/FullTcp]
> $ns attach-agent $node0 $src
> $ns attach-agent $node1 $sink
> $ns connect $src $sink
>
> $sink listen;
> $src set window_ 100
>
> set ftp1 [new Application/FTP]
> $ftp1 attach-agent $src
>
> Application/FTP instproc start {} {
> [$self agent] send -1;
> }
>
> $ns namtrace-all $nf
> $ns at 0.0 "ftp start"
> $ns at 10.0 "finish"
>