2

We have a problem with our Veins simulation. We are trying to implement an algorithm in the demo scenario (TraCIDemo11p) regarding message diffusion and our problem is with sending WSM messages. We want to send a specific message from a Node (e.g. car) to a specific RSU. The Node knows its neighbours by collecting beacon messages and stores the ID and type of sender to a buffer. The problem is when we want to send the message to, for example RSU with ID 7, if there is a Node with ID 7, two messages will be sent, because they both have ID 7. Where can we change the IDs that are given implicitly, so that we can differentiate the nodes and RSUs in the TraCIDemo11p.cc?

Because they are two different modules, the nodes are stored in an array node[] and RSUs in the array rsu[], that's why they can have the same ID or index for that matter.

We have tried by changing the myId attribute in the initialize method of TraCIDemoRSU11p, but when the message is about to be sent, the recepient does not receive it. By analyzing the beacon messages received by the car, we can tell that the RSU has the modified ID, 50 for example. Then we use the populateWSM method and state the rcvID parameter to be 50, but the message is never received on the RSU.

We are using Veins 4.7.1. and OmNet++ 5.4.1.

Bokiyz
  • 23
  • 3

1 Answers1

2

You are right: Veins 4.7.1 was using the host module's index (that is, the 7 in "node[7]") as the "MAC address" of a network card (see here). More recent versions, for example, Veins 5.0-alpha2, are using a fully flexible scheme; moreover it defaults to using the OMNeT++ module id of the network card (see here), which not only allows differentiating between hosts with the same index, but also between multiple network cards within these hosts.

If switching to Veins 5 is not an option for you, back-porting this change should be straightforward.

Christoph Sommer
  • 6,413
  • 1
  • 14
  • 34
  • Thank you for your response Mr. Sommer. Switching to Veins 5 is not an option for us in this moment. How do you suggest we fix this in our current version then, I didn't quite understand the "back-porting" situation. – Bokiyz Sep 06 '19 at 09:49
  • My recommendation would be to find the git commit that changed the aforementioned lines and to do the same changes in your codebase. – Christoph Sommer Sep 06 '19 at 09:50
  • Solved. Thank you for your time Mr. Sommer. – Bokiyz Sep 06 '19 at 10:19