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

Re: Variable BW link?




On Mon, 29 Mar 1999, Ji-Cheol Moon wrote:

> I'm trying a variable bandwidth link.
> But, it seems that there is just fixed bandwidth link in ns.
> Do you know about a variable bandwidth link module?


Both delay_ and bandwidth_ are bound variables-- so you should be able
to change them dynamically.  You first need to obtain a handle to your
Link object (through the link_ associative array), then access
the "link_" instvar, which corresponds to a "DelayLink" object in C++.

Say you want to change the bandwidth and delay of a simplex link between
nodes n1 and n2.  You could do the following:

        set i1 [$n1 id]
        set i2 [$n2 id]
	[[$ns set link_($i1:$i2)] set link_] set bandwidth_ $new_bw
        [[$ns set link_($i1:$i2)] set link_] set delay_ $new_delay