satellite-bbframe-conf.cc
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2013 Magister Solutions Ltd
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * Author: Jani Puttonen <jani.puttonen@magister.fi>
19  */
20 
21 #include "satellite-bbframe-conf.h"
22 
23 #include "satellite-utils.h"
24 
25 #include <ns3/boolean.h>
26 #include <ns3/double.h>
27 #include <ns3/enum.h>
28 #include <ns3/log.h>
29 #include <ns3/string.h>
30 #include <ns3/uinteger.h>
31 
32 #include <algorithm>
33 #include <iostream>
34 #include <limits>
35 #include <sstream>
36 #include <string>
37 #include <utility>
38 #include <vector>
39 
40 NS_LOG_COMPONENT_DEFINE("SatBbFrameConf");
41 
42 namespace ns3
43 {
44 
50 const uint32_t payloadConf[7][3] = {
51  {2, 360, 90},
52  {3, 240, 60},
53  {4, 180, 45},
54  {5, 144, 36},
55  {6, 120, 30},
56  {7, 102, 25},
57  {8, 90, 22},
58 };
59 
61  : m_modcod(SatEnums::SAT_MODCOD_QPSK_1_TO_2),
62  m_frameType(SatEnums::NORMAL_FRAME),
63  m_frameDuration(Seconds(0.0)),
64  m_payloadBits(0),
65  m_cnoRequirement(0.0)
66 {
67  NS_LOG_FUNCTION(this);
68  NS_ASSERT(false);
69 
73 }
74 
77  Time frameDur,
78  uint32_t payloadBits)
79  : m_modcod(modcod),
80  m_frameType(fType),
81  m_frameDuration(frameDur),
82  m_payloadBits(payloadBits),
83  m_cnoRequirement(0.0)
84 {
85 }
86 
89 {
90  NS_LOG_FUNCTION(this);
91  return m_modcod;
92 }
93 
96 {
97  NS_LOG_FUNCTION(this);
98  return m_frameType;
99 }
100 
101 uint32_t
103 {
104  NS_LOG_FUNCTION(this);
105  return m_payloadBits;
106 }
107 
108 Time
110 {
111  NS_LOG_FUNCTION(this);
112  return m_frameDuration;
113 }
114 
115 double
117 {
118  NS_LOG_FUNCTION(this);
119  return m_cnoRequirement;
120 }
121 
122 void
124 {
125  NS_LOG_FUNCTION(this << cnoRequirement);
126  m_cnoRequirement = cnoRequirement;
127 }
128 
129 void
131 {
132  NS_LOG_FUNCTION(this);
133 
134  std::cout << "Modcod, " << SatEnums::GetModcodTypeName(m_modcod) << ", frameType, "
135  << m_frameType << ", payloadBits, " << m_payloadBits << ", frameDuration, "
136  << m_frameDuration << ", cnoRequirement, " << m_cnoRequirement << std::endl;
137 }
138 
139 NS_OBJECT_ENSURE_REGISTERED(SatBbFrameConf);
140 
142  : m_symbolRate(100000000.0),
143  m_symbolsPerSlot(90),
144  m_pilotBlockInSymbols(0),
145  m_pilotBlockIntervalInSlots(36),
146  m_plHeaderInSlots(1),
147  m_dummyFrameInSlots(36),
148  m_bbFrameHeaderSizeInBytes(10),
149  m_bbFrameHighOccupancyThreshold(0.9),
150  m_bbFrameLowOccupancyThreshold(0.5),
151  m_targetBler(0.00001),
152  m_acmEnabled(false),
153  m_defaultModCodDummyFramesS2X(SatEnums::SAT_NONVALID_MODCOD),
154  m_defaultModCodDummyFramesS2XStr("QPSK_1_TO_4"),
155  m_defaultModCod(SatEnums::SAT_NONVALID_MODCOD),
156  m_defaultModCodStr("QPSK_1_TO_2"),
157  m_shortFramePayloadInSlots(),
158  m_normalFramePayloadInSlots(),
159  m_waveforms(),
160  m_bbFrameUsageMode(SatEnums::NORMAL_FRAMES),
161  m_mostRobustShortFrameModcod(SatEnums::SAT_NONVALID_MODCOD),
162  m_mostRobustNormalFrameModcod(SatEnums::SAT_NONVALID_MODCOD),
163  m_dvbVersion(SatEnums::DVB_S2),
164  m_bbFrameS2XPilots(true),
165  m_modCodsUsedStr("")
166 {
167  NS_LOG_FUNCTION(this);
168  NS_FATAL_ERROR("Default constructor not supported!!!");
169 }
170 
172  : m_symbolRate(symbolRate),
173  m_symbolsPerSlot(90),
174  m_pilotBlockInSymbols(0),
175  m_pilotBlockIntervalInSlots(36),
176  m_plHeaderInSlots(1),
177  m_dummyFrameInSlots(36),
178  m_bbFrameHeaderSizeInBytes(10),
179  m_bbFrameHighOccupancyThreshold(0.9),
180  m_bbFrameLowOccupancyThreshold(0.5),
181  m_targetBler(0.00001),
182  m_acmEnabled(false),
183  m_defaultModCodDummyFramesS2X(SatEnums::SAT_NONVALID_MODCOD),
184  m_defaultModCodDummyFramesS2XStr("QPSK_1_TO_4"),
185  m_defaultModCod(SatEnums::SAT_NONVALID_MODCOD),
186  m_defaultModCodStr("QPSK_1_TO_2"),
187  m_shortFramePayloadInSlots(),
188  m_normalFramePayloadInSlots(),
189  m_waveforms(),
190  m_bbFrameUsageMode(SatEnums::NORMAL_FRAMES),
191  m_mostRobustShortFrameModcod(SatEnums::SAT_NONVALID_MODCOD),
192  m_mostRobustNormalFrameModcod(SatEnums::SAT_NONVALID_MODCOD),
193  m_dvbVersion(dvbVersion),
194  m_bbFrameS2XPilots(true),
195  m_modCodsUsedStr("")
196 {
197  ObjectBase::ConstructSelf(AttributeConstructionList());
198 
199  // Initialize the payloads
200  for (uint32_t i = 0; i < 7; ++i)
201  {
202  m_normalFramePayloadInSlots.insert(std::make_pair(payloadConf[i][0], payloadConf[i][1]));
203  m_shortFramePayloadInSlots.insert(std::make_pair(payloadConf[i][0], payloadConf[i][2]));
204  }
205 
206  // Load custom MC list if specified or all MC if nothing in m_modCodsUsedStr is empty
207  m_modCodsUsed.clear();
208  GetModCodsList();
209 
210  switch (m_dvbVersion)
211  {
212  case SatEnums::DVB_S2:
214  break;
215  case SatEnums::DVB_S2X:
217  {
218  NS_FATAL_ERROR("Cannot use NORMAL_AND_SHORT_FRAMES with DVB-S2X ModCods");
219  }
220 
222  "SAT_MODCOD_S2X_" + m_defaultModCodStr + "_" +
223  (m_bbFrameUsageMode == SatEnums::NORMAL_FRAMES ? "NORMAL" : "SHORT") + "_" +
224  (m_bbFrameS2XPilots ? "PILOTS" : "NOPILOTS"));
225 
228  "_SHORT_" + (m_bbFrameS2XPilots ? "PILOTS" : "NOPILOTS"));
229 
230  break;
231  default:
232  NS_FATAL_ERROR("Unknown DVB version used");
233  }
234 
235  if (std::find(m_modCodsUsed.begin(), m_modCodsUsed.end(), m_defaultModCod) ==
236  m_modCodsUsed.end())
237  {
238  NS_FATAL_ERROR("Default ModCod (" + SatEnums::GetModcodTypeName(m_defaultModCod) +
239  ") is not in the list of used ModCods.");
240  }
241 
242  // Available frame types
243  std::vector<SatEnums::SatBbFrameType_t> frameTypes;
245 
246  uint32_t wfCount(1);
247  for (std::vector<SatEnums::SatModcod_t>::const_iterator mit = m_modCodsUsed.begin();
248  mit != m_modCodsUsed.end();
249  ++mit)
250  {
251  switch (m_dvbVersion)
252  {
253  case SatEnums::DVB_S2:
254  for (std::vector<SatEnums::SatBbFrameType_t>::const_iterator fit = frameTypes.begin();
255  fit != frameTypes.end();
256  ++fit)
257  {
258  // Calculate the payload
259  uint32_t pl = CalculateBbFramePayloadBits(*mit, *fit);
260 
261  // Calculate the frame length
262  Time len = CalculateBbFrameDuration(*mit, *fit);
263 
264  Ptr<SatDvbS2Waveform> wf = Create<SatDvbS2Waveform>(*mit, *fit, len, pl);
265  m_waveforms.insert(std::make_pair(std::make_pair(*mit, *fit), wf));
266  wfCount++;
267  }
268  break;
269  case SatEnums::DVB_S2X:
271  uint32_t pl = CalculateBbFramePayloadBits(*mit, fit);
272 
273  // Calculate the frame length
274  Time len = CalculateBbFrameDuration(*mit, fit);
275 
276  Ptr<SatDvbS2Waveform> wf = Create<SatDvbS2Waveform>(*mit, fit, len, pl);
277  m_waveforms.insert(std::make_pair(std::make_pair(*mit, fit), wf));
278  wfCount++;
279  break;
280  }
281  }
282 
283  /* Add waveform with Default Dummy Frames ModCod when using DVB-S2X.
284  * Added if not already in ModCods list.
285  */
287  std::find(m_modCodsUsed.begin(), m_modCodsUsed.end(), m_defaultModCodDummyFramesS2X) ==
288  m_modCodsUsed.end())
289  {
292  uint32_t pl = CalculateBbFramePayloadBits(mit, fit);
293 
294  // Calculate the frame length
295  Time len = CalculateBbFrameDuration(mit, fit);
296 
297  Ptr<SatDvbS2Waveform> wf = Create<SatDvbS2Waveform>(mit, fit, len, pl);
298  m_waveforms.insert(std::make_pair(std::make_pair(mit, fit), wf));
299  wfCount++;
300  }
301 
302  uint32_t payloadBitsForShortFrame = std::numeric_limits<uint32_t>::max();
303  uint32_t payloadBitsForNormalFrame = std::numeric_limits<uint32_t>::max();
304 
305  // find the waveform with the more robust MODCOD than previous one
306  for (waveformMap_t::const_reverse_iterator rit = m_waveforms.rbegin();
307  rit != m_waveforms.rend();
308  ++rit)
309  {
310  if (rit->second->GetBbFrameType() == SatEnums::SHORT_FRAME)
311  {
312  // The first waveform over the threshold
313  if (rit->second->GetPayloadInBits() < payloadBitsForShortFrame)
314  {
315  payloadBitsForShortFrame = rit->second->GetPayloadInBits();
316  m_mostRobustShortFrameModcod = rit->second->GetModcod();
317  }
318  }
319 
320  if (rit->second->GetBbFrameType() == SatEnums::NORMAL_FRAME)
321  {
322  // The first waveform over the threshold
323  if (rit->second->GetPayloadInBits() < payloadBitsForNormalFrame)
324  {
325  payloadBitsForNormalFrame = rit->second->GetPayloadInBits();
326  m_mostRobustNormalFrameModcod = rit->second->GetModcod();
327  }
328  }
329  }
330 
334  {
335  NS_FATAL_ERROR(
336  "The most robust MODCOD not found for short frames, BB frame configuration error???");
337  }
341  {
342  NS_FATAL_ERROR(
343  "The most robust MODCOD not found for normal frames, BB frame configuration error???");
344  }
345 
348  {
349  // currently is assumed that the most robust MODCODs are same for both short and normal
350  // frames
351  NS_FATAL_ERROR("The most robust MODCODs are different for short and normal frames!!!");
352  }
353 }
354 
355 TypeId
357 {
358  static TypeId tid =
359  TypeId("ns3::SatBbFrameConf")
360  .SetParent<Object>()
361  .AddAttribute("SymbolsPerSlot",
362  "Number of symbols per slot",
363  UintegerValue(90),
364  MakeUintegerAccessor(&SatBbFrameConf::m_symbolsPerSlot),
365  MakeUintegerChecker<uint32_t>())
366  .AddAttribute("PilotBlockInSymbols",
367  "Pilot block size in symbols",
368  UintegerValue(36),
369  MakeUintegerAccessor(&SatBbFrameConf::m_pilotBlockInSymbols),
370  MakeUintegerChecker<uint32_t>())
371  .AddAttribute("PilotBlockIntervalInSlots",
372  "Pilot block interval in slots",
373  UintegerValue(16),
374  MakeUintegerAccessor(&SatBbFrameConf::m_pilotBlockIntervalInSlots),
375  MakeUintegerChecker<uint32_t>())
376  .AddAttribute("PlHeaderInSlots",
377  "PL header size in slots",
378  UintegerValue(1),
379  MakeUintegerAccessor(&SatBbFrameConf::m_plHeaderInSlots),
380  MakeUintegerChecker<uint32_t>())
381  .AddAttribute("DummyFrameInSlots",
382  "Dummy frame size in slots",
383  UintegerValue(36),
384  MakeUintegerAccessor(&SatBbFrameConf::m_dummyFrameInSlots),
385  MakeUintegerChecker<uint32_t>())
386  .AddAttribute("TargetBLER",
387  "Block error rate target",
388  DoubleValue(0.00001),
389  MakeDoubleAccessor(&SatBbFrameConf::m_targetBler),
390  MakeDoubleChecker<double>())
391  .AddAttribute("AcmEnabled",
392  "Enable ACM",
393  BooleanValue(false),
394  MakeBooleanAccessor(&SatBbFrameConf::m_acmEnabled),
395  MakeBooleanChecker())
396  .AddAttribute("DefaultModCod",
397  "Default MODCOD",
398  StringValue("QPSK_1_TO_2"),
399  MakeStringAccessor(&SatBbFrameConf::m_defaultModCodStr),
400  MakeStringChecker())
401  .AddAttribute("DefaultModCodDummyFramesS2X",
402  "Default MODCOD for DVB-S2X Dummy Frames. In DVB-S2, Dummy Frames use "
403  "m_defaultModCod.",
404  StringValue("QPSK_1_TO_4"),
406  MakeStringChecker())
407  .AddAttribute("BbFrameHeaderInBytes",
408  "BB Frame header size in bytes",
409  UintegerValue(10), // ETSI EN 302 307 V1.3.1 specified 80 bits
410  MakeUintegerAccessor(&SatBbFrameConf::m_bbFrameHeaderSizeInBytes),
411  MakeUintegerChecker<uint32_t>())
412  .AddAttribute("BbFrameHighOccupancyThreshold",
413  "BB Frame high occupancy threshold [0-1]",
414  DoubleValue(0.9),
416  MakeDoubleChecker<double>(0.0, 1.0))
417  .AddAttribute("BbFrameLowOccupancyThreshold",
418  "BB Frame low occupancy threshold [0-1]",
419  DoubleValue(0.5),
421  MakeDoubleChecker<double>(0.0, 1.0))
422  .AddAttribute(
423  "BBFrameUsageMode",
424  "Mode for selecting used BB Frames.",
425  EnumValue(SatEnums::NORMAL_FRAMES),
426  MakeEnumAccessor<SatEnums::BbFrameUsageMode_t>(&SatBbFrameConf::m_bbFrameUsageMode),
427  MakeEnumChecker(SatEnums::SHORT_FRAMES,
428  "ShortFrames",
430  "NormalFrames",
432  "ShortAndNormalFrames"))
433  .AddAttribute("BBFramePilotsS2X",
434  "Use Pilots in DVB-S2X BB Frames.",
435  BooleanValue(true),
436  MakeBooleanAccessor(&SatBbFrameConf::m_bbFrameS2XPilots),
437  MakeBooleanChecker())
438  .AddAttribute("ModCodsUsed",
439  "List of DVB-S2X ModCods used. If nothing specified, all available "
440  "ModCods are used",
441  StringValue(""),
442  MakeStringAccessor(&SatBbFrameConf::m_modCodsUsedStr),
443  MakeStringChecker())
444  .AddConstructor<SatBbFrameConf>();
445  return tid;
446 }
447 
448 TypeId
450 {
451  return GetTypeId();
452 }
453 
455 {
456  NS_LOG_FUNCTION(this);
457 }
458 
459 void
460 SatBbFrameConf::InitializeCNoRequirements(Ptr<SatLinkResultsFwd> linkResults)
461 {
462  NS_LOG_FUNCTION(this);
463 
464  for (waveformMap_t::iterator it = m_waveforms.begin(); it != m_waveforms.end(); ++it)
465  {
471  double esnoRequirementDb =
472  linkResults->GetEsNoDb(it->second->GetModcod(), it->first.second, m_targetBler);
473 
479  it->second->SetCNoRequirement(SatUtils::DbToLinear(esnoRequirementDb) * m_symbolRate);
480  }
481 }
482 
483 void
485 {
486  NS_LOG_FUNCTION(this);
487 
488  for (waveformMap_t::const_iterator it = m_waveforms.begin(); it != m_waveforms.end(); ++it)
489  {
490  it->second->Dump();
491  }
492 }
493 
496 {
497  NS_LOG_FUNCTION(this);
498  return m_dvbVersion;
499 }
500 
501 std::vector<SatEnums::SatModcod_t>
503 {
504  NS_LOG_FUNCTION(this);
505  return m_modCodsUsed;
506 }
507 
508 uint32_t
510  SatEnums::SatBbFrameType_t frameType) const
511 {
512  NS_LOG_FUNCTION(this << modcod << frameType);
513 
514  uint32_t dataSlots(0);
515  uint32_t modulatedBits = SatUtils::GetModulatedBits(modcod);
516 
517  switch (frameType)
518  {
519  case SatEnums::SHORT_FRAME: {
520  dataSlots = m_shortFramePayloadInSlots.at(modulatedBits);
521  break;
522  }
523  case SatEnums::NORMAL_FRAME: {
524  dataSlots = m_normalFramePayloadInSlots.at(modulatedBits);
525  break;
526  }
527  default: {
528  NS_FATAL_ERROR("Unsupported enum SatBbFrameType_t!");
529  break;
530  }
531  }
532 
533  return (uint32_t)(dataSlots * m_symbolsPerSlot * modulatedBits *
534  SatUtils::GetCodingRate(modcod));
535 }
536 
537 Time
539  SatEnums::SatBbFrameType_t frameType) const
540 {
541  NS_LOG_FUNCTION(this << modcod << frameType);
542 
543  uint32_t dataSlots(0);
544  uint32_t modulatedBits = SatUtils::GetModulatedBits(modcod);
545 
546  switch (frameType)
547  {
548  case SatEnums::SHORT_FRAME: {
549  dataSlots = m_shortFramePayloadInSlots.at(modulatedBits);
550  break;
551  }
552  case SatEnums::NORMAL_FRAME: {
553  dataSlots = m_normalFramePayloadInSlots.at(modulatedBits);
554  break;
555  }
556  default: {
557  NS_FATAL_ERROR("Unsupported enum SatBbFrameType_t!");
558  break;
559  }
560  }
561 
562  uint32_t slots = dataSlots + m_plHeaderInSlots;
563  uint32_t dataSymbols = slots * m_symbolsPerSlot;
564  uint32_t pilotSlots = (uint32_t)(floor((double)slots / m_pilotBlockIntervalInSlots));
565  uint32_t pilotSymbols = pilotSlots * m_pilotBlockInSymbols;
566 
567  uint32_t totalSymbols = dataSymbols + pilotSymbols;
568  double frameLength = totalSymbols / m_symbolRate;
569 
570  return Seconds(frameLength);
571 }
572 
573 void
575 {
576  NS_LOG_FUNCTION(this);
577  m_modCodsUsed.clear();
578 
579  if (m_modCodsUsedStr.size() == 0)
580  {
581  switch (m_dvbVersion)
582  {
583  case SatEnums::DVB_S2:
585  return;
586  case SatEnums::DVB_S2X:
590  return;
591  default:
592  NS_FATAL_ERROR("Incorrect DVB version");
593  }
594  }
595 
596  std::stringstream strm(m_modCodsUsedStr);
597  std::string name;
598  std::string prefix;
599  std::string suffix;
600 
601  switch (m_dvbVersion)
602  {
603  case SatEnums::DVB_S2:
604  prefix = "SAT_MODCOD_";
605  suffix = "";
606  break;
607  case SatEnums::DVB_S2X:
608  prefix = "SAT_MODCOD_S2X_";
609  suffix = std::string("_") +
610  (m_bbFrameUsageMode == SatEnums::NORMAL_FRAMES ? "NORMAL" : "SHORT") + "_" +
611  (m_bbFrameS2XPilots ? "PILOTS" : "NOPILOTS");
612  break;
613  default:
614  NS_FATAL_ERROR("Incorrect DVB version");
615  }
616 
617  while (getline(strm, name, ' '))
618  {
619  SatEnums::SatModcod_t mc = SatEnums::GetModcodFromName(prefix + name + suffix);
620  m_modCodsUsed.push_back(mc);
621  }
622  std::sort(m_modCodsUsed.begin(), m_modCodsUsed.end());
623 }
624 
625 uint32_t
627  SatEnums::SatBbFrameType_t frameType) const
628 {
629  NS_LOG_FUNCTION(this << modcod << frameType);
630  return m_waveforms.at(std::make_pair(modcod, frameType))->GetPayloadInBits();
631 }
632 
633 double
635 {
636  NS_LOG_FUNCTION(this);
637  return m_symbolRate;
638 }
639 
640 Time
642  SatEnums::SatBbFrameType_t frameType) const
643 {
644  NS_LOG_FUNCTION(this << modcod << frameType);
645  return m_waveforms.at(std::make_pair(modcod, frameType))->GetFrameDuration();
646 }
647 
648 Time
650 {
651  NS_LOG_FUNCTION(this);
653 }
654 
657 {
658  NS_LOG_FUNCTION(this << frameType);
659 
660  // If ACM is disabled, return the default MODCOD
661  if (!m_acmEnabled)
662  {
663  return m_defaultModCod;
664  }
665 
666  // Return the waveform with best spectral efficiency
667  for (waveformMap_t::const_reverse_iterator rit = m_waveforms.rbegin();
668  rit != m_waveforms.rend();
669  ++rit)
670  {
671  if (rit->second->GetBbFrameType() == frameType)
672  {
673  double cnoReq = rit->second->GetCNoRequirement();
674  // The first waveform over the threshold
675  if (cnoReq <= cNo)
676  {
677  return rit->second->GetModcod();
678  }
679  }
680  }
681  return m_defaultModCod;
682 }
683 
686 {
687  NS_LOG_FUNCTION(this << frameType);
688 
690 
691  if (frameType == SatEnums::SHORT_FRAME)
692  {
693  mostRobustModcod = m_mostRobustShortFrameModcod;
694  }
695  else if (frameType == SatEnums::NORMAL_FRAME)
696  {
697  mostRobustModcod = m_mostRobustNormalFrameModcod;
698  }
699  else
700  {
701  NS_FATAL_ERROR("Not supported frame type!!!");
702  }
703 
704  return mostRobustModcod;
705 }
706 
709 {
710  NS_LOG_FUNCTION(this);
711  return m_defaultModCod;
712 }
713 
716 {
717  NS_LOG_FUNCTION(this);
719 }
720 
721 } // namespace ns3
This class implements the BB Frame configurations for DVB-S2.
SatEnums::BbFrameUsageMode_t m_bbFrameUsageMode
BBFrame usage mode.
double GetSymbolRate()
Symbol rate in baud.
uint32_t m_pilotBlockInSymbols
The size of the pilot block in symbols.
void GetModCodsList()
Get the list of ModCods from their string representation.
void DumpWaveforms() const
Dump waveform details for debugging purposes.
SatBbFrameConf()
Default constructor.
uint32_t m_symbolsPerSlot
The size of the (data) slot in symbols.
Time CalculateBbFrameDuration(SatEnums::SatModcod_t modcod, SatEnums::SatBbFrameType_t frameType) const
Calculate the BBFrame duration in Time.
double m_targetBler
Block error rate target for the waveforms.
void InitializeCNoRequirements(Ptr< SatLinkResultsFwd > linkResults)
Initialize the C/No requirements for a given BLER target.
virtual ~SatBbFrameConf()
Destructor for SatBbFrameConf.
double m_bbFrameLowOccupancyThreshold
The BB frame low occupancy threshold in range 0 - 1.
double m_bbFrameHighOccupancyThreshold
The BB frame high occupancy threshold in range 0 - 1.
std::map< uint32_t, uint32_t > m_normalFramePayloadInSlots
SatEnums::SatModcod_t m_defaultModCodDummyFramesS2X
Default MODCOD for DVB-S2X dummy Frames.
bool m_acmEnabled
Flag to indicate whether ACM is enabled or disabled.
static TypeId GetTypeId(void)
Get the type ID.
std::string m_defaultModCodStr
The string representation of default ModCod.
Time GetBbFrameDuration(SatEnums::SatModcod_t modcod, SatEnums::SatBbFrameType_t frameType) const
Get the BB frame frame duration.
std::vector< SatEnums::SatModcod_t > m_modCodsUsed
List of ModCods used.
bool m_bbFrameS2XPilots
Indicates if using pilots in BBFrames when DVB-S2X is chosen.
std::map< uint32_t, uint32_t > m_shortFramePayloadInSlots
uint32_t m_bbFrameHeaderSizeInBytes
The BB frame header size in bytes.
uint32_t m_plHeaderInSlots
The PL header size in slots.
SatEnums::SatModcod_t GetMostRobustModcod(SatEnums::SatBbFrameType_t frameType) const
Get the most robust MODCOD with a given BB frame type.
SatEnums::SatModcod_t m_mostRobustShortFrameModcod
The most robust MODCOD for short frame.
std::string m_defaultModCodDummyFramesS2XStr
String representation of default ModCod for DVB-S2X Dummy Frames.
virtual TypeId GetInstanceTypeId(void) const
Get the type ID of instance.
SatEnums::DvbVersion_t GetDvbVersion()
Indicates if using DVB-S2 or DVB-S2X.
SatEnums::DvbVersion_t m_dvbVersion
Indicates if using DVB-S2 or DVB-S2X.
uint32_t m_pilotBlockIntervalInSlots
Interval of pilot block in slots.
uint32_t GetBbFramePayloadBits(SatEnums::SatModcod_t modcod, SatEnums::SatBbFrameType_t frameType) const
Get the BB frame payload in bits.
Time GetDummyBbFrameDuration() const
Get the dummy frame duration in Time.
std::vector< SatEnums::SatModcod_t > GetModCodsUsed()
Get the list of ModCods used.
SatEnums::SatModcod_t GetDefaultModCod() const
Get the default MODCOD.
uint32_t CalculateBbFramePayloadBits(SatEnums::SatModcod_t modcod, SatEnums::SatBbFrameType_t frameType) const
Calculate the BBrame higher layer payload in bits.
SatEnums::SatModcod_t GetBestModcod(double cNo, SatEnums::SatBbFrameType_t frameType) const
Get the best MODCOD with a given BB frame type.
std::string m_modCodsUsedStr
String containing all DVB-S2X ModCods used.
waveformMap_t m_waveforms
Available "waveforms", i.e.
SatEnums::SatModcod_t m_defaultModCod
Default MODCOD is used.
SatEnums::SatModcod_t GetDefaultModCodDummyFramesS2X() const
Get the default MODCOD for short DVB-S2X frames.
SatEnums::SatModcod_t m_mostRobustNormalFrameModcod
The most robust MODCOD for long frame.
double m_symbolRate
Symbol rate in baud.
uint32_t m_dummyFrameInSlots
Dummy BBFrame length in slots.
SatDvbS2Waveform()
Default constructor for SatDvbS2Waveform.
uint32_t GetPayloadInBits() const
Get payload of this waveform in bits.
double m_cnoRequirement
C/No requirement calculated with a certain BLER target from the link results.
void SetCNoRequirement(double cnoRequirement)
Set the C/No requirement of the waveform in linear domain.
Time GetFrameDuration() const
Get the frame duration in Time.
SatEnums::SatModcod_t m_modcod
MODCOD.
uint32_t m_payloadBits
Payload in bits.
void Dump() const
Dump the contents of the waveform.
SatEnums::SatBbFrameType_t m_frameType
Frame type: short, normal.
double GetCNoRequirement() const
Get C/No requirement corresponding a given BLER target.
Time m_frameDuration
Frame duration in Time.
SatEnums::SatModcod_t GetModcod() const
Get MODCOD of this waveform.
SatEnums::SatBbFrameType_t GetBbFrameType() const
Get BB frame type.
SatEnums class is for simplifying the use of enumerators in the satellite module.
static SatModcod_t GetModcodFromName(const std::string name)
static void GetAvailableBbFrameTypes(std::vector< SatBbFrameType_t > &frameTypes)
SatBbFrameType_t
BB frame type used in DVB-S2 FWD link.
SatModcod_t
Modulation scheme and coding rate for DVB-S2.
static void GetAvailableModcodsFwdLinkS2X(std::vector< SatModcod_t > &modcods, SatEnums::BbFrameUsageMode_t type, bool pilots)
static std::string GetModcodTypeName(SatModcod_t modcod)
@ SHORT_AND_NORMAL_FRAMES
SHORT_AND_NORMAL_FRAMES.
@ SHORT_FRAMES
SHORT_FRAMES.
@ NORMAL_FRAMES
NORMAL_FRAMES.
DvbVersion_t
The scheduling algorithm used to fill the BBFrames.
static void GetAvailableModcodsFwdLink(std::vector< SatModcod_t > &modcods)
static SatEnums::SatBbFrameType_t GetFrameTypeS2X(SatEnums::SatModcod_t modcod)
static T DbToLinear(T db)
Converts decibels to linear.
static uint32_t GetModulatedBits(SatEnums::SatModcod_t modcod)
Get the modulated bits of a certain MODCOD.
static double GetCodingRate(SatEnums::SatModcod_t modcod)
Gets the coding rate of a certain MODCOD.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.
const uint32_t payloadConf[7][3]
1st col = modulated bits 2nd col = payload slots per normal frame 3rnd col = payload slots per short ...