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

Re: [ns] multiple flows



Apu Kapadia wrote:

> I'm observing something weird with tcp flows. I set up a flow monitor and
> I label the tcp flows from 1 to n (for n flows). I print out the
> statistics for each flow in my finish procedure. For many values of n, I
> get an exception when I try to do the following:
>
>         set flowmon_id [lindex $flowmon $i]
>         puts $dropfile "[$flowmon_id set pdrops_]
>
> It seems that the first line returns a null string, and hence an exception
> is thrown in the next line. I'm able to get stats for number of flows =
> 1,4,5,6,8,10,12,30, etc. (seems arbitrary to me), but for many other
> values of total flows I get an exception.
>
> Is this a bug?
>
> Regards,
> Apu

I don't think you cannot access a flow monitor object using list operators
such as lindex. You need to obtain a list of flows first with:

set flowlist [$flowmon flows]

and then you will be able to work with the list in the way you wanted:

set flowmon_id [lindex $flowlist $i]
puts $dropfile "[$flowmon_id set pdrops_]

-- Felix Hernandez