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

Re: [ns] How to monitor flow?




> I tried to monitor some flow states but failed. I have
> read ns document carefully and searched old archive.
> After spending two days reading some samples, such as
> test-suite-red.tcl, many_tcp.tcl and
> test-suite-cbq.tcl, I failed.

There are some useful examples in ~ns/tcl/rtmechanisms.
 
> What I want to do is to monitor each flow's packets
> been dropped and number of packets been queued. I do,
> however, get some flow statistics. 

Modigyi your flowdump procedure as follows.

proc flowdump {interval} {
        global ns fmon fstate

        $fmon dump
        flush $fstate
        foreach f [$fmon flows] {
>        	set flow_arrs [$f set barrivals_]
>		set flow_deps [$f set bdepartures_]
>		set flow_drops [$f set bdrops_]	
	        
		$f reset
        }
        $fmon reset
    $ns at [expr [$ns now] + $interval] "flowdump $interval"
}

The number of queued packets for each flow are 
(arrivals - departures - drops) in this interval +
 queued packets in the last interval (zero to begin with).

	- ratul

> But I don't know
> how to process the data. I guess I have to write some
> awk code to parse the trace data first, then to write
> some perl script to translate it to xgraph format, to
> use xgraph to display it finally. Due to my poor
> knowledge in linux/unix, I knew little about awk,
> perl, tcl (I am a windows user but have to use ns
> under linux for some reason). 
> 
> I attached the tcl script I used. Any of your
> suggestion, comments are highly appreciated.
> 
> Thanks in advance.
> 
> Canhui
> 
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Shopping - Thousands of Stores. Millions of Products.
> http://shopping.yahoo.com/