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

Re: Very strange sim results



On Fri, 6 Nov 1998, Biaz Saad wrote:

> Are you using a lossy link ?

That's not apparent from his code (included again as text below for
anyone who can't read attachments, or is browsing the archives.)

I suspect Chris's problem is that he is opening the tracefile, but not
explicitly closing it, so stuff doesn't always get flushed out to it. 

L.

-->8--

proc create_net_6_DT { } {
        #
        #        s1                    s3
        #          \                   /
        # 10Mb, 1ms \   0.3Mb, 1ms    / 0.1Mb, 300ms
        #           r1 ------------ r2
        # 10Mb, 1ms /                 \ 0.1Mb, 300ms
        #          /                   \
        #        s2                   s4 tcl
        #

        global ns s1 s2 s3 s4 r1 r2
        set s1 [$ns node]
        set s2 [$ns node]
        set r1 [$ns node]
        set r2 [$ns node]
        set s3 [$ns node]
        set s4 [$ns node]

        $ns duplex-link $s1 $r1 10Mb 1ms DropTail
        $ns duplex-link $s2 $r1 10Mb 1ms DropTail
        $ns duplex-link $r1 $r2 0.3Mb 1ms DropTail
        $ns duplex-link $r2 $s3 0.1Mb 300ms DropTail
        $ns duplex-link $r2 $s4 0.1Mb 300ms DropTail

}

set ns [new Simulator]

create_net_6_DT

set stopTime 30

set tFile [open queue.tr w]
$ns trace-queue $r2 $s3 $tFile

set tcp0 [$ns create-connection TCP/Reno $s1 TCPSink $s3 40]
$tcp0 set window_ 100
set ftp0 [$tcp0 attach-source FTP]

set tcp1 [$ns create-connection TCP/Reno $s2 TCPSink $s4 41]
$tcp1 set window_ 100
set ftp1 [$tcp1 attach-source FTP]

# Enable the next line for different sim results !!!
# $ns at 25.0 "puts \"Very strange...\"" 

$ns at 0.0 "$ftp0 start"
$ns at 0.0 "$ftp1 start"

$ns at $stopTime "$ftp0 stop"
$ns at $stopTime "$ftp1 stop"

$ns at $stopTime "puts \"Simulation finished.\""
$ns at $stopTime "exit"

$ns run

-->8--

> If so, check that your error model is correctly initialized,
> specially in errmodel.cc if you are using an old version of ns-2.
> 
> Saad.
> 
> 
> On Fri, 6 Nov 1998, Christof Brandauer wrote:
> 
> > Dear ns-users!
> > 
> > I've come across a (from my point of view) very strange behavior of ns
> > that I can't explain.
> > 
> > I run a simple simulation (I attached the script) where I
> > "trace-queue" one link. 
> > 
> > >From the trace output "queue.tr" I count the # of dropped packets
> > doing a:
> > 
> > % grep ^d queue.tr | wc -l
> > 
> > which results in 0.
> > 
> > 
> > Then I run the sim again, but this time schedule one additional event:
> > 
> > $ns at 25.0 "puts \"Very strange.\""
> > 
> > I would have thought that this should not have any effect on the sim
> > itself. However I get a different "queue.tr", including 43 packet drop
> > events. 
> > 
> > I'd greatly appreciate it if anyone could clear things up for me.
> > 
> > thx in advance,
> > chris

<[email protected]>PGP<http://www.ee.surrey.ac.uk/Personal/L.Wood/>