I noticed that in the Veins demo scenario a node broadcasts the data message it creates to each and every other node in the simulation.
I tried to modify that a bit. I modified the sendMessage()
function in TraCIDemo11p.cc
file by initializing the address of the recipient in the WSM
using the setRecipientAddress()
function. But while running the simulation in Veins 3.0
, I find that this message is still being broadcast to all the nodes apart from the target node.
- How do I implement this p2p connection?
- How do I generalize by adding an RSU to the scenario to implement a heterogeneous communication framework?
In its basis the 802.11p standard, which is the main communication standard for Vehicular Communication (and also the one used in Veins), does broadcast.
So basically, whatever you send via a 802.11p network interface, it will always be broadcasted, however you can make-up some type of p2p by doing "source-destination checking" from the frames.
You can extend the
WaveShortMessage
to contain Source and Destination fields specific for your application, and then perform checks if the destination is receiving from the intended sender.Lets say we have two nodes
nodeSender
andnodeReceiver
who want to communicate.nodeSender
would need to include its own identifier (name, ID etc) in the message:nodeReceiver
would need to check if the message it "hears" is from the intended sender. Because in reality it will be hearing from multiple senders due to the broadcast nature of 80211pYou can use vehicles SUMO id as their unique identifier for the addresses. You can obtain that by querying the
TraCIMobility
module: