32 #include <ns3/double.h>
34 #include <ns3/pointer.h>
35 #include <ns3/simulator.h>
36 #include <ns3/singleton.h>
37 #include <ns3/uinteger.h>
39 NS_LOG_COMPONENT_DEFINE(
"SatGwPhy");
44 NS_OBJECT_ENSURE_REGISTERED(SatGwPhy);
50 TypeId(
"ns3::SatGwPhy")
52 .AddConstructor<SatGwPhy>()
53 .AddAttribute(
"PhyRx",
54 "The PhyRx layer attached to this phy.",
57 MakePointerChecker<SatPhyRx>())
58 .AddAttribute(
"PhyTx",
59 "The PhyTx layer attached to this phy.",
62 MakePointerChecker<SatPhyTx>())
63 .AddAttribute(
"RxTemperatureDbk",
64 "RX noise temperature in GW in dBK.",
68 MakeDoubleChecker<double>())
71 "Maximum RX gain in dB",
74 MakeDoubleChecker<double_t>())
77 "Maximum TX gain in dB",
80 MakeDoubleChecker<double_t>())
81 .AddAttribute(
"TxMaxPowerDbw",
82 "Maximum TX power in dB",
85 MakeDoubleChecker<double>())
88 "TX Output loss in dB",
91 MakeDoubleChecker<double>())
94 "TX Pointing loss in dB",
97 MakeDoubleChecker<double>())
98 .AddAttribute(
"TxOboLossDb",
102 MakeDoubleChecker<double>())
105 "TX Antenna loss in dB",
108 MakeDoubleChecker<double>())
111 "RX Antenna loss in dB",
114 MakeDoubleChecker<double>())
115 .AddAttribute(
"DefaultFadingValue",
116 "Default value for fading",
119 MakeDoubleChecker<double_t>())
120 .AddAttribute(
"ImIfCOverIDb",
121 "Intermodulation interference, C over I in dB.",
124 MakeDoubleChecker<double>())
125 .AddAttribute(
"AciIfWrtNoisePercent",
126 "Adjacent channel interference wrt white noise in percents.",
129 MakeDoubleChecker<double>(0, 100))
130 .AddAttribute(
"AntennaReconfigurationDelay",
131 "Delay of antenna reconfiguration when performing handover",
132 TimeValue(Seconds(0.0)),
141 NS_LOG_FUNCTION(
this);
147 : m_aciIfWrtNoisePercent(10.0),
148 m_imInterferenceCOverIDb(22.0),
149 m_imInterferenceCOverI(
SatUtils::DbToLinear(m_imInterferenceCOverIDb)),
150 m_antennaReconfigurationDelay(Seconds(0.0))
152 NS_LOG_FUNCTION(
this);
153 NS_FATAL_ERROR(
"SatGwPhy default constructor is not allowed to use");
157 Ptr<SatLinkResults> linkResults,
158 SatPhyRxCarrierConf::RxCarrierCreateParams_s parameters,
159 Ptr<SatSuperframeConf> superFrameConf)
161 m_aciIfWrtNoisePercent(10.0),
162 m_imInterferenceCOverIDb(22.0),
163 m_imInterferenceCOverI(
SatUtils::DbToLinear(m_imInterferenceCOverIDb)),
164 m_antennaReconfigurationDelay(Seconds(0.0))
166 NS_LOG_FUNCTION(
this);
168 ObjectBase::ConstructSelf(AttributeConstructionList());
174 parameters.m_extNoiseDensityWhz = 0.0;
176 parameters.m_linkRegenerationMode =
177 Singleton<SatTopology>::Get()->GetReturnLinkRegenerationMode();
180 Ptr<SatPhyRxCarrierConf> carrierConf = CreateObject<SatPhyRxCarrierConf>(parameters);
184 carrierConf->SetLinkResults(linkResults);
187 carrierConf->SetAdditionalInterferenceCb(
195 NS_LOG_FUNCTION(
this);
201 NS_LOG_FUNCTION(
this);
208 NS_LOG_FUNCTION(
this);
215 NS_LOG_FUNCTION(
this);
235 NS_LOG_FUNCTION(
this << satId << beamId);
239 Ptr<SatChannel> returnLink = channels.second;
252 NS_LOG_FUNCTION(
this);
256 Ptr<SatChannel> forwardLink = channels.first;
257 Ptr<SatChannel> returnLink = channels.second;
260 NS_LOG_INFO(
"Setting new Tx on channel " << forwardLink);
261 m_phyTx->SetChannel(forwardLink);
std::pair< Ptr< SatChannel >, Ptr< SatChannel > > ChannelPair_t
SatLinkDir_t
Link direction used for packet tracing.
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.
void PerformHandover(uint32_t satId, uint32_t beamId)
Change underlying SatChannel to send and receive data from a new satellite and beam.
virtual ~SatGwPhy()
Destructor for SatGwPhy.
void AssignNewSatChannels()
Update the underlying SatChannel to send and receive data from the current beam (as described in the ...
double m_imInterferenceCOverIDb
Configured intermodulation interference in dB.
Time m_antennaReconfigurationDelay
Delay of antenna reconfiguration when performing handover.
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 SetSatId(uint32_t satId)
Set the satId this PHY is connected with.
void SetDefaultFading(double fading)
Set the default fading of the PHY.
Ptr< SatPhyRx > m_phyRx
Pointer to internal SatPhyRx instance.
double GetTxOutputLossDb() const
Get the output loss of the transmitter in dB.
uint32_t m_satId
Satellite ID.
double GetTxAntennaGainDb() const
Get the maximum antenna gain of the transmitter in dB.
uint32_t m_beamId
Beam ID.
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.
SatPhy::ChannelPairGetterCallback m_retrieveChannelPair
Callback for retrieving SatChannel pairs by beam.
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.
Ptr< SatPhyTx > m_phyTx
Pointer to internal SatPhyTx instance.
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.
bool SetBeamId(uint32_t beamId)
Set the beamId this PHY is connected with.
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.