25#include "ns3/boolean.h"
26#include "ns3/double.h"
29#include "ns3/object.h"
30#include "ns3/uinteger.h"
40NS_LOG_COMPONENT_DEFINE(
"SatFrameConf");
53 NS_LOG_FUNCTION(
this);
62 uint32_t spreadingFactor)
66 NS_LOG_FUNCTION(
this);
68 if ((spacing < 0.00) && (spacing > 1.00))
70 NS_FATAL_ERROR(
"Spacing for BTU is out of range. Check frame configuration parameters "
74 if ((rollOff < 0.00) && (rollOff > 1.00))
76 NS_FATAL_ERROR(
"Roll-off for BTU is out of range. Check frame configuration parameters "
89 NS_LOG_FUNCTION(
this);
101 NS_LOG_FUNCTION(
this);
109 uint16_t frameCarrierId,
117 NS_LOG_FUNCTION(
this);
122 NS_LOG_FUNCTION(
this);
138 NS_LOG_FUNCTION(
this);
153 NS_LOG_FUNCTION(
this);
159 NS_FATAL_ERROR(
"No carriers can be created for the frame with given BTU and bandwidth. "
160 "Check frame configuration parameters (attributes)!!! ");
168 Ptr<SatWaveform> defWaveform =
m_waveformConf->GetWaveform(defWaveFormId);
171 Time timeSlotDuration = defWaveform->GetBurstDuration(
m_btuConf->GetSymbolRateInBauds());
172 uint32_t carrierSlotCount =
176 if (carrierSlotCount == 0)
178 NS_FATAL_ERROR(
"Time slots cannot be created with target frame duration. Check frame "
179 "target duration!!!");
183 NS_LOG_INFO(
"Carrier slot count " << carrierSlotCount);
186 m_duration = Time(carrierSlotCount * timeSlotDuration.GetInteger());
196 uint32_t mostRobustWaveFormId;
198 if (!
m_waveformConf->GetMostRobustWaveformId(mostRobustWaveFormId,
199 defWaveform->GetBurstLengthInSymbols()))
201 NS_FATAL_ERROR(
"Most robust waveform not found, error in waveform configuration ???");
204 Ptr<SatWaveform> waveform =
m_waveformConf->GetWaveform(mostRobustWaveFormId);
208 uint32_t frameTimeSlotCount = 0;
213 for (uint32_t j = 0; j < carrierSlotCount; j++)
216 Ptr<SatTimeSlotConf> timeSlot =
217 Create<SatTimeSlotConf>(Time(j * timeSlotDuration.GetInteger()) + guardTime,
223 frameTimeSlotCount++;
227 NS_FATAL_ERROR(
"Time slot count is over limit. Check frame configuration!!!");
235 NS_LOG_FUNCTION(
this);
241 NS_LOG_FUNCTION(
this << carrierId);
245 NS_FATAL_ERROR(
"Carrier Id out of range");
248 double carrierBandwidthHz =
m_btuConf->GetAllocatedBandwidthInHz();
250 return ((carrierBandwidthHz * carrierId) + (carrierBandwidthHz / 2.0));
256 NS_LOG_FUNCTION(
this << bandwidthType);
258 double bandwidth = 0.0;
260 switch (bandwidthType)
263 bandwidth =
m_btuConf->GetAllocatedBandwidthInHz();
267 bandwidth =
m_btuConf->GetOccupiedBandwidthInHz();
271 bandwidth =
m_btuConf->GetEffectiveBandwidthInHz();
275 NS_FATAL_ERROR(
"Invalid bandwidth type!!!");
285 NS_LOG_FUNCTION(
this);
287 uint8_t subdivisionLevel = 0;
288 Ptr<SatFrameConf> parent =
m_parent;
290 while (parent !=
nullptr)
293 parent = parent->m_parent;
296 NS_LOG_INFO(
"Subdivision level is " << (uint32_t)subdivisionLevel);
297 return subdivisionLevel;
303 NS_LOG_FUNCTION(
this);
305 uint16_t slotCount = 0;
318 NS_LOG_FUNCTION(
this);
320 Ptr<SatTimeSlotConf> foundTimeSlot =
nullptr;
322 SatTimeSlotConfMap_t::const_iterator foundCarrier =
m_timeSlotConfMap.find(carrierId);
324 if (foundCarrier !=
m_timeSlotConfMap.end() && index < foundCarrier->second.size())
326 foundTimeSlot = foundCarrier->second[index];
330 NS_FATAL_ERROR(
"Index is invalid!!!");
333 return foundTimeSlot;
339 NS_LOG_FUNCTION(
this);
341 Ptr<SatTimeSlotConf> foundTimeSlot =
nullptr;
347 return foundTimeSlot;
353 NS_LOG_FUNCTION(
this);
361 timeSlots = it->second;
365 NS_FATAL_ERROR(
"Carrier not found!!!");
374 NS_LOG_FUNCTION(
this << conf);
377 SatTimeSlotConfMap_t::iterator it =
m_timeSlotConfMap.find(conf->GetCarrierId());
383 std::pair<SatTimeSlotConfMap_t::iterator, bool> result =
m_timeSlotConfMap.insert(
399 NS_FATAL_ERROR(
"Cannot insert slot to container!!!");
403 it->second.push_back(conf);
412Ptr<SatSuperframeConf>
415 NS_LOG_FUNCTION_NOARGS();
417 Ptr<SatSuperframeConf> superFrameConf;
422 superFrameConf = CreateObject<SatSuperframeConf0>();
426 superFrameConf = CreateObject<SatSuperframeConf1>();
430 superFrameConf = CreateObject<SatSuperframeConf2>();
434 superFrameConf = CreateObject<SatSuperframeConf3>();
438 superFrameConf = CreateObject<SatSuperframeConf4>();
442 NS_FATAL_ERROR(
"Not supported super frame configuration!!!");
446 return superFrameConf;
458 NS_LOG_FUNCTION(
this);
463 NS_LOG_FUNCTION(
this);
469 static TypeId tid = TypeId(
"ns3::SatSuperframeConf").SetParent<Object>();
476 double bandwidthInHz,
479 uint32_t spreadingFactor,
480 uint8_t subdivisionLevel)
482 NS_LOG_FUNCTION(
this << &frameConfParameters << bandwidthInHz << rollOff << spacing
483 << (uint32_t)subdivisionLevel);
491 Create<SatBtuConf>(bandwidthInHz, rollOff, spacing, spreadingFactor);
492 Ptr<SatFrameConf> frameConf = Create<SatFrameConf>(frameConfParameters);
495 uint16_t carriersCount = frameConf->GetCarrierCount();
497 if (frameConf->IsLogon() && carriersCount > 1)
499 NS_FATAL_ERROR(
"Logon frame can have only one carrier, this one have " << carriersCount
505 NS_FATAL_ERROR(
"Logon frame cannot be set several times.");
508 if (frameConf->IsLogon())
514 for (uint32_t i = 0; i < carriersCount; i++)
519 if ((raBaseIndex + i) >= std::numeric_limits<uint8_t>::max())
521 NS_FATAL_ERROR(
"RA channels maximum count is exceeded!!!");
525 std::make_tuple(frameId, i, frameConf->GetAllocationChannelId()));
533 for (uint8_t i = 0; i <= subdivisionLevel; ++i)
535 double subdivisionAmount = std::pow(2.0,
static_cast<double>(i));
538 frameConfParameters.
m_btuConf = Create<SatBtuConf>(bandwidthInHz / subdivisionAmount,
542 Ptr<SatFrameConf> frameConf = Create<SatFrameConf>(frameConfParameters);
544 if (frameConf->IsLogon())
546 NS_FATAL_ERROR(
"Logon frame must use Random Access.");
553 frameConfParameters.
m_parent = frameConf;
561 NS_LOG_FUNCTION(
this << (uint32_t)index);
569 NS_LOG_FUNCTION(
this);
577 NS_LOG_FUNCTION(
this);
581 NS_FATAL_ERROR(
"Frame ID out of range.");
584 uint32_t carrierId = frameCarrierId;
586 for (uint8_t i = 0; i < frameId; i++)
588 carrierId +=
m_frames[i]->GetCarrierCount();
597 NS_LOG_FUNCTION(
this);
599 double frameStartFrequency = 0.0;
600 uint32_t carrierIdInFrame = carrierId;
604 for (uint8_t i = 0; i < frameId; ++i)
606 carrierIdInFrame -=
m_frames[i]->GetCarrierCount();
607 frameStartFrequency +=
m_frames[i]->GetBandwidthHz();
610 double carrierFrequencyInFrame =
m_frames[frameId]->GetCarrierFrequencyHz(carrierIdInFrame);
612 return frameStartFrequency + carrierFrequencyInFrame;
619 NS_LOG_FUNCTION(
this);
623 return m_frames[frameId]->GetCarrierBandwidthHz(bandwidthType);
629 NS_LOG_FUNCTION(
this << carrierId);
639 NS_LOG_FUNCTION(
this);
643 return m_frames[frameId]->IsRandomAccess();
649 NS_LOG_FUNCTION(
this << (uint32_t)frameIndex << bandwidthHz);
653 NS_FATAL_ERROR(
"Frame index out of range!!!");
662 NS_LOG_FUNCTION(
this << (uint32_t)frameIndex << bandwidthHz);
666 NS_FATAL_ERROR(
"Frame index out of range!!!");
675 NS_LOG_FUNCTION(
this << (uint32_t)frameIndex << spacing);
679 NS_FATAL_ERROR(
"Frame index out of range!!!");
688 NS_LOG_FUNCTION(
this << (uint32_t)frameIndex << rollOff);
692 NS_FATAL_ERROR(
"Frame index out of range!!!");
701 NS_LOG_FUNCTION(
this << frameIndex << spreadingFactor);
705 NS_FATAL_ERROR(
"Frame index out of range!!!");
714 NS_LOG_FUNCTION(
this << (uint32_t)frameIndex << randomAccess);
718 NS_FATAL_ERROR(
"Frame index out of range!!!");
727 NS_LOG_FUNCTION(
this << (uint32_t)frameIndex << logon);
731 NS_FATAL_ERROR(
"Frame index out of range!!!");
740 NS_LOG_FUNCTION(
this << (uint32_t)frameIndex << (uint32_t)allocationChannel);
744 NS_FATAL_ERROR(
"Frame index out of range!!!");
753 NS_LOG_FUNCTION(
this << (uint32_t)frameIndex << guardTimeSymbols);
757 NS_FATAL_ERROR(
"Frame index out of range!!!");
766 NS_LOG_FUNCTION(
this << (uint32_t)frameIndex);
770 NS_FATAL_ERROR(
"Frame index out of range!!!");
779 NS_LOG_FUNCTION(
this << (uint32_t)frameIndex);
783 NS_FATAL_ERROR(
"Frame index out of range!!!");
792 NS_LOG_FUNCTION(
this << (uint32_t)frameIndex);
796 NS_FATAL_ERROR(
"Frame index out of range!!!");
805 NS_LOG_FUNCTION(
this << (uint32_t)frameIndex);
809 NS_FATAL_ERROR(
"Frame index out of range!!!");
818 NS_LOG_FUNCTION(
this << frameIndex);
822 NS_FATAL_ERROR(
"Frame index out of range!!!");
831 NS_LOG_FUNCTION(
this << (uint32_t)frameIndex);
835 NS_FATAL_ERROR(
"Frame index out of range!!!");
838 return m_frames[frameIndex]->IsRandomAccess();
844 NS_LOG_FUNCTION(
this << (uint32_t)frameIndex);
848 NS_FATAL_ERROR(
"Frame index out of range!!!");
851 return m_frames[frameIndex]->IsLogon();
857 NS_LOG_FUNCTION(
this << (uint32_t)frameIndex);
861 NS_FATAL_ERROR(
"Frame index out of range!!!");
870 NS_LOG_FUNCTION(
this << (uint32_t)frameIndex);
874 NS_FATAL_ERROR(
"Frame index out of range!!!");
883 NS_LOG_FUNCTION(
this);
891 NS_LOG_FUNCTION(
this);
899 Ptr<SatWaveformConf> waveformConf)
901 NS_LOG_FUNCTION(
this);
905 NS_LOG_WARN(
"Superframe is configured to use config type 0, thus ACM should be disabled!");
911 "Superframe is configured to use config type 1, thus ACM should be enabled!");
916 bool useDefaultWaveform =
false;
917 bool checkSlotLimit =
true;
918 uint8_t subdivisionLevels = 0;
932 useDefaultWaveform =
true;
937 checkSlotLimit =
false;
940 checkSlotLimit =
false;
944 useDefaultWaveform =
true;
945 checkSlotLimit =
false;
948 NS_FATAL_ERROR(
"Not supported configuration type " <<
m_configType <<
"!!!");
956 for (uint8_t frameIndex = 0; frameIndex <
m_frameCount; frameIndex++)
962 frameConfParameters.
m_parent =
nullptr;
987 "SatSuperframeConf::Configure: Error: configured more frames than requested");
994 NS_FATAL_ERROR(
"Bandwidth of super frame exceeds allocated bandwidth");
1001 NS_LOG_FUNCTION(
this);
1009 std::tie(frameId, carrierId, std::ignore) =
m_raChannels[raChannel];
1011 timeSlots =
m_frames[frameId]->GetTimeSlotConfs(carrierId);
1015 NS_FATAL_ERROR(
"Channel out of range!!!");
1024 NS_LOG_FUNCTION(
this);
1026 uint16_t slotCount = 0;
1032 std::tie(frameId, carrierId, std::ignore) =
m_raChannels[raChannel];
1034 slotCount =
m_frames[frameId]->GetTimeSlotConfs(carrierId).size();
1038 NS_FATAL_ERROR(
"Channel out of range!!!");
1047 NS_LOG_FUNCTION(
this);
1054 NS_LOG_FUNCTION(
this);
1056 uint8_t frameId = 0;
1064 NS_FATAL_ERROR(
"Channel out of range!!!");
1073 NS_LOG_FUNCTION(
this);
1075 uint8_t allocationChannel = 0;
1079 allocationChannel = std::get<2>(
m_raChannels[raChannel]);
1083 NS_FATAL_ERROR(
"Channel out of range!!!");
1086 return allocationChannel;
1092 NS_LOG_FUNCTION(
this);
1094 uint32_t payloadInBytes = 0;
1098 uint8_t frameId = std::get<0>(
m_raChannels[raChannel]);
1099 Ptr<SatTimeSlotConf> timeSlotConf = (*
m_frames[frameId]->GetTimeSlotConfs(0).begin());
1100 Ptr<SatWaveform> waveform =
1101 m_frames[frameId]->GetWaveformConf()->GetWaveform(timeSlotConf->GetWaveFormId());
1103 payloadInBytes = waveform->GetPayloadInBytes();
1107 NS_FATAL_ERROR(
"Channel " << raChannel <<
" out of range!!!");
1110 return payloadInBytes;
1116 std::string name =
"Frame";
1121#define GetIndexAsFrameName(index) SatSuperframeConf::GetIndexAsFrameName(index)
1124#define ADD_FRAME_ATTRIBUTES(index, \
1131 lowerLayerService, \
1134 .AddAttribute(GetIndexAsFrameName(index) + "_AllocatedBandwidthHz", \
1135 std::string("The allocated bandwidth [Hz] for ") + GetIndexAsFrameName(index), \
1136 TypeId::ATTR_CONSTRUCT, \
1137 DoubleValue(frameBandwidth), \
1138 MakeDoubleAccessor(&SatSuperframeConf::SetFrame##index##AllocatedBandwidthHz, \
1139 &SatSuperframeConf::GetFrame##index##AllocatedBandwidthHz), \
1140 MakeDoubleChecker<double>()) \
1142 GetIndexAsFrameName(index) + std::string("_CarrierAllocatedBandwidthHz"), \
1143 std::string("The allocated carrier bandwidth [Hz] for ") + GetIndexAsFrameName(index), \
1144 TypeId::ATTR_CONSTRUCT, \
1145 DoubleValue(carrierBandwidth), \
1146 MakeDoubleAccessor(&SatSuperframeConf::SetFrame##index##CarrierAllocatedBandwidthHz, \
1147 &SatSuperframeConf::GetFrame##index##CarrierAllocatedBandwidthHz), \
1148 MakeDoubleChecker<double>()) \
1149 .AddAttribute(GetIndexAsFrameName(index) + std::string("_CarrierRollOff"), \
1150 std::string("The roll-off factor for ") + GetIndexAsFrameName(index), \
1151 TypeId::ATTR_CONSTRUCT, \
1152 DoubleValue(carrierSpacing), \
1153 MakeDoubleAccessor(&SatSuperframeConf::SetFrame##index##CarrierRollOff, \
1154 &SatSuperframeConf::GetFrame##index##CarrierRollOff), \
1155 MakeDoubleChecker<double>(0.00, 1.00)) \
1156 .AddAttribute(GetIndexAsFrameName(index) + std::string("_CarrierSpacing"), \
1157 std::string("The carrier spacing factor for ") + GetIndexAsFrameName(index), \
1158 TypeId::ATTR_CONSTRUCT, \
1159 DoubleValue(carrierRollOff), \
1160 MakeDoubleAccessor(&SatSuperframeConf::SetFrame##index##CarrierSpacing, \
1161 &SatSuperframeConf::GetFrame##index##CarrierSpacing), \
1162 MakeDoubleChecker<double>(0.00, 1.00)) \
1163 .AddAttribute(GetIndexAsFrameName(index) + std::string("_SpreadingFactor"), \
1164 std::string("The carrier spreading factor for ") + \
1165 GetIndexAsFrameName(index), \
1166 TypeId::ATTR_CONSTRUCT, \
1167 UintegerValue(spreadingFactor), \
1168 MakeUintegerAccessor(&SatSuperframeConf::SetFrame##index##SpreadingFactor, \
1169 &SatSuperframeConf::GetFrame##index##SpreadingFactor), \
1170 MakeUintegerChecker<uint32_t>(1, std::numeric_limits<uint32_t>::max())) \
1171 .AddAttribute(GetIndexAsFrameName(index) + std::string("_RandomAccessFrame"), \
1172 std::string("Flag to tell if ") + GetIndexAsFrameName(index) + \
1173 std::string(" is used for random access"), \
1174 TypeId::ATTR_CONSTRUCT, \
1175 BooleanValue(randomAccess), \
1176 MakeBooleanAccessor(&SatSuperframeConf::SetFrame##index##RandomAccess, \
1177 &SatSuperframeConf::IsFrame##index##RandomAccess), \
1178 MakeBooleanChecker()) \
1180 GetIndexAsFrameName(index) + std::string("_LowerLayerService"), \
1181 std::string("Lower layer service to use for ") + GetIndexAsFrameName(index), \
1182 TypeId::ATTR_CONSTRUCT, \
1183 UintegerValue(lowerLayerService), \
1184 MakeUintegerAccessor(&SatSuperframeConf::SetFrame##index##AllocationChannelId, \
1185 &SatSuperframeConf::GetFrame##index##AllocationChannelId), \
1186 MakeUintegerChecker<uint8_t>()) \
1187 .AddAttribute(GetIndexAsFrameName(index) + std::string("_LogonFrame"), \
1188 std::string("Flag to tell if ") + GetIndexAsFrameName(index) + \
1189 std::string(" is used for logon"), \
1190 TypeId::ATTR_CONSTRUCT, \
1191 BooleanValue(logon), \
1192 MakeBooleanAccessor(&SatSuperframeConf::SetFrame##index##Logon, \
1193 &SatSuperframeConf::IsFrame##index##Logon), \
1194 MakeBooleanChecker()) \
1195 .AddAttribute(GetIndexAsFrameName(index) + std::string("_GuardTimeSymbols"), \
1196 std::string("Set the guard time of ") + GetIndexAsFrameName(index) + \
1197 std::string(" in symbols"), \
1198 TypeId::ATTR_CONSTRUCT, \
1199 UintegerValue(guardTime), \
1200 MakeUintegerAccessor(&SatSuperframeConf::SetFrame##index##GuardTimeSymbols, \
1201 &SatSuperframeConf::GetFrame##index##GuardTimeSymbols), \
1202 MakeUintegerChecker<uint8_t>())
1205#define ADD_SUPER_FRAME_ATTRIBUTES(frameCount, configType, maxSubdivision) \
1206 .AddAttribute("FrameCount", \
1207 "The number of frames in super frame.", \
1208 TypeId::ATTR_CONSTRUCT, \
1209 UintegerValue(frameCount), \
1210 MakeUintegerAccessor(&SatSuperframeConf::SetFrameCount, \
1211 &SatSuperframeConf::GetFrameCount), \
1212 MakeUintegerChecker<uint32_t>(1, SatSuperframeConf::m_maxFrameCount)) \
1214 "FrameConfigType", \
1215 "The frame configuration type used for super frame.", \
1216 TypeId::ATTR_CONSTRUCT, \
1217 EnumValue(configType), \
1218 MakeEnumAccessor<SatSuperframeConf::ConfigType_t>(&SatSuperframeConf::SetConfigType, \
1219 &SatSuperframeConf::GetConfigType), \
1220 MakeEnumChecker(SatSuperframeConf::CONFIG_TYPE_0, \
1222 SatSuperframeConf::CONFIG_TYPE_1, \
1224 SatSuperframeConf::CONFIG_TYPE_2, \
1226 SatSuperframeConf::CONFIG_TYPE_3, \
1228 SatSuperframeConf::CONFIG_TYPE_4, \
1231 "MaxCarrierSubdivision", \
1232 "The maximum amount of subdivision for a single carrier (ConfigType_3 only).", \
1233 TypeId::ATTR_CONSTRUCT, \
1234 UintegerValue(maxSubdivision), \
1235 MakeUintegerAccessor(&SatSuperframeConf::SetMaxSubdivision, \
1236 &SatSuperframeConf::GetMaxSubdivision), \
1237 MakeUintegerChecker<uint8_t>(0))
1242 NS_LOG_FUNCTION(
this);
1244 uint32_t currentFrame = 0;
1245 uint32_t lastIdInFrame =
m_frames[0]->GetCarrierCount() - 1;
1247 while (carrierId > lastIdInFrame)
1250 lastIdInFrame +=
m_frames[currentFrame]->GetCarrierCount();
1253 return currentFrame;
1259 NS_LOG_FUNCTION(
this);
1261 uint8_t raChannelId = 0;
1264 if (
m_frames[frameId]->IsRandomAccess())
1266 uint32_t carrierIdInFrame = carrierId;
1268 for (uint8_t i = 0; i < frameId; i++)
1270 carrierIdInFrame -=
m_frames[i]->GetCarrierCount();
1275 raChannelId +=
m_frames[i]->GetCarrierCount();
1280 raChannelId += carrierIdInFrame;
1292 NS_LOG_FUNCTION(
this);
1297 NS_LOG_FUNCTION(
this);
1304 TypeId(
"ns3::SatSuperframeConf0")
1377 NS_LOG_FUNCTION(
this);
1386 NS_LOG_FUNCTION(
this);
1391 NS_LOG_FUNCTION(
this);
1398 TypeId(
"ns3::SatSuperframeConf1")
1471 NS_LOG_FUNCTION(
this);
1480 NS_LOG_FUNCTION(
this);
1485 NS_LOG_FUNCTION(
this);
1492 TypeId(
"ns3::SatSuperframeConf2")
1565 NS_LOG_FUNCTION(
this);
1574 NS_LOG_FUNCTION(
this);
1579 NS_LOG_FUNCTION(
this);
1586 TypeId(
"ns3::SatSuperframeConf3")
1659 NS_LOG_FUNCTION(
this);
1668 NS_LOG_FUNCTION(
this);
1673 NS_LOG_FUNCTION(
this);
1680 TypeId(
"ns3::SatSuperframeConf4")
1682 .AddConstructor<SatSuperframeConf4>()
1702 NS_LOG_FUNCTION(
this);
~SatBtuConf()
Destructor for SatBtuConf.
SatBtuConf()
Default constructor for SatBtuConf.
double m_allocatedBandwidthInHz
double m_effectiveBandwidthInHz
double m_occupiedBandwidthInHz
CarrierBandwidthType_t
Types of bandwidth.
uint8_t GetSubdivisionLevel() const
Get the subdivision level of this frame.
uint16_t AddTimeSlotConf(Ptr< SatTimeSlotConf > conf)
Add time slot.
uint32_t m_minPayloadPerCarrierInBytes
static const uint16_t m_maxTimeSlotCount
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.
Ptr< SatBtuConf > m_btuConf
~SatFrameConf()
Destructor for SatFrameConf.
Ptr< SatFrameConf > m_parent
uint8_t m_guardTimeSymbols
SatTimeSlotConfContainer_t GetTimeSlotConfs(uint16_t carrierId) const
Get time slot of the specific carrier.
uint16_t GetTimeSlotCount() const
Get time slot count of the frame.
SatFrameConf()
Default constructor for SatFrameConf.
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.
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.
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.
This class implements super frame configuration 3.
~SatSuperframeConf3()
Destructor for SatSuperframeConf.
virtual void DoConfigure()
Do frame specific configuration as needed.
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.
This abstract class defines and implements interface of configuration for super frames.
SatSuperframeConf()
Default constructor for SatSuperframeConf.
void SetFrameCarrierSpacing(uint8_t frameIndex, double spacing)
SatFrameConf::SatTimeSlotConfContainer_t GetRaSlots(uint8_t raChannel)
Get RA channel time slots.
SatFrameConfList_t m_frames
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.
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)
bool m_frameIsLogon[m_maxFrameCount]
uint16_t GetRaSlotCount(uint8_t raChannel)
Get RA channel time slot count.
ConfigType_t m_configType
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
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.
static const uint8_t m_maxFrameCount
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]
bool IsFrameLogon(uint8_t frameIndex) const
double m_frameAllocatedBandwidth[m_maxFrameCount]
void Configure(double allocatedBandwidthHz, Time targetDuration, Ptr< SatWaveformConf > waveformConf)
Configures super frame configuration according to set attributes.
uint32_t m_frameCarrierSpreadingFactor[m_maxFrameCount]
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.
bool m_frameIsRandomAccess[m_maxFrameCount]
void SetFrameCarrierSpreadingFactor(uint8_t frameIndex, uint32_t spreadingFactor)
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
@ 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.
SatTimeSlotConf()
Default constructor for SatTimeSlotConf.
SatTimeSlotType_t
Types for time slot.
@ SLOT_TYPE_TRC
Control or traffic slot.
~SatTimeSlotConf()
Destructor for SatTimeSlotConf.
uint16_t m_frameCarrierId
SatTimeSlotType_t m_slotType
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.
#define ADD_SUPER_FRAME_ATTRIBUTES(frameCount, configType, maxSubdivision)
#define ADD_FRAME_ATTRIBUTES(index, frameBandwidth, carrierBandwidth, carrierSpacing, carrierRollOff, spreadingFactor, randomAccess, lowerLayerService, logon, guardTime)
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