satellite-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 SAT_CONF_H
22 #define SAT_CONF_H
23 
24 #include "ns3/geo-coordinate.h"
25 #include "ns3/object.h"
26 #include "ns3/satellite-channel.h"
27 #include "ns3/satellite-fwd-carrier-conf.h"
28 #include "ns3/satellite-superframe-sequence.h"
29 #include "ns3/uinteger.h"
30 
31 #include <fstream>
32 #include <set>
33 #include <vector>
34 
35 namespace ns3
36 {
37 
42 class SatConf : public Object
43 {
44  public:
48  SatConf();
49 
50  virtual ~SatConf()
51  {
52  }
53 
58  static TypeId GetTypeId(void);
59  TypeId GetInstanceTypeId(void) const;
60 
61  inline Ptr<SatSuperframeSeq> GetSuperframeSeq()
62  {
63  return m_superframeSeq;
64  }
65 
76  void Initialize(std::string rtnConf,
77  std::string fwdConf,
78  std::string gwPos,
79  std::string satPos,
80  std::string wfConf,
81  std::string tle,
82  bool isConstellation = false);
83 
88  std::ifstream* OpenFile(std::string filePathName) const;
89 
95  std::vector<std::vector<uint32_t>> LoadSatConf(std::string filePathName) const;
96 
102  uint32_t GetBeamCount() const;
103 
110  std::vector<uint32_t> GetBeamConfiguration(uint32_t beamId, SatEnums::SatLinkDir_t dir) const;
111 
115  uint32_t GetRtnLinkCarrierCount() const;
116 
122  uint32_t GetGwCount() const;
123 
129  uint32_t GetUtCount() const;
130 
136  uint32_t GetSatCount() const;
137 
145  GeoCoordinate GetGwPosition(uint32_t gwId) const;
146 
154  GeoCoordinate GetUtPosition(uint32_t utId) const;
155 
162 
168  std::string GetSatTle() const;
169 
179  uint32_t freqId,
180  uint32_t carrierId);
181 
191  uint32_t carrierId,
192  SatEnums::CarrierBandwidthType_t bandwidthType);
193 
197  uint32_t GetFwdLinkCarrierCount() const;
198 
204 
210 
214  void SetUtPositionInputFileName(std::string utPositionInputFileName);
215 
221  std::vector<std::string> LoadTles(std::string filePathName);
222 
229  std::vector<std::pair<uint32_t, uint32_t>> LoadIsls(std::string filePathName);
230 
234  static const uint32_t BEAM_ID_INDEX = 0;
235 
239  static const uint32_t U_FREQ_ID_INDEX = 1;
240 
244  static const uint32_t GW_ID_INDEX = 2;
245 
249  static const uint32_t F_FREQ_ID_INDEX = 3;
250  static const uint32_t BEAM_ELEM_COUNT = 4;
251 
252  private:
253  typedef std::vector<GeoCoordinate> PositionContainer_t;
254 
255  /*
256  * Columns:
257  * 1. Beam id
258  * 2. User frequency id
259  * 3. GW id
260  * 4. Feeder frequency id
261  */
262  std::vector<std::vector<uint32_t>> m_rtnConf;
263  std::vector<std::vector<uint32_t>> m_fwdConf;
264 
269 
273  uint32_t m_beamCount;
274 
279 
284 
289 
293  std::string m_tleSat;
294 
298  std::vector<std::string> m_tles;
299 
304 
311  Ptr<SatSuperframeSeq> m_superframeSeq;
312 
319  std::vector<Ptr<SatFwdCarrierConf>> m_forwardLinkCarrierConf;
320 
327  std::vector<Ptr<SatFwdCarrierConf>> m_returnLinkCarrierConf;
328 
333 
338 
343 
348 
353 
358 
363 
368 
378 
383 
388 
393 
398 
403 
408 
413 
418 
423 
431  double GetFwdLinkCarrierBandwidthHz(uint32_t carrierId,
432  SatEnums::CarrierBandwidthType_t bandwidthType) const;
433 
441  double GetRtnLinkCarrierBandwidthHz(uint32_t carrierId,
442  SatEnums::CarrierBandwidthType_t bandwidthType) const;
443 
448  void Configure(std::string wfConf);
449 
457  uint32_t GetSuperframeCarrierId(uint32_t carrierId, uint32_t* seqId);
458 
465  uint32_t GetGlobalCarrierId(uint32_t seqId, uint32_t carrierId);
466 
472  void LoadPositions(std::string filePathName, PositionContainer_t& container);
473 
479  void LoadTle(std::string filePathName, std::string& tleInfo);
480 };
481 
482 } // namespace ns3
483 
484 #endif /* SAT_CONF_H */
GeoCoordinate class is used to store and operate with geodetic coordinates.
A configuration class for the GEO satellite reference system.
uint32_t m_beamCount
Beam count.
std::string m_utPositionInputFileName
File to use when loading UT specific position (for user defined positions)
double GetCarrierBandwidthHz(SatEnums::ChannelType_t chType, uint32_t carrierId, SatEnums::CarrierBandwidthType_t bandwidthType)
Convert carrier id and sequence id to to bandwidth value.
std::string m_tleSat
TLE information of the Satellite.
std::vector< uint32_t > GetBeamConfiguration(uint32_t beamId, SatEnums::SatLinkDir_t dir) const
Get the configuration vector for a given satellite beam id.
uint32_t m_fwdFeederLinkChannelCount
GeoCoordinate GetUtPosition(uint32_t utId) const
Get the position of the GW for a given UT id.
TypeId GetInstanceTypeId(void) const
std::string GetSatTle() const
Get the TLE of the Satellite.
double m_rtnUserLinkBandwidthHz
Bandwidth of return user link.
uint32_t m_rtnFeederLinkChannelCount
uint32_t GetSatCount() const
Get count of the SATs (positions).
double m_fwdCarrierAllocatedBandwidthHz
The configured allocated bandwidth for forward link carriers.
uint32_t GetGlobalCarrierId(uint32_t seqId, uint32_t carrierId)
void Initialize(std::string rtnConf, std::string fwdConf, std::string gwPos, std::string satPos, std::string wfConf, std::string tle, bool isConstellation=false)
Initialize the configuration.
SatConf()
Default constructor.
uint32_t m_rtnUserLinkChannelCount
uint32_t GetSuperframeCarrierId(uint32_t carrierId, uint32_t *seqId)
PositionContainer_t m_utPositions
Geodetic positions of the UTs.
static const uint32_t GW_ID_INDEX
Definition for GW ID index (column) in m_conf.
double GetRtnLinkCarrierBandwidthHz(uint32_t carrierId, SatEnums::CarrierBandwidthType_t bandwidthType) const
Get bandwidth of the return link carrier.
uint32_t GetRtnLinkCarrierCount() const
std::vector< std::pair< uint32_t, uint32_t > > LoadIsls(std::string filePathName)
Load a vector of ISLs from a file.
double m_rtnCarrierSpacingFactor
The configured carrier spacing factor for return link carriers.
GeoCoordinate GetGeoSatPosition() const
Get the position of the Geo Satellite.
SatSuperframeConf::SuperFrameConfiguration_t m_SuperFrameConfForSeq0
The super frame configuration used for sequence 0.
double m_fwdFeederLinkFreqHz
Base frequency of forward feeder link.
std::vector< std::string > m_tles
TLE information for a satellite constellation.
std::vector< Ptr< SatFwdCarrierConf > > m_returnLinkCarrierConf
Return link carrier configuration for SCPC.
double m_fwdCarrierRollOffFactor
The configured carrier roll-off factor for forward link carriers.
std::ifstream * OpenFile(std::string filePathName) const
Try to open a file from a given path.
SatEnums::RegenerationMode_t GetForwardLinkRegenerationMode() const
Get the regeneration mode used in satellites for forward link.
PositionContainer_t m_geoSatPosition
Geodetic positions of the Geo Satellite.
double m_rtnFeederLinkFreqHz
Base frequency of return feeder link.
uint32_t GetBeamCount() const
Get count of the beams (configurations).
SatEnums::RegenerationMode_t m_returnLinkRegenerationMode
The regeneration mode used in satellites for return link.
static const uint32_t BEAM_ID_INDEX
Definition for beam ID index (column) in m_conf.
uint32_t GetGwCount() const
Get count of the GWs (positions).
double m_rtnCarrierAllocatedBandwidthHz
The configured allocated bandwidth for return link carriers.
double m_rtnCarrierRollOffFactor
The configured carrier roll-off factor for return link carriers.
std::vector< std::string > LoadTles(std::string filePathName)
Load a vector of TLE information from a file.
void Configure(std::string wfConf)
Configures itself with default values.
double m_rtnFeederLinkBandwidthHz
Bandwidth of return feeder link.
GeoCoordinate GetGwPosition(uint32_t gwId) const
Get the position of the GW for a given GW id.
double GetCarrierFrequencyHz(SatEnums::ChannelType_t chType, uint32_t freqId, uint32_t carrierId)
Convert carrier id, sequency id and frequency id to real frequency value.
double m_rtnUserLinkFreqHz
Base frequency of return user link.
double GetFwdLinkCarrierBandwidthHz(uint32_t carrierId, SatEnums::CarrierBandwidthType_t bandwidthType) const
Get bandwidth of the forward link carrier.
SatEnums::RegenerationMode_t m_forwardLinkRegenerationMode
The regeneration mode used in satellites for forward link.
static TypeId GetTypeId(void)
Get the type ID.
double m_fwdUserLinkBandwidthHz
Bandwidth of forward user link.
Ptr< SatSuperframeSeq > GetSuperframeSeq()
std::vector< std::vector< uint32_t > > m_fwdConf
double m_fwdFeederLinkBandwidthHz
Bandwidth of forward feeder link.
PositionContainer_t m_gwPositions
Geodetic positions of the GWs.
static const uint32_t U_FREQ_ID_INDEX
Definition for user frequency ID index (column) in m_conf.
std::vector< std::vector< uint32_t > > LoadSatConf(std::string filePathName) const
Load satellite configuration from a file.
double m_fwdUserLinkFreqHz
Base frequency of forward user link.
uint32_t GetFwdLinkCarrierCount() const
Ptr< SatSuperframeSeq > m_superframeSeq
Superframe sequence configuration.
virtual ~SatConf()
void LoadTle(std::string filePathName, std::string &tleInfo)
Load TLE information from a file.
std::vector< GeoCoordinate > PositionContainer_t
static const uint32_t BEAM_ELEM_COUNT
void LoadPositions(std::string filePathName, PositionContainer_t &container)
Load node positions from a file.
std::vector< std::vector< uint32_t > > m_rtnConf
SatEnums::RegenerationMode_t GetReturnLinkRegenerationMode() const
Get the regeneration mode used in satellites for return link.
double m_fwdCarrierSpacingFactor
The configured carrier spacing factor for forward link carriers.
static const uint32_t F_FREQ_ID_INDEX
Definition for feeder frequency ID index (column) in m_conf.
bool m_isConstellation
Indicates with this is a constellation of satellites.
void SetUtPositionInputFileName(std::string utPositionInputFileName)
Set the UT positions file name.
uint32_t GetUtCount() const
Get count of the UTs (positions).
std::vector< Ptr< SatFwdCarrierConf > > m_forwardLinkCarrierConf
Forward link carrier configuration.
uint32_t m_fwdUserLinkChannelCount
The number of the channels in different satellite links: forward user, return user,...
SatLinkDir_t
Link direction used for packet tracing.
ChannelType_t
Types of channel.
CarrierBandwidthType_t
Types of bandwidth.
RegenerationMode_t
The regeneration mode used in satellites.
SuperFrameConfiguration_t
Configurable Super Frames.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.