问题
I am working with Omnet++, veins. I use the code that exist here:
Flooding.ned also flooding.cc exist in same link.
I am working with flooding application, and I assigned sentbeacon true, and sent Data to false, to compute the probability of beacon delivery. all statistical are recorded in the mentioned project.
for flooding.cc I changed onBeacon function to record the recievedbeacon
void Flooding::onBeacon(WaveShortMessage *wsm)
{
// not used for this algorithm
// statistics recording
emit(beaconReceivedSignal, 1);
stats->updateAllBeaconsReceived();
}
Then I want to record the number of sent packet, so I changed in this file Mac1609_4.cc ( the code is part of this file and just the line that I changed).
void Mac1609_4::handleSelfMsg(cMessage* msg)
{
DBG_MAC << "Sending a Packet. Frequency " << freq << " Priority" << lastAC << std::endl;
sendDelayed(mac, RADIODELAY_11P, lowerLayerOut);
statsSentPackets++;
stats->updateAllpacketsent();
}
My question is about the statistical number.I need the help with equation to compute the probability of beacon delivery correctly. I used realistic map, when I running the project and get results , I could not know how to compute the probability, I try to take part of area (RoiRect) but it still I have the same issue, may be I need to compute the probability for specific range or should I take small area, to have accurate results?
For the included results, I stopped the simulation with 36 nodes.
回答1:
It's because of broadcast nature of sending beacon.
Assuming that the network contains N nodes and there are ideal propagation conditions, when a node sends one beacon packet, it will be received by N-1 nodes (i.e. all other nodes). As a consequence:
allSentBeacon = 1
allReceivedBeacon = N-1
By the way: in that situation the delivery ratio should be defined as:deliveryRatio = allReceivedBeacon / (allSentBeacon * (N-1))
来源:https://stackoverflow.com/questions/37105527/omnet-veins-asking-about-the-value-of-recievedbeacon-and-sentpacket