1

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. enter image description here

Vega
  • 27,856
  • 27
  • 95
  • 103
phdstudent
  • 41
  • 6

1 Answers1

0

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))

Jerzy D.
  • 6,707
  • 2
  • 16
  • 22
  • Ok, I understand why the recievedbroadcast is more than the sent, however, I want to compute the probability of beacon delivery and compare it with similar values, the equation that u include does not give me the correct value . please check that attached picture and let me know why the packetsend count different than the packet sent vector – phdstudent May 09 '16 at 11:46
  • The line `allpacketsentSignal:vector (vector) = 39.0 (77)` means: this signal was emitted 77 times, each time with some value, and the _mean_ value of all emitted values is equal to 39.0. Could you extend your question and provide `NED` declaration of this statistic as well as `C++` code, where you involve it? And could you write a number of nodes? – Jerzy D. May 09 '16 at 12:45
  • How the methods `stats->updateAllBeaconsReceived()` and `stats->updateAllpacketsent()` look like? – Jerzy D. May 10 '16 at 06:11
  • This code FranciscoStatistics.cc already in the same github above link `void FranciscoStatistics::updateAllpacketsent() { ++allpacketsent; emit(allpacketsentSignal,allpacketsent); } void FranciscoStatistics::updateAllBeaconsReceived() { ++allBeaconsReceived; emit(allBeaconsReceivedSignal, allBeaconsReceived); } ` – phdstudent May 10 '16 at 10:18
  • I want to mention that every second one more car is added to scenario, should I add them at the same time ? to compute the required correctly or detect a region and time "? – phdstudent May 11 '16 at 06:55
  • In `allpacketsentSignal` and `allpacketsentSignal` statistics you should take into account only the *count* of values. Moreover, could you write how you estimate an expected number of all received beacon when a number of cars increases during simulation? – Jerzy D. May 11 '16 at 18:31
  • I think this is the problem because it is not correct to take all the numbers of packet for nodes that increased in different area. So how can I compute the probability for a node taking into account its neighboring nodes in specific time http://stackoverflow.com/questions/37150827/omnet-veins-the-number-of-neighbors-nodes-for-car-x-in-specific-time what can I do ? – phdstudent May 13 '16 at 11:46