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

Re: Setting link up & down in your agent code



> From: ChengLin TAN <[email protected]>
> Date: Wed, 10 Jun 1998 18:56:16 +0200

ChengLin,

In connection with bringing a link down, you also have to

	a) update unicast routing at the incident nodes
	b) update multicast routing at the incident nodes
	c) drop all packets queued for transmission on that
		link
	d) drop all packets in transit

Conversely, when bringing a link up, you have to do steps (a) and (b)
above only.

The rtmodel APIs do all of that automatically.  If you choose to
control the links directly through your agent, then you'd likely
want to do the work of the rtmodel code yourself.  

All of this is in the documentation
(http://www-mash.cs.berkeley.edu/ns/nsDoc.ps.gz),
and, of course, the source code.


Kannan



> 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
> 

--
[email protected]
http://www.isi.edu/~kannan