satellite-bbframe-conf.h
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 #ifndef SATELLITE_BBFRAME_CONF_H
22 #define SATELLITE_BBFRAME_CONF_H
23 
24 #include "satellite-enums.h"
25 #include "satellite-link-results.h"
26 
27 #include <ns3/nstime.h>
28 #include <ns3/object.h>
29 #include <ns3/ptr.h>
30 #include <ns3/simple-ref-count.h>
31 
32 #include <map>
33 
34 namespace ns3
35 {
36 
37 class SatLinkResultsDvbS2;
38 
47 class SatDvbS2Waveform : public SimpleRefCount<SatDvbS2Waveform>
48 {
49  public:
54 
64  Time frameLen,
65  uint32_t payloadBits);
66 
72 
78 
83  uint32_t GetPayloadInBits() const;
84 
89  Time GetFrameDuration() const;
90 
96  void SetCNoRequirement(double cnoRequirement);
97 
102  double GetCNoRequirement() const;
103 
107  void Dump() const;
108 
109  private:
114 
119 
124 
128  uint32_t m_payloadBits;
129 
135 };
136 
144 class SatBbFrameConf : public Object
145 {
146  public:
150  SatBbFrameConf();
151 
156  SatBbFrameConf(double symbolRate, SatEnums::DvbVersion_t dvbVersion);
157 
161  virtual ~SatBbFrameConf();
162 
167  static TypeId GetTypeId(void);
168 
173  virtual TypeId GetInstanceTypeId(void) const;
174 
178  typedef std::map<std::pair<SatEnums::SatModcod_t, SatEnums::SatBbFrameType_t>,
179  Ptr<SatDvbS2Waveform>>
181 
187  inline uint32_t GetBbFrameHeaderSizeInBytes() const
188  {
190  }
191 
197  inline double GetBbFrameHighOccupancyThreshold() const
198  {
200  }
201 
207  inline double GetBbFrameLowOccupancyThreshold() const
208  {
210  }
211 
218  {
219  return m_bbFrameUsageMode;
220  }
221 
227  void InitializeCNoRequirements(Ptr<SatLinkResultsFwd> linkResults);
228 
234  Time GetDummyBbFrameDuration() const;
235 
243  SatEnums::SatBbFrameType_t frameType) const;
244 
250  double GetSymbolRate();
251 
258  SatEnums::SatBbFrameType_t frameType) const;
259 
267 
273 
279 
286 
290  void DumpWaveforms() const;
291 
298 
304  std::vector<SatEnums::SatModcod_t> GetModCodsUsed();
305 
306  private:
314  SatEnums::SatBbFrameType_t frameType) const;
315 
324  SatEnums::SatBbFrameType_t frameType) const;
325 
329  void GetModCodsList();
330 
334  double m_symbolRate;
335 
340 
345 
350 
355 
360 
365 
370 
375 
380  double m_targetBler;
381 
387 
392 
401 
415 
421  std::string m_defaultModCodStr;
422 
423  std::map<uint32_t, uint32_t> m_shortFramePayloadInSlots;
424  std::map<uint32_t, uint32_t> m_normalFramePayloadInSlots;
425 
430 
435 
440 
445 
450 
455 
459  std::vector<SatEnums::SatModcod_t> m_modCodsUsed;
460 
464  std::string m_modCodsUsedStr;
465 };
466 
467 } // namespace ns3
468 
469 #endif // SATELLITE_BBFRAME_CONF_H
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.
double GetBbFrameHighOccupancyThreshold() const
Get configured BB frame high occupancy threshold.
uint32_t GetBbFrameHeaderSizeInBytes() const
Get BB frame header size in bytes.
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.
double GetBbFrameLowOccupancyThreshold() const
Get configured BB frame low occupancy threshold.
std::map< uint32_t, uint32_t > m_shortFramePayloadInSlots
std::map< std::pair< SatEnums::SatModcod_t, SatEnums::SatBbFrameType_t >, Ptr< SatDvbS2Waveform > > waveformMap_t
Define type waveformMap_t.
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::BbFrameUsageMode_t GetBbFrameUsageMode() const
Get configured BB frame usage mode.
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.
This class implements the content of one individual DVB-S2 waveform.
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.
SatBbFrameType_t
BB frame type used in DVB-S2 FWD link.
SatModcod_t
Modulation scheme and coding rate for DVB-S2.
BbFrameUsageMode_t
BBFrame usage modes.
DvbVersion_t
The scheduling algorithm used to fill the BBFrames.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.