25 #include <ns3/boolean.h>
26 #include <ns3/double.h>
29 #include <ns3/object.h>
30 #include <ns3/uinteger.h>
35 NS_LOG_COMPONENT_DEFINE(
"SatFrameConf");
43 : m_allocatedBandwidthInHz(0.0),
44 m_occupiedBandwidthInHz(0.0),
45 m_effectiveBandwidthInHz(0.0),
48 NS_LOG_FUNCTION(
this);
57 uint32_t spreadingFactor)
58 : m_allocatedBandwidthInHz(bandwidthInHz),
59 m_spreadingFactor(spreadingFactor)
61 NS_LOG_FUNCTION(
this);
63 if ((spacing < 0.00) && (spacing > 1.00))
65 NS_FATAL_ERROR(
"Spacing for BTU is out of range. Check frame configuration parameters "
69 if ((rollOff < 0.00) && (rollOff > 1.00))
71 NS_FATAL_ERROR(
"Roll-off for BTU is out of range. Check frame configuration parameters "
84 NS_LOG_FUNCTION(
this);
96 NS_LOG_FUNCTION(
this);
104 uint16_t frameCarrierId,
106 : m_startTime(startTime),
107 m_waveFormId(waveFormId),
108 m_frameCarrierId(frameCarrierId),
112 NS_LOG_FUNCTION(
this);
117 NS_LOG_FUNCTION(
this);
123 : m_bandwidthHz(0.0),
125 m_isRandomAccess(false),
128 m_allocationChannel(0),
130 m_maxSymbolsPerCarrier(0),
131 m_minPayloadPerCarrierInBytes(0)
133 NS_LOG_FUNCTION(
this);
140 : m_bandwidthHz(parameters.m_bandwidthHz),
141 m_isRandomAccess(parameters.m_isRandomAccess),
142 m_isLogon(parameters.m_isLogon),
143 m_parent(parameters.m_parent),
144 m_btuConf(parameters.m_btuConf),
145 m_waveformConf(parameters.m_waveformConf),
146 m_allocationChannel(parameters.m_allocationChannel)
148 NS_LOG_FUNCTION(
this);
154 NS_FATAL_ERROR(
"No carriers can be created for the frame with given BTU and bandwidth. "
155 "Check frame configuration parameters (attributes)!!! ");
163 Ptr<SatWaveform> defWaveform =
m_waveformConf->GetWaveform(defWaveFormId);
166 Time timeSlotDuration = defWaveform->GetBurstDuration(
m_btuConf->GetSymbolRateInBauds());
167 uint32_t carrierSlotCount =
171 if (carrierSlotCount == 0)
173 NS_FATAL_ERROR(
"Time slots cannot be created with target frame duration. Check frame "
174 "target duration!!!");
178 NS_LOG_INFO(
"Carrier slot count " << carrierSlotCount);
181 m_duration = Time(carrierSlotCount * timeSlotDuration.GetInteger());
191 uint32_t mostRobustWaveFormId;
193 if (!
m_waveformConf->GetMostRobustWaveformId(mostRobustWaveFormId,
194 defWaveform->GetBurstLengthInSymbols()))
196 NS_FATAL_ERROR(
"Most robust waveform not found, error in waveform configuration ???");
199 Ptr<SatWaveform> waveform =
m_waveformConf->GetWaveform(mostRobustWaveFormId);
203 uint32_t frameTimeSlotCount = 0;
208 for (uint32_t j = 0; j < carrierSlotCount; j++)
211 Ptr<SatTimeSlotConf> timeSlot =
212 Create<SatTimeSlotConf>(Time(j * timeSlotDuration.GetInteger()) + guardTime,
218 frameTimeSlotCount++;
222 NS_FATAL_ERROR(
"Time slot count is over limit. Check frame configuration!!!");
230 NS_LOG_FUNCTION(
this);
236 NS_LOG_FUNCTION(
this << carrierId);
240 NS_FATAL_ERROR(
"Carrier Id out of range");
243 double carrierBandwidthHz =
m_btuConf->GetAllocatedBandwidthInHz();
245 return ((carrierBandwidthHz * carrierId) + (carrierBandwidthHz / 2.0));
251 NS_LOG_FUNCTION(
this << bandwidthType);
253 double bandwidth = 0.0;
255 switch (bandwidthType)
258 bandwidth =
m_btuConf->GetAllocatedBandwidthInHz();
262 bandwidth =
m_btuConf->GetOccupiedBandwidthInHz();
266 bandwidth =
m_btuConf->GetEffectiveBandwidthInHz();
270 NS_FATAL_ERROR(
"Invalid bandwidth type!!!");
280 NS_LOG_FUNCTION(
this);
282 uint8_t subdivisionLevel = 0;
283 Ptr<SatFrameConf> parent =
m_parent;
285 while (parent !=
nullptr)
288 parent = parent->m_parent;
291 NS_LOG_INFO(
"Subdivision level is " << (uint32_t)subdivisionLevel);
292 return subdivisionLevel;
298 NS_LOG_FUNCTION(
this);
300 uint16_t slotCount = 0;
313 NS_LOG_FUNCTION(
this);
315 Ptr<SatTimeSlotConf> foundTimeSlot = NULL;
317 SatTimeSlotConfMap_t::const_iterator foundCarrier =
m_timeSlotConfMap.find(carrierId);
319 if (foundCarrier !=
m_timeSlotConfMap.end() && index < foundCarrier->second.size())
321 foundTimeSlot = foundCarrier->second[index];
325 NS_FATAL_ERROR(
"Index is invalid!!!");
328 return foundTimeSlot;
334 NS_LOG_FUNCTION(
this);
336 Ptr<SatTimeSlotConf> foundTimeSlot = NULL;
342 return foundTimeSlot;
348 NS_LOG_FUNCTION(
this);
356 timeSlots = it->second;
360 NS_FATAL_ERROR(
"Carrier not found!!!");
369 NS_LOG_FUNCTION(
this << conf);
372 SatTimeSlotConfMap_t::iterator it =
m_timeSlotConfMap.find(conf->GetCarrierId());
378 std::pair<SatTimeSlotConfMap_t::iterator, bool> result =
m_timeSlotConfMap.insert(
394 NS_FATAL_ERROR(
"Cannot insert slot to container!!!");
398 it->second.push_back(conf);
407 Ptr<SatSuperframeConf>
410 NS_LOG_FUNCTION_NOARGS();
412 Ptr<SatSuperframeConf> superFrameConf;
417 superFrameConf = CreateObject<SatSuperframeConf0>();
421 superFrameConf = CreateObject<SatSuperframeConf1>();
425 superFrameConf = CreateObject<SatSuperframeConf2>();
429 superFrameConf = CreateObject<SatSuperframeConf3>();
433 superFrameConf = CreateObject<SatSuperframeConf4>();
437 NS_FATAL_ERROR(
"Not supported super frame configuration!!!");
441 return superFrameConf;
445 : m_usedBandwidthHz(0.0),
448 m_configType(CONFIG_TYPE_0),
450 m_logonEnabled(false),
451 m_logonChannelIndex(0)
453 NS_LOG_FUNCTION(
this);
458 NS_LOG_FUNCTION(
this);
464 static TypeId tid = TypeId(
"ns3::SatSuperframeConf").SetParent<Object>();
472 NS_LOG_FUNCTION(
this);
478 double bandwidthInHz,
481 uint32_t spreadingFactor,
482 uint8_t subdivisionLevel)
484 NS_LOG_FUNCTION(
this << &frameConfParameters << bandwidthInHz << rollOff << spacing
485 << (uint32_t)subdivisionLevel);
493 Create<SatBtuConf>(bandwidthInHz, rollOff, spacing, spreadingFactor);
494 Ptr<SatFrameConf> frameConf = Create<SatFrameConf>(frameConfParameters);
497 uint16_t carriersCount = frameConf->GetCarrierCount();
499 if (frameConf->IsLogon() && carriersCount > 1)
501 NS_FATAL_ERROR(
"Logon frame can have only one carrier, this one have " << carriersCount
507 NS_FATAL_ERROR(
"Logon frame cannot be set several times.");
510 if (frameConf->IsLogon())
516 for (uint32_t i = 0; i < carriersCount; i++)
521 if ((raBaseIndex + i) >= std::numeric_limits<uint8_t>::max())
523 NS_FATAL_ERROR(
"RA channels maximum count is exceeded!!!");
527 std::make_tuple(frameId, i, frameConf->GetAllocationChannelId()));
535 for (uint8_t i = 0; i <= subdivisionLevel; ++i)
537 double subdivisionAmount = std::pow(2.0,
static_cast<double>(i));
540 frameConfParameters.
m_btuConf = Create<SatBtuConf>(bandwidthInHz / subdivisionAmount,
544 Ptr<SatFrameConf> frameConf = Create<SatFrameConf>(frameConfParameters);
546 if (frameConf->IsLogon())
548 NS_FATAL_ERROR(
"Logon frame must use Random Access.");
555 frameConfParameters.
m_parent = frameConf;
563 NS_LOG_FUNCTION(
this << (uint32_t)index);
571 NS_LOG_FUNCTION(
this);
579 NS_LOG_FUNCTION(
this);
583 NS_FATAL_ERROR(
"Frame ID out of range.");
586 uint32_t carrierId = frameCarrierId;
588 for (uint8_t i = 0; i < frameId; i++)
590 carrierId +=
m_frames[i]->GetCarrierCount();
599 NS_LOG_FUNCTION(
this);
601 double frameStartFrequency = 0.0;
602 uint32_t carrierIdInFrame = carrierId;
606 for (uint8_t i = 0; i < frameId; ++i)
608 carrierIdInFrame -=
m_frames[i]->GetCarrierCount();
609 frameStartFrequency +=
m_frames[i]->GetBandwidthHz();
612 double carrierFrequencyInFrame =
m_frames[frameId]->GetCarrierFrequencyHz(carrierIdInFrame);
614 return frameStartFrequency + carrierFrequencyInFrame;
621 NS_LOG_FUNCTION(
this);
625 return m_frames[frameId]->GetCarrierBandwidthHz(bandwidthType);
631 NS_LOG_FUNCTION(
this << carrierId);
641 NS_LOG_FUNCTION(
this);
645 return m_frames[frameId]->IsRandomAccess();
651 NS_LOG_FUNCTION(
this << (uint32_t)frameIndex << bandwidthHz);
655 NS_FATAL_ERROR(
"Frame index out of range!!!");
664 NS_LOG_FUNCTION(
this << (uint32_t)frameIndex << bandwidthHz);
668 NS_FATAL_ERROR(
"Frame index out of range!!!");
677 NS_LOG_FUNCTION(
this << (uint32_t)frameIndex << spacing);
681 NS_FATAL_ERROR(
"Frame index out of range!!!");
690 NS_LOG_FUNCTION(
this << (uint32_t)frameIndex << rollOff);
694 NS_FATAL_ERROR(
"Frame index out of range!!!");
703 NS_LOG_FUNCTION(
this << frameIndex << spreadingFactor);
707 NS_FATAL_ERROR(
"Frame index out of range!!!");
716 NS_LOG_FUNCTION(
this << (uint32_t)frameIndex << randomAccess);
720 NS_FATAL_ERROR(
"Frame index out of range!!!");
729 NS_LOG_FUNCTION(
this << (uint32_t)frameIndex << logon);
733 NS_FATAL_ERROR(
"Frame index out of range!!!");
742 NS_LOG_FUNCTION(
this << (uint32_t)frameIndex << (uint32_t)allocationChannel);
746 NS_FATAL_ERROR(
"Frame index out of range!!!");
755 NS_LOG_FUNCTION(
this << (uint32_t)frameIndex << guardTimeSymbols);
759 NS_FATAL_ERROR(
"Frame index out of range!!!");
768 NS_LOG_FUNCTION(
this << (uint32_t)frameIndex);
772 NS_FATAL_ERROR(
"Frame index out of range!!!");
781 NS_LOG_FUNCTION(
this << (uint32_t)frameIndex);
785 NS_FATAL_ERROR(
"Frame index out of range!!!");
794 NS_LOG_FUNCTION(
this << (uint32_t)frameIndex);
798 NS_FATAL_ERROR(
"Frame index out of range!!!");
807 NS_LOG_FUNCTION(
this << (uint32_t)frameIndex);
811 NS_FATAL_ERROR(
"Frame index out of range!!!");
820 NS_LOG_FUNCTION(
this << frameIndex);
824 NS_FATAL_ERROR(
"Frame index out of range!!!");
833 NS_LOG_FUNCTION(
this << (uint32_t)frameIndex);
837 NS_FATAL_ERROR(
"Frame index out of range!!!");
840 return m_frames[frameIndex]->IsRandomAccess();
846 NS_LOG_FUNCTION(
this << (uint32_t)frameIndex);
850 NS_FATAL_ERROR(
"Frame index out of range!!!");
853 return m_frames[frameIndex]->IsLogon();
859 NS_LOG_FUNCTION(
this << (uint32_t)frameIndex);
863 NS_FATAL_ERROR(
"Frame index out of range!!!");
872 NS_LOG_FUNCTION(
this << (uint32_t)frameIndex);
876 NS_FATAL_ERROR(
"Frame index out of range!!!");
885 NS_LOG_FUNCTION(
this);
893 NS_LOG_FUNCTION(
this);
901 Ptr<SatWaveformConf> waveformConf)
903 NS_LOG_FUNCTION(
this);
907 NS_LOG_WARN(
"Superframe is configured to use config type 0, thus ACM should be disabled!");
913 "Superframe is configured to use config type 1, thus ACM should be enabled!");
918 bool useDefaultWaveform =
false;
919 bool checkSlotLimit =
true;
920 uint8_t subdivisionLevels = 0;
934 useDefaultWaveform =
true;
939 checkSlotLimit =
false;
942 checkSlotLimit =
false;
946 useDefaultWaveform =
true;
947 checkSlotLimit =
false;
950 NS_FATAL_ERROR(
"Not supported configuration type " <<
m_configType <<
"!!!");
958 for (uint8_t frameIndex = 0; frameIndex <
m_frameCount; frameIndex++)
964 frameConfParameters.
m_parent =
nullptr;
989 "SatSuperframeConf::Configure: Error: configured more frames than requested");
996 NS_FATAL_ERROR(
"Bandwidth of super frame exceeds allocated bandwidth");
1003 NS_LOG_FUNCTION(
this);
1011 std::tie(frameId, carrierId, std::ignore) =
m_raChannels[raChannel];
1013 timeSlots =
m_frames[frameId]->GetTimeSlotConfs(carrierId);
1017 NS_FATAL_ERROR(
"Channel out of range!!!");
1026 NS_LOG_FUNCTION(
this);
1028 uint16_t slotCount = 0;
1034 std::tie(frameId, carrierId, std::ignore) =
m_raChannels[raChannel];
1036 slotCount =
m_frames[frameId]->GetTimeSlotConfs(carrierId).size();
1040 NS_FATAL_ERROR(
"Channel out of range!!!");
1049 NS_LOG_FUNCTION(
this);
1056 NS_LOG_FUNCTION(
this);
1058 uint8_t frameId = 0;
1066 NS_FATAL_ERROR(
"Channel out of range!!!");
1075 NS_LOG_FUNCTION(
this);
1077 uint8_t allocationChannel = 0;
1081 allocationChannel = std::get<2>(
m_raChannels[raChannel]);
1085 NS_FATAL_ERROR(
"Channel out of range!!!");
1088 return allocationChannel;
1094 NS_LOG_FUNCTION(
this);
1096 uint32_t payloadInBytes = 0;
1100 uint8_t frameId = std::get<0>(
m_raChannels[raChannel]);
1101 Ptr<SatTimeSlotConf> timeSlotConf = (*
m_frames[frameId]->GetTimeSlotConfs(0).begin());
1102 Ptr<SatWaveform> waveform =
1103 m_frames[frameId]->GetWaveformConf()->GetWaveform(timeSlotConf->GetWaveFormId());
1105 payloadInBytes = waveform->GetPayloadInBytes();
1109 NS_FATAL_ERROR(
"Channel " << raChannel <<
" out of range!!!");
1112 return payloadInBytes;
1118 std::string name =
"Frame";
1123 #define GetIndexAsFrameName(index) SatSuperframeConf::GetIndexAsFrameName(index)
1126 #define ADD_FRAME_ATTRIBUTES(index, \
1133 lowerLayerService, \
1136 .AddAttribute(GetIndexAsFrameName(index) + "_AllocatedBandwidthHz", \
1137 std::string("The allocated bandwidth [Hz] for ") + GetIndexAsFrameName(index), \
1138 TypeId::ATTR_CONSTRUCT, \
1139 DoubleValue(frameBandwidth), \
1140 MakeDoubleAccessor(&SatSuperframeConf::SetFrame##index##AllocatedBandwidthHz, \
1141 &SatSuperframeConf::GetFrame##index##AllocatedBandwidthHz), \
1142 MakeDoubleChecker<double>()) \
1144 GetIndexAsFrameName(index) + std::string("_CarrierAllocatedBandwidthHz"), \
1145 std::string("The allocated carrier bandwidth [Hz] for ") + GetIndexAsFrameName(index), \
1146 TypeId::ATTR_CONSTRUCT, \
1147 DoubleValue(carrierBandwidth), \
1148 MakeDoubleAccessor(&SatSuperframeConf::SetFrame##index##CarrierAllocatedBandwidthHz, \
1149 &SatSuperframeConf::GetFrame##index##CarrierAllocatedBandwidthHz), \
1150 MakeDoubleChecker<double>()) \
1151 .AddAttribute(GetIndexAsFrameName(index) + std::string("_CarrierRollOff"), \
1152 std::string("The roll-off factor for ") + GetIndexAsFrameName(index), \
1153 TypeId::ATTR_CONSTRUCT, \
1154 DoubleValue(carrierSpacing), \
1155 MakeDoubleAccessor(&SatSuperframeConf::SetFrame##index##CarrierRollOff, \
1156 &SatSuperframeConf::GetFrame##index##CarrierRollOff), \
1157 MakeDoubleChecker<double>(0.00, 1.00)) \
1158 .AddAttribute(GetIndexAsFrameName(index) + std::string("_CarrierSpacing"), \
1159 std::string("The carrier spacing factor for ") + GetIndexAsFrameName(index), \
1160 TypeId::ATTR_CONSTRUCT, \
1161 DoubleValue(carrierRollOff), \
1162 MakeDoubleAccessor(&SatSuperframeConf::SetFrame##index##CarrierSpacing, \
1163 &SatSuperframeConf::GetFrame##index##CarrierSpacing), \
1164 MakeDoubleChecker<double>(0.00, 1.00)) \
1165 .AddAttribute(GetIndexAsFrameName(index) + std::string("_SpreadingFactor"), \
1166 std::string("The carrier spreading factor for ") + \
1167 GetIndexAsFrameName(index), \
1168 TypeId::ATTR_CONSTRUCT, \
1169 UintegerValue(spreadingFactor), \
1170 MakeUintegerAccessor(&SatSuperframeConf::SetFrame##index##SpreadingFactor, \
1171 &SatSuperframeConf::GetFrame##index##SpreadingFactor), \
1172 MakeUintegerChecker<uint32_t>(1, std::numeric_limits<uint32_t>::max())) \
1173 .AddAttribute(GetIndexAsFrameName(index) + std::string("_RandomAccessFrame"), \
1174 std::string("Flag to tell if ") + GetIndexAsFrameName(index) + \
1175 std::string(" is used for random access"), \
1176 TypeId::ATTR_CONSTRUCT, \
1177 BooleanValue(randomAccess), \
1178 MakeBooleanAccessor(&SatSuperframeConf::SetFrame##index##RandomAccess, \
1179 &SatSuperframeConf::IsFrame##index##RandomAccess), \
1180 MakeBooleanChecker()) \
1182 GetIndexAsFrameName(index) + std::string("_LowerLayerService"), \
1183 std::string("Lower layer service to use for ") + GetIndexAsFrameName(index), \
1184 TypeId::ATTR_CONSTRUCT, \
1185 UintegerValue(lowerLayerService), \
1186 MakeUintegerAccessor(&SatSuperframeConf::SetFrame##index##AllocationChannelId, \
1187 &SatSuperframeConf::GetFrame##index##AllocationChannelId), \
1188 MakeUintegerChecker<uint8_t>()) \
1189 .AddAttribute(GetIndexAsFrameName(index) + std::string("_LogonFrame"), \
1190 std::string("Flag to tell if ") + GetIndexAsFrameName(index) + \
1191 std::string(" is used for logon"), \
1192 TypeId::ATTR_CONSTRUCT, \
1193 BooleanValue(logon), \
1194 MakeBooleanAccessor(&SatSuperframeConf::SetFrame##index##Logon, \
1195 &SatSuperframeConf::IsFrame##index##Logon), \
1196 MakeBooleanChecker()) \
1197 .AddAttribute(GetIndexAsFrameName(index) + std::string("_GuardTimeSymbols"), \
1198 std::string("Set the guard time of ") + GetIndexAsFrameName(index) + \
1199 std::string(" in symbols"), \
1200 TypeId::ATTR_CONSTRUCT, \
1201 UintegerValue(guardTime), \
1202 MakeUintegerAccessor(&SatSuperframeConf::SetFrame##index##GuardTimeSymbols, \
1203 &SatSuperframeConf::GetFrame##index##GuardTimeSymbols), \
1204 MakeUintegerChecker<uint8_t>())
1207 #define ADD_SUPER_FRAME_ATTRIBUTES(frameCount, configType, maxSubdivision) \
1208 .AddAttribute("FrameCount", \
1209 "The number of frames in super frame.", \
1210 TypeId::ATTR_CONSTRUCT, \
1211 UintegerValue(frameCount), \
1212 MakeUintegerAccessor(&SatSuperframeConf::SetFrameCount, \
1213 &SatSuperframeConf::GetFrameCount), \
1214 MakeUintegerChecker<uint32_t>(1, SatSuperframeConf::m_maxFrameCount)) \
1215 .AddAttribute("FrameConfigType", \
1216 "The frame configuration type used for super frame.", \
1217 TypeId::ATTR_CONSTRUCT, \
1218 EnumValue(configType), \
1219 MakeEnumAccessor(&SatSuperframeConf::SetConfigType, \
1220 &SatSuperframeConf::GetConfigType), \
1221 MakeEnumChecker(SatSuperframeConf::CONFIG_TYPE_0, \
1223 SatSuperframeConf::CONFIG_TYPE_1, \
1225 SatSuperframeConf::CONFIG_TYPE_2, \
1227 SatSuperframeConf::CONFIG_TYPE_3, \
1229 SatSuperframeConf::CONFIG_TYPE_4, \
1232 "MaxCarrierSubdivision", \
1233 "The maximum amount of subdivision for a single carrier (ConfigType_3 only).", \
1234 TypeId::ATTR_CONSTRUCT, \
1235 UintegerValue(maxSubdivision), \
1236 MakeUintegerAccessor(&SatSuperframeConf::SetMaxSubdivision, \
1237 &SatSuperframeConf::GetMaxSubdivision), \
1238 MakeUintegerChecker<uint8_t>(0))
1243 NS_LOG_FUNCTION(
this);
1245 uint32_t currentFrame = 0;
1246 uint32_t lastIdInFrame =
m_frames[0]->GetCarrierCount() - 1;
1248 while (carrierId > lastIdInFrame)
1251 lastIdInFrame +=
m_frames[currentFrame]->GetCarrierCount();
1254 return currentFrame;
1260 NS_LOG_FUNCTION(
this);
1262 uint8_t raChannelId = 0;
1265 if (
m_frames[frameId]->IsRandomAccess())
1267 uint32_t carrierIdInFrame = carrierId;
1269 for (uint8_t i = 0; i < frameId; i++)
1271 carrierIdInFrame -=
m_frames[i]->GetCarrierCount();
1276 raChannelId +=
m_frames[i]->GetCarrierCount();
1281 raChannelId += carrierIdInFrame;
1293 NS_LOG_FUNCTION(
this);
1298 NS_LOG_FUNCTION(
this);
1305 TypeId(
"ns3::SatSuperframeConf0")
1378 NS_LOG_FUNCTION(
this);
1385 NS_LOG_FUNCTION(
this);
1394 NS_LOG_FUNCTION(
this);
1399 NS_LOG_FUNCTION(
this);
1406 TypeId(
"ns3::SatSuperframeConf1")
1479 NS_LOG_FUNCTION(
this);
1486 NS_LOG_FUNCTION(
this);
1495 NS_LOG_FUNCTION(
this);
1500 NS_LOG_FUNCTION(
this);
1507 TypeId(
"ns3::SatSuperframeConf2")
1580 NS_LOG_FUNCTION(
this);
1587 NS_LOG_FUNCTION(
this);
1596 NS_LOG_FUNCTION(
this);
1601 NS_LOG_FUNCTION(
this);
1608 TypeId(
"ns3::SatSuperframeConf3")
1681 NS_LOG_FUNCTION(
this);
1688 NS_LOG_FUNCTION(
this);
1697 NS_LOG_FUNCTION(
this);
1702 NS_LOG_FUNCTION(
this);
1709 TypeId(
"ns3::SatSuperframeConf4")
1711 .AddConstructor<SatSuperframeConf4>()
1731 NS_LOG_FUNCTION(
this);
1738 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