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

Setting link up & down in your agent code



hi,

To set link up & down, i know i can use
$ns rtmodel-at 0.2 down $n0 $n1
$ns rtmodel-at 0.8 up $n0 $n1

However, if i want to use the following in my agent code procedures
(called BringUp and BringDown) instead :

[$ns link $n0 $n1] down ---> in BringDown
[$ns link $n0 $n1] up -----> in BringUp

I have declared both links to be dynamic using
[$ns link $n0 $n1] dynamic
[$ns link $n0 $n1] dynamic

in my test script, i called the procedures as follows:

$ns at 0.2 "$myagent BringDown"
$ns at 0.8 "$myagent BringUp"

After i bring up the link, the link does not seems to be working
(although NAM shows the link turns fr red to black).  Is it that the
routes are not updated yet?  How do i solve this problem?

Thanks in advance for any clue.
regards,
chenglin