Problems in changing the Tx Power of nodes in a WiFi network

118 views
Skip to first unread message

Varun Reddy

unread,
Apr 21, 2017, 2:18:27 PM4/21/17
to ns-3-users
Hi everyone,

I am simulating a wifi network with the Two-ray propagation loss model. I want the nodes to have a transmit power of 16dBm. However, when I print the actual Tx power (within the DoCalcRxPower() function inside propagation-loss-model.cc) I observe values such as -43dBm. I also observe values such as 96dBm (in the debugger). I'm not exactly sure why these values occur although I set a default transmit power value of 16dBm.

I have attached a few files here:
1/ wifi_sample.cc : The source code for my wifi network
2/ propagation-loss-model.cc : Source code for the loss model
3/ AP_stat.txt : Output of the program execution, it contains details about the Tx power for the AP in my wifi network.
4/ debug : Picture of the debugger output (backtrace)

Thank you!

Varun
AP_stat
debug.png
wifi_sample.cc
propagation-loss-model.cc

Tommaso Pecorella

unread,
Apr 24, 2017, 10:11:27 AM4/24/17
to ns-3-users
Only the last value is "right". Don't worry about the previous ones, they're just intermediate steps.
If you want to fully understand what's going on you'll have to study the code, the debugger isn't exactly the best option.
About reaching -43dBm... well, it depends on your scenario, the nodes distance, the antenna elevation, etc.

T.

Varun Reddy

unread,
Apr 24, 2017, 1:51:08 PM4/24/17
to ns-3-users
Thank you for your help Tommaso.

The problem arises in propagation-loss-model.cc :

double
PropagationLossModel::CalcRxPower (double txPowerDbm,
                                   Ptr<MobilityModel> a,
                                   Ptr<MobilityModel> b) const
{
  double self = DoCalcRxPower (txPowerDbm, a, b);
  if (m_next != 0)
    {
      self = m_next->CalcRxPower (self, a, b);
    }
  return self;
}

If (m_next!=0) then CalcRxPower is called twice. This was what was altering my Tx power from 96dBm to -43dBm.

Thank you for going through this problem!

Varun
Reply all
Reply to author
Forward
0 new messages