Change VeinsInetSampleMessage in Inet example - omnet++

How do you change the sample message that gets broadcast to vehicles in the veins_inet sample application?
I can see that TraCI comes equipped with many functions that generate information about a node, such as speed, acceleration, location etc. I would like to include such information in the messages the nodes broadcast and that can be read in Pcap recordings made by each node. Currently the default message is just the RoadID of the node.

Related

Record message in Pcap recording with Inet

In the veins_inet sample application there exists a sample message that is sent to nodes upon a node getting into an accident. The sample message contains one piece of information which is the RodeID. I have implemented Pcap recorders onto each node to record the broadcasts between nodes for analysis later, but I notice that the RoadID isn't in the Pcap files. How do I make sure the content of the messages sent is also visible in the Pcap recording files?

Inet framework getting time

I'm using the wireless example, and i want get the simulation time and save in parameter for calculate the time the packet arrival and the packet send. Have anyone solution for these?
There is a statistics for this automatically collected in application models (i.e. like BasicUdpApp etc.). It's called endToEndDelay.
The proper way to do this (and this what is already done in INET) is that you during packet creation you should add a TAG to the sent packet which contains a simtime_t variable and put the actual simtime there and then read the same TAG when the packet arrives and calculate the difference. Putting values into the "parameters" of a message would NOT work as the packets could be fragmented/defragmented in the network so their identity is not kept and the attached parameters are destroyed.
But again, this is already present in INET 4.2

How can I modify veins source code to build my first VANET simulation trigger by a RSU?

In a section of road (I exported a portion of map from osm), I have already placed a RSU and generate some random trips of some vehicles. I would like now simulate the exchanges of messages as described bellow:
- the RSU broadcasts periodically a message, like WSA or SAM (Service Announcement Message), and all vehicles that receive the message will respond to the RSU.
Hence, I would like to simulate packet loss according to the number of vehicles and number of exchanges messages handled by the RSU.
I don't know where to change the first sender of message in the original veins source code. In the original veins program, it is a node[0] that triggers the accident message.
Thank you in advance for your return.
You can find the source code of the application running in the Veins 5a1 example simulation in src/veins/modules/application/traci/TraCIDemo11p.cc
I would recommend to start learning about Veins by running the example simulation and playing around with the above mentioned file to see how/what the behavior of the simulation changes.
If you are new to OMNeT++ as well, you will likely find it very useful to start by learning plain OMNeT++ (that is, without Veins) first. The OMNeT++ Tic Toc tutorial is an excellent place to start here.

send the reputation values of nodes to the neighbour nodes

I want to send the reputation values of nodes to the neighbour nodes in OMNet++ utilizing Veins. I have installed veins4a. I have done the tictoc and run the veins successfully. Can anybody help me on how to send this type of information in Veins. Should i use extra message but UDP/TCP is not supported in the current version of Veins.
Is it possible to send this message using the WaveShortMessage.msg by adding extra information (like extension in this message)?
The best way to start might be to modify the existing example, which uses TraCIDemo11p as its application and WaveShortMessage as the message exchanged between cars. Feel free to add new fields to the message class (just like you did in the Tic Toc tutorial, but now in WaveShortMessage.msg) and to implement new ways of how the application reacts to received messages (again, just like in the Tic Toc tutorial, but now in TraCIDemo11p.cc).

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