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

Re: trace Average Queue Size in RED



Fusun Inanc wrote:
> 
> Thanks for the prompt reply.
> 
> I look at the ns documentation but I couldn't find how to access my queue
> instance.  I just defined the queue in this line.
> 
>      $ns duplex-link $n1 $n2 3Mb 10ms RED
> 
> how can I define the  variable $redq  to this queue?
> 
>      set redq .........?
>      set avgque [$redq set ave_]
>      puts " Average Queue Size = $avgque "
> 
> Thanks again,
>
You can use for example the following two procedures:

Simulator instproc get-link { node1 node2 } {
    $self instvar link_
    set id1 [$node1 id]
    set id2 [$node2 id]
    return $link_($id1:$id2)
}

Simulator instproc get-queue { node1 node2 } {
    global ns
    set l [$ns get-link $node1 $node2]
    set q [$l queue]
    return $q
}

bye
Roman
-- 
--------------------------------------------------------
Roman Pletka                [email protected]
* *  Also on WWW: http://studwww.eurecom.fr/~pletka  * *
--------------------------------------------------------