Dear ns-users,
I am trying to add some kind of communication between the layers of the
protocol stack for the wireless communication stack (apply cross-layer based
algorithms). When I have started working with ns2 my view about ns was as
follows:
ns create object instances from class mobilenode based on the simulated
topology, then each node will have an object instance from each layer, e.g. it
will have an object from the used routing protocol, mac protocol, and the
physical channel, this is done to allow each node to change the attributes of
these agents according to its state.
I want to add an extra parameter to the constructors of the layers objects,
i.e. you know that for example the constructor of AODV protocol takes the node
address as a parameter in its constructor however the mac and the physical
channel takes nothing.
So, I have explored the files in the ~/tcl/lib directory to see where such
objects instances are created, I have found in the ns-lib.tcl the following
lines of codes that are used to create the routing agent instance, and this is
what I need to modify to include my extra parameter:
AODV {
set ragent [$self create-aodv-agent $node]
}
Simulator instproc create-aodv-agent { node } {
# Create AODV routing agent
set ragent [new Agent/AODV [$node node-addr]]
$self at 0.0 "$ragent start" ;# start BEACON/HELLO Messages
$node set ragent_ $ragent
return $ragent
}
But I have found the code used to create the mac and the physical layer
instances. This lead me to the thinking that there is only one mac instance
that is common to all nodes in the network, i.e. the mac instance recieve
frames from all nodes and it manage the medium for all nodes (not like the
routing agent which is specific for each node).
Is this concept right? if no where is the mac instance for each node is
created so I can modify its constructor?
Another question, there are many parameters in the ns-mobilenode.tcl and
ns-lib.tcl files like ragent_, mac_, etc. what is the role of these parameters?
and where it is defined formaly? in other words can anybody clarify for me how
is the mobilenode is represented in the tcl files in ns, and what are the
realtions between these parameters and the node itself, and how are the
analgoeus objects in C++ are created as a shadow for these parameters?
I have searched mant tutorials in adddition to ns-manual, but ?I have not
found the answers to my questions, especially about if the mac is common to all
or every node has its own mac object.
Sorry for the too long email, but it is hard to feel that you are missing the
basic concepts so there is no foundations to rely on.
Thanks in advance,
Gaby
---------------------------------
Yahoo! oneSearch: Finally, mobile search that gives answers, not web links.