22 #include "ns3/config-store-module.h"
23 #include "ns3/core-module.h"
24 #include "ns3/internet-module.h"
25 #include "ns3/network-module.h"
26 #include "ns3/satellite-module.h"
27 #include "ns3/traffic-module.h"
41 NS_LOG_COMPONENT_DEFINE(
"sat-generic-launcher");
49 ChangeCno(
const std::vector<Ptr<SatUtPhy>>& utsPhysicalLayers)
54 for (
auto& phy : utsPhysicalLayers)
56 phy->SetAttribute(
"TxMaxPowerDbw", DoubleValue(
g_txMaxPower));
64 main(
int argc,
char* argv[])
66 bool varyingCno(
false);
67 uint32_t maxSubdivisions(0);
68 uint32_t frameConfigType(2);
69 double initialBandwidth(3.75e6);
70 Time superframeDuration(MicroSeconds(26500));
71 std::string inputFileNameWithPath =
72 Singleton<SatEnvVariables>::Get()->LocateDirectory(
"contrib/satellite/examples") +
73 "/generic-input-attributes.xml";
75 Ptr<SimulationHelper> simulationHelper = CreateObject<SimulationHelper>(
"generic-launcher");
76 simulationHelper->SetDefaultValues();
79 cmd.AddValue(
"MaxCarrierSubdivision",
80 "The maximum amount of subdivision for a single carrier",
82 cmd.AddValue(
"FrameConfigType",
83 "The frame configuration type used for super frame",
85 cmd.AddValue(
"UseVaryingCno",
86 "Simulate varying C/N0 for UTs instead of changing their traffic overtime",
88 simulationHelper->AddDefaultUiArguments(cmd, inputFileNameWithPath);
89 cmd.Parse(argc, argv);
91 Config::SetDefault(
"ns3::SimulationHelperConf::BeamsIDs", StringValue(
"12"));
92 Config::SetDefault(
"ns3::SimulationHelperConf::UtCountPerBeam",
93 StringValue(
"ns3::ConstantRandomVariable[Constant=30]"));
94 Config::SetDefault(
"ns3::SimulationHelperConf::UserCountPerUt",
95 StringValue(
"ns3::ConstantRandomVariable[Constant=1]"));
97 Config::SetDefault(
"ns3::SatSuperframeConf0::FrameCount", UintegerValue(1));
98 Config::SetDefault(
"ns3::SatSuperframeConf0::FrameConfigType",
99 StringValue(
"ConfigType_" + std::to_string(frameConfigType)));
100 Config::SetDefault(
"ns3::SatSuperframeConf0::MaxCarrierSubdivision",
101 UintegerValue(maxSubdivisions));
102 Config::SetDefault(
"ns3::SatSuperframeConf0::Frame0_AllocatedBandwidthHz",
103 DoubleValue(initialBandwidth));
104 Config::SetDefault(
"ns3::SatSuperframeConf0::Frame0_CarrierAllocatedBandwidthHz",
105 DoubleValue(initialBandwidth));
106 Config::SetDefault(
"ns3::SatSuperframeConf0::Frame0_CarrierRollOff", DoubleValue(0.2));
107 Config::SetDefault(
"ns3::SatSuperframeConf0::Frame0_CarrierSpacing", DoubleValue(0.0));
108 Config::SetDefault(
"ns3::SatSuperframeConf0::Frame0_RandomAccessFrame", BooleanValue(
false));
110 Config::SetDefault(
"ns3::SatSuperframeSeq::TargetDuration", TimeValue(superframeDuration));
111 Config::SetDefault(
"ns3::CbrApplication::Interval", TimeValue(superframeDuration));
113 Config::SetDefault(
"ns3::SatFwdLinkScheduler::CnoEstimationWindow",
114 TimeValue(MilliSeconds(500)));
115 Config::SetDefault(
"ns3::SatRequestManager::CnoReportInterval", TimeValue(
g_cnoInterval));
116 Config::SetDefault(
"ns3::SatBeamScheduler::CnoEstimationMode",
117 StringValue(
"MinimumValueInWindow"));
118 Config::SetDefault(
"ns3::SatBeamScheduler::CnoEstimationWindow", TimeValue(
g_cnoInterval));
120 Config::SetDefault(
"ns3::SatUtPhy::TxMaxPowerDbw", DoubleValue(
g_txMaxPower));
121 Config::SetDefault(
"ns3::SatGeoUserPhy::TxMaxPowerDbw", DoubleValue(15.0));
122 Config::SetDefault(
"ns3::SatGeoFeederPhy::FixedAmplificationGainDb", DoubleValue(200.0));
124 simulationHelper->ReadInputAttributesFromFile(inputFileNameWithPath);
127 Ptr<SimulationHelperConf> simulationConf = CreateObject<SimulationHelperConf>();
129 simulationHelper->SetBeams(simulationConf->m_enabledBeams);
130 simulationHelper->SetUtCountPerBeam(simulationConf->m_utCount);
131 simulationHelper->SetUserCountPerUt(simulationConf->m_utUserCount);
132 simulationHelper->SetUserCountPerMobileUt(simulationConf->m_utMobileUserCount);
134 simulationHelper->CreateSatScenario(
SatHelper::NONE, simulationConf->m_mobileUtsFolder);
135 if (simulationConf->m_activateProgressLogging)
137 simulationHelper->EnableProgressLogs();
140 simulationHelper->StoreAttributesToFile(
"parametersUsed.xml");
144 std::vector<Ptr<SatUtPhy>> utsPhysicalLayers;
145 NodeContainer utNodes = simulationHelper->GetSatelliteHelper()->UtNodes();
146 for (uint32_t i = 0; i < utNodes.GetN(); ++i)
148 Ptr<Node> node = utNodes.Get(i);
149 for (uint32_t j = 0; j < node->GetNDevices(); ++j)
151 Ptr<SatNetDevice> dev = DynamicCast<SatNetDevice>(node->GetDevice(j));
154 Ptr<SatUtPhy> phy = DynamicCast<SatUtPhy>(dev->GetPhy());
157 utsPhysicalLayers.push_back(phy);
162 Simulator::Schedule(Seconds(0), &
ChangeCno, utsPhysicalLayers);
175 Config::SetDefault(
"ns3::CbrApplication::PacketSize", UintegerValue(40));
184 Config::SetDefault(
"ns3::CbrApplication::PacketSize", UintegerValue(25600));
193 Config::SetDefault(
"ns3::CbrApplication::PacketSize", UintegerValue(1000));
202 Config::SetDefault(
"ns3::CbrApplication::PacketSize", UintegerValue(1000));
211 Config::SetDefault(
"ns3::CbrApplication::PacketSize", UintegerValue(40000));
220 Config::SetDefault(
"ns3::CbrApplication::PacketSize", UintegerValue(1));
229 Config::SetDefault(
"ns3::CbrApplication::PacketSize", UintegerValue(100));
238 Config::SetDefault(
"ns3::CbrApplication::PacketSize", UintegerValue(3000));
247 Config::SetDefault(
"ns3::CbrApplication::PacketSize", UintegerValue(40000));
256 Config::SetDefault(
"ns3::CbrApplication::PacketSize", UintegerValue(30000));
265 Config::SetDefault(
"ns3::CbrApplication::PacketSize", UintegerValue(1500));
274 Config::SetDefault(
"ns3::CbrApplication::PacketSize", UintegerValue(800));
284 if (simulationConf->m_activateStatistics)
286 simulationHelper->CreateDefaultStats();
287 Ptr<SatStatsHelperContainer> stats = simulationHelper->GetStatisticsContainer();
304 simulationHelper->RunSimulation();
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.
static Time g_simulationTime
static double g_txMaxPower
static Time g_cnoInterval
static void ChangeCno(const std::vector< Ptr< SatUtPhy >> &utsPhysicalLayers)