omnet++/veins : how to register interface entry for nic 80211p - omnet++

while trying to connect veins and inet, I've noticed my cars don't register
the nic80211p interfaceEntry in the InterfaceTable.
Indeed, the interfacetable contains only loopback l0 for every node.
In the omnet/inet manual it is written :
"Interfaces are registered dynamically in the initialization phase by modules that represent
network interface cards (NICs). The INET Framework makes use of the multi-stage initialization feature of OMNeT++, and interface registration takes place in the first stage (i.e. stage
INITSTAGE_LINK_LAYER
)."
So if I understand the registration shoud be done in Nic80211p.ned and specifically in Mac1609_4::initialize()?
What do you think?
Thanks for any help.
Regards,

Since this question was asked, the Veins repository on Github was amended to include a sample subproject (veins_inet) that runs an INET Framework (INET 3.4.0) simulation using Veins for nodes' mobility.
You can see the necessary code (and, after clicking on Browse Files, you can download a .zip archive of the complete project) on https://github.com/sommer/veins/commit/90d4586e

Related

Omnetpp wirelesshost sending useful information

I am new to Omnetpp, and I am trying to send messages from one node to another wirelessly.
Basically, I would like to do something as in the tictoc example of Omnetpp (https://docs.omnetpp.org/tutorials/tictoc/) but then wirelessly.
I have installed INET already, and I have seen the wireless example, which uses the UdpBasicAPP. However, I do not know how to change the data of the message send while using the UdPBasicAPP. In my case, what I am sending (i.e. the data) is very important because it is part of a bigger project. Eventually, the idea is to use the 802.11p standard (which exists in VEINS) and multiple nodes, but I thought this was a good place to start.
I hope someone can help me out.
Kind regards
just to be aware: 802.11p is also supported directly in INET. Just set the opMode parameter on the network interface.
You will need to create your own application module. Take a look/copy UdpBasicApp and modify it according to your needs. Check the sendPacket() function which creates an ApplicationPacket. ApplicationPacket contains only a single sequence number, but you can create your own application level data structure and use that for sending.

How to check channel state from MAC layer

In Omnet++ 5.5.1 with INET 4 framework, from MAC layer, I am trying to check if the physical channel is idle.
Would anyone please suggest me the code for that?
UPDATE
I'm using the following interface.
# wireless interface
**.wlan[*].typename = "WirelessInterface"
**.wlan[*].radio.typename = "ApskScalarRadio"
Thanking you.
Usually radios implement the IRadio interface, and the medium state can be queried through various methods on that interface. Check the CsmaCaMac.cc file for examples. Here is the actual implementation you are looking for:
https://github.com/inet-framework/inet/blob/master/src/inet/linklayer/csmaca/CsmaCaMac.cc#L593

How to connect RSUs to Controller node via cable in omnet++ Veins?

I am trying to connect two (or more, in the future) RSUs (one is not in the transmission radius of the other) in the Controller node that will receive the information from the RSUs and build global knowledge of the scenario.
I've tried to approach as in the links LINK1 and LINK2, and I was unsuccessful.
Is there a similar example?
PS: I am using Omnet++ 5.3, Veins 4.7.1, and Sumo 0.32.0.
Depending on how much focus you want to put on simulating the wired network, it might make sense to write your simulation as an INET simulation first and then use Veins (with its veins_inet submodule) to make nodes behave like vehicles.

Omnet++ How to connect up a network in my application

I am trying to build a simple simulation using omnet++. I'd like to avoid using things like ned. Instead I want to allocate the modules set up the simulation topology entirely under program control. (i.e. I'll configure my simulation and set up connections etc. in main() instead of using ned)
How do I go about doing this ? (any examples you can point me to?)
thanks
Create a top level network in NED and drop a single simple module called builder or something like that. Then create/connect the necessary modules in that module's initialize method (or schedule a message at t=0s and do the network buildup there).
There is an example in OMNeT++ that does exactly like this, in samples/routing. Choose the NetBuilder configuration. That example is reading the network topology from an external file, but you can change it to create any topology you would like to have.
The actual code for the network generation is in samples/routing/builder/netbuilder.cc in NetBuilder::buildNetwork

omnet++ retrieve network topology from code

I'm very new to OMNeT++ and I'm writing my first simulation with it. What I'm trying to do is to retrieve the complete topology of the network at execution time from a node.
Basically, I have a router node that needs to know the entire topology (which node is connect to who) but I don't want to statically change the C++ code according to the Network selected. Instead, the idea is that the router is able in its initialization function to discover all the connections between nodes.
How can I do that?
Thanks in advance.
What you need is the omnetpp::cTopology class from the OMNeT++ API: https://omnetpp.org/doc/omnetpp/api/classomnetpp_1_1cTopology.html
If you are using INET, there is a slightly enhanced version of this class in inet::common::Topology

Resources