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

Re: [ns] link handles



Patrick

duplex-link doesn't resturn a reference to a link object. In fact,
duplex-link calls simplex-link twice.
Try this:

$ns duplex-link $n1 $n2 1Mb 10ms DropTail
set newlink [$ns link $n1 $n2]

Now, you can use "$newlink up?" like:

if { [$newlink up?] == "up" } {
...

Carlos

On Mon, 19 Jun 2000, Patrick Simen wrote:

> I am trying to vary a link's bandwidth and delay dynamically.  I came
> across Sally Floyd's email
> (http://www-mash.CS.Berkeley.EDU/dist/archive/ns-users/0005/0409.html) about
> her changes to ns which allow this, but only after trying lots of stuff
> with links.
> 
> This brought up a question about whether the info in the ns manual,
> chapter 6.4, is
> correct.  It gives a list of commands that begin with "$ns_".  That seems
> to work.  But it also lists commands like "$link up?".
> 
> I can't get those to work.  How do you get a handle to a link object? I
> wrote:
> 
> set newlink [$ns duplex-link $n1 $n2 1Mb 10ms DropTail]
> 
> But then the command "$newlink up?" fails.  The failure message is:
> 
> invalid command name ""
>     while executing
> "$newlink up?"
> 
> And when I write: "puts stdout $newlink", I just get a blank line, as if
> no handle to the link between $n1 and $n2 exists.  So how do you get a
> handle for a link?  Or, what does "$link" refer to in chapter 6.4?
> 
> --Pat.
> 
> ---------------------- 
> Patrick Simen 
> [email protected] 
> EECS Dept.
> University of Michigan 
> ----------------------
> 
> 
>