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>
41 NS_LOG_COMPONENT_DEFINE(
"SatUtPhy");
46 NS_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)),
138 NS_LOG_FUNCTION(
this);
143 : m_otherSysInterferenceCOverIDb(24.7),
144 m_otherSysInterferenceCOverI(
SatUtils::DbToLinear(m_otherSysInterferenceCOverIDb)),
145 m_antennaReconfigurationDelay(Seconds(0.0))
147 NS_LOG_FUNCTION(
this);
148 NS_FATAL_ERROR(
"SatUtPhy default constructor is not allowed to be used");
152 Ptr<SatLinkResults> linkResults,
153 SatPhyRxCarrierConf::RxCarrierCreateParams_s parameters,
154 Ptr<SatSuperframeConf> superFrameConf)
156 m_antennaReconfigurationDelay(Seconds(0.0))
158 NS_LOG_FUNCTION(
this);
160 ObjectBase::ConstructSelf(AttributeConstructionList());
165 parameters.m_aciIfWrtNoiseFactor = 0.0;
166 parameters.m_extNoiseDensityWhz = 0.0;
168 parameters.m_linkRegenerationMode =
169 Singleton<SatTopology>::Get()->GetForwardLinkRegenerationMode();
172 Ptr<SatPhyRxCarrierConf> carrierConf = CreateObject<SatPhyRxCarrierConf>(parameters);
176 carrierConf->SetLinkResults(linkResults);
179 carrierConf->SetAdditionalInterferenceCb(
187 NS_LOG_FUNCTION(
this);
193 NS_LOG_FUNCTION(
this);
200 NS_LOG_FUNCTION(
this);
201 Object::DoInitialize();
207 NS_LOG_FUNCTION(
this);
215 NS_LOG_FUNCTION(
this << beamId);
220 channels.first->RemoveRx(
m_phyRx);
231 NS_LOG_FUNCTION(
this);
235 Ptr<SatChannel> forwardLink = channels.first;
236 Ptr<SatChannel> returnLink = channels.second;
239 NS_LOG_INFO(
"Setting new Tx on channel " << returnLink);
240 m_phyTx->SetChannel(returnLink);
259 NS_LOG_FUNCTION(
this);
266 NS_LOG_FUNCTION(
this << rxParams << phyError);
268 uint8_t slice = rxParams->m_txInfo.sliceId;
272 NS_LOG_INFO(
"Dummy frame receive, it is not decoded");
282 NS_LOG_INFO(
"Slice of BBFrame (" << (uint32_t)slice
283 <<
") not in list of subscriptions: BBFrame dropped");
std::pair< Ptr< SatChannel >, Ptr< SatChannel > > ChannelPair_t
SatLinkDir_t
Link direction used for packet tracing.
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.
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.
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.
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.
double m_otherSysInterferenceCOverIDb
Configured other system interference in dB.
static TypeId GetTypeId(void)
inherited from Object
virtual ~SatUtPhy()
Destructor.
virtual double GetAdditionalInterference()
Get additional interference, used to compute final SINR at RX.
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.
TypeId GetInstanceTypeId(void) const
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.