34#include "ns3/double.h"
36#include "ns3/pointer.h"
37#include "ns3/simulator.h"
38#include "ns3/singleton.h"
39#include "ns3/uinteger.h"
41NS_LOG_COMPONENT_DEFINE(
"SatUtPhy");
46NS_OBJECT_ENSURE_REGISTERED(
SatUtPhy);
52 TypeId(
"ns3::SatUtPhy")
54 .AddConstructor<SatUtPhy>()
55 .AddAttribute(
"PhyRx",
56 "The PhyRx layer attached to this phy.",
59 MakePointerChecker<SatPhyRx>())
60 .AddAttribute(
"PhyTx",
61 "The PhyTx layer attached to this phy.",
64 MakePointerChecker<SatPhyTx>())
65 .AddAttribute(
"RxTemperatureDbk",
66 "RX noise temperature in UT in dBK.",
70 MakeDoubleChecker<double>())
73 "Maximum RX gain in dB",
76 MakeDoubleChecker<double_t>())
79 "Maximum TX gain in dB",
82 MakeDoubleChecker<double_t>())
83 .AddAttribute(
"TxMaxPowerDbw",
84 "Maximum TX power in dB",
87 MakeDoubleChecker<double>())
90 "TX Output loss in dB",
93 MakeDoubleChecker<double>())
96 "TX Pointing loss in dB",
99 MakeDoubleChecker<double>())
100 .AddAttribute(
"TxOboLossDb",
104 MakeDoubleChecker<double>())
107 "TX Antenna loss in dB",
110 MakeDoubleChecker<double>())
113 "RX Antenna loss in dB",
116 MakeDoubleChecker<double>())
117 .AddAttribute(
"DefaultFadingValue",
118 "Default value for fading",
121 MakeDoubleChecker<double_t>())
122 .AddAttribute(
"OtherSysIfCOverIDb",
123 "Other system interference, C over I in dB.",
126 MakeDoubleChecker<double>())
127 .AddAttribute(
"AntennaReconfigurationDelay",
128 "Delay of antenna reconfiguration when performing handover",
129 TimeValue(Seconds(0.0)),
140 NS_LOG_FUNCTION(
this);
141 NS_FATAL_ERROR(
"SatUtPhy default constructor is not allowed to be used");
145 Ptr<SatLinkResults> linkResults,
146 SatPhyRxCarrierConf::RxCarrierCreateParams_s parameters,
147 Ptr<SatSuperframeConf> superFrameConf)
154 NS_LOG_FUNCTION(
this << linkResults << superFrameConf);
160 NS_LOG_FUNCTION(
this);
171 Singleton<SatTopology>::Get()->GetForwardLinkRegenerationMode();
174 Ptr<SatPhyRxCarrierConf> carrierConf = CreateObject<SatPhyRxCarrierConf>(
m_parameters);
181 carrierConf->SetAdditionalInterferenceCb(
189 NS_LOG_FUNCTION(
this);
195 NS_LOG_FUNCTION(
this);
202 NS_LOG_FUNCTION(
this);
203 Object::DoInitialize();
209 NS_LOG_FUNCTION(
this);
217 NS_LOG_FUNCTION(
this << beamId);
222 channels.first->RemoveRx(
m_phyRx);
233 NS_LOG_FUNCTION(
this);
237 Ptr<SatChannel> forwardLink = channels.first;
238 Ptr<SatChannel> returnLink = channels.second;
241 NS_LOG_INFO(
"Setting new Tx on channel " << returnLink);
242 m_phyTx->SetChannel(returnLink);
261 NS_LOG_FUNCTION(
this);
268 NS_LOG_FUNCTION(
this << rxParams << phyError);
270 uint8_t slice = rxParams->m_txInfo.sliceId;
274 NS_LOG_INFO(
"Dummy frame receive, it is not decoded");
284 NS_LOG_INFO(
"Slice of BBFrame (" << (uint32_t)slice
285 <<
") not in list of subscriptions: BBFrame dropped");
std::pair< Ptr< SatChannel >, Ptr< SatChannel > > ChannelPair_t
SatLinkDir_t
Link direction used for packet tracing.
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.
virtual void Receive(Ptr< SatSignalParameters > rxParams, bool phyError)
Receives packets from lower layer.
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.
void SetTxAntennaLossDb(double lossDb)
Set the antenna loss of the transmitter in dB.
virtual void SetPhyRx(Ptr< SatPhyRx > phyRx)
Set the SatPhyRx module.
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.
The SatUtPhy models the physical layer of the User Terminal of the satellite system.
SatPhyRxCarrierConf::RxCarrierCreateParams_s m_parameters
RX carrier configuration parameters.
double m_otherSysInterferenceCOverIDb
Configured other system interference in dB.
virtual void NotifyConstructionCompleted() override
Notifier called once the ObjectBase is fully constructed.
static TypeId GetTypeId(void)
inherited from Object
virtual ~SatUtPhy()
Destructor.
virtual double GetAdditionalInterference()
Get additional interference, used to compute final SINR at RX.
Ptr< SatSuperframeConf > m_superFrameConf
Super frame cofiguration.
Ptr< SatLinkResults > m_linkResults
Link results used for this physical layer.
void AssignNewSatChannels()
Update the underlying SatChannel to send and receive data from the current beam (as described in the ...
double m_otherSysInterferenceCOverI
Other system interference in linear.
virtual SatEnums::SatLinkDir_t GetSatLinkRxDir()
Get the link RX direction.
std::set< uint8_t > m_slicesSubscribed
The list of slices subscribed for this UT.
bool IsTxPossible(void) const
Inform whether or not the underlying Tx channel is properly configured for transmission.
void Receive(Ptr< SatSignalParameters > rxParams, bool phyError)
Receives packets from lower layer.
Time m_antennaReconfigurationDelay
Delay of antenna reconfiguration when performing handover.
virtual SatEnums::SatLinkDir_t GetSatLinkTxDir()
Get the link TX direction.
void UpdateSliceSubscription(uint8_t slice)
Updates the slices subscription list.
void PerformHandover(uint32_t satId, uint32_t beamId)
Change underlying SatChannel to send and receive data from a new satellite and beam.
virtual void DoInitialize(void)
Initialization of SatUtPhy.
virtual void DoDispose(void)
Dispose of SatUtPhy.
SatUtPhy(void)
Default constructor, which is not used.
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.