[ns] how to dynamically attach (UDP) agents to nodes from C++?
t.reimann at lancaster.ac.uk
Fri Apr 6 15:13:37 PDT 2007
Timo Reimann wrote:
> I'm currently in need of extending ns-2 with an application that requires
> a lot of UDP connections netween nodes.
> Instead of statically defining these, I thought about setting them up and
> tearing down dynamically within the C++ code of the application I've
> started to implement. The alternative would be to use a fully-meshed UDP
> topology created in OTcl but this would pretty much clutter the
> configuration and use up a lot of ressources I'd only need at certain
Actually, I've been thinking about this some more and realized that it
would suffice if I could just do the connect part as in
[simulator object] connect [UDP object #1] [UDP object #2]
dynamically within C++.
Problem that arises with this issue, however, is: how'd I get the object
numbers in the compiled hierarchy? I suppose I need to work with node IDs
or similar but I haven't manage to figure out the details. Basically, all
I need is an address such that I can send my custom AppData objects to
another application. There's nsaddr_t but I don't know how to derive that
from the node name. (which is all I've got from OTcl and is the same as
this->name_, e.g. _o12.)
More information about the Ns-users