25 #include <ns3/boolean.h>
26 #include <ns3/double.h>
29 #include <ns3/object.h>
30 #include <ns3/uinteger.h>
40 NS_LOG_COMPONENT_DEFINE(
"SatFrameConf");
48 : m_allocatedBandwidthInHz(0.0),
49 m_occupiedBandwidthInHz(0.0),
50 m_effectiveBandwidthInHz(0.0),
53 NS_LOG_FUNCTION(
this);
62 uint32_t spreadingFactor)
63 : m_allocatedBandwidthInHz(bandwidthInHz),
64 m_spreadingFactor(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,
111 : m_startTime(startTime),
112 m_waveFormId(waveFormId),
113 m_frameCarrierId(frameCarrierId),
117 NS_LOG_FUNCTION(
this);
122 NS_LOG_FUNCTION(
this);
128 : m_bandwidthHz(0.0),
130 m_isRandomAccess(false),
133 m_allocationChannel(0),
135 m_maxSymbolsPerCarrier(0),
136 m_minPayloadPerCarrierInBytes(0)
138 NS_LOG_FUNCTION(
this);
145 : m_bandwidthHz(parameters.m_bandwidthHz),
146 m_isRandomAccess(parameters.m_isRandomAccess),
147 m_isLogon(parameters.m_isLogon),
148 m_parent(parameters.m_parent),
149 m_btuConf(parameters.m_btuConf),
150 m_waveformConf(parameters.m_waveformConf),
151 m_allocationChannel(parameters.m_allocationChannel)
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);
412 Ptr<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;
450 : m_usedBandwidthHz(0.0),
453 m_configType(CONFIG_TYPE_0),
455 m_logonEnabled(false),
456 m_logonChannelIndex(0)
458 NS_LOG_FUNCTION(
this);
463 NS_LOG_FUNCTION(
this);
469 static TypeId tid = TypeId(
"ns3::SatSuperframeConf").SetParent<Object>();
477 NS_LOG_FUNCTION(
this);
483 double bandwidthInHz,
486 uint32_t spreadingFactor,
487 uint8_t subdivisionLevel)
489 NS_LOG_FUNCTION(
this << &frameConfParameters << bandwidthInHz << rollOff << spacing
490 << (uint32_t)subdivisionLevel);
498 Create<SatBtuConf>(bandwidthInHz, rollOff, spacing, spreadingFactor);
499 Ptr<SatFrameConf> frameConf = Create<SatFrameConf>(frameConfParameters);
502 uint16_t carriersCount = frameConf->GetCarrierCount();
504 if (frameConf->IsLogon() && carriersCount > 1)
506 NS_FATAL_ERROR(
"Logon frame can have only one carrier, this one have " << carriersCount
512 NS_FATAL_ERROR(
"Logon frame cannot be set several times.");
515 if (frameConf->IsLogon())
521 for (uint32_t i = 0; i < carriersCount; i++)
526 if ((raBaseIndex + i) >= std::numeric_limits<uint8_t>::max())
528 NS_FATAL_ERROR(
"RA channels maximum count is exceeded!!!");
532 std::make_tuple(frameId, i, frameConf->GetAllocationChannelId()));
540 for (uint8_t i = 0; i <= subdivisionLevel; ++i)
542 double subdivisionAmount = std::pow(2.0,
static_cast<double>(i));
545 frameConfParameters.
m_btuConf = Create<SatBtuConf>(bandwidthInHz / subdivisionAmount,
549 Ptr<SatFrameConf> frameConf = Create<SatFrameConf>(frameConfParameters);
551 if (frameConf->IsLogon())
553 NS_FATAL_ERROR(
"Logon frame must use Random Access.");
560 frameConfParameters.
m_parent = frameConf;
568 NS_LOG_FUNCTION(
this << (uint32_t)index);
576 NS_LOG_FUNCTION(
this);
584 NS_LOG_FUNCTION(
this);
588 NS_FATAL_ERROR(
"Frame ID out of range.");
591 uint32_t carrierId = frameCarrierId;
593 for (uint8_t i = 0; i < frameId; i++)
595 carrierId +=
m_frames[i]->GetCarrierCount();
604 NS_LOG_FUNCTION(
this);
606 double frameStartFrequency = 0.0;
607 uint32_t carrierIdInFrame = carrierId;
611 for (uint8_t i = 0; i < frameId; ++i)
613 carrierIdInFrame -=
m_frames[i]->GetCarrierCount();
614 frameStartFrequency +=
m_frames[i]->GetBandwidthHz();
617 double carrierFrequencyInFrame =
m_frames[frameId]->GetCarrierFrequencyHz(carrierIdInFrame);
619 return frameStartFrequency + carrierFrequencyInFrame;
626 NS_LOG_FUNCTION(
this);
630 return m_frames[frameId]->GetCarrierBandwidthHz(bandwidthType);
636 NS_LOG_FUNCTION(
this << carrierId);
646 NS_LOG_FUNCTION(
this);
650 return m_frames[frameId]->IsRandomAccess();
656 NS_LOG_FUNCTION(
this << (uint32_t)frameIndex << bandwidthHz);
660 NS_FATAL_ERROR(
"Frame index out of range!!!");
669 NS_LOG_FUNCTION(
this << (uint32_t)frameIndex << bandwidthHz);
673 NS_FATAL_ERROR(
"Frame index out of range!!!");
682 NS_LOG_FUNCTION(
this << (uint32_t)frameIndex << spacing);
686 NS_FATAL_ERROR(
"Frame index out of range!!!");
695 NS_LOG_FUNCTION(
this << (uint32_t)frameIndex << rollOff);
699 NS_FATAL_ERROR(
"Frame index out of range!!!");
708 NS_LOG_FUNCTION(
this << frameIndex << spreadingFactor);
712 NS_FATAL_ERROR(
"Frame index out of range!!!");
721 NS_LOG_FUNCTION(
this << (uint32_t)frameIndex << randomAccess);
725 NS_FATAL_ERROR(
"Frame index out of range!!!");
734 NS_LOG_FUNCTION(
this << (uint32_t)frameIndex << logon);
738 NS_FATAL_ERROR(
"Frame index out of range!!!");
747 NS_LOG_FUNCTION(
this << (uint32_t)frameIndex << (uint32_t)allocationChannel);
751 NS_FATAL_ERROR(
"Frame index out of range!!!");
760 NS_LOG_FUNCTION(
this << (uint32_t)frameIndex << guardTimeSymbols);
764 NS_FATAL_ERROR(
"Frame index out of range!!!");
773 NS_LOG_FUNCTION(
this << (uint32_t)frameIndex);
777 NS_FATAL_ERROR(
"Frame index out of range!!!");
786 NS_LOG_FUNCTION(
this << (uint32_t)frameIndex);
790 NS_FATAL_ERROR(
"Frame index out of range!!!");
799 NS_LOG_FUNCTION(
this << (uint32_t)frameIndex);
803 NS_FATAL_ERROR(
"Frame index out of range!!!");
812 NS_LOG_FUNCTION(
this << (uint32_t)frameIndex);
816 NS_FATAL_ERROR(
"Frame index out of range!!!");
825 NS_LOG_FUNCTION(
this << frameIndex);
829 NS_FATAL_ERROR(
"Frame index out of range!!!");
838 NS_LOG_FUNCTION(
this << (uint32_t)frameIndex);
842 NS_FATAL_ERROR(
"Frame index out of range!!!");
845 return m_frames[frameIndex]->IsRandomAccess();
851 NS_LOG_FUNCTION(
this << (uint32_t)frameIndex);
855 NS_FATAL_ERROR(
"Frame index out of range!!!");
858 return m_frames[frameIndex]->IsLogon();
864 NS_LOG_FUNCTION(
this << (uint32_t)frameIndex);
868 NS_FATAL_ERROR(
"Frame index out of range!!!");
877 NS_LOG_FUNCTION(
this << (uint32_t)frameIndex);
881 NS_FATAL_ERROR(
"Frame index out of range!!!");
890 NS_LOG_FUNCTION(
this);
898 NS_LOG_FUNCTION(
this);
906 Ptr<SatWaveformConf> waveformConf)
908 NS_LOG_FUNCTION(
this);
912 NS_LOG_WARN(
"Superframe is configured to use config type 0, thus ACM should be disabled!");
918 "Superframe is configured to use config type 1, thus ACM should be enabled!");
923 bool useDefaultWaveform =
false;
924 bool checkSlotLimit =
true;
925 uint8_t subdivisionLevels = 0;
939 useDefaultWaveform =
true;
944 checkSlotLimit =
false;
947 checkSlotLimit =
false;
951 useDefaultWaveform =
true;
952 checkSlotLimit =
false;
955 NS_FATAL_ERROR(
"Not supported configuration type " <<
m_configType <<
"!!!");
963 for (uint8_t frameIndex = 0; frameIndex <
m_frameCount; frameIndex++)
969 frameConfParameters.
m_parent =
nullptr;
994 "SatSuperframeConf::Configure: Error: configured more frames than requested");
1001 NS_FATAL_ERROR(
"Bandwidth of super frame exceeds allocated bandwidth");
1008 NS_LOG_FUNCTION(
this);
1016 std::tie(frameId, carrierId, std::ignore) =
m_raChannels[raChannel];
1018 timeSlots =
m_frames[frameId]->GetTimeSlotConfs(carrierId);
1022 NS_FATAL_ERROR(
"Channel out of range!!!");
1031 NS_LOG_FUNCTION(
this);
1033 uint16_t slotCount = 0;
1039 std::tie(frameId, carrierId, std::ignore) =
m_raChannels[raChannel];
1041 slotCount =
m_frames[frameId]->GetTimeSlotConfs(carrierId).size();
1045 NS_FATAL_ERROR(
"Channel out of range!!!");
1054 NS_LOG_FUNCTION(
this);
1061 NS_LOG_FUNCTION(
this);
1063 uint8_t frameId = 0;
1071 NS_FATAL_ERROR(
"Channel out of range!!!");
1080 NS_LOG_FUNCTION(
this);
1082 uint8_t allocationChannel = 0;
1086 allocationChannel = std::get<2>(
m_raChannels[raChannel]);
1090 NS_FATAL_ERROR(
"Channel out of range!!!");
1093 return allocationChannel;
1099 NS_LOG_FUNCTION(
this);
1101 uint32_t payloadInBytes = 0;
1105 uint8_t frameId = std::get<0>(
m_raChannels[raChannel]);
1106 Ptr<SatTimeSlotConf> timeSlotConf = (*
m_frames[frameId]->GetTimeSlotConfs(0).begin());
1107 Ptr<SatWaveform> waveform =
1108 m_frames[frameId]->GetWaveformConf()->GetWaveform(timeSlotConf->GetWaveFormId());
1110 payloadInBytes = waveform->GetPayloadInBytes();
1114 NS_FATAL_ERROR(
"Channel " << raChannel <<
" out of range!!!");
1117 return payloadInBytes;
1123 std::string name =
"Frame";
1128 #define GetIndexAsFrameName(index) SatSuperframeConf::GetIndexAsFrameName(index)
1131 #define ADD_FRAME_ATTRIBUTES(index, \
1138 lowerLayerService, \
1141 .AddAttribute(GetIndexAsFrameName(index) + "_AllocatedBandwidthHz", \
1142 std::string("The allocated bandwidth [Hz] for ") + GetIndexAsFrameName(index), \
1143 TypeId::ATTR_CONSTRUCT, \
1144 DoubleValue(frameBandwidth), \
1145 MakeDoubleAccessor(&SatSuperframeConf::SetFrame##index##AllocatedBandwidthHz, \
1146 &SatSuperframeConf::GetFrame##index##AllocatedBandwidthHz), \
1147 MakeDoubleChecker<double>()) \
1149 GetIndexAsFrameName(index) + std::string("_CarrierAllocatedBandwidthHz"), \
1150 std::string("The allocated carrier bandwidth [Hz] for ") + GetIndexAsFrameName(index), \
1151 TypeId::ATTR_CONSTRUCT, \
1152 DoubleValue(carrierBandwidth), \
1153 MakeDoubleAccessor(&SatSuperframeConf::SetFrame##index##CarrierAllocatedBandwidthHz, \
1154 &SatSuperframeConf::GetFrame##index##CarrierAllocatedBandwidthHz), \
1155 MakeDoubleChecker<double>()) \
1156 .AddAttribute(GetIndexAsFrameName(index) + std::string("_CarrierRollOff"), \
1157 std::string("The roll-off factor for ") + GetIndexAsFrameName(index), \
1158 TypeId::ATTR_CONSTRUCT, \
1159 DoubleValue(carrierSpacing), \
1160 MakeDoubleAccessor(&SatSuperframeConf::SetFrame##index##CarrierRollOff, \
1161 &SatSuperframeConf::GetFrame##index##CarrierRollOff), \
1162 MakeDoubleChecker<double>(0.00, 1.00)) \
1163 .AddAttribute(GetIndexAsFrameName(index) + std::string("_CarrierSpacing"), \
1164 std::string("The carrier spacing factor for ") + GetIndexAsFrameName(index), \
1165 TypeId::ATTR_CONSTRUCT, \
1166 DoubleValue(carrierRollOff), \
1167 MakeDoubleAccessor(&SatSuperframeConf::SetFrame##index##CarrierSpacing, \
1168 &SatSuperframeConf::GetFrame##index##CarrierSpacing), \
1169 MakeDoubleChecker<double>(0.00, 1.00)) \
1170 .AddAttribute(GetIndexAsFrameName(index) + std::string("_SpreadingFactor"), \
1171 std::string("The carrier spreading factor for ") + \
1172 GetIndexAsFrameName(index), \
1173 TypeId::ATTR_CONSTRUCT, \
1174 UintegerValue(spreadingFactor), \
1175 MakeUintegerAccessor(&SatSuperframeConf::SetFrame##index##SpreadingFactor, \
1176 &SatSuperframeConf::GetFrame##index##SpreadingFactor), \
1177 MakeUintegerChecker<uint32_t>(1, std::numeric_limits<uint32_t>::max())) \
1178 .AddAttribute(GetIndexAsFrameName(index) + std::string("_RandomAccessFrame"), \
1179 std::string("Flag to tell if ") + GetIndexAsFrameName(index) + \
1180 std::string(" is used for random access"), \
1181 TypeId::ATTR_CONSTRUCT, \
1182 BooleanValue(randomAccess), \
1183 MakeBooleanAccessor(&SatSuperframeConf::SetFrame##index##RandomAccess, \
1184 &SatSuperframeConf::IsFrame##index##RandomAccess), \
1185 MakeBooleanChecker()) \
1187 GetIndexAsFrameName(index) + std::string("_LowerLayerService"), \
1188 std::string("Lower layer service to use for ") + GetIndexAsFrameName(index), \
1189 TypeId::ATTR_CONSTRUCT, \
1190 UintegerValue(lowerLayerService), \
1191 MakeUintegerAccessor(&SatSuperframeConf::SetFrame##index##AllocationChannelId, \
1192 &SatSuperframeConf::GetFrame##index##AllocationChannelId), \
1193 MakeUintegerChecker<uint8_t>()) \
1194 .AddAttribute(GetIndexAsFrameName(index) + std::string("_LogonFrame"), \
1195 std::string("Flag to tell if ") + GetIndexAsFrameName(index) + \
1196 std::string(" is used for logon"), \
1197 TypeId::ATTR_CONSTRUCT, \
1198 BooleanValue(logon), \
1199 MakeBooleanAccessor(&SatSuperframeConf::SetFrame##index##Logon, \
1200 &SatSuperframeConf::IsFrame##index##Logon), \
1201 MakeBooleanChecker()) \
1202 .AddAttribute(GetIndexAsFrameName(index) + std::string("_GuardTimeSymbols"), \
1203 std::string("Set the guard time of ") + GetIndexAsFrameName(index) + \
1204 std::string(" in symbols"), \
1205 TypeId::ATTR_CONSTRUCT, \
1206 UintegerValue(guardTime), \
1207 MakeUintegerAccessor(&SatSuperframeConf::SetFrame##index##GuardTimeSymbols, \
1208 &SatSuperframeConf::GetFrame##index##GuardTimeSymbols), \
1209 MakeUintegerChecker<uint8_t>())
1212 #define ADD_SUPER_FRAME_ATTRIBUTES(frameCount, configType, maxSubdivision) \
1213 .AddAttribute("FrameCount", \
1214 "The number of frames in super frame.", \
1215 TypeId::ATTR_CONSTRUCT, \
1216 UintegerValue(frameCount), \
1217 MakeUintegerAccessor(&SatSuperframeConf::SetFrameCount, \
1218 &SatSuperframeConf::GetFrameCount), \
1219 MakeUintegerChecker<uint32_t>(1, SatSuperframeConf::m_maxFrameCount)) \
1221 "FrameConfigType", \
1222 "The frame configuration type used for super frame.", \
1223 TypeId::ATTR_CONSTRUCT, \
1224 EnumValue(configType), \
1225 MakeEnumAccessor<SatSuperframeConf::ConfigType_t>(&SatSuperframeConf::SetConfigType, \
1226 &SatSuperframeConf::GetConfigType), \
1227 MakeEnumChecker(SatSuperframeConf::CONFIG_TYPE_0, \
1229 SatSuperframeConf::CONFIG_TYPE_1, \
1231 SatSuperframeConf::CONFIG_TYPE_2, \
1233 SatSuperframeConf::CONFIG_TYPE_3, \
1235 SatSuperframeConf::CONFIG_TYPE_4, \
1238 "MaxCarrierSubdivision", \
1239 "The maximum amount of subdivision for a single carrier (ConfigType_3 only).", \
1240 TypeId::ATTR_CONSTRUCT, \
1241 UintegerValue(maxSubdivision), \
1242 MakeUintegerAccessor(&SatSuperframeConf::SetMaxSubdivision, \
1243 &SatSuperframeConf::GetMaxSubdivision), \
1244 MakeUintegerChecker<uint8_t>(0))
1249 NS_LOG_FUNCTION(
this);
1251 uint32_t currentFrame = 0;
1252 uint32_t lastIdInFrame =
m_frames[0]->GetCarrierCount() - 1;
1254 while (carrierId > lastIdInFrame)
1257 lastIdInFrame +=
m_frames[currentFrame]->GetCarrierCount();
1260 return currentFrame;
1266 NS_LOG_FUNCTION(
this);
1268 uint8_t raChannelId = 0;
1271 if (
m_frames[frameId]->IsRandomAccess())
1273 uint32_t carrierIdInFrame = carrierId;
1275 for (uint8_t i = 0; i < frameId; i++)
1277 carrierIdInFrame -=
m_frames[i]->GetCarrierCount();
1282 raChannelId +=
m_frames[i]->GetCarrierCount();
1287 raChannelId += carrierIdInFrame;
1299 NS_LOG_FUNCTION(
this);
1304 NS_LOG_FUNCTION(
this);
1311 TypeId(
"ns3::SatSuperframeConf0")
1384 NS_LOG_FUNCTION(
this);
1391 NS_LOG_FUNCTION(
this);
1400 NS_LOG_FUNCTION(
this);
1405 NS_LOG_FUNCTION(
this);
1412 TypeId(
"ns3::SatSuperframeConf1")
1485 NS_LOG_FUNCTION(
this);
1492 NS_LOG_FUNCTION(
this);
1501 NS_LOG_FUNCTION(
this);
1506 NS_LOG_FUNCTION(
this);
1513 TypeId(
"ns3::SatSuperframeConf2")
1586 NS_LOG_FUNCTION(
this);
1593 NS_LOG_FUNCTION(
this);
1602 NS_LOG_FUNCTION(
this);
1607 NS_LOG_FUNCTION(
this);
1614 TypeId(
"ns3::SatSuperframeConf3")
1687 NS_LOG_FUNCTION(
this);
1694 NS_LOG_FUNCTION(
this);
1703 NS_LOG_FUNCTION(
this);
1708 NS_LOG_FUNCTION(
this);
1715 TypeId(
"ns3::SatSuperframeConf4")
1717 .AddConstructor<SatSuperframeConf4>()
1737 NS_LOG_FUNCTION(
this);
1744 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
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.
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.
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]
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
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.
This class implements configuration for time slots (for super frames / frames)
SatTimeSlotConf()
Default constructor for SatTimeSlotConf.
SatTimeSlotType_t
Types for time slot.
@ SLOT_TYPE_TRC
Control or traffic slot.
~SatTimeSlotConf()
Destructor for SatTimeSlotConf.
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