22 #include "ns3/applications-module.h"
23 #include "ns3/config-store-module.h"
24 #include "ns3/core-module.h"
25 #include "ns3/internet-module.h"
26 #include "ns3/network-module.h"
27 #include "ns3/satellite-module.h"
28 #include "ns3/traffic-module.h"
43 NS_LOG_COMPONENT_DEFINE(
"sat-rtn-system-test-example");
49 NS_LOG_INFO(
"RBDC request generated with " << value <<
" kbps");
56 NS_LOG_INFO(
"AVBDC request generated with " << value <<
" Bytes");
63 NS_LOG_INFO(
"VBDC request generated with " << value <<
" Bytes");
72 NS_LOG_INFO(
"" << value <<
" Bytes allocated within TBTP");
77 main(
int argc,
char* argv[])
80 uint32_t endUsersPerUt = 10;
81 uint32_t utsPerBeam = 10;
82 Time utAppStartTime = Seconds(0.1);
88 double simLength(30.0);
89 std::string preDefinedFrameConfig =
"Configuration_0";
90 uint32_t testCase = 0;
91 uint32_t trafficModel = 0;
93 LogComponentEnable(
"sat-rtn-system-test-example", LOG_LEVEL_INFO);
96 std::string simulationName =
"example-rtn-system-test";
97 auto simulationHelper = CreateObject<SimulationHelper>(simulationName);
105 Config::SetDefault(
"ns3::OnOffApplication::OnTime",
106 StringValue(
"ns3::ExponentialRandomVariable[Mean=1.0|Bound=0.0]"));
107 Config::SetDefault(
"ns3::OnOffApplication::OffTime",
108 StringValue(
"ns3::ExponentialRandomVariable[Mean=1.0|Bound=0.0]"));
111 std::string inputFileNameWithPath =
112 Singleton<SatEnvVariables>::Get()->LocateDirectory(
"contrib/satellite/examples") +
117 cmd.AddValue(
"testCase",
"Test case to execute", testCase);
118 cmd.AddValue(
"frameConf",
"Pre-defined super frame configuration", preDefinedFrameConfig);
119 cmd.AddValue(
"trafficModel",
"Traffic model to use (0 = CBR, 1 = OnOff)", trafficModel);
120 cmd.AddValue(
"simLength",
"Simulation length", simLength);
121 cmd.AddValue(
"beamId",
"Beam Id", beamId);
122 cmd.AddValue(
"utAppStartTime",
"Application (first) start time.", utAppStartTime);
123 simulationHelper->AddDefaultUiArguments(cmd, inputFileNameWithPath);
124 cmd.Parse(argc, argv);
126 Config::SetDefault(
"ns3::ConfigStore::Filename", StringValue(inputFileNameWithPath));
127 Config::SetDefault(
"ns3::ConfigStore::Mode", StringValue(
"Load"));
128 Config::SetDefault(
"ns3::ConfigStore::FileFormat", StringValue(
"Xml"));
129 ConfigStore inputFrameConfig;
130 inputFrameConfig.ConfigureDefaults();
133 Config::SetDefault(
"ns3::SatConf::SuperFrameConfForSeq0", StringValue(preDefinedFrameConfig));
136 Config::SetDefault(
"ns3::SatBeamScheduler::SuperFrameAllocatorType", StringValue(
"Default"));
143 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService0_ConstantAssignmentProvided",
145 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService0_ConstantServiceRate",
146 StringValue(
"ns3::ConstantRandomVariable[Constant=2]"));
147 Config::SetDefault(
"ns3::SatDefaultSuperframeAllocator::FcaEnabled", BooleanValue(
false));
153 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService0_ConstantAssignmentProvided",
155 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService0_ConstantServiceRate",
156 StringValue(
"ns3::ConstantRandomVariable[Constant=2]"));
157 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService3_VolumeAllowed",
159 Config::SetDefault(
"ns3::SatDefaultSuperframeAllocator::FcaEnabled", BooleanValue(
true));
163 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService0_ConstantAssignmentProvided",
165 Config::SetDefault(
"ns3::SatWaveformConf::AcmEnabled", BooleanValue(
true));
166 Config::SetDefault(
"ns3::SatBeamHelper::FadingModel", StringValue(
"FadingMarkov"));
170 Config::SetDefault(
"ns3::SatChannel::EnableExternalFadingInputTrace", BooleanValue(
true));
171 Config::SetDefault(
"ns3::SatFadingExternalInputTraceContainer::UtFwdDownIndexFileName",
172 StringValue(
"BeamId-1_256_UT_fading_fwddwn_trace_index.txt"));
173 Config::SetDefault(
"ns3::SatFadingExternalInputTraceContainer::UtRtnUpIndexFileName",
174 StringValue(
"BeamId-1_256_UT_fading_rtnup_trace_index.txt"));
186 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService0_ConstantAssignmentProvided",
187 BooleanValue(
false));
188 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService1_ConstantAssignmentProvided",
189 BooleanValue(
false));
190 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService2_ConstantAssignmentProvided",
191 BooleanValue(
false));
192 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService3_ConstantAssignmentProvided",
194 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService3_ConstantServiceRate",
195 StringValue(
"ns3::ConstantRandomVariable[Constant=100]"));
196 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService0_RbdcAllowed",
197 BooleanValue(
false));
198 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService1_RbdcAllowed",
199 BooleanValue(
false));
200 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService2_RbdcAllowed",
201 BooleanValue(
false));
202 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService3_RbdcAllowed",
203 BooleanValue(
false));
204 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService0_VolumeAllowed",
205 BooleanValue(
false));
206 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService1_VolumeAllowed",
207 BooleanValue(
false));
208 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService2_VolumeAllowed",
209 BooleanValue(
false));
210 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService3_VolumeAllowed",
211 BooleanValue(
false));
223 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService0_ConstantAssignmentProvided",
224 BooleanValue(
false));
225 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService0_ConstantServiceRate",
226 StringValue(
"ns3::ConstantRandomVariable[Constant=1]"));
227 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService1_ConstantAssignmentProvided",
228 BooleanValue(
false));
229 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService2_ConstantAssignmentProvided",
230 BooleanValue(
false));
231 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService3_ConstantAssignmentProvided",
232 BooleanValue(
false));
233 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService0_RbdcAllowed",
234 BooleanValue(
false));
235 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService1_RbdcAllowed",
236 BooleanValue(
false));
237 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService2_RbdcAllowed",
238 BooleanValue(
false));
239 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService3_RbdcAllowed",
241 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService0_VolumeAllowed",
242 BooleanValue(
false));
243 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService1_VolumeAllowed",
244 BooleanValue(
false));
245 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService2_VolumeAllowed",
246 BooleanValue(
false));
247 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService3_VolumeAllowed",
248 BooleanValue(
false));
259 Config::SetDefault(
"ns3::SatBeamHelper::RandomAccessModel",
273 Config::SetDefault(
"ns3::OnOffApplication::OffTime",
274 StringValue(
"ns3::ExponentialRandomVariable[Mean=1.0|Bound=0.0]"));
286 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService0_ConstantAssignmentProvided",
287 BooleanValue(
false));
288 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService0_ConstantServiceRate",
289 StringValue(
"ns3::ConstantRandomVariable[Constant=1]"));
290 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService1_ConstantAssignmentProvided",
291 BooleanValue(
false));
292 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService2_ConstantAssignmentProvided",
293 BooleanValue(
false));
294 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService3_ConstantAssignmentProvided",
295 BooleanValue(
false));
296 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService0_RbdcAllowed",
297 BooleanValue(
false));
298 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService1_RbdcAllowed",
299 BooleanValue(
false));
300 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService2_RbdcAllowed",
301 BooleanValue(
false));
302 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService3_RbdcAllowed",
303 BooleanValue(
false));
304 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService0_VolumeAllowed",
305 BooleanValue(
false));
306 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService1_VolumeAllowed",
307 BooleanValue(
false));
308 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService2_VolumeAllowed",
309 BooleanValue(
false));
310 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService3_VolumeAllowed",
322 Config::SetDefault(
"ns3::SatBeamHelper::RandomAccessModel",
336 Config::SetDefault(
"ns3::OnOffApplication::OffTime",
337 StringValue(
"ns3::ExponentialRandomVariable[Mean=10.0|Bound=0.0]"));
351 simulationHelper->SetUtCountPerBeam(utsPerBeam);
352 simulationHelper->SetUserCountPerUt(endUsersPerUt);
353 simulationHelper->SetBeamSet({beamId});
354 simulationHelper->SetSimulationTime(simLength);
357 simulationHelper->CreateSatScenario();
359 Config::ConnectWithoutContext(
"/NodeList/*/DeviceList/*/SatLlc/SatRequestManager/RbdcTrace",
362 Config::ConnectWithoutContext(
"/NodeList/*/DeviceList/*/SatLlc/SatRequestManager/VbdcTrace",
365 Config::ConnectWithoutContext(
"/NodeList/*/DeviceList/*/SatLlc/SatRequestManager/AvbdcTrace",
368 Config::ConnectWithoutContext(
"/NodeList/*/DeviceList/*/SatMac/DaResourcesTrace",
380 switch (trafficModel)
391 NS_FATAL_ERROR(
"Not Supported Traffic Model!");
395 simulationHelper->InstallTrafficModel(model,
399 Seconds(simLength + 1),
405 Ptr<SatStatsHelperContainer> s = simulationHelper->GetStatisticsContainer();
430 NS_LOG_INFO(
"--- sat-rtn-sys-test ---");
431 NS_LOG_INFO(
" Test case: " << testCase);
432 NS_LOG_INFO(
" Traffic model: " << trafficModel);
436 NS_LOG_INFO(
" Simulation length: " << simLength);
437 NS_LOG_INFO(
" Number of UTs: " << utsPerBeam);
438 NS_LOG_INFO(
" Number of end users per UT: " << endUsersPerUt);
453 simulationHelper->RunSimulation();
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.
static void AvbcdRcvdCb(uint32_t value)
static void TbtpResources(uint32_t value)
static void VbcdRcvdCb(uint32_t value)
static void RbcdRcvdCb(uint32_t value)