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

Re: [ns] link_->bandwidth()




If you want to use link_ it must be initialized to the link object.  For
RED, it is done when the link is created in tcl/lib/ns-lib.tcl

If you are implementing a new Queue then I think you can do it in your
script by the following :-

$ns duplex-link $n1 $n2 10Mb 1ms MyQueue

set link1 [$ns link $n1 $n2]
set link2 [$ns link $n2 $n1]

set q [$link1 queue]
$q link [$link1 set link_]

set q [$link2 queue]
$q link [$link2 set link_]

Note that you need to provide command method to set the link in your
queue class (check red.cc, cbq.cc). I assumed above that the command is
"link".

Hope this helps,
- Manish

"Huike (Victor) Li" wrote:
> 
> I implemented a new algorithm in ns, (like RED, for flow control)
> but when execute
> double m=link_->bandwidth();
> it gives the error message of
> Segmentation fault (core dumped).
> 
> I am sure everything defined well(:TclClass,  ***:Queue, etc.)
> How to solve it?
> Thanks,
> 
> Huike (Victor) Li
> 
> Department of EEE
> University of Melbourne
> Victoria 3051
> Australia
> Tel: +61 3 9344 9201
> Fax: +61 3 9344 9188