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);
102 std::string onPattern =
"ns3::ExponentialRandomVariable[Mean=1.0|Bound=0.0]";
103 std::string offPattern =
"ns3::ExponentialRandomVariable[Mean=1.0|Bound=0.0]";
106 std::string inputFileNameWithPath =
107 Singleton<SatEnvVariables>::Get()->LocateDirectory(
"contrib/satellite/examples") +
112 cmd.AddValue(
"testCase",
"Test case to execute", testCase);
113 cmd.AddValue(
"frameConf",
"Pre-defined super frame configuration", preDefinedFrameConfig);
114 cmd.AddValue(
"trafficModel",
"Traffic model to use (0 = CBR, 1 = OnOff)", trafficModel);
115 cmd.AddValue(
"simLength",
"Simulation length", simLength);
116 cmd.AddValue(
"beamId",
"Beam Id", beamId);
117 cmd.AddValue(
"utAppStartTime",
"Application (first) start time.", utAppStartTime);
118 simulationHelper->AddDefaultUiArguments(cmd, inputFileNameWithPath);
119 cmd.Parse(argc, argv);
121 Config::SetDefault(
"ns3::ConfigStore::Filename", StringValue(inputFileNameWithPath));
122 Config::SetDefault(
"ns3::ConfigStore::Mode", StringValue(
"Load"));
123 Config::SetDefault(
"ns3::ConfigStore::FileFormat", StringValue(
"Xml"));
124 ConfigStore inputFrameConfig;
125 inputFrameConfig.ConfigureDefaults();
128 Config::SetDefault(
"ns3::SatConf::SuperFrameConfForSeq0", StringValue(preDefinedFrameConfig));
131 Config::SetDefault(
"ns3::SatBeamScheduler::SuperFrameAllocatorType", StringValue(
"Default"));
138 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService0_ConstantAssignmentProvided",
140 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService0_ConstantServiceRate",
141 StringValue(
"ns3::ConstantRandomVariable[Constant=2]"));
142 Config::SetDefault(
"ns3::SatDefaultSuperframeAllocator::FcaEnabled", BooleanValue(
false));
148 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService0_ConstantAssignmentProvided",
150 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService0_ConstantServiceRate",
151 StringValue(
"ns3::ConstantRandomVariable[Constant=2]"));
152 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService3_VolumeAllowed",
154 Config::SetDefault(
"ns3::SatDefaultSuperframeAllocator::FcaEnabled", BooleanValue(
true));
158 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService0_ConstantAssignmentProvided",
160 Config::SetDefault(
"ns3::SatWaveformConf::AcmEnabled", BooleanValue(
true));
161 Config::SetDefault(
"ns3::SatBeamHelper::FadingModel", StringValue(
"FadingMarkov"));
165 Config::SetDefault(
"ns3::SatChannel::EnableExternalFadingInputTrace", BooleanValue(
true));
166 Config::SetDefault(
"ns3::SatFadingExternalInputTraceContainer::UtFwdDownIndexFileName",
167 StringValue(
"BeamId-1_256_UT_fading_fwddwn_trace_index.txt"));
168 Config::SetDefault(
"ns3::SatFadingExternalInputTraceContainer::UtRtnUpIndexFileName",
169 StringValue(
"BeamId-1_256_UT_fading_rtnup_trace_index.txt"));
181 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService0_ConstantAssignmentProvided",
182 BooleanValue(
false));
183 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService1_ConstantAssignmentProvided",
184 BooleanValue(
false));
185 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService2_ConstantAssignmentProvided",
186 BooleanValue(
false));
187 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService3_ConstantAssignmentProvided",
189 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService3_ConstantServiceRate",
190 StringValue(
"ns3::ConstantRandomVariable[Constant=100]"));
191 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService0_RbdcAllowed",
192 BooleanValue(
false));
193 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService1_RbdcAllowed",
194 BooleanValue(
false));
195 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService2_RbdcAllowed",
196 BooleanValue(
false));
197 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService3_RbdcAllowed",
198 BooleanValue(
false));
199 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService0_VolumeAllowed",
200 BooleanValue(
false));
201 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService1_VolumeAllowed",
202 BooleanValue(
false));
203 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService2_VolumeAllowed",
204 BooleanValue(
false));
205 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService3_VolumeAllowed",
206 BooleanValue(
false));
218 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService0_ConstantAssignmentProvided",
219 BooleanValue(
false));
220 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService0_ConstantServiceRate",
221 StringValue(
"ns3::ConstantRandomVariable[Constant=1]"));
222 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService1_ConstantAssignmentProvided",
223 BooleanValue(
false));
224 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService2_ConstantAssignmentProvided",
225 BooleanValue(
false));
226 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService3_ConstantAssignmentProvided",
227 BooleanValue(
false));
228 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService0_RbdcAllowed",
229 BooleanValue(
false));
230 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService1_RbdcAllowed",
231 BooleanValue(
false));
232 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService2_RbdcAllowed",
233 BooleanValue(
false));
234 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService3_RbdcAllowed",
236 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService0_VolumeAllowed",
237 BooleanValue(
false));
238 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService1_VolumeAllowed",
239 BooleanValue(
false));
240 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService2_VolumeAllowed",
241 BooleanValue(
false));
242 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService3_VolumeAllowed",
243 BooleanValue(
false));
254 Config::SetDefault(
"ns3::SatBeamHelper::RandomAccessModel",
268 offPattern =
"ns3::ExponentialRandomVariable[Mean=1.0|Bound=0.0]";
280 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService0_ConstantAssignmentProvided",
281 BooleanValue(
false));
282 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService0_ConstantServiceRate",
283 StringValue(
"ns3::ConstantRandomVariable[Constant=1]"));
284 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService1_ConstantAssignmentProvided",
285 BooleanValue(
false));
286 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService2_ConstantAssignmentProvided",
287 BooleanValue(
false));
288 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService3_ConstantAssignmentProvided",
289 BooleanValue(
false));
290 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService0_RbdcAllowed",
291 BooleanValue(
false));
292 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService1_RbdcAllowed",
293 BooleanValue(
false));
294 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService2_RbdcAllowed",
295 BooleanValue(
false));
296 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService3_RbdcAllowed",
297 BooleanValue(
false));
298 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService0_VolumeAllowed",
299 BooleanValue(
false));
300 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService1_VolumeAllowed",
301 BooleanValue(
false));
302 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService2_VolumeAllowed",
303 BooleanValue(
false));
304 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService3_VolumeAllowed",
316 Config::SetDefault(
"ns3::SatBeamHelper::RandomAccessModel",
330 offPattern =
"ns3::ExponentialRandomVariable[Mean=10.0|Bound=0.0]";
344 simulationHelper->SetUtCountPerBeam(utsPerBeam);
345 simulationHelper->SetUserCountPerUt(endUsersPerUt);
346 simulationHelper->SetBeamSet({beamId});
347 simulationHelper->SetSimulationTime(simLength);
349 simulationHelper->LoadScenario(
"geo-33E");
352 simulationHelper->CreateSatScenario();
354 Config::ConnectWithoutContext(
"/NodeList/*/DeviceList/*/SatLlc/SatRequestManager/RbdcTrace",
357 Config::ConnectWithoutContext(
"/NodeList/*/DeviceList/*/SatLlc/SatRequestManager/VbdcTrace",
360 Config::ConnectWithoutContext(
"/NodeList/*/DeviceList/*/SatLlc/SatRequestManager/AvbdcTrace",
363 Config::ConnectWithoutContext(
"/NodeList/*/DeviceList/*/SatMac/DaResourcesTrace",
373 switch (trafficModel)
377 simulationHelper->GetTrafficHelper()->AddCbrTraffic(
382 NodeContainer(Singleton<SatTopology>::Get()->GetGwUserNode(0)),
383 Singleton<SatTopology>::Get()->GetUtUserNodes(),
385 Seconds(simLength + 1),
391 simulationHelper->GetTrafficHelper()->AddOnOffTraffic(
396 NodeContainer(Singleton<SatTopology>::Get()->GetGwUserNode(0)),
397 Singleton<SatTopology>::Get()->GetUtUserNodes(),
401 Seconds(simLength + 1),
406 NS_FATAL_ERROR(
"Not Supported Traffic Model!");
413 Ptr<SatStatsHelperContainer> s = simulationHelper->GetStatisticsContainer();
438 NS_LOG_INFO(
"--- sat-rtn-sys-test ---");
439 NS_LOG_INFO(
" Test case: " << testCase);
440 NS_LOG_INFO(
" Traffic model: " << trafficModel);
444 NS_LOG_INFO(
" Simulation length: " << simLength);
445 NS_LOG_INFO(
" Number of UTs: " << utsPerBeam);
446 NS_LOG_INFO(
" Number of end users per UT: " << endUsersPerUt);
461 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)