How can I perform unicast communication in Veins? - omnet++

While looking for various information on Stackoverflow, I read that Veins 5.x and above support Unicast communication.
I understood that unicast communication is possible through populateWSM(). However, I don't understand which LAddress::L2Type rcvId should be in the ID value of the second parameter.
Should I pass the ID value obtained through
getParentModule() -> getIndex()
Or is it necessary to pass the ID value of the left node list when running the simulation? If it's the latter, how can I get the ID value?

The demo implementation of Veins 5.1 uses the OMNeT++ module ID. For more robustness, I would recommend querying the MAC layer. See, for example, https://github.com/sommer/veins/blob/veins-5.1/src/veins/modules/application/ieee80211p/DemoBaseApplLayer.cc#L83

Related

How to get Vehicle ID from SUMO in Veins

In my Veins simulation, I want to use SUMO vehicle ID as the ID of the vehicle (instead of using Veins module id). I tried different method but was not successful. I tried to obtain sumo id using mobility -> getExternalId() in DemoBaseApplLayer.cc file. Build was successful but it does not run. If i do, getParentModule->getId() - it works fine. But I need SUMO Id not module id for my work,
Is there a way to use SUMO vehicle Id as the id of the vehicle in Veins?
If you mean that the wireless node with node vector index 1 in OMNeT++ should correspond to a vehicle named vehicle_1 in SUMO this will not easily be possible. If all you want to do is inquire about which name SUMO uses to refer to a wireless node managed via TraCIMobility in OMNeT++ then its getExternalId method is exactly the right one to call. If using the method gives you a runtime error, please post the precise output and messages you are seeing, the precise software versions you are using, and the steps needed to reproduce your error on another machine.

How to enable SUMO TraCI using SimuLTE and Veins?

I am using SimuLTE and Veins simulating sending safety message via LTE. The content of the message depends on the real-time values of the traffic, e.g., mean speed. In order to get such values, I plan to use TraCICommandInterface supported by Veins. However, I could not find out how and where I can do this. To be specific, in Veins without SimuLTE, I know the vehicle node is a module of TraCIMobility, which has an application layer, where we can customize the functions for receiving/sending messages, such as wsm, and managed by TraCIScenarioManager. However in the simulation example provided by SimuLTE, the vehicle/node is a module of VeinInetMobility, which is managed by VeinInetManager. Neither of them are using TraCICommandInterface or TraCIMobility. Besides, the lte applications are not using the same layer as BaseWaveApplLayer, where we can take some action as soon as the vehicle/node updates the position. Can anyone help explain how I could possibly implement the following using SimuLTE and Veins:
In order to monitor the vehicle/node values using TraCI, which class should I modify to use TraCI? VeinsInetMobility, VeinsInetManager or else?
How can I take action in the application only when there is a position update to the vehicle/node?
What is the essential difference between VeinsInetMobility and TraCIMobility? Can I use the latter for LTE scenario?
In Veins 4.6, a TraCIMobility module is used to update the Veins channel models every time a node's position changes. Quite similarly, in Veins_INET of Veins 4.6, a VeinsInetMobility module is used to update the INET Framework channel models every time a node's position changes. Because SimuLTE uses INET Framework channel models, this is the class that must be used here (otherwise the INET channel models would not know, e.g, whether two nodes are too far away to communicate).
If you want to take action every time a SUMO time step has completed, you can just add this to the executeOneTimestep method of TraCIScenarioManager.
Note that if you ever want to interact with the SUMO vehicle via the VeinsInetMobility module (e.g., changing a vehicle's route) a few changes will be necessary: Veins_INET of Veins 4.6 does not track a node's external id (the ID that SUMO uses to refer to the corresponding vehicle), so this would need to be added to VeinsInetMobility (line 54) along with code to use it, similar to TraCIMobility (line 127).

how can I get the Id for a rsu in veins?

I have three rsu in my app. is there any id for rsu like car id for cars? if yes, how can I get rsu id in rsu initializer method? if not how can I distinguish between rsus?
If you the consider the demo scenario, it has one RSU integrated stored in an Array structure. However, you can have an arbitrary number of RSUs by increasing the number in the brackets.
Therefore, you can address every RSU individually by its module id *.rsu[<index>] (e.g. RSUExampleScenario.rsu[0]) which is also available in the code via getId(). OMNeT++ also provides other useful functions for getting the name of a module.
If this is identifier is not enough for you, at least in the Mac layer there is an additional id which you can use to distinguish nodes.
If this is not not enough, you would need to add your own identifier variable to the NED module.

How and where does SNMP get his traffic data?

since i havent found an answer to that on the net, im trying it here :
I was wondering how SNMP get his traffic data on a router ?
I am actually monitoring a router with 2 different way :
- With snmp which seems to give me the exact number of octets going trought the router,
- With a custom data flow collector ( a bit complicated think about it as netflow or sflow) who give me data only when a flow close (i guess its that right, if im wrong tell me).
So how snmp does that, did they got a poller on the port ? or do they just acess to something in the hardware ?
SNMP is just a protocol, which in particular defines a data model to represent the agent status and configuration; there is no particular technology behinf the curitain. Often routers have an internal infrastructure that collects data and send to manager
The underlying operating system keeps the counters for incoming octets and so on. The SNMP agent on the device usually reads the counters directly and returns the values to you via standard messages.
However, not familiar with the flow approach so cannot answer the other half of your question.

How can I simulate the two simple scenarios in Veins?

I am a PhD student at INSA Lyon, France. I work on mobility in urban environments.
I installed Omnet ++ 4.6, Sumo 0.21.0 and Veins 3.0 to simulate vehicle mobility.
In fact, I've never used Omnet ++ in my previous work. I read the existing tutorials of Omnet ++ in the website and now I want to start to simulate these two small scenarios:
1 Scenario: I want to have a set of mobile vehicles that exchange information among themselves
2nd scenario: I want to have a set of mobile vehicles and a set of fixed RSU that exchange information
What can I change in the existing example of Veins to lead simulate these scenarios please?
Can you help me to do this please.
Thanks very much in advance.
If you are interested in using Road Side Units (RSUs) in your simulation, you might want to base your work on Veins 4a2 instead. Its example simulation already includes an RSU participating in data exchange: as soon as a vehicle stops, it sends a message. Each vehicle and RSU that receives a message re-broadcasts one message per simulation. Each vehicle that receives a message computes a different route to avoid the road where the message originated. See this answer for a screenshot of the resulting simulation.

Resources