wilcoln
wilcoln

Reputation: 73

How to suppress a connection between two nodes in TCL language

I have been looking for it for a while in various tutorials and all I can find is the syntax for creating a connection between 2 existing nodes n1 and n2 i.e

$ns duplex-link $n1 $n2 10Mb 10ms DropTail

But my need now is to delete at a particular moment (say t = 5s) the connection between them. I've thought about hacking the previous syntax by setting the bandwidth of the existing connection to 0, like this:

$ns at 5. "$ns duplex-link $n1 $n2 0Mb 10ms DropTail"

I think this should do the trick, at least theoretically, but I wonder if there is no better way, built-in way to achieve that.

Upvotes: 1

Views: 64

Answers (1)

wilcoln
wilcoln

Reputation: 73

This is the right way for doing it

$ns rtmodel-at 5. down $n1 $n2

Source

Upvotes: 1

Related Questions