22 #include "ns3/applications-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"
43 NS_LOG_COMPONENT_DEFINE(
"sat-fwd-link-beam-hopping-example");
46 main(
int argc,
char* argv[])
48 uint32_t endUsersPerUt(1);
49 bool enableBeamHopping(
true);
50 Time simLength(Seconds(3.0));
53 std::string simulationName(
"sat-fwd-link-beam-hopping-example");
54 Ptr<SimulationHelper> simulationHelper = CreateObject<SimulationHelper>(simulationName);
58 cmd.AddValue(
"enableBeamHopping",
"Enable FWD link beam hopping", enableBeamHopping);
59 cmd.AddValue(
"simTime",
"Length of simulation", simLength);
60 cmd.AddValue(
"scaleDown",
61 "Scale down the bandwidth to see differences with less traffic",
63 simulationHelper->AddDefaultUiArguments(cmd);
64 cmd.Parse(argc, argv);
66 simulationHelper->SetDefaultValues();
67 simulationHelper->SetUserCountPerUt(endUsersPerUt);
68 if (enableBeamHopping)
69 simulationHelper->ConfigureFwdLinkBeamHopping();
72 Config::SetDefault(
"ns3::SatConf::FwdCarrierAllocatedBandwidth",
73 DoubleValue(enableBeamHopping ? 1e+08 : 2.5e+07));
75 simulationHelper->SetSimulationTime(simLength.GetSeconds());
78 simulationHelper->SetBeams(
"1 2 3 4 11 12 13 14 25 26 27 28 40 41");
79 std::map<uint32_t, uint32_t> utsInBeam = {{1, 30},
95 for (
const auto it : utsInBeam)
97 simulationHelper->SetUtCountPerBeam(it.first, it.second);
101 simulationHelper->CreateSatScenario();
104 Config::SetDefault(
"ns3::CbrApplication::Interval", TimeValue(MilliSeconds(1)));
105 Config::SetDefault(
"ns3::CbrApplication::PacketSize", UintegerValue(512));
113 auto stats = simulationHelper->GetStatisticsContainer();
120 simulationHelper->EnableProgressLogs();
121 simulationHelper->RunSimulation();
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.