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

Re: [ns] Problem with queue size



Briefly go through your code, what you did is creat a queue-monitor every
time the loop record executed, so, of course the initilization make the
queue size as 0. Therefore, take this line out of the record proc, you
will get it.

Good luck.
Victor

On Wed, 12 Apr 2000, Hassan Mansouri wrote:

> 
> Dear ns users, Hello.
> 
> I tried to get the size of the queue in a link using the proc below
> and although I could see the packets piling up and even dropping the 
> output of the queue size was 0 at all time. Can you please help?
> Thanks alot.
> 
> proc record {} {
>         global ns n mf 
>         #Set the time after which the procedure should be called again
>         set time 0.002
>         #Get the size of the queue of each link
>         set q [$ns monitor-queue $n(1) $n(2) ""]
>         set q12 [$q set size_]
>         puts $q12
>         #Get the current time
>         set now [$ns now]
>         #Write to the file
>         puts $mf "$now $q12"
>         #Re-schefule the procedure
>         $ns at [expr $now + $time] "record"
> 
> }
> 
> Hassan.
>