[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Total Traffic
On Fri, 10 Sep 1999, FADY CHRISTOPHY wrote:
> How can I calculate the total traffic through a link ij between the node
> i and the node j, in ns2.
> Thanks in advance.
I did this by adding a queue monitor to the queue being served by the
link. The queue monitor counted the number of bytes that departed from the
queue, and I divided by the time to obtain the used capcity.
Here's some relevant snippets of code.
-----
proc end {} {
global qm
puts "bytes leaving queue = [$qm set bdepartures_]"
exit 0
}
set link [$ns link $node(0) $node(1)]
# don't think this file used, but it's needed as a parameter - suppose
# I could use /dev/null
set qt [open qmon.out w]
$link init-monitor $ns $qt 0.05
set qm [$link set qMonitor_]
$ns at 0.0 "$qm reset"
$ns run
-----
Sean.
-----
Sean Murphy, Email: [email protected]
Teltec Ireland, Phone: +353-1-7045080
DCU, Dublin 9, Fax: +353-1-7045092
Ireland.