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 <stdint.h>
34 #include <string>
35 #include <utility>
36 #include <vector>
37 
38 namespace ns3
39 {
40 
45 class SatConf : public Object
46 {
47  public:
51  SatConf();
52 
53  virtual ~SatConf()
54  {
55  }
56 
61  static TypeId GetTypeId(void);
62  TypeId GetInstanceTypeId(void) const;
63 
64  inline Ptr<SatSuperframeSeq> GetSuperframeSeq()
65  {
66  return m_superframeSeq;
67  }
68 
79  void Initialize(std::string rtnConf,
80  std::string fwdConf,
81  std::string gwPos,
82  std::string satPos,
83  std::string utPos,
84  std::string wfConf,
85  bool isConstellation = false);
86 
91  std::ifstream* OpenFile(std::string filePathName) const;
92 
98  std::vector<std::vector<uint32_t>> LoadSatConf(std::string filePathName) const;
99 
104  void SetUtPositionsPath(std::string inputFileUtListPositions);
105 
111  uint32_t GetBeamCount() const;
112 
119  std::vector<uint32_t> GetBeamConfiguration(uint32_t beamId, SatEnums::SatLinkDir_t dir) const;
120 
124  uint32_t GetRtnLinkCarrierCount() const;
125 
131  uint32_t GetGwCount() const;
132 
138  uint32_t GetUtCount() const;
139 
145  uint32_t GetSatCount() const;
146 
154  GeoCoordinate GetGwPosition(uint32_t gwId) const;
155 
163  GeoCoordinate GetUtPosition(uint32_t utId) const;
164 
171 
177  std::string GetStartTimeStr() const;
178 
188  uint32_t freqId,
189  uint32_t carrierId);
190 
200  uint32_t carrierId,
201  SatEnums::CarrierBandwidthType_t bandwidthType);
202 
206  uint32_t GetFwdLinkCarrierCount() const;
207 
214  std::vector<std::string> LoadTles(std::string filePathName, std::string startDatePathName);
215 
222  std::vector<std::pair<uint32_t, uint32_t>> LoadIsls(std::string filePathName);
223 
227  static const uint32_t BEAM_ID_INDEX = 0;
228 
232  static const uint32_t U_FREQ_ID_INDEX = 1;
233 
237  static const uint32_t GW_ID_INDEX = 2;
238 
242  static const uint32_t F_FREQ_ID_INDEX = 3;
243  static const uint32_t BEAM_ELEM_COUNT = 4;
244 
245  private:
246  typedef std::vector<GeoCoordinate> PositionContainer_t;
247 
248  /*
249  * Columns:
250  * 1. Beam id
251  * 2. User frequency id
252  * 3. GW id
253  * 4. Feeder frequency id
254  */
255  std::vector<std::vector<uint32_t>> m_rtnConf;
256  std::vector<std::vector<uint32_t>> m_fwdConf;
257 
262 
266  uint32_t m_beamCount;
267 
272 
277 
282 
286  std::vector<std::string> m_tles;
287 
291  std::string m_startTimeStr;
292 
299  Ptr<SatSuperframeSeq> m_superframeSeq;
300 
307  std::vector<Ptr<SatFwdCarrierConf>> m_forwardLinkCarrierConf;
308 
315  std::vector<Ptr<SatFwdCarrierConf>> m_returnLinkCarrierConf;
316 
321 
326 
331 
336 
341 
346 
351 
356 
366 
371 
376 
381 
386 
391 
396 
401 
406 
411 
419  double GetFwdLinkCarrierBandwidthHz(uint32_t carrierId,
420  SatEnums::CarrierBandwidthType_t bandwidthType) const;
421 
429  double GetRtnLinkCarrierBandwidthHz(uint32_t carrierId,
430  SatEnums::CarrierBandwidthType_t bandwidthType) const;
431 
436  void Configure(std::string wfConf);
437 
445  uint32_t GetSuperframeCarrierId(uint32_t carrierId, uint32_t* seqId);
446 
453  uint32_t GetGlobalCarrierId(uint32_t seqId, uint32_t carrierId);
454 
460  void LoadPositions(std::string filePathName, PositionContainer_t& container);
461 };
462 
463 } // namespace ns3
464 
465 #endif /* SAT_CONF_H */
GeoCoordinate class is used to store and operate with geodetic coordinates.
A configuration class for the satellite reference system.
uint32_t m_beamCount
Beam count.
double GetCarrierBandwidthHz(SatEnums::ChannelType_t chType, uint32_t carrierId, SatEnums::CarrierBandwidthType_t bandwidthType)
Convert carrier id and sequence id to to bandwidth value.
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
double m_rtnUserLinkBandwidthHz
Bandwidth of return user link.
uint32_t m_rtnFeederLinkChannelCount
uint32_t GetSatCount() const
Get count of the SATs (positions).
void Initialize(std::string rtnConf, std::string fwdConf, std::string gwPos, std::string satPos, std::string utPos, std::string wfConf, bool isConstellation=false)
Initialize the configuration.
double m_fwdCarrierAllocatedBandwidthHz
The configured allocated bandwidth for forward link carriers.
uint32_t GetGlobalCarrierId(uint32_t seqId, uint32_t carrierId)
SatConf()
Default constructor.
uint32_t m_rtnUserLinkChannelCount
std::string GetStartTimeStr() const
Get the simulation start time for scenarios using SGP4 model.
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.
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.
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::string m_startTimeStr
Start time of simulation, on format "YYYY-MM-DD hh:mm:ss".
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.
GeoCoordinate GetSatPosition() const
Get the position of the Satellite.
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()
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
PositionContainer_t m_satPosition
Geodetic positions of the Satellite.
std::vector< std::string > LoadTles(std::string filePathName, std::string startDatePathName)
Load a vector of TLE information from a file.
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.
void SetUtPositionsPath(std::string inputFileUtListPositions)
Update the list of positions.
bool m_isConstellation
Indicates with this is a constellation of satellites.
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.