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"
42 NS_LOG_COMPONENT_DEFINE(
"sat-dama-sim-tn9");
45 main(
int argc,
char* argv[])
51 uint32_t endUsersPerUt(1);
52 uint32_t utsPerBeam(220);
54 uint32_t fadingConf(0);
57 uint32_t packetSize(1280);
58 double intervalSeconds = 0.64;
60 double simLength(300.0);
61 Time appStartTime = Seconds(0.1);
64 auto simulationHelper = CreateObject<SimulationHelper>(
"example-dama-sim-tn9");
65 Config::SetDefault(
"ns3::SatEnvVariables::EnableSimulationOutputOverwrite", BooleanValue(
true));
67 std::string inputFileNameWithPath =
68 Singleton<SatEnvVariables>::Get()->LocateDirectory(
"contrib/satellite/examples") +
69 "/tn9-dama-input-attributes.xml";
73 cmd.AddValue(
"simLength",
"Simulation duration in seconds", simLength);
74 cmd.AddValue(
"utsPerBeam",
"Number of UTs per spot-beam", utsPerBeam);
75 cmd.AddValue(
"nccConf",
"NCC configuration", nccConf);
76 cmd.AddValue(
"fadingConf",
"Fading configuration (0: Markov, 1: Rain)", fadingConf);
77 simulationHelper->AddDefaultUiArguments(cmd, inputFileNameWithPath);
78 cmd.Parse(argc, argv);
81 Config::SetDefault(
"ns3::ConfigStore::Filename", StringValue(inputFileNameWithPath));
82 Config::SetDefault(
"ns3::ConfigStore::Mode", StringValue(
"Load"));
83 Config::SetDefault(
"ns3::ConfigStore::FileFormat", StringValue(
"Xml"));
84 ConfigStore inputConfig;
85 inputConfig.ConfigureDefaults();
125 simulationHelper->SetUtCountPerBeam(utsPerBeam);
126 simulationHelper->SetUserCountPerUt(endUsersPerUt);
127 simulationHelper->SetSimulationTime(simLength);
128 simulationHelper->SetBeamSet({beamId});
131 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService3_ConstantAssignmentProvided",
132 BooleanValue(
false));
133 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService3_RbdcAllowed", BooleanValue(
true));
134 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService3_MinimumServiceRate",
136 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService3_VolumeAllowed",
137 BooleanValue(
false));
138 Config::SetDefault(
"ns3::SatBeamScheduler::ControlSlotsEnabled", BooleanValue(
true));
143 Config::SetDefault(
"ns3::SatSuperframeConf0::FrameConfigType", StringValue(
"ConfigType_0"));
144 Config::SetDefault(
"ns3::SatWaveformConf::AcmEnabled", BooleanValue(
false));
148 Config::SetDefault(
"ns3::SatSuperframeConf0::FrameConfigType", StringValue(
"ConfigType_1"));
149 Config::SetDefault(
"ns3::SatWaveformConf::AcmEnabled", BooleanValue(
true));
153 Config::SetDefault(
"ns3::SatSuperframeConf0::FrameConfigType", StringValue(
"ConfigType_2"));
154 Config::SetDefault(
"ns3::SatWaveformConf::AcmEnabled", BooleanValue(
true));
158 NS_FATAL_ERROR(
"Unsupported nccConf: " << nccConf);
176 Config::SetDefault(
"ns3::SatChannel::EnableExternalFadingInputTrace", BooleanValue(
true));
177 Config::SetDefault(
"ns3::SatFadingExternalInputTraceContainer::UtFwdDownIndexFileName",
178 StringValue(
"BeamId-1_256_UT_fading_fwddwn_trace_index.txt"));
179 Config::SetDefault(
"ns3::SatFadingExternalInputTraceContainer::UtRtnUpIndexFileName",
180 StringValue(
"BeamId-1_256_UT_fading_rtnup_trace_index.txt"));
185 NS_FATAL_ERROR(
"Unsupported fadingConf: " << fadingConf);
190 simulationHelper->LoadScenario(
"geo-33E");
193 simulationHelper->CreateSatScenario();
196 simulationHelper->GetTrafficHelper()->AddCbrTraffic(
199 Seconds(intervalSeconds),
201 NodeContainer(Singleton<SatTopology>::Get()->GetGwUserNode(0)),
202 Singleton<SatTopology>::Get()->GetUtUserNodes(),
210 Ptr<SatStatsHelperContainer> s = simulationHelper->GetStatisticsContainer();
233 NS_LOG_INFO(
"--- sat-dama-sim-tn9 ---");
234 NS_LOG_INFO(
" Packet size: " << packetSize);
235 NS_LOG_INFO(
" Simulation length: " << simLength);
236 NS_LOG_INFO(
" Number of UTs: " << utsPerBeam);
237 NS_LOG_INFO(
" Number of end users per UT: " << endUsersPerUt);
257 simulationHelper->RunSimulation();
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.