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"
41 NS_LOG_COMPONENT_DEFINE(
"sat-constellation-example");
44 main(
int argc,
char* argv[])
46 uint32_t packetSize = 512;
47 std::string interval =
"20ms";
48 std::string scenarioFolder =
"constellation-eutelsat-geo-2-sats-isls";
50 Ptr<SimulationHelper> simulationHelper =
51 CreateObject<SimulationHelper>(
"example-constellation");
55 cmd.AddValue(
"packetSize",
"Size of constant packet (bytes)", packetSize);
56 cmd.AddValue(
"interval",
"Interval to sent packets in seconds (e.g. (1s))", interval);
57 cmd.AddValue(
"scenarioFolder",
58 "Scenario folder (e.g. constellation-eutelsat-geo-2-sats-isls)",
60 simulationHelper->AddDefaultUiArguments(cmd);
61 cmd.Parse(argc, argv);
64 Config::SetDefault(
"ns3::SatConf::ForwardLinkRegenerationMode",
66 Config::SetDefault(
"ns3::SatConf::ReturnLinkRegenerationMode",
68 Config::SetDefault(
"ns3::SatOrbiterFeederPhy::QueueSize", UintegerValue(100000));
69 Config::SetDefault(
"ns3::SatOrbiterUserPhy::QueueSize", UintegerValue(100000));
72 Config::SetDefault(
"ns3::PointToPointIslHelper::IslDataRate",
73 DataRateValue(DataRate(
"100Mb/s")));
74 Config::SetDefault(
"ns3::SatSGP4MobilityModel::UpdatePositionEachRequest", BooleanValue(
false));
75 Config::SetDefault(
"ns3::SatSGP4MobilityModel::UpdatePositionPeriod", TimeValue(Seconds(1)));
76 Config::SetDefault(
"ns3::SatHelper::GwUsers", UintegerValue(3));
77 Config::SetDefault(
"ns3::SatGwMac::SendNcrBroadcast", BooleanValue(
false));
80 Config::SetDefault(
"ns3::SatHelper::BeamNetworkAddress", Ipv4AddressValue(
"20.1.0.0"));
81 Config::SetDefault(
"ns3::SatHelper::GwNetworkAddress", Ipv4AddressValue(
"10.1.0.0"));
82 Config::SetDefault(
"ns3::SatHelper::UtNetworkAddress", Ipv4AddressValue(
"250.1.0.0"));
85 Config::SetDefault(
"ns3::SatBbFrameConf::AcmEnabled", BooleanValue(
true));
88 Config::SetDefault(
"ns3::SatEnvVariables::EnableSimulationOutputOverwrite", BooleanValue(
true));
91 Config::SetDefault(
"ns3::SatHelper::PacketTraceEnabled", BooleanValue(
true));
93 simulationHelper->LoadScenario(scenarioFolder);
95 simulationHelper->SetSimulationTime(Seconds(30));
97 std::set<uint32_t> beamSetAll = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
98 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
99 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45,
100 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60,
101 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72};
103 std::set<uint32_t> beamSet = {43, 30};
105 std::set<uint32_t> beamSetTelesat = {1, 43, 60, 64};
108 if (scenarioFolder ==
"constellation-telesat-351-sats")
110 simulationHelper->SetBeamSet(beamSetTelesat);
114 simulationHelper->SetBeamSet(beamSet);
116 simulationHelper->SetUserCountPerUt(2);
118 LogComponentEnable(
"sat-constellation-example", LOG_LEVEL_INFO);
120 simulationHelper->CreateSatScenario();
122 Singleton<SatTopology>::Get()->PrintTopology(std::cout);
123 Singleton<SatIdMapper>::Get()->ShowIslMap();
125 Config::SetDefault(
"ns3::CbrApplication::Interval", StringValue(interval));
126 Config::SetDefault(
"ns3::CbrApplication::PacketSize", UintegerValue(packetSize));
128 Time startTime = Seconds(1.0);
129 Time stopTime = Seconds(29.0);
130 Time startDelay = Seconds(0.0);
132 NodeContainer gws = Singleton<SatTopology>::Get()->GetGwNodes();
133 NodeContainer uts = Singleton<SatTopology>::Get()->GetUtNodes();
134 NodeContainer gwUsers = Singleton<SatTopology>::Get()->GetGwUserNodes();
135 NodeContainer utUsers = Singleton<SatTopology>::Get()->GetUtUserNodes(uts);
139 Ptr<SatTrafficHelper> trafficHelper = simulationHelper->GetTrafficHelper();
161 NS_LOG_INFO(
"--- sat-constellation-example ---");
162 NS_LOG_INFO(
" PacketSize: " << packetSize);
163 NS_LOG_INFO(
" Interval: " << interval);
167 Config::SetDefault(
"ns3::ConfigStore::Filename", StringValue(
"output-attributes.xml"));
168 Config::SetDefault(
"ns3::ConfigStore::FileFormat", StringValue(
"Xml"));
169 Config::SetDefault(
"ns3::ConfigStore::Mode", StringValue(
"Save"));
170 ConfigStore outputConfig;
171 outputConfig.ConfigureDefaults();
173 Ptr<SatStatsHelperContainer> s = simulationHelper->GetStatisticsContainer();
279 simulationHelper->EnableProgressLogs();
280 simulationHelper->RunSimulation();
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.