23 #ifndef SATELLITE_PHY_RX_CARRIER_H
24 #define SATELLITE_PHY_RX_CARRIER_H
35 #include <ns3/mac48-address.h>
36 #include <ns3/object.h>
38 #include <ns3/traced-callback.h>
52 class SatSignalParameters;
54 class SatChannelEstimationErrorContainer;
87 Mac48Address receiverAddress,
88 Mac48Address destinationAddress,
123 const Address& utAddress,
134 Ptr<SatPhyRxCarrierConf> carrierConf,
135 Ptr<SatWaveformConf> waveformConf,
136 bool isRandomAccessEnabled);
223 virtual bool StartRx(Ptr<SatSignalParameters> rxParams);
312 Ptr<SatSignalParameters> rxParams,
313 Address rxAddress) = 0;
326 Ptr<SatSignalParameters> rxParams);
379 double rxBandwidthHz);
389 Ptr<SatWaveformConf> waveformConf);
479 double rxNoisePowerW,
480 double rxAciIfPowerW,
481 double rxExtNoisePowerW,
482 double otherInterference);
620 TracedCallback<Ptr<SatSignalParameters>,
ChannelType_t
Types of channel.
PacketType_t
Packet types.
RegenerationMode_t
The regeneration mode used in satellites.
Callback< void, uint32_t, uint32_t, Address, Address, double, bool > CnoCallback
Callback< void, uint32_t, uint32_t, uint32_t, uint8_t, double > AverageNormalizedOfferedLoadCallback
ErrorModel
Error model enum.
Callback< double > AdditionalInterferenceCallback
Callback to get additional interference from PHY layer.
Base class for all SatPhyRxCarriers.
void SetPhy(Ptr< SatPhy > phy)
Function for setting the SatPhy module.
SatPhy::AverageNormalizedOfferedLoadCallback m_avgNormalizedOfferedLoadCallback
Average normalized offered load callback.
void SetNodeInfo(const Ptr< SatNodeInfo > nodeInfo)
Function for setting the node info class.
Ptr< SatInterference > GetInterferenceModel()
Get pointer to the current interference model.
void DoCompositeSinrOutputTrace(double cSinr)
Function for composite SINR output tracing.
void RemoveStoredRxParams(uint32_t key)
Remove stored rxParams under a key.
double m_rxExtNoisePowerW
External noise power system RX noise.
Ptr< SatNodeInfo > m_nodeInfo
void SetLinkRegenerationMode(SatEnums::RegenerationMode_t linkRegenerationMode)
Set the link regeneration mode.
void CheckRxStateSanity()
Function for checking the Rx state sanity.
void SetCnoCb(SatPhyRx::CnoCallback cb)
Function for settign the C/NO callback.
TracedCallback< double, const Address & > m_linkSinrTrace
A callback for link specific SINR in dB.
Ptr< SatInterferenceElimination > m_satInterferenceElimination
static TypeId GetTypeId(void)
Function for gettign the NS-3 type ID.
TracedCallback< uint32_t, const Address & > m_daRxCarrierIdTrace
TracedCallback< Ptr< SatSignalParameters >, Mac48Address, Mac48Address, double, double > m_linkBudgetTrace
The trace source on packet receptiong.
void SetAverageNormalizedOfferedLoadCallback(SatPhyRx::AverageNormalizedOfferedLoadCallback callback)
Function for setting the AverageNormalizedOfferedLoadCallback callback.
Ptr< SatNodeInfo > GetNodeInfo()
Get the satellite node info.
SatPhyRxCarrierConf::AdditionalInterferenceCallback m_additionalInterferenceCallback
Callback to get additional interference.
TracedCallback< double, const Address & > m_rxPowerTrace
A callback for received signal power in dBW.
uint32_t GetCarrierId() const
Get the ID of the carrier.
void DecreaseNumOfRxState(SatEnums::PacketType_t packetType)
Function for decreasing the number of ongoing transmissions.
virtual SatEnums::RegenerationMode_t GetLinkRegenerationMode()
Get the link regeneration mode.
void SetBeamId(uint32_t beamId)
Function for setting the beam id for all the transmissions from this SatPhyTx.
Ptr< SatWaveformConf > m_waveformConf
CarrierType
Possible carrier types.
virtual Ptr< SatInterference::InterferenceChangeEvent > CreateInterference(Ptr< SatSignalParameters > rxParams, Address rxAddress)=0
Create an interference event based on Rx parameters and address.
Ptr< SatLinkResults > m_linkResults
virtual SatEnums::ChannelType_t GetChannelType()
Get the channel type.
bool IsCompositeSinrOutputTraceEnabled() const
Check if composite SINR output trace is enabled.
uint32_t GetBeamId()
Get ID the ID of the beam this carrier is attached to.
bool m_receivingDedicatedAccess
Mac48Address m_ownAddress
virtual void DoCreateInterferenceEliminationModel(Ptr< SatPhyRxCarrierConf > carrierConf, uint32_t carrierId, Ptr< SatWaveformConf > waveformConf)
Create an interference cancelation model for this carrier.
std::map< uint32_t, rxParams_s > m_rxParamsMap
double CalculateSinr(double rxPowerW, double ifPowerW, double rxNoisePowerW, double rxAciIfPowerW, double rxExtNoisePowerW, double otherInterference)
Function for calculating the SINR.
SatPhyRx::ReceiveCallback m_rxCallback
The upper layer package receive callback.
TracedCallback< uint32_t, const Address &, bool > m_daRxTrace
DaRx trace source.
double m_rxAciIfPowerW
RX Adjacent channel interference.
void(* RxPowerTraceCallback)(double rxPower, const Address &utAddress)
Callback signature for RxPowerTrace trace source.
virtual bool StartRx(Ptr< SatSignalParameters > rxParams)
Function for starting packet reception from the SatChannel.
bool m_enableCompositeSinrOutputTrace
TracedCallback< double, const Address & > m_sinrTrace
A callback for transmission composite SINR at UT (BBFrame) or GW (time slot).
void(* PhyRxCollisionCallback)(uint32_t nPackets, const Address &utAddress, bool isCollided)
Common callback signature for trace sources related to packets reception by PHY and its collision.
Ptr< SatChannelEstimationErrorContainer > m_channelEstimationError
Channel estimation error container.
rxParams_s GetStoredRxParams(uint32_t key)
Get stored rxParams under a key.
double m_constantErrorRate
bool IsReceivingDedicatedAccess()
Check if the carrier is receiving a dedicated access packet.
Ptr< SatChannelEstimationErrorContainer > GetChannelEstimationErrorContainer()
Get a pointer to the channel estimation error container of the carrier.
void SetReceiveCb(SatPhyRx::ReceiveCallback cb)
Function for setting the receive callback.
bool CheckAgainstLinkResults(double cSinr, Ptr< SatSignalParameters > rxParams)
Function for checking the SINR against the link results.
SatPhy::CnoCallback m_cnoCallback
The upper layer C/N0 receive callback.
bool CheckAgainstLinkResultsErrorModelAvi(double cSinr, Ptr< SatSignalParameters > rxParams)
Function for checking the SINR against the link results.
virtual void DoCreateInterferenceModel(Ptr< SatPhyRxCarrierConf > carrierConf, uint32_t carrierId, double rxBandwidthHz)
Create an interference model for this carrier.
double CalculateCompositeSinr(double sinr1, double sinr2)
Function for calculating the composite SINR.
double GetWorstSinr(double sinr1, double sinr2)
Function for calculating the worst sinr between uplink and downlink.
SatPhyRxCarrierConf::ErrorModel m_errorModel
uint32_t m_numOfOngoingRx
Contains information about how many ongoing Rx events there are.
const bool m_randomAccessEnabled
Is random access enabled for this carrier.
virtual void BeginEndScheduling()
Function for initializing the frame/window end scheduling.
Ptr< SatInterferenceElimination > GetInterferenceEliminationModel()
Get pointer to the current interference elimination model.
virtual void DoDispose()
Dispose.
double GetUniformRandomValue(double min, double max)
A helper method for getting values form a uniform random variable in child classes.
void(* LinkBudgetTraceCallback)(Ptr< SatSignalParameters > rxParams, Mac48Address receiverAddress, Mac48Address destinationAddress, double interference, double sinr)
Callback signature for LinkBudgetTrace trace source.
void ChangeState(State newState)
Function for changing the receiver state.
SatPhyRxCarrier(uint32_t carrierId, Ptr< SatPhyRxCarrierConf > carrierConf, Ptr< SatWaveformConf > waveformConf, bool isRandomAccessEnabled)
Constructor.
void SetChannelType(SatEnums::ChannelType_t channelType)
Set the channel type for the carrier.
void SetSatId(uint32_t satId)
Function for setting the satellite id for all the transmissions from this SatPhyTx.
virtual CarrierType GetCarrierType()
Method for querying the type of the carrier.
Ptr< UniformRandomVariable > m_uniformVariable
Ptr< SatInterference > m_satInterference
State
Enum for PHY states.
double m_rxNoisePowerW
RX noise.
SatEnums::RegenerationMode_t m_linkRegenerationMode
Link regeneration mode.
virtual const bool GetDefaultReceiveMode()
Get the default receive mode for the carrier.
std::pair< bool, SatPhyRxCarrier::rxParams_s > GetReceiveParams(Ptr< SatSignalParameters > rxParams)
Rx parameter storage methods.
Ptr< SatWaveformConf > GetWaveformConf()
Get pointer to the waveform configuration.
Ptr< SatLinkResults > GetLinkResults()
Get pointer to the link results given by the carrier creation configuration.
virtual void EndRxData(uint32_t key)=0
Function for ending the packet reception from the SatChannel.
void IncreaseNumOfRxState(SatEnums::PacketType_t packetType)
Function for increasing the number of ongoing transmissions.
uint32_t m_rxPacketCounter
Running counter for received packets.
virtual ~SatPhyRxCarrier()
Destructor.
double GetRxTemperatureK()
Method for querying the temperature of the carrier.
uint32_t GetSatId()
Get ID the ID of the satellite this carrier is attached to.
SatEnums::ChannelType_t m_channelType
void(* PhyRxErrorCallback)(uint32_t nPackets, const Address &utAddress, bool isError)
Common callback signature for trace sources related to packets reception by PHY and its error.
double m_rxBandwidthHz
RX Bandwidth in Hz.
State GetState()
Get the state of the carrier.
void(* LinkSinrTraceCallback)(double sinr, const Address &utAddress)
Callback signature for LinkSinrTrace trace source.
void StoreRxParams(uint32_t key, rxParams_s rxParams)
Store rxParams under a key.
Mac48Address GetOwnAddress()
Get the MAC address of the carrier.
double m_rxTemperatureK
RX noise temperature in K.
Callback< void, uint32_t, uint32_t, Address, Address, double, bool > CnoCallback
Callback< void, Ptr< SatSignalParameters >, bool > ReceiveCallback
Callback< void, uint32_t, uint32_t, uint32_t, uint8_t, double > AverageNormalizedOfferedLoadCallback
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.
Struct for storing the packet specific Rx parameters.
Mac48Address finalDestAddress
Ptr< SatSignalParameters > rxParams
Mac48Address finalSourceAddress
Mac48Address sourceAddress
Ptr< SatInterference::InterferenceChangeEvent > interferenceEvent