LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Network Simulator code for cognitive radio (https://www.linuxquestions.org/questions/linux-newbie-8/network-simulator-code-for-cognitive-radio-881094/)

protti1 05-16-2011 10:20 PM

Network Simulator code for cognitive radio
 
Hello,

I am using the following add-on with ns2 to be able to simulate cognitive radio networks.
http://www.ece.mtu.edu/~ljialian/

While looking on the net, I also found this article which explains how to send Hello packets on multiple interfaces using the above mentioned simulator.

A Tutorial on Broadcasting Packets over Multiple-Channels in a Multi-Inferface Network Setting in NS-2

However, the project that I am working on asks for the mobile node to switch between channels, and not interfaces.

In addition to the code that the above article gives, here is what I am attempting to do:

if(nIfaces) //nIfaces is the number of interfaces on each radio
{
for(int i=0; i<nIfaces; i++)
{
Packet *p = p->copy();
struct hdr_cmn *ch_copy = HDR_CMN(p_copy);
for(int j=0; j<wcett_total_channels; j++) // wcett_total_channels is a global variable that contains the total number of channels
{
ch_copy->channelindex_ = j;
cout << "sendHello from node " << index << "On channel " << j << " on interface " << i << endl;
Scheduler::instance().schedule(targetlist[i], p_copy, 0.0);
}
}
}

However, this does not seem to work!

Any pointers to this will be appreciated!

Cheers
protti1

rajbora80 07-16-2014 07:12 AM

Yes , this program doesnot seem to work.
Did you simulate any other programs?


All times are GMT -5. The time now is 06:35 PM.