23 #ifndef SATELLITE_PHY_H
24 #define SATELLITE_PHY_H
33 #include <ns3/address.h>
34 #include <ns3/nstime.h>
35 #include <ns3/object.h>
36 #include <ns3/packet.h>
85 typedef Callback<void, PacketContainer_t, Ptr<SatSignalParameters>>
ReceiveCallback;
94 typedef Callback<void, uint32_t, uint32_t, Address, Address, double, bool>
CnoCallback;
103 typedef Callback<void, uint32_t, uint32_t, uint32_t, uint8_t, double>
360 Ptr<SatMobilityModel> satelliteMobility);
368 Ptr<SatMobilityModel> satelliteMobility);
376 Ptr<SatSuperframeConf> superFrameConf);
394 virtual Ptr<SatPhyTx>
GetPhyTx()
const;
400 virtual Ptr<SatPhyRx>
GetPhyRx()
const;
406 virtual void SetPhyTx(Ptr<SatPhyTx> phyTx);
412 virtual void SetPhyRx(Ptr<SatPhyRx> phyRx);
456 virtual void Receive(Ptr<SatSignalParameters> rxParams,
bool phyError);
472 bool isSatelliteMac);
484 uint8_t allocationChannelId,
485 double averageNormalizedOfferedLoad);
522 void ModcodTrace(Ptr<SatSignalParameters> rxParams);
569 TracedCallback<Ptr<const Packet>,
const Address&>
m_rxTrace;
SatLinkDir_t
Link direction used for packet tracing.
SatLoraNodeType_t
Specifies standard used and the king of node.
SatNodeType_t
Node type used for packet tracing.
SatPacketEvent_t
Packet event used for packet tracing.
SatLogLevel_t
Log level 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.
virtual void SetTxAntennaGainPattern(Ptr< SatAntennaGainPattern > agp, Ptr< SatMobilityModel > satelliteMobility)
Set the transmit antenna gain pattern.
double m_txMaxAntennaGainDb
Configured maximum transmitter antenna gain in dBi.
TracedCallback< Time, SatEnums::SatPacketEvent_t, SatEnums::SatNodeType_t, uint32_t, Mac48Address, SatEnums::SatLogLevel_t, SatEnums::SatLinkDir_t, std::string > m_packetTrace
Trace callback used for packet tracing:
void SetNodeInfo(const Ptr< SatNodeInfo > nodeInfo)
Set the node info class.
void SetTimeTag(SatPhy::PacketContainer_t packets)
Set SatPhyTimeTag of packets.
virtual double GetAdditionalInterference()=0
Get additional interference, used to compute final SINR at RX.
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.
void Initialize()
Initialize phy.
virtual Ptr< SatPhyTx > GetPhyTx() const
Get the SatPhyTx pointer.
virtual void SetRxAntennaGainPattern(Ptr< SatAntennaGainPattern > agp, Ptr< SatMobilityModel > satelliteMobility)
Set the receive antenna gain pattern.
TracedCallback< const Time &, const Address & > m_rxDelayTrace
Traced callback for all received packets, including delay information and the address of the senders.
TracedCallback< const Time &, const Address & > m_rxJitterTrace
Traced callback for all received packets, including jitter information and the address of the senders...
void SetTxOboLossDb(double lossDb)
Set the OBO loss of the transmitter in dB.
void CnoInfo(uint32_t satId, uint32_t beamId, Address source, Address destination, double cno, bool isSatelliteMac)
Function for getting the C/NO information.
void SetSatId(uint32_t satId)
Set the satId this PHY is connected with.
TracedCallback< const Time &, const Address & > m_rxLinkDelayTrace
Traced callback for all received packets, including link delay information and the address of the sen...
void SetDefaultFading(double fading)
Set the default fading of the PHY.
Ptr< SatPhyRx > m_phyRx
Pointer to internal SatPhyRx instance.
virtual SatEnums::SatLinkDir_t GetSatLinkTxDir()
Get the link TX direction.
virtual SatEnums::SatLinkDir_t GetSatLinkRxDir()
Get the link RX direction.
double GetTxOutputLossDb() const
Get the output loss of the transmitter in dB.
uint32_t m_satId
Satellite ID.
void BeginEndScheduling()
Begin frame/window end scheduling for processes utilizing frame length as interval.
TypeId GetInstanceTypeId(void) const
Derived from Object.
virtual void SendPduWithParams(Ptr< SatSignalParameters > rxParams)
Send Pdu to the PHY tx module (for satellite switch packet forwarding)
double GetTxAntennaGainDb() const
Get the maximum antenna gain of the transmitter in dB.
Callback< void, uint32_t, uint32_t, Address, Address, double, bool > CnoCallback
uint32_t m_beamId
Beam ID.
double m_rxAntennaLossDb
Configured receiver antenna loss in Dbs.
double m_defaultFadingValue
Default fading value.
virtual Ptr< SatPhyRx > GetPhyRx() const
Get the SatPhyRx pointer.
void SetTxOutputLossDb(double lossDb)
Set the output loss of the transmitter in dB.
static TypeId GetTypeId(void)
Derived from Object.
double GetTxPointingLossDb() const
Get the pointing loss of the transmitter in dB.
double m_txMaxPowerDbw
Configured maximum transmitter power in DbWs.
void SetRxFadingContainer(Ptr< SatBaseFading > fadingContainer)
Set fading container.
void AverageNormalizedOfferedRandomAccessLoadInfo(uint32_t satId, uint32_t beamId, uint32_t carrierId, uint8_t allocationChannelId, double averageNormalizedOfferedLoad)
Function for getting the normalized offered load of the specific random access allocation channel.
Ptr< SatChannel > GetTxChannel()
Get the Tx satellite channel.
Ptr< SatNodeInfo > m_nodeInfo
Node info containing node related information, such as node type, node id and MAC address (of the Sat...
TracedCallback< uint32_t, const Address & > m_rxLinkModcodTrace
Traced callback for all received packets, including link MODCOD information and the address of the se...
double m_rxNoiseTemperatureDbk
Configured receiver noise temperature in dBK.
double m_rxMaxAntennaGainDb
Configured maximum receiver antenna gain in dBi.
virtual void SendPdu(PacketContainer_t, uint32_t carrierId, Time duration, SatSignalParameters::txInfo_s txInfo)
Send Pdu to the PHY tx module (for initial transmissions from either UT or GW)
void SetChannelPairGetterCallback(SatPhy::ChannelPairGetterCallback cb)
Set the channel pair getter callback.
double GetDefaultFading() const
Get the default fading of the PHY.
virtual void RxTraces(SatPhy::PacketContainer_t packets)
Invoke the Rx trace source for each received packet.
virtual void Receive(Ptr< SatSignalParameters > rxParams, bool phyError)
Receives packets from lower layer.
double m_txOutputLossDb
Configured transmitter output loss in Dbs.
Callback< void, uint32_t, uint32_t, uint32_t, uint8_t, double > AverageNormalizedOfferedLoadCallback
double GetTxMaxPowerDbw() const
Get the maximum transmit power of the transmitter in dB.
SatPhyRxCarrierConf::InterferenceEliminationModel InterferenceEliminationModel
Define InterferenceEliminationModel in SatPhy.
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.
TracedCallback< Ptr< const Packet >, const Address & > m_rxTrace
Traced callback for all received packets, including the address of the senders.
double GetRxAntennaGainDb() const
Get the maximum antenna gain of the receiver in dB.
SatPhy(void)
Default constructor.
SatPhy::AverageNormalizedOfferedLoadCallback m_avgNormalizedOfferedLoadCallback
Average normalized offered load callback.
double m_eirpWoGainW
Calculated EIRP without gain in W.
virtual void SetPhyTx(Ptr< SatPhyTx > phyTx)
Set the SatPhyTx module.
void SetRxAntennaLossDb(double lossDb)
Set the antenna loss of the receiver in dB.
Time m_lastDelay
Last delay measurement.
Callback< void, PacketContainer_t, Ptr< SatSignalParameters > > ReceiveCallback
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 m_txPointingLossDb
Configured transmitter pointing loss in Dbs.
SatPhyRxCarrierConf::ErrorModel ErrorModel
Define ErrorModel in SatPhy.
double GetRxAntennaLossDb() const
Get the antenna loss of the receiver in dB.
Ptr< SatPhyTx > m_phyTx
Pointer to internal SatPhyTx instance.
void ModcodTrace(Ptr< SatSignalParameters > rxParams)
Invoke the RxLinkModcod trace source for each received packet.
void SetTxAntennaGainDb(double gainDb)
Set the maximum antenna gain of the transmitter in dB.
double m_txAntennaLossDb
Configured transmitter antenna loss in Dbs.
bool m_isStatisticsTagsEnabled
EnableStatisticsTags attribute.
virtual void DoDispose(void)
Dispose of SatPhy.
virtual ~SatPhy()
Destructor.
Time m_lastLinkDelay
Last delay measurement for link.
void SetTxFadingContainer(Ptr< SatBaseFading > fadingContainer)
Set fading container.
double CalculateSinr(double sinr, double otherInterference)
Calculate final SINR with PHY specific parameters and given calculated SINR.
SatSignalParameters::PacketsInBurst_t PacketContainer_t
Define PacketContainer in SatPhy.
void SetTxAntennaLossDb(double lossDb)
Set the antenna loss of the transmitter in dB.
double m_txOboLossDb
Configured transmitter OBO loss in Dbs.
virtual void SetPhyRx(Ptr< SatPhyRx > phyRx)
Set the SatPhyRx module.
SatPhyRxCarrierConf::InterferenceModel InterferenceModel
Define InterferenceModel in SatPhy.
SatPhy::CnoCallback m_cnoCallback
The C/N0 info callback.
Callback< SatChannelPair::ChannelPair_t, uint32_t, uint32_t > ChannelPairGetterCallback
Callback for retrieving a pair of SatChannel associated to a beam.
virtual void DoInitialize(void)
Initialization of SatPhy.
SatPhy::ReceiveCallback m_rxCallback
The upper layer package receive callback.
TracedCallback< const Time &, const Address & > m_rxLinkJitterTrace
Traced callback for all received packets, including link jitter information and the address of the se...
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.
InterferenceEliminationModel
Interference cancelation model enum.
ErrorModel
Error model enum.
InterferenceModel
Interference model enum.
std::vector< Ptr< Packet > > PacketsInBurst_t
Buffer for transmissions.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.
Creation parameters for base PHY object.
Ptr< NetDevice > m_device
SatEnums::SatLoraNodeType_t m_standard
Struct for storing the packet specific Tx information.