0

I am new to VEINS/Omnet++ and trying various broadcast suppression techniques and would like to calculate the packet loss ratio. I assume I have to use this formula :

Packet Loss Ratio = TotalLostPackets / SentPackets

But since some nodes send 0 packets, is there an easy way to specify this in the Omnet++ .anf config file or maybe in VEINS without doing manual adjustments? Otherwise if any node sends a 0 packet, then all graphs appear as infinity.

Thank you!

user629034
  • 659
  • 2
  • 11
  • 30

1 Answers1

5

This does not directly answer your question, but I would warn against using this equation in a simulation where not all nodes might send the same number of packets or where broadcasts are sent. Each packet sent as a broadcast can potentially be received by many other nodes meaning that even a simulation where only 1 packet is sent might also record 7 successful receptions and 5 packet losses. Your equation would calculate the loss rate as 5/1=500% whereas I would find a rate of 5/12=42% more reasonable.

As a side effect of calculating loss rate as "fail/(success+fail)" you will not need to take special care for nodes that did not send/receive packets.

Christoph Sommer
  • 6,893
  • 1
  • 17
  • 35
  • Thank you! Just to confirm - in VEINS SentPackets == successful receptions - correct? – user629034 Oct 26 '17 at 02:06
  • 2
    No! Just because a packet was sent does not mean it was successfully received. If you want to know how many packets were received, check one of the metrics with "received" in its name. You can find an overview in the source code https://github.com/sommer/veins/blob/veins-4.6/src/veins/modules/mac/ieee80211p/Mac1609_4.cc#L395 – Christoph Sommer Oct 27 '17 at 07:32
  • Thank you Dr. Sommer. I am sorry for the confusion, but I meant SentPackets from the sender's perspective. As I understood, receivedBroadcasts means that this node received that many broadcasts from other nodes, but besides SentPackets - do I have to implement custom ack scheme to accurately calculate Packet Loss Ratio in VEINS? Thank you very much. Please let me know if I should address this as a separate question. – user629034 Oct 28 '17 at 03:08
  • 2
    You can see the SentPackets counter being increased here: https://github.com/sommer/veins/blob/veins-4.6/src/veins/modules/mac/ieee80211p/Mac1609_4.cc#L229 - what this means is that the metric is counting how many packets have been sent to the channel - not how many packets were received successfully. Note that Veins 4.6 also counts how many frames were *detected* by the MAC layer, but could not be *decoded*. From this (and the number of *detected* and successfully *decoded* - that is, received - frames), you can calculate a loss rate as well – Christoph Sommer Oct 29 '17 at 09:59