A. Contention based
The
file maccon.h and maccon.cc in folder mac is an example implementation for
contention based
In
this Maccon, the channel list array number is equal to the number of nodes in
the simulation script test4maccon.tcl.
Nodes randomly select the channel based on this channel array. In the topology
and traffic file topo4.tcl, 3
pairs of nodes are transmitted simultaneously.
Since the channel decision of this
Besides the code change in
Module wirelessphy: example about
how to use interface for |
void
WirelessPhy::sendDown(Packet *p){ … // Send the packet //channel_->recv(p, this); multichannel[hdr_cmn::access(p)->channelindex_]->recv(p,
this); … } |
B. Collision free
The
file macng.h and macng.cc in folder mac is an example implementation for
collision frees
The operation of Macng is divided into two phases. In the first phase, each node sends out strategy packet with preferred receiving channel. If there is an empty channel available, then it is selected as the preferred receiving channel. If there is no empty channel, node shares the channel with the node that is furthest away from it. In the second phase, node will use the channel selected during the first phase to send and receive data. The channel selection algorithms we are using is a simple rule, which is for the demonstration purpose, hence, collision still exists.
Besides the code change in
Module wirelessphy: example about
how to use interface for |
void
WirelessPhy::sendDown(Packet *p){ … // Send the packet //channel_->recv(p, this);
multichannel[hdr_cmn::access(p)->channelindex_]->recv(p, this); … } |
The simulation script for this
Here is the simulation result for Maccon and Macng.
Previous: Exemplary Demonstrations Overview Next: GUI user guide
Return to Main…