Wave Service Advertisement (WSA) implementation

1.2k views Asked by At

I am working on the implementation of the following scenario using OMNET++ & VEINS simulators.

  1. Every RSU will broadcast WSA (Wave Service Advertisement) Beacon once per second. (i.e. I2V communication).
  2. Every passing vehicle would store these WSAs. (i.e. Caching)
  3. Vehicles interested in a WSA, would query nearby vehicles. (i.e. Searching for WSA) (i.e. V2V communication).
  4. Vehicles after receiving the query, would response to the query (if the required WSA is inside the vehicle cache). (i.e. V2V communication)

Issues regarding implementation:

  • Do I need to define a new .msg files for each of the above phases (for RSU broadcast, for vehicles query, and for vehicles responding) ? or I need to amend the WaveShortMessage.msg file only ?
  • Do I need to define my own .cc, .h, .ned files for RSU and CAR or I can amend the traci examples (of Veins).
1

There are 1 answers

0
user4786271 On

Do I need to define a new .msg files for each of the above phases (for RSU broadcast, for vehicles query, and for vehicles responding) ? or I need to amend the WaveShortMessage.msg file only ?

It is highly recommended that you create a general message type for your specific application. You could extend the WaveShortMessage.msg, and then add a type field in your message, which would represent different types of messages for the application: RSUbroadcast, VehicleQueryFrame and so on. The decision in the end boils down to your choice. But having messages as specified as possible (keeping them atomic for a certain task) is good practice.

cplusplus {{
#include "veins/modules/heterogeneous/messages/WaveShortMessage_m.h"        // include the base message


#define RSU_BROADCAST_FRAMETYPE 50
#define VEHICLE_QUERY_FRAMETYPE 51

}}

class WaveShortMessage;     // Making the C++ Declarations Available

message MyAppGeneralMessage extends WaveShortMessage
{
    int frameType;
}

Having the different types will allow you control over the behaviour of the application based on the different message type.

if(msg->getType() == foo)
{
    /* do smth for foo */
}

Do I need to define my own .cc, .h, .ned files for RSU and CAR or I can amend the traci examples (of Veins).

In general yes. You will probably need to define .ned, .cc, .h for the application(s) which you want to run on the RSU and the Car, but not for redefining what a RSU and a Car really is.

If you are reluctant you can start of by looking and the demo files and examples inside Veins.