[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ns] LossMonitor in multicast
Hi Ns users
I'm trying to collect statistic such as throughput,
packet loss rate on each receiver side in mftp. I have
tried Agent/LossMonitor but it doesn't collect any
parameters. Here is my Tcl code snippet.
proc record { } {
global srvNode sink n thru loss_rate
set ns [Simulator instance]
set time 0.5
for {set i 0} {$i <$srvNode} {incr i} {
set recv_pkt($i) [$sink($i) set npkts_]
set lost_pkt($i) [$sink($i) set nlost_]
set recv_byt($i) [$sink($i) set bytes_]
puts stdout "node($i) $bw($i) $recv_pkt($i)
$lost_pkt($i)"
}
set now [$ns now] ; #get the current time
#calculate thrughput
for {set i 0} {$i <$srvNode} {incr i} {
puts $thru($i) "$now [expr
$recv_byt($i)/$time*8/1000000]"
}
#reset the bytes_ values on the traffic sinks
for {set i 0} {$i <$srvNode} {incr i} {
$sink($i) set bytes_ 0
$sink($i) set nlost_ 0
}
#reschedule the procedure
$ns at [expr $now+$time] "record"
}
One discrepancy from tutorial is that I didn't include
$ns connect $source $sink
because it's multicasting. On simualtion, nam shows
traffic is flowing well but any reason I couldn't
collect traffics. Any help will be appreciated..
mike lui
__________________________________________________
Do You Yahoo!?
Yahoo! Photos -- now, 100 FREE prints!
http://photos.yahoo.com