23 #ifndef SATELLITE_FRAME_CONF_H
24 #define SATELLITE_FRAME_CONF_H
31 #include <ns3/random-variable-stream.h>
32 #include <ns3/simple-ref-count.h>
65 SatBtuConf(
double bandwidthInHz,
double rollOff,
double spacing, uint32_t spreadingFactor);
329 Ptr<SatTimeSlotConf>
GetTimeSlotConf(uint16_t carrierId, uint16_t index)
const;
569 std::stringstream ss;
641 uint32_t
GetCarrierId(uint8_t frameId, uint16_t frameCarrierId)
const;
695 void Configure(
double allocatedBandwidthHz,
697 Ptr<SatWaveformConf> waveformConf);
874 double bandwidthInHz,
877 uint32_t spreadingFactor,
878 uint8_t subdivisionLevel);
882 #define FRAME_ATTRIBUTE_ACCESSOR_DEFINE(index) \
883 inline void SetFrame##index##AllocatedBandwidthHz(double value) \
885 return SetFrameAllocatedBandwidthHz(index, value); \
887 inline double GetFrame##index##AllocatedBandwidthHz() const \
889 return GetFrameAllocatedBandwidthHz(index); \
891 inline void SetFrame##index##CarrierAllocatedBandwidthHz(double value) \
893 return SetFrameCarrierAllocatedBandwidthHz(index, value); \
895 inline double GetFrame##index##CarrierAllocatedBandwidthHz() const \
897 return GetFrameCarrierAllocatedBandwidthHz(index); \
899 inline void SetFrame##index##CarrierSpacing(double value) \
901 return SetFrameCarrierSpacing(index, value); \
903 inline double GetFrame##index##CarrierSpacing() const \
905 return GetFrameCarrierSpacing(index); \
907 inline void SetFrame##index##CarrierRollOff(double value) \
909 return SetFrameCarrierRollOff(index, value); \
911 inline double GetFrame##index##CarrierRollOff() const \
913 return GetFrameCarrierRollOff(index); \
915 inline void SetFrame##index##SpreadingFactor(uint32_t value) \
917 return SetFrameCarrierSpreadingFactor(index, value); \
919 inline double GetFrame##index##SpreadingFactor() const \
921 return GetFrameCarrierSpreadingFactor(index); \
923 inline void SetFrame##index##RandomAccess(bool value) \
925 return SetFrameRandomAccess(index, value); \
927 inline double IsFrame##index##RandomAccess() const \
929 return IsFrameRandomAccess(index); \
931 inline void SetFrame##index##AllocationChannelId(uint8_t value) \
933 return SetFrameAllocationChannelId(index, value); \
935 inline uint8_t GetFrame##index##AllocationChannelId() const \
937 return GetFrameAllocationChannelId(index); \
939 inline void SetFrame##index##Logon(bool value) \
941 return SetFrameLogon(index, value); \
943 inline double IsFrame##index##Logon() const \
945 return IsFrameLogon(index); \
947 inline void SetFrame##index##GuardTimeSymbols(uint8_t value) \
949 return SetFrameGuardTimeSymbols(index, value); \
951 inline uint8_t GetFrame##index##GuardTimeSymbols() const \
953 return GetFrameGuardTimeSymbols(index); \
This class implements configuration for Bandwidth Time Unit (BTU).
~SatBtuConf()
Destructor for SatBtuConf.
double GetAllocatedBandwidthInHz() const
Get bandwidth of BTU.
double GetOccupiedBandwidthInHz() const
Get occupied bandwidth of BTU.
double GetSpreadingFactor() const
Get spreading factor of BTU.
double GetSymbolRateInBauds() const
Get symbol rate of BTU.
double GetEffectiveBandwidthInHz() const
Get occupied bandwidth of BTU.
SatBtuConf()
Default constructor for SatBtuConf.
double m_allocatedBandwidthInHz
double m_effectiveBandwidthInHz
double m_occupiedBandwidthInHz
CarrierBandwidthType_t
Types of bandwidth.
This class implements configuration for frames (for super frames)
bool IsLogon() const
Get state if frame is logon frame.
uint8_t GetSubdivisionLevel() const
Get the subdivision level of this frame.
uint8_t GetAllocationChannelId() const
Get allocation channel ID of this frame.
uint16_t AddTimeSlotConf(Ptr< SatTimeSlotConf > conf)
Add time slot.
bool IsRandomAccess() const
Get state if frame is random access frame.
uint8_t GetGuardTimeSymbols() const
Get the guard time configuration of this frame.
std::map< uint16_t, SatTimeSlotConfContainer_t > SatTimeSlotConfMap_t
uint32_t GetCarrierMinPayloadInBytes() const
Get minimum payload of a carrier in bytes.
uint32_t m_minPayloadPerCarrierInBytes
static const uint16_t m_maxTimeSlotCount
Ptr< SatFrameConf > GetParent() const
double GetCarrierBandwidthHz(SatEnums::CarrierBandwidthType_t bandwidthType) const
Get carrier bandwidth in frame.
Ptr< SatTimeSlotConf > GetTimeSlotConf(uint16_t index) const
Get time slot configuration of the frame.
Ptr< SatWaveformConf > m_waveformConf
uint8_t m_allocationChannel
uint32_t m_maxSymbolsPerCarrier
SatTimeSlotConfMap_t m_timeSlotConfMap
std::vector< Ptr< SatTimeSlotConf > > SatTimeSlotConfContainer_t
Define type SatTimeSlotConfContainer_t.
double GetCarrierFrequencyHz(uint16_t carrierId) const
Get carrier center frequency in frame.
uint16_t GetCarrierCount() const
Get carrier count of the frame.
Ptr< SatBtuConf > m_btuConf
uint32_t GetCarrierMaxSymbols() const
Get maximum symbols in carrier.
~SatFrameConf()
Destructor for SatFrameConf.
Ptr< SatFrameConf > m_parent
uint8_t m_guardTimeSymbols
double GetBandwidthHz() const
Get bandwidth of the frame.
SatTimeSlotConfContainer_t GetTimeSlotConfs(uint16_t carrierId) const
Get time slot of the specific carrier.
Time GetDuration() const
Get duration of frame.
uint16_t GetTimeSlotCount() const
Get time slot count of the frame.
SatFrameConf()
Default constructor for SatFrameConf.
Ptr< SatWaveformConf > GetWaveformConf() const
Get waveform configuration of this frame.
bool IsSubdivided() const
Get wether this frame is subdivided or not.
Ptr< SatBtuConf > GetBtuConf() const
Get BTU conf of the frame.
This class implements super frame configuration 0.
virtual void DoConfigure()
Do frame specific configuration as needed.
static TypeId GetTypeId(void)
Get the type ID.
~SatSuperframeConf0()
Destructor for SatSuperframeConf.
SatSuperframeConf0()
Default constructor for SatSuperframeConf.
virtual TypeId GetInstanceTypeId(void) const
Get the type ID of instance.
This class implements super frame configuration 1.
SatSuperframeConf1()
Default constructor for SatSuperframeConf.
static TypeId GetTypeId(void)
Get the type ID.
~SatSuperframeConf1()
Destructor for SatSuperframeConf.
virtual void DoConfigure()
Do frame specific configuration as needed.
virtual TypeId GetInstanceTypeId(void) const
Get the type ID of instance.
This class implements sup.
~SatSuperframeConf2()
Destructor for SatSuperframeConf.
static TypeId GetTypeId(void)
Get the type ID.
virtual void DoConfigure()
Do frame specific configuration as needed.
SatSuperframeConf2()
Default constructor for SatSuperframeConf.
virtual TypeId GetInstanceTypeId(void) const
Get the type ID of instance.
This class implements super frame configuration 3.
~SatSuperframeConf3()
Destructor for SatSuperframeConf.
virtual void DoConfigure()
Do frame specific configuration as needed.
virtual TypeId GetInstanceTypeId(void) const
Get the type ID of instance.
static TypeId GetTypeId(void)
Get the type ID.
SatSuperframeConf3()
Default constructor for SatSuperframeConf.
This class implements super frame configuration 4.
static TypeId GetTypeId(void)
Get the type ID.
virtual void DoConfigure()
Do frame specific configuration as needed.
SatSuperframeConf4()
Default constructor for SatSuperframeConf.
~SatSuperframeConf4()
Destructor for SatSuperframeConf.
virtual TypeId GetInstanceTypeId(void) const
Get the type ID of instance.
This abstract class defines and implements interface of configuration for super frames.
FRAME_ATTRIBUTE_ACCESSOR_DEFINE(0)
SatSuperframeConf()
Default constructor for SatSuperframeConf.
FRAME_ATTRIBUTE_ACCESSOR_DEFINE(1)
void SetFrameCarrierSpacing(uint8_t frameIndex, double spacing)
SatFrameConf::SatTimeSlotConfContainer_t GetRaSlots(uint8_t raChannel)
Get RA channel time slots.
SatFrameConfList_t m_frames
double GetBandwidthHz() const
Get bandwidth of the super frame.
void SetFrameCount(uint8_t frameCount)
Set number of frames to be used in super frame.
void SetMaxSubdivision(uint8_t maximumCarrierSubdivision)
double m_frameCarrierSpacing[m_maxFrameCount]
uint8_t m_frameGuardTimeSymbols[m_maxFrameCount]
uint32_t GetCarrierCount() const
Get carrier count in the super frame.
static std::string GetNumberAsString(T number)
Template method to convert number to string.
SatSuperframeConf::ConfigType_t GetConfigType() const
Get frame configuration type to be used in super frame.
double GetFrameCarrierSpacing(uint8_t frameIndex) const
bool IsLogonEnabled() const
double GetFrameAllocatedBandwidthHz(uint8_t frameIndex) const
Ptr< SatFrameConf > GetCarrierFrameConf(uint32_t carrierId) const
Get the frame configuration of the requested carrier.
void SetFrameGuardTimeSymbols(uint8_t frameIndex, uint8_t guardTimeSymbols)
uint8_t GetMaxSubdivision() const
bool m_frameIsLogon[m_maxFrameCount]
virtual TypeId GetInstanceTypeId(void) const
Get the type ID of instance.
uint16_t GetRaSlotCount(uint8_t raChannel)
Get RA channel time slot count.
ConfigType_t m_configType
FRAME_ATTRIBUTE_ACCESSOR_DEFINE(4)
FRAME_ATTRIBUTE_ACCESSOR_DEFINE(3)
void SetFrameRandomAccess(uint8_t frameIndex, bool randomAccess)
void SetFrameAllocatedBandwidthHz(uint8_t frameIndex, double bandwidthHz)
uint8_t GetRaChannel(uint32_t carrierId) const
Get the RA channel id (index) corresponding to given (global) carrier id.
void SetFrameLogon(uint8_t frameIndex, bool logon)
void SetFrameAllocationChannelId(uint8_t frameIndex, uint8_t allocationChannel)
std::vector< RaChannelInfo_t > m_raChannels
double m_frameCarrierAllocatedBandwidth[m_maxFrameCount]
double GetCarrierFrequencyHz(uint32_t carrierId) const
Get the center frequency of the requested carrier.
uint32_t GetRaChannelTimeSlotPayloadInBytes(uint8_t raChannel) const
Get the payload of the RA channel time slot in bytes.
uint8_t GetFrameGuardTimeSymbols(uint8_t frameIndex) const
static std::string GetIndexAsFrameName(uint32_t index)
Method to convert frame index to frame name.
double GetFrameCarrierAllocatedBandwidthHz(uint8_t frameIndex) const
FRAME_ATTRIBUTE_ACCESSOR_DEFINE(7)
void SetConfigType(SatSuperframeConf::ConfigType_t type)
Set frame configuration type to be used in super frame.
void AddFrameConf(SatFrameConf::SatFrameConfParams_t frameConfParameters, double bandwidthInHz, double rollOff, double spacing, uint32_t spreadingFactor, uint8_t subdivisionLevel)
Add frame configuration to super frame configuration.
double GetFrameCarrierRollOff(uint8_t frameIndex) const
SuperFrameConfiguration_t
Configurable Super Frames.
@ SUPER_FRAME_CONFIG_0
SUPER_FRAME_CONFIG_0.
@ SUPER_FRAME_CONFIG_3
SUPER_FRAME_CONFIG_3.
@ SUPER_FRAME_CONFIG_4
SUPER_FRAME_CONFIG_4.
@ SUPER_FRAME_CONFIG_1
SUPER_FRAME_CONFIG_1.
@ SUPER_FRAME_CONFIG_2
SUPER_FRAME_CONFIG_2.
FRAME_ATTRIBUTE_ACCESSOR_DEFINE(2)
static const uint8_t m_maxFrameCount
uint8_t GetFrameCount() const
Get number of frames to be used in super frame.
static Ptr< SatSuperframeConf > CreateSuperframeConf(SuperFrameConfiguration_t conf)
Create pre-configured super frame configuration-.
uint8_t GetRaChannelFrameId(uint8_t raChannel) const
Get RA channel frame ID.
void SetFrameCarrierRollOff(uint8_t frameIndex, double rollOff)
uint8_t GetFrameAllocationChannelId(uint8_t frameIndex) const
uint32_t m_logonChannelIndex
void SetFrameCarrierAllocatedBandwidthHz(uint8_t frameIndex, double bandwidthHz)
double GetCarrierBandwidthHz(uint32_t carrierId, SatEnums::CarrierBandwidthType_t bandwidthType) const
Get the bandwidth of the requested carrier.
uint8_t m_frameAllocationChannel[m_maxFrameCount]
std::vector< Ptr< SatFrameConf > > SatFrameConfList_t
Define type SatFrameConfList_t.
bool IsFrameLogon(uint8_t frameIndex) const
double m_frameAllocatedBandwidth[m_maxFrameCount]
FRAME_ATTRIBUTE_ACCESSOR_DEFINE(8)
void Configure(double allocatedBandwidthHz, Time targetDuration, Ptr< SatWaveformConf > waveformConf)
Configures super frame configuration according to set attributes.
uint32_t m_frameCarrierSpreadingFactor[m_maxFrameCount]
FRAME_ATTRIBUTE_ACCESSOR_DEFINE(9)
Time GetDuration() const
Get duration of super frame.
virtual void DoConfigure()=0
Do frame specific configuration as needed.
double m_frameCarrierRollOff[m_maxFrameCount]
uint32_t GetCarrierId(uint8_t frameId, uint16_t frameCarrierId) const
Get carrier id of the super frame.
~SatSuperframeConf()
Destructor for SatSuperframeConf.
std::tuple< uint8_t, uint8_t, uint8_t > RaChannelInfo_t
bool m_frameIsRandomAccess[m_maxFrameCount]
void SetFrameCarrierSpreadingFactor(uint8_t frameIndex, uint32_t spreadingFactor)
FRAME_ATTRIBUTE_ACCESSOR_DEFINE(5)
static TypeId GetTypeId(void)
Get the type ID.
Ptr< SatFrameConf > GetFrameConf(uint8_t id) const
Get frame conf of the super frame.
uint8_t GetRaChannelCount() const
Get the number of the RA channels in super frame configuration.
uint32_t GetFrameCarrierSpreadingFactor(uint8_t frameIndex) const
bool IsFrameRandomAccess(uint8_t frameIndex) const
uint32_t GetLogonChannelIndex() const
uint8_t GetCarrierFrame(uint32_t carrierId) const
Get frame id where given global carrier ID belongs to.
uint8_t GetRaChannelAllocationChannelId(uint8_t raChannel) const
Get RA channel allocation channel ID.
uint8_t m_maxCarrierSubdivision
ConfigType_t
Enum for configuration types.
@ CONFIG_TYPE_4
Configuration type 4 (ESSA)
@ CONFIG_TYPE_2
Configuration type 2.
@ CONFIG_TYPE_1
Configuration type 1.
@ CONFIG_TYPE_0
Configuration type 0.
@ CONFIG_TYPE_3
Configuration type 3.
bool IsRandomAccessCarrier(uint32_t carrierId) const
Check if given carrier is random access carrier.
FRAME_ATTRIBUTE_ACCESSOR_DEFINE(6)
This class implements configuration for time slots (for super frames / frames)
SatTimeSlotConf::SatTimeSlotType_t GetSlotType() const
Get time slot type.
SatTimeSlotConf()
Default constructor for SatTimeSlotConf.
void SetRcIndex(uint8_t rcIndex)
Set RC index of the time slot.
uint32_t GetWaveFormId() const
Get wave form id of time slot.
Time GetStartTime() const
Get start time of time slot.
uint8_t GetRcIndex()
Get RC index of the time slot.
SatTimeSlotType_t
Types for time slot.
@ SLOT_TYPE_TRC
Control or traffic slot.
@ SLOT_TYPE_TR
Traffic slot.
@ SLOT_TYPE_C
Control slot.
~SatTimeSlotConf()
Destructor for SatTimeSlotConf.
void SetSlotType(SatTimeSlotConf::SatTimeSlotType_t slotType)
Set time slot type.
uint16_t m_frameCarrierId
uint16_t GetCarrierId() const
Get carrier id of time slot (inside frame).
SatTimeSlotType_t m_slotType
constexpr uint16_t MAXIMUM_TIME_SLOT_ID
Maximum value for time slot ID as specified in ETSI EN 301 542-2, chapter 7.5.1.3.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.
Helper struct to reduce the number of parameters fed into the SatFrameConf constructor.
Ptr< SatFrameConf > m_parent
Ptr< SatBtuConf > m_btuConf
uint8_t m_guardTimeSymbols
uint8_t m_allocationChannel
Ptr< SatWaveformConf > m_waveformConf
bool m_defaultWaveformInUse