25 #include <ns3/boolean.h>
26 #include <ns3/double.h>
29 #include <ns3/nstime.h>
30 #include <ns3/simulator.h>
31 #include <ns3/string.h>
35 NS_LOG_COMPONENT_DEFINE(
"SatBstpController");
40 NS_OBJECT_ENSURE_REGISTERED(SatBstpController);
45 m_configFileName(
"SatBstpConf.txt"),
46 m_superFrameDuration(MilliSeconds(100)),
49 NS_LOG_FUNCTION(
this);
51 ObjectBase::ConstructSelf(AttributeConstructionList());
59 NS_FATAL_ERROR(
"Beam hopping supports currently only STATIC mode!");
71 NS_LOG_FUNCTION(
this);
85 TypeId(
"ns3::SatBstpController")
87 .AddConstructor<SatBstpController>()
88 .AddAttribute(
"BeamHoppingMode",
96 .AddAttribute(
"StaticBeamHoppingConfigFileName",
97 "Configuration file name for static beam hopping.",
98 StringValue(
"SatBstpConf_GW1.txt"),
101 .AddAttribute(
"SuperframeDuration",
102 "Superframe duration in Time.",
103 TimeValue(MilliSeconds(10)),
112 NS_LOG_FUNCTION(
this);
120 NS_LOG_FUNCTION(
this);
125 it->second.Nullify();
134 uint32_t feederFreqId,
138 NS_LOG_FUNCTION(
this << beamId << userFreqId << feederFreqId << gwId);
145 NS_LOG_INFO(
"Add beam: " << beamId <<
", userFreqId: " << userFreqId
146 <<
", feederFreqId: " << feederFreqId <<
", gwId: " << gwId);
150 m_staticBstp->AddEnabledBeamInfo(beamId, userFreqId, feederFreqId, gwId);
159 NS_LOG_FUNCTION(
this);
161 uint32_t validityInSuperframes(1);
166 std::vector<uint32_t> nextConf =
m_staticBstp->GetNextConf();
169 validityInSuperframes = nextConf.front();
176 uint32_t beamId = (*it).first;
183 if (std::find(nextConf.begin() + 1, nextConf.end(), beamId) != nextConf.end())
195 NS_FATAL_ERROR(
"Dynamic beam switching time plan not yet supported!");
SatBstpController class is responsible of enabling and disabling configurable spot-beams defined by a...
BeamHoppingType_t m_bhMode
virtual ~SatBstpController()
Destructor for SatRequestManager.
static TypeId GetTypeId(void)
inherited from Object
virtual TypeId GetInstanceTypeId(void) const
Get the type ID of instance.
CallbackContainer_t m_gwNdCallbacks
SatBstpController()
Default constructor.
void Initialize()
Initialize the beam hopping configurations.
std::string m_configFileName
Ptr< SatStaticBstp > m_staticBstp
Beam switching time plan.
void AddNetDeviceCallback(uint32_t beamId, uint32_t userFreqId, uint32_t feederFreqId, uint32_t gwId, SatBstpController::ToggleCallback cb)
Add a callback to the SatNetDevice of GW matching to a certain beam id.
virtual void DoDispose()
Dispose of this class instance.
Callback< void, bool > ToggleCallback
Callback to fetch queue statistics.
void DoBstpConfiguration()
Periodical method to enable/disable certain beam ids related to the scheduling and transmission of BB...
Time m_superFrameDuration
Superframe duration in Time.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.