[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [ns] Problem in a code to simulate by TCP/IP Full
On Fri, 15 Sep 2000, Vincenzo Mazzotta wrote:
> Hi to all, i'm testing my optical queue by UDP with CBR, Expoo and Pareto Generator and all is ok ...
> Now i testing my optical queue on TCP/IP but i've some problem because i see that FTP Application seems don't go ... To finally the nam file and trace file is empty ...
> Somebody can tell me where is the bug in this TCL code ???
You forgot
$ns run
to set the simulator going.
L.
>
> set ns [new Simulator]
>
> set f [open tcp.tr w]
> $ns trace-all $f
>
> set nf [open tcp.nam w]
> $ns namtrace-all $nf
>
> set node1 [$ns node]
> set node2 [$ns node]
>
> $ns duplex-link $node1 $node2 5Mb 1us DropTail
>
> set tcp [new Agent/TCP]
> $tcp set class_ 1
> $ns attach-agent $node1 $tcp
> set sink [new Agent/TCPSink]
> $ns attach-agent $node2 $sink
> $ns connect $tcp $sink
>
> set ftp [new Application/FTP]
> $ftp attach-agent $tcp
> $ns at 0.0 "$ftp start"
> $ns at 10.0 "finish"
>
> proc finish {} {
> global ns nf
> $ns flush-trace
> close $f
> close $nf
> exec nam tcp.nam &
> exit 0
> }
>
>
> Thanks in advanced
> [email protected]
>
<[email protected]>PGP<http://www.ee.surrey.ac.uk/Personal/L.Wood/>