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

[ns] Reseting the flowmon packets and bytes counter...




Hi!:

	I have a simple problem that I really do not know how to solve, for I started 
with Ns quite recently... the question is that I have created a FlowMonitor 
over a particular node and I got it to output the data in a file, but I do not 
know how to reset the Monitor from data dumping to the next data dumping. Here 
is the code of my FlowMon:


---------------------------------------------------
set probe_mon [$ns makeflowmon Fid]
$ns attach-fmon $link_routers $probe_mon 0

proc set_flowMonitor {flowmon output_chan} {
  $flowmon attach $output_chan
  set bytesInt_ [new Integrator]
  set pktsInt_ [new Integrator]
  $flowmon set-bytes-integrator $bytesInt_
  $flowmon set-pkts-integrator $pktsInt_
  return $flowmon
}

set_flowMonitor $probe_mon $probe_trace


proc Probing {} {
  global ns probe_src probe_mon Probe_lifeTime Probe_end 
Probe_interarrivalTime rng
  global probe_plot
  $ns at [$ns now] "$probe_src start"
  set this_probe_end [expr [$ns now] + $Probe_lifeTime]
  set next_probe [expr $this_probe_end + [$rng uniform 0 
$Probe_interarrivalTime]]
  $ns at $this_probe_end "$probe_src stop"
  $ns at $this_probe_end "$probe_mon dump"
  $probe_mon set bytesInt_ 0
  $probe_mon set pktsInt_ 0
  puts " "
  puts "Probe started at [$ns now] and will end at $this_probe_end"
  if {$next_probe < $Probe_end} {
    puts "Next probe scheduled for $next_probe"
    puts " "
    $ns at $next_probe "Probing"
  }
  return 0
}
---------------------------------------------------------

And I want to reset all the statistics from probing to probing (each time I 
make the 'dump'), so that I have all the counts starting from 0 each time I 
call 'Probing()'... I have tried to set bytesInt_ and pktsInt_ to 0, as you 
see, but that does not work...

The only thing I would like to do is just to print the numbers of the 
particular flow I am interested in and not all the flows I have. I have also 
tried to use instead of 'dump' '$flowmon dumpflow()' but I do not get it to 
work... Is there any way to do it?


I would really appreciate any help in this...

Thanks in advance!!



-- 
Ignacio M�s Ivars
Department of Teleinformatics - Royal Institute of Technology (KTH/IT)
Electrum, 204  S-164 40 KISTA (Sweden)
Office phone: +46 8 7521497
Office fax: +46 8 7511793
E-mail: [email protected]
http://www.it.kth.se/~nacho/

-- 
Ignacio M�s Ivars
Department of Teleinformatics - Royal Institute of Technology (KTH/IT)
Electrum, 204  S-164 40 KISTA (Sweden)
Office phone: +46 8 7521497
Office fax: +46 8 7511793
E-mail: [email protected]
http://www.it.kth.se/~nacho/