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-mobility-example");
44 main(
int argc,
char* argv[])
47 LogComponentEnable(
"sat-mobility-example", LOG_LEVEL_INFO);
51 uint32_t endUsersPerUt(1);
52 uint32_t utsPerBeam(1);
54 uint32_t packetSize(100);
55 Time interval(Seconds(10.0));
57 std::string tleFileName(
"tle_iss_zarya.txt");
58 std::string startDate(
"2014-09-29 12:05:48");
59 bool updatePositionEachRequest(
false);
60 Time updatePositionPeriod(Seconds(1));
62 Time appStartTime = Seconds(0.1);
63 Time simLength(Seconds(7200.0));
65 Ptr<SimulationHelper> simulationHelper = CreateObject<SimulationHelper>(
"sat-mobility-example");
69 cmd.AddValue(
"PacketSize",
"UDP packet size (in bytes)", packetSize);
70 cmd.AddValue(
"Interval",
"CBR interval (in seconds, or add unit)", interval);
71 cmd.AddValue(
"SimLength",
"Simulation length (in seconds, or add unit)", simLength);
72 cmd.AddValue(
"TleFileName",
73 "Name of TLE file to load (path from data/tle folder)",
75 cmd.AddValue(
"StartDate",
76 "Simulation absolute UTC start time (format: YYYY-MM-DD hh:mm:ss)",
78 cmd.AddValue(
"UpdatePositionEachRequest",
79 "Enable position computation each time a packet is sent",
80 updatePositionEachRequest);
81 cmd.AddValue(
"UpdatePositionPeriod",
82 "Period of satellite position refresh, if not update on each request (in seconds, "
84 updatePositionPeriod);
85 simulationHelper->AddDefaultUiArguments(cmd);
86 cmd.Parse(argc, argv);
89 Config::SetDefault(
"ns3::SatEnvVariables::EnableSimulationOutputOverwrite", BooleanValue(
true));
90 Config::SetDefault(
"ns3::SatHelper::PacketTraceEnabled", BooleanValue(
true));
92 Config::SetDefault(
"ns3::SatAntennaGainPatternContainer::PatternsFolder",
93 StringValue(
"SatAntennaGain72BeamsShifted"));
95 Config::SetDefault(
"ns3::SatHelper::SatMobilitySGP4Enabled", BooleanValue(
true));
96 Config::SetDefault(
"ns3::SatHelper::SatMobilitySGP4TleFileName", StringValue(tleFileName));
97 Config::SetDefault(
"ns3::SatSGP4MobilityModel::StartDateStr", StringValue(startDate));
98 Config::SetDefault(
"ns3::SatSGP4MobilityModel::UpdatePositionEachRequest",
99 BooleanValue(updatePositionEachRequest));
100 Config::SetDefault(
"ns3::SatSGP4MobilityModel::UpdatePositionPeriod",
101 TimeValue(updatePositionPeriod));
103 simulationHelper->SetSimulationTime(simLength);
104 simulationHelper->SetUserCountPerUt(endUsersPerUt);
105 simulationHelper->SetUtCountPerBeam(utsPerBeam);
108 std::stringstream beamsEnabled;
109 beamsEnabled << beamId;
110 simulationHelper->SetBeams(beamsEnabled.str());
113 simulationHelper->CreateSatScenario();
116 Config::SetDefault(
"ns3::CbrApplication::Interval", TimeValue(interval));
117 Config::SetDefault(
"ns3::CbrApplication::PacketSize", UintegerValue(packetSize));
133 NS_LOG_INFO(
"--- sat-mobility-example ---");
134 NS_LOG_INFO(
" Packet size in bytes: " << packetSize);
135 NS_LOG_INFO(
" Packet sending interval: " << interval.GetSeconds());
136 NS_LOG_INFO(
" Simulation length: " << simLength.GetSeconds());
137 NS_LOG_INFO(
" Number of UTs: " << utsPerBeam);
138 NS_LOG_INFO(
" Number of end users per UT: " << endUsersPerUt);
142 Ptr<SatStatsHelperContainer> s = simulationHelper->GetStatisticsContainer();
143 simulationHelper->EnableProgressLogs();
145 Config::SetDefault(
"ns3::ConfigStore::Filename", StringValue(
"output-attributes.xml"));
146 Config::SetDefault(
"ns3::ConfigStore::FileFormat", StringValue(
"Xml"));
147 Config::SetDefault(
"ns3::ConfigStore::Mode", StringValue(
"Save"));
148 ConfigStore outputConfig;
149 outputConfig.ConfigureDefaults();
166 simulationHelper->RunSimulation();
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.