0
votes

i am new in using the OMNET++ simulator. Currently i want to build a network which consists of two or more nodes, each having two interfaces on which they can send messages out (e.g. Ethernet and Wireless).

I want to program the node behavior by myself. When a message arrives at a host, i want to define in the handleMessage(cMessage *msg) method, whether the host should transmit the received message via Ethernet or Wireless interface.

Can i take the WirelessHost from the INET package for this scenario? If yes, how can i program the decision on what interface to use for retransmitting the received message? I followed the wireless tutorial from INET, but they only configure .ned and .ini files but not the .cc files where the behavior is coded.

In the tutorial the UdpBasicApp was used. It would be nice if i could write an own App like described above.

Thanks in advance!

1
Welcome to Stack Overflow! Please edit your question to show the code you have so far. You should include at least an outline (but preferably a minimal reproducible example) of the code that you are having problems with, then we can try to help with the specific problem. You should also read How to Ask.Toby Speight

1 Answers

0
votes

Right. You can tune your own node, just creating a new one (.h .ned .cc file), that can import and reuse Wireless host features and add/override extra functions. So a custom MyNode.cc file for new MyNode element could be:

#include "MyNode.h"
#include <string.h>
#include <omnetpp.h>

void MyNode::initialize()
{
}

void MyNode::handleMessage(cMessage *msg)
{
 EV << "Received message, now applying new custom procedure \n";
 new_behaviour msg;
}

Also can help you here a complete sample of a new node created to delete all received packets OMNET++ How to retain all functions in AODVRouting class but override sendAODVPacket function only?

Cheers!