[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Two TBFs in succession..
It should not do what you want. I copied the code from ns-lib.tcl and
ns-agent.tcl:
Simulator instproc attach-tbf-agent { node agent tbf } {
$node attach $agent
$agent attach-tbf $tbf
}
Agent instproc attach-tbf { tbf } {
$tbf target [$self target]
$self target $tbf
}
So in your code, the first tbf will be replaced by the second
one. But I guess you can do it in this way. Not test yet.
Add one instproc to TBF(it is as same as for Agent):
TBF instproc attach-tbf { tbf } {
$tbf target [$self target]
$self target $tbf
}
And then, do
$tbf attach-tbf $tbf1
Thanks.
--Zhenhai
On Thu, 11 Mar 1999 [email protected] wrote:
> HI,
> I am trying to put two TBFs in succession...
>
> Will the following code work..??(The code is from test-tbf.tcl)
>
> <..snip..>
> set a [new Agent/UDP]
>
> <.....Snip..>
> set tbf [new TBF]
> $tbf set bucket_ 1024
> $tbf set rate_ 32000
> $tbf set qlen_ 100
>
> $ns attach-tbf-agent $n0 $a $tbf
>
> set tbf1 [new TBF]
> $tbf1 set bucket_ 2048
> $tbf1 set rate_ 32000
> $tbf1 set qlen_ 100
>
> $ns attach-tbf-agent $n0 $a $tbf1
>
> <.....Snip..>
>
>
> Thanks,
> Arni
>
>
>