Propagation Loss Model Error: TxPowerDbm equal to 0

60 views
Skip to first unread message

Albert Santos

unread,
Jun 14, 2022, 12:16:41 PM6/14/22
to ns-3-users
Hello everyone. I ran an LTE scenario and configured PathLoss::

lteHelper->SetAttribute("PathlossModel", StringValue("ns3::FriisPropagationLossModel"));

Thus, i added a line in src/propagation/model/propagation-loss-module.cc (specifically on line 259) to display the TxPowerDbm. FriisPropagationLossModel's DoCalcRxPower method looks like this:
------------------------------------------------------------------------------------------------------------------------
double
FriisPropagationLossModel::DoCalcRxPower (double txPowerDbm,
                                          Ptr<MobilityModel> a,
                                          Ptr<MobilityModel> b) const
{
  /*
   * Friis free space equation:
   * where Pt, Gr, Gr and P are in Watt units
   * L is in meter units.
   *
   *    P     Gt * Gr * (lambda^2)
   *   --- = ---------------------
   *    Pt     (4 * pi * d)^2 * L
   *
   * Gt: tx gain (unit-less)
   * Gr: rx gain (unit-less)
   * Pt: tx power (W)
   * d: distance (m)
   * L: system loss
   * lambda: wavelength (m)
   *
   * Here, we ignore tx and rx gain and the input and output values
   * are in dB or dBm:
   *
   *                                         lambda^2
   * rx = tx +  10 log10 (---------------------------- )
   *                                      (4 * pi * d)^2 * L
   *
   * rx: rx power (dB)
   * tx: tx power (dB)
   * d: distance (m)
   * L: system loss (unit-less)
   * lambda: wavelength (m)
   */

  std::cout << "TX in frris: " << txPowerDbm << std::endl; // ADDED LINE
.
.
.
------------------------------------------------------------------------------------------------------------------------

The default value of TxPower (30dbm) should be displayed but only the value 0 is shown. I wanted to know if this is normal or not as this happens with all other propagation loss models when configured by the LTE helper. 

Tom Henderson

unread,
Jun 20, 2022, 6:32:11 PM6/20/22
to ns-3-...@googlegroups.com, Albert Santos

> *
> *
> The default value of TxPower (30dbm) should be displayed but only the
> value 0 is shown. I wanted to know if this is normal or not as this
> happens with all other propagation loss models when configured by the
> LTE helper.
>
I looked into this today and this is normal and not a bug. The reason
is due to the use of the spectrum channel framework.

Originally, before spectrum, there was the YansWifiChannel, and a number
of propagation loss models were developed for this. In the Yans model,
a signal with a scalar (single-value) power was transmitted on the
channel, and then this power value was passed to the propagation loss
model so that it could be decremented.

Spectrum channels, such as used in LTE, decompose the signal into a
number of bands, and distribute the total power across all bands, and
store this information in a power spectral density. There were a couple
of 'spectrum-aware' propagation loss models developed that operated
directly on the power spectral density. However, we wanted to be able
to reuse the legacy loss models like Friis in this framework. The
solution was to use these models by passing a special value (0 dBm) for
the transmit power, and let those models calculate the loss in dB.
Then, this loss (combined with loss or gain of other elements such as
antennas) can be converted to a linear scale and multiplied by the power
spectral density (which is affected by the configured TxPower values).

See lines 320-338 of src/spectrum/model/multi-model-spectrum-channel.cc.

- Tom
Reply all
Reply to author
Forward
0 new messages