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

[ns] flow monitoring results problem



hi all,
       i get the same results from flow mionitor
object 
when i used it with and without the integrator.

can someone kindly help


set ns [new Simulator]


$ns color 1 Blue
$ns color 2 Red

set f [open out.tr w]
$ns trace-all $f


proc finish {} {
        global ns f
        $ns flush-trace
	#Close the trace file
        close $f                
        exit 0
}

#proc to create integrators
proc set_flowMonitor {flowmon outFile} {
        $flowmon attach $outFile
        set bytesInt_ [new Integrator]
        set pktsInt_ [new Integrator]
        $flowmon set-bytes-integrator $bytesInt_
        $flowmon set-pkts-integrator $pktsInt_	
        return $flowmon
}

#Create four nodes
set n0 [$ns node]
set n1 [$ns node]
set n2 [$ns node]
set n3 [$ns node]

#Create links between the nodes
$ns duplex-link $n0 $n2 1Mb 10ms DropTail
$ns duplex-link $n1 $n2 1Mb 10ms DropTail
$ns duplex-link $n3 $n2 1Mb 10ms SFQ

$ns duplex-link-op $n0 $n2 orient right-down
$ns duplex-link-op $n1 $n2 orient right-up
$ns duplex-link-op $n2 $n3 orient right


$ns duplex-link-op $n2 $n3 queuePos 0.5

set f [open out1.tr w]
$ns trace-queue $n2 $n3 $f


set tcp0 [new Agent/TCP]
$tcp0 set class_ 1
$ns attach-agent $n0 $tcp0

set cbr0 [new Application/Traffic/CBR]
$cbr0 set packetSize_ 300
$cbr0 set interval_ 0.5
$cbr0 attach-agent $tcp0

set tcp1 [new Agent/TCP]
$tcp1 set class_ 2
$ns attach-agent $n1 $tcp1

1
set cbr1 [new Application/Traffic/CBR]
$cbr1 set packetSize_ 500
$cbr1 set interval_ 0.005
$cbr1 attach-agent $tcp1

set sink0 [new Agent/TCPSink]
$ns attach-agent $n3 $sink0

set sink1 [new Agent/TCPSink]
$ns attach-agent $n3 $sink1

#set sink2 [new Agent/TCPSink]
#$ns attach-agent $n3 $sink2

$ns connect $tcp0 $sink0  
$ns connect $tcp1 $sink1
#$ns connect $tcp2 $sink2
   
set slink [$ns link $n2 $n3]    
set fm [open all.f1 w]
set fmon [$ns makeflowmon Fid ]
$ns attach-fmon $slink $fmon  

#here is the set_flowmonitor statement
set_flowMonitor $fmon $fm 

#here is the other 
#when i comment the previous and run only
#this the outputs are the same

#$fmon attach $fm

$ns at 5.0 "$fmon dump"


$ns at 0.5 "$cbr0 start"
$ns at 0.75 "$cbr1 start"
$ns at 4.25 "$cbr1 stop"
$ns at 4.5 "$cbr0 stop"


$ns at 5.0 "finish"

#Run the simulation
$ns run


can someone kindly run this script and help me,

thanks
Badri

=====


__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail. 
http://personal.mail.yahoo.com/