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"
39NS_LOG_COMPONENT_DEFINE(
"SatGwPhy");
44NS_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)),
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)
161 NS_LOG_FUNCTION(
this << linkResults << superFrameConf);
167 NS_LOG_FUNCTION(
this);
178 Singleton<SatTopology>::Get()->GetReturnLinkRegenerationMode();
181 Ptr<SatPhyRxCarrierConf> carrierConf = CreateObject<SatPhyRxCarrierConf>(
m_parameters);
188 carrierConf->SetAdditionalInterferenceCb(
196 NS_LOG_FUNCTION(
this);
202 NS_LOG_FUNCTION(
this);
209 NS_LOG_FUNCTION(
this);
216 NS_LOG_FUNCTION(
this);
236 NS_LOG_FUNCTION(
this << satId << beamId);
240 Ptr<SatChannel> returnLink = channels.second;
253 NS_LOG_FUNCTION(
this);
257 Ptr<SatChannel> forwardLink = channels.first;
258 Ptr<SatChannel> returnLink = channels.second;
261 NS_LOG_INFO(
"Setting new Tx on channel " << forwardLink);
262 m_phyTx->SetChannel(forwardLink);
std::pair< Ptr< SatChannel >, Ptr< SatChannel > > ChannelPair_t
SatLinkDir_t
Link direction used for packet tracing.
The SatGwPhy models the physical layer of the satellite system (UT, GW, satellite).
virtual double GetAdditionalInterference()
Get additional interference, used to compute final SINR at RX.
double m_imInterferenceCOverI
Intermodulation interference in linear.
SatGwPhy(void)
Default constructor.
SatPhyRxCarrierConf::RxCarrierCreateParams_s m_parameters
RX carrier configuration parameters.
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 void NotifyConstructionCompleted() override
Notifier called once the ObjectBase is fully constructed.
Ptr< SatSuperframeConf > m_superFrameConf
Super frame cofiguration.
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.
Ptr< SatLinkResults > m_linkResults
Link results used for this physical layer.
static TypeId GetTypeId(void)
inherited from Object
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.
virtual void NotifyConstructionCompleted() override
Notifier called once the ObjectBase is fully constructed.
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.
SatPhy(void)
Default constructor.
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.