Help with Implementing ETX in DSR Routing Protocol in ns-3

81 views
Skip to first unread message

Jiten Patel

unread,
Jan 14, 2025, 3:10:30 PM1/14/25
to ns-3-users
Hi all,

I am a student currently working on my research project at uni. I am using ns3 version 3.43 on Ubuntu 24.04.
I’m trying to modify the DSR routing protocol to use the Expected Transmission Count (ETX) metric instead of the usual hop count for a wireless multi-hop network with around 50 nodes. I'm using YansWifiChannel and YansWifiPhy for the network setup.

From what I understand, there are two ways I can calculate ETX:
  1. Using BER from the PHY Layer:
    I was thinking of using an ErrorRateModel to get the packet success rate and then calculate BER. My initial plan was to use the GetChunkSuccessRate() method, but this method requires SNR as one of its parameters, and I’m unsure how to access SNR in YansWifiPhy. Does anyone have advice on how to get the SNR, or is there a better way to calculate or obtain BER for each link?
  2. Probing Control Packets/Hello Messages:
    Another option I’m considering is probing periodic control packets or Hello Messages to get the packet drop rate for each link and then compute ETX from that. However, this seems like it could get a bit more complex.
I’d really appreciate any guidance on the best way to go about this. If the first option is recommended, could you provide more details on how I could go about it?

Thank you for your help.

Best Regards,
Jiten Patel

Tom Henderson

unread,
Jan 14, 2025, 11:10:55 PM1/14/25
to ns-3-...@googlegroups.com, Jiten Patel
I can't really recommend an approach other than to point you to the literature (there have been plenty of papers about ETX and the variations around it).  For instance, the OLSR routing daemon olsrd has implemented ETX for many years.  An older paper concerning DSR and ETX (which uses probes, your option 2 below) is here: http://nil.lcs.mit.edu/rtm/papers/etx.pdf

As for how to get data out of the ns-3 wifi models, you can probably implement something like option 1 in a manner similar to the IdealWifiManager in ns-3, which uses a (non-standard) packet tag sent in the acks to tell the sender what the SNR was at the receiver. The SNR then is used in a lookup table (the error model) to find the highest MCS that supports a target BER that is defined in the IdealWifiManager.  So, I would look at IdealWifiManager for inspiration on how to do something like 1).

For option 2, I'd probably not use hellos but instead define some probing application (could even be a UDP traffic generator) such as the paper cited above describes.  Then, you would want to get statistics out of the WifiMac layer regarding successes and failures.  If you measure this at a higher layer, you will miss the wifi retransmissions (it may appear to be loss-free but only because Wi-Fi is retransmitting below).  The WifiMac::AckedMpdu, NAckedMpdu, and DroppedMpdu traces are probably what you need to tabulate these statistics. 

Keep in mind also that if you configure a dynamic rate control algorithm such as MinstrelHt and are gathering statistics on probes, you may lose control of the MCS that is dynamically selected for sending data, and it may interfere with your ETX calculations.

I found this repo also but don't know anything about it; someone attempted adding ETX to ns-3 AODV a while back: https://github.com/neje/ns3-aodv-etx

- Tom
--
Posting to this group should follow these guidelines https://www.nsnam.org/wiki/Ns-3-users-guidelines-for-posting
---
You received this message because you are subscribed to the Google Groups "ns-3-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ns-3-users+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/ns-3-users/2faaca75-1ddd-438e-8c7c-446cf1b94be3n%40googlegroups.com.


Jiten Patel

unread,
Jan 15, 2025, 1:55:55 PM1/15/25
to ns-3-users
Dear Tom,

Thank you so much for the detailed response and the resources you shared. I looked into them and they are really very helpful and actually a great fit for what I'm trying to do.

I understood how to get the SNR via tags and use periodic probing for ETX. However, for BER, I was wondering if there’s a more effective or standard method to calculate or obtain the Bit Error Rate (BER) in a wireless multi-hop network with multiple nodes over each link in ns-3, especially when using YansWifiChannel and YansWifiPhy?

Thank you again for your help. I really appreciate your guidance.

Best Regards,
Jiten Patel
Message has been deleted
Message has been deleted

Jiten Patel

unread,
Jan 21, 2025, 11:22:57 AM1/21/25
to ns-3-users
Hi,

My goal is to obtain the BER or set a fixed BER in WifiPhy. To achieve this, I attempted to use the RateErrorModel, but I discovered that it works only for wired connections (e.g., PointToPointNetDevice). I found that we cannot directly use the RateErrorModel for WifiPhy; however, we can utilize the PostReceptionErrorModel attribute to set a RateErrorModel and apply a fixed BER after reception.

However, I am currently stuck on how to trace or track packets that are dropped post reception. Since I am unable to trace them, I cannot confirm whether the BER has been applied correctly. My understanding is that the PhyRxDrop TraceSource only triggers the corresponding callback function DURING reception. Since the error model drops packets after reception, they do not appear in the corresponding callback function for PhyRxDrop.

Could someone please suggest how to trace the packets dropped via the Post Reception Error Model?

Thank you.

Best Regards,
Jiten Patel

Reply all
Reply to author
Forward
Message has been deleted
Message has been deleted
Message has been deleted
0 new messages