[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: LAN routing ?
Your script works for me, I can see all three flows. And you don't
need '$ns compute-routes' in the middle, however it doesn't hurt. I
can email you the nam trace file I get, if you like.
-Yuri
Apinun Tunpan <[email protected]> writes:
> Hello,
>
> I have some problems with LAN routing. I use ns-allinone-2.1b5.
> I run ns on SunOS 5.6 (Solaris).
>
> My test configuration is as follows:
>
> na nb
> | |
> n0 n2
> | |
> +-----+
> | |
> n1 n3
>
> Here n0,n1,n2,n3 are nodes in a 802_3 LAN.
> na and nb are external nodes which interact with nodes inside the LAN.
> I want to have three ftp traffic flows: n0->nb, nb->n1 and nb->na.
>
> The problem is that the only traffic flow that gets through
> in both directions (data/ack) was nb->n1 (as seen from nam --
> you may try to diable the 'start' statement of each ftp flow
> and see the result).
>
> The script for the simulation is given below
>
> Is there any routing statement I should add to the script ?
> or is it a bug ? or is it a problem with my own ns build ?
>
> Thanks,
> Apinun.
>
>
> == cut here ==
>
> set ns [new Simulator]
> set f [open out.nam w]
> $ns namtrace-all $f
>
> set n0 [$ns node]
> set n1 [$ns node]
> set n2 [$ns node]
> set n3 [$ns node]
>
> set nodelist_ "$n0 $n1 $n2 $n3"
>
> set na [$ns node]
> set nb [$ns node]
>
> $ns duplex-link $na $n0 10Mb 20ms DropTail
> $ns duplex-link $nb $n2 10Mb 20ms DropTail
>
> $ns duplex-link-op $na $n0 orient down
> $ns duplex-link-op $nb $n2 orient down
>
> set lan_ [$ns make-lan $nodelist_ 10Mb 1ms LL Queue/DropTail Mac/802_3 Channel]
>
> $ns compute-routes
>
> set tcp0 [$ns create-connection TCP/Reno $n0 TCPSink $nb 0]
> set tcp1 [$ns create-connection TCP/Reno $nb TCPSink $n1 1]
> set tcp2 [$ns create-connection TCP/Reno $nb TCPSink $na 2]
>
> $tcp0 set window_ 128
> $tcp1 set window_ 128
> $tcp2 set window_ 128
>
> set ftp0 [$tcp0 attach-app FTP]
> set ftp1 [$tcp1 attach-app FTP]
> set ftp2 [$tcp2 attach-app FTP]
>
> $ns at 0.1 "$ftp0 start"
> $ns at 0.2 "$ftp1 start"
> $ns at 0.3 "$ftp2 start"
>
> $ns at 30.0 "$ns halt"
> puts "running..."
> $ns run
>
> puts "finishing..."
> $ns flush-trace
> close $f
>
> == cut here ==