28 #include <ns3/simulator.h>
30 NS_LOG_COMPONENT_DEFINE(
"SatPhyRxCarrierUplink");
35 NS_OBJECT_ENSURE_REGISTERED(SatPhyRxCarrierUplink);
38 Ptr<SatPhyRxCarrierConf> carrierConf,
39 Ptr<SatWaveformConf> waveformConf,
40 bool randomAccessEnabled)
41 :
SatPhyRxCarrier(carrierId, carrierConf, waveformConf, randomAccessEnabled)
43 NS_LOG_FUNCTION(
this);
48 NS_LOG_FUNCTION(
this);
54 static TypeId tid = TypeId(
"ns3::SatPhyRxCarrierUplink").SetParent<
SatPhyRxCarrier>();
58 Ptr<SatInterference::InterferenceChangeEvent>
61 NS_LOG_FUNCTION(
this << rxParams << senderAddress);
68 NS_LOG_FUNCTION(
this << rxParams);
88 NS_LOG_FUNCTION(
this << key);
89 NS_LOG_INFO(
"State: " <<
GetState());
97 packetRxParams.rxParams->SetInterferencePower(
101 packetRxParams.rxParams->SetInterferencePowerInSatellite(
102 packetRxParams.rxParams->GetInterferencePowerPerFragment());
103 packetRxParams.rxParams->SetRxPowersInSatellite(packetRxParams.rxParams->m_rxPower_W,
109 double sinr =
CalculateSinr(packetRxParams.rxParams->m_rxPower_W,
110 packetRxParams.rxParams->GetInterferencePower(),
127 NS_FATAL_ERROR(
"Incorrect channel for satPhyRxCarrierUplink: "
131 NS_ASSERT(!packetRxParams.rxParams->HasSinrComputed());
139 packetRxParams.destAddress,
140 packetRxParams.rxParams->GetInterferencePower(),
146 packetRxParams.rxParams =
nullptr;
147 packetRxParams.interferenceEvent =
nullptr;
static std::string GetChannelTypeName(ChannelType_t channelType)
Base class for all SatPhyRxCarriers.
Ptr< SatInterference > GetInterferenceModel()
Get pointer to the current interference model.
void RemoveStoredRxParams(uint32_t key)
Remove stored rxParams under a key.
double m_rxExtNoisePowerW
External noise power system RX noise.
TracedCallback< double, const Address & > m_linkSinrTrace
A callback for link specific SINR in dB.
TracedCallback< Ptr< SatSignalParameters >, Mac48Address, Mac48Address, double, double > m_linkBudgetTrace
The trace source on packet receptiong.
SatPhyRxCarrierConf::AdditionalInterferenceCallback m_additionalInterferenceCallback
Callback to get additional interference.
void DecreaseNumOfRxState(SatEnums::PacketType_t packetType)
Function for decreasing the number of ongoing transmissions.
virtual SatEnums::ChannelType_t GetChannelType()
Get the channel type.
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.
double m_rxAciIfPowerW
RX Adjacent channel interference.
virtual bool StartRx(Ptr< SatSignalParameters > rxParams)
Function for starting packet reception from the SatChannel.
rxParams_s GetStoredRxParams(uint32_t key)
Get stored rxParams under a key.
double m_rxNoisePowerW
RX noise.
State GetState()
Get the state of the carrier.
Mac48Address GetOwnAddress()
Get the MAC address of the carrier.
SatPhyRxCarrierUplink(uint32_t carrierId, Ptr< SatPhyRxCarrierConf > carrierConf, Ptr< SatWaveformConf > waveformConf, bool randomAccessEnabled)
Constructor.
virtual Ptr< SatInterference::InterferenceChangeEvent > CreateInterference(Ptr< SatSignalParameters > rxParams, Address rxAddress)
Create an interference event based on Rx parameters and address.
virtual ~SatPhyRxCarrierUplink()
Destructor.
static TypeId GetTypeId(void)
Get the TypeId of the class.
bool StartRx(Ptr< SatSignalParameters > rxParams)
Function for starting packet reception from the SatChannel.
virtual void EndRxData(uint32_t key)
Function for ending the packet reception from the SatChannel.
static T LinearToDb(T linear)
Converts linear to decibels.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.