Hi,

I would like to ask how do the agent and node connect each other in
ns-2.29.

I've noticed that the simulator attach-agent tcl function (ns-lib.tcl)
does it, which then calls for the node attach -function (ns-node.tcl). The
Node instproc attach adds the agent to the agents_ list in the Node. But
how does the agent get the target for sending packets?

Within the same function (attach) there are these commands:

$agent set node_ $self
$agent set agent_addr_ [AddrParams addr2id $address_]

I can find the agent_addr_ as a bound variable in agent, but I cannot see
where the node_ variable is used (and that contains the link to the node
tcl object). Somehow this information is then used to set the target_
value in the agent, but how?

The reason I'm asking, is that I would like to put an object between
agents and the node entry and want to understand the flow of control
really well here. It is my understanding that the agents downtarget is the
node entry point, right?

Anyone capable of helping? Just pointing out the right place in the code
to look, or documentation to read, will be enough. Thanks in advance,

- Mikko Särelä

Reply via email to