31 #include <ns3/double.h>
33 #include <ns3/pointer.h>
34 #include <ns3/simulator.h>
35 #include <ns3/uinteger.h>
37 NS_LOG_COMPONENT_DEFINE(
"SatGwPhy");
42 NS_OBJECT_ENSURE_REGISTERED(SatGwPhy);
48 TypeId(
"ns3::SatGwPhy")
50 .AddConstructor<SatGwPhy>()
51 .AddAttribute(
"PhyRx",
52 "The PhyRx layer attached to this phy.",
55 MakePointerChecker<SatPhyRx>())
56 .AddAttribute(
"PhyTx",
57 "The PhyTx layer attached to this phy.",
60 MakePointerChecker<SatPhyTx>())
61 .AddAttribute(
"RxTemperatureDbk",
62 "RX noise temperature in GW in dBK.",
66 MakeDoubleChecker<double>())
69 "Maximum RX gain in dB",
72 MakeDoubleChecker<double_t>())
75 "Maximum TX gain in dB",
78 MakeDoubleChecker<double_t>())
79 .AddAttribute(
"TxMaxPowerDbw",
80 "Maximum TX power in dB",
83 MakeDoubleChecker<double>())
86 "TX Output loss in dB",
89 MakeDoubleChecker<double>())
92 "TX Pointing loss in dB",
95 MakeDoubleChecker<double>())
96 .AddAttribute(
"TxOboLossDb",
100 MakeDoubleChecker<double>())
103 "TX Antenna loss in dB",
106 MakeDoubleChecker<double>())
109 "RX Antenna loss in dB",
112 MakeDoubleChecker<double>())
113 .AddAttribute(
"DefaultFadingValue",
114 "Default value for fading",
117 MakeDoubleChecker<double_t>())
118 .AddAttribute(
"ImIfCOverIDb",
119 "Intermodulation interference, C over I in dB.",
122 MakeDoubleChecker<double>())
123 .AddAttribute(
"AciIfWrtNoisePercent",
124 "Adjacent channel interference wrt white noise in percents.",
127 MakeDoubleChecker<double>(0, 100));
134 NS_LOG_FUNCTION(
this);
140 : m_aciIfWrtNoisePercent(10.0),
141 m_imInterferenceCOverIDb(22.0),
142 m_imInterferenceCOverI(
SatUtils::DbToLinear(m_imInterferenceCOverIDb))
144 NS_LOG_FUNCTION(
this);
145 NS_FATAL_ERROR(
"SatGwPhy default constructor is not allowed to use");
149 Ptr<SatLinkResults> linkResults,
150 SatPhyRxCarrierConf::RxCarrierCreateParams_s parameters,
151 Ptr<SatSuperframeConf> superFrameConf,
154 m_aciIfWrtNoisePercent(10.0),
155 m_imInterferenceCOverIDb(22.0),
156 m_imInterferenceCOverI(
SatUtils::DbToLinear(m_imInterferenceCOverIDb))
158 NS_LOG_FUNCTION(
this);
160 ObjectBase::ConstructSelf(AttributeConstructionList());
166 parameters.m_extNoiseDensityWhz = 0.0;
168 parameters.m_linkRegenerationMode = returnLinkRegenerationMode;
171 Ptr<SatPhyRxCarrierConf> carrierConf = CreateObject<SatPhyRxCarrierConf>(parameters);
175 carrierConf->SetLinkResults(linkResults);
178 carrierConf->SetAdditionalInterferenceCb(
186 NS_LOG_FUNCTION(
this);
192 NS_LOG_FUNCTION(
this);
199 NS_LOG_FUNCTION(
this);
206 NS_LOG_FUNCTION(
this);
SatLinkDir_t
Link direction used for packet tracing.
RegenerationMode_t
The regeneration mode used in satellites.
TypeId GetInstanceTypeId(void) const
virtual double GetAdditionalInterference()
Get additional interference, used to compute final SINR at RX.
double m_imInterferenceCOverI
Intermodulation interference in linear.
SatGwPhy(void)
Default constructor.
virtual void DoInitialize(void)
Initialization of SatPhy.
double m_aciIfWrtNoisePercent
Configured adjacent channel interference wrt noise (percent).
virtual void DoDispose(void)
Dispose of this class instance.
virtual ~SatGwPhy()
Destructor for SatGwPhy.
double m_imInterferenceCOverIDb
Configured intermodulation interference in dB.
virtual SatEnums::SatLinkDir_t GetSatLinkTxDir()
Get the link TX direction.
virtual SatEnums::SatLinkDir_t GetSatLinkRxDir()
Get the link RX direction.
static TypeId GetTypeId(void)
inherited from Object
The SatPhy models the basic physical layer of the satellite system.
void SetTxPointingLossDb(double lossDb)
Set the pointing loss of the transmitter in dB.
void SetRxAntennaGainDb(double gainDb)
Set the maximum antenna gain of the receiver in dB.
void ConfigureRxCarriers(Ptr< SatPhyRxCarrierConf > carrierConf, Ptr< SatSuperframeConf > superFrameConf)
Configure Rx carriers.
virtual Ptr< SatPhyTx > GetPhyTx() const
Get the SatPhyTx pointer.
void SetTxOboLossDb(double lossDb)
Set the OBO loss of the transmitter in dB.
void SetDefaultFading(double fading)
Set the default fading of the PHY.
double GetTxOutputLossDb() const
Get the output loss of the transmitter in dB.
double GetTxAntennaGainDb() const
Get the maximum antenna gain of the transmitter in dB.
virtual Ptr< SatPhyRx > GetPhyRx() const
Get the SatPhyRx pointer.
void SetTxOutputLossDb(double lossDb)
Set the output loss of the transmitter in dB.
double GetTxPointingLossDb() const
Get the pointing loss of the transmitter in dB.
double GetDefaultFading() const
Get the default fading of the PHY.
double GetTxMaxPowerDbw() const
Get the maximum transmit power of the transmitter in dB.
double GetTxOboLossDb() const
Get the OBO loss of the transmitter in dB.
void SetTxMaxPowerDbw(double powerDb)
Set the maximum transmit power of the transmitter in dB.
double GetRxAntennaGainDb() const
Get the maximum antenna gain of the receiver in dB.
virtual void SetPhyTx(Ptr< SatPhyTx > phyTx)
Set the SatPhyTx module.
void SetRxAntennaLossDb(double lossDb)
Set the antenna loss of the receiver in dB.
void SetRxNoiseTemperatureDbk(double temperatureDbk)
Set the noise temperature of the receiver in dbK.
double GetRxNoiseTemperatureDbk() const
Get the noise temperature of the receiver in dbK.
double GetRxAntennaLossDb() const
Get the antenna loss of the receiver in dB.
void SetTxAntennaGainDb(double gainDb)
Set the maximum antenna gain of the transmitter in dB.
virtual void DoDispose(void)
Dispose of SatPhy.
void SetTxAntennaLossDb(double lossDb)
Set the antenna loss of the transmitter in dB.
virtual void SetPhyRx(Ptr< SatPhyRx > phyRx)
Set the SatPhyRx module.
virtual void DoInitialize(void)
Initialization of SatPhy.
double GetTxAntennaLossDb() const
Get the antenna loss of the transmitter in dB.
SatUtils class is for general conversions used in satellite module.
static T DbToLinear(T db)
Converts decibels to linear.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.
Creation parameters for base PHY object.