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

Re: [ns] access to MAC/LL intenal variables



Fabienne,

	As far as I know $tcp refers to an agent, not a node. More generally, if 
a variable is bound you can access to it from OTcl. I suggest you take a look at 
ll.cc and mac.cc to see what variables are bound when the constructor is called 
and see if any variables are accessible throught the command function.
	
> 
> Dear all,
> 
> The problem I encounter is that I wonder how to access the intenal
> variables of MAC and LL instances. Actually it is rather simple to
> access node variables using commands as
> 
> $tcp set bytes_
> 
> but the problem is how to access the MAC/LL entity of a node and more
> especially its internal variables? I would like to plot for instance the
> LL variable bytes_ of only one of my node (and not for all the other
> nodes) and I can't manage to do that. If I use 
> 
> set ll             LL
> $ns node-config   -llType $ll  ...etc...
> puts "bytes_= [$ll set bytes_]" 
> 
> and that I create several nodes, which value will bytes_ return, to
> which node does $ll refer, and how can I access the variable bytes_ of a
> specific node?

>From ns-node.tcl every node has it's own mac and ll objects, take a look at the 
instproc add-interface and you'll see that a node has ll_, mac_, netif_, etc 
variables; that are arrays containing the LL, MAC, etc needed per connection. 

So you could do something like 

set LL1 [$n0 set ll_(1)]

to get access to the LL object stored in n0's ll_ array at index 1.

I believe what you have written actually sets ll to the value "LL", that is a 
string not an LL object...

> 
> I would very much appreciate any help on this subject

hope this was helpfull.

> 
> Sincerely
> 
> Fabienne

ps : from the notes (manual) you get the impression that the new node API 
permits to have only one type of MAC, LL, i.e. level 1-2 stack; whereas you can 
actually have different interfaces on the same node (at least that's the 
impression given by the code in ns-node.tcl); can someone clarify this for me?


Tarik