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"
64 NS_LOG_COMPONENT_DEFINE(
"sat-group-example");
79 s->AddPerBeamFwdAppDelay(outputType);
81 s->AddPerGroupFwdAppDelay(outputType);
82 s->AddPerGroupRtnAppDelay(outputType);
84 s->AddPerGroupFwdDevDelay(outputType);
85 s->AddPerGroupRtnDevDelay(outputType);
86 s->AddPerGroupFwdMacDelay(outputType);
87 s->AddPerGroupRtnMacDelay(outputType);
88 s->AddPerGroupFwdPhyDelay(outputType);
89 s->AddPerGroupRtnPhyDelay(outputType);
91 s->AddAverageGroupFwdAppDelay(outputType);
92 s->AddAverageGroupRtnAppDelay(outputType);
94 s->AddAverageGroupFwdDevDelay(outputType);
95 s->AddAverageGroupRtnDevDelay(outputType);
96 s->AddAverageGroupFwdMacDelay(outputType);
97 s->AddAverageGroupRtnMacDelay(outputType);
98 s->AddAverageGroupFwdPhyDelay(outputType);
99 s->AddAverageGroupRtnPhyDelay(outputType);
101 s->AddPerGroupFwdAppJitter(outputType);
102 s->AddPerGroupRtnAppJitter(outputType);
104 s->AddPerGroupFwdDevJitter(outputType);
105 s->AddPerGroupRtnDevJitter(outputType);
106 s->AddPerGroupFwdMacJitter(outputType);
107 s->AddPerGroupRtnMacJitter(outputType);
108 s->AddPerGroupFwdPhyJitter(outputType);
109 s->AddPerGroupRtnPhyJitter(outputType);
111 s->AddAverageGroupFwdAppJitter(outputType);
112 s->AddAverageGroupRtnAppJitter(outputType);
114 s->AddAverageGroupFwdDevJitter(outputType);
115 s->AddAverageGroupRtnDevJitter(outputType);
116 s->AddAverageGroupFwdMacJitter(outputType);
117 s->AddAverageGroupRtnMacJitter(outputType);
118 s->AddAverageGroupFwdPhyJitter(outputType);
119 s->AddAverageGroupRtnPhyJitter(outputType);
121 s->AddPerGroupFwdAppPlt(outputType);
122 s->AddPerGroupRtnAppPlt(outputType);
124 s->AddAverageGroupFwdAppPlt(outputType);
125 s->AddAverageGroupRtnAppPlt(outputType);
127 s->AddPerGroupFwdQueueBytes(outputType);
128 s->AddPerGroupRtnQueueBytes(outputType);
130 s->AddPerGroupFwdQueuePackets(outputType);
131 s->AddPerGroupRtnQueuePackets(outputType);
133 s->AddPerGroupFwdSignallingLoad(outputType);
134 s->AddPerGroupRtnSignallingLoad(outputType);
136 s->AddPerGroupFwdCompositeSinr(outputType);
137 s->AddPerGroupRtnCompositeSinr(outputType);
139 s->AddPerGroupFwdAppThroughput(outputType);
140 s->AddPerGroupRtnAppThroughput(outputType);
142 s->AddPerGroupFwdUserDevThroughput(outputType);
143 s->AddPerGroupRtnFeederDevThroughput(outputType);
144 s->AddPerGroupFwdUserMacThroughput(outputType);
145 s->AddPerGroupRtnFeederMacThroughput(outputType);
146 s->AddPerGroupFwdUserPhyThroughput(outputType);
147 s->AddPerGroupRtnFeederPhyThroughput(outputType);
149 s->AddAverageGroupFwdAppThroughput(outputType);
150 s->AddAverageGroupRtnAppThroughput(outputType);
152 s->AddAverageGroupFwdUserDevThroughput(outputType);
153 s->AddAverageGroupRtnFeederDevThroughput(outputType);
154 s->AddAverageGroupFwdUserMacThroughput(outputType);
155 s->AddAverageGroupRtnFeederMacThroughput(outputType);
156 s->AddAverageGroupFwdUserPhyThroughput(outputType);
157 s->AddAverageGroupRtnFeederPhyThroughput(outputType);
159 s->AddPerGroupFwdUserDaPacketError(outputType);
160 s->AddPerGroupRtnFeederDaPacketError(outputType);
161 s->AddPerGroupFeederSlottedAlohaPacketError(outputType);
162 s->AddPerGroupFeederCrdsaPacketError(outputType);
163 s->AddPerGroupFeederEssaPacketError(outputType);
165 s->AddPerGroupFeederSlottedAlohaPacketCollision(outputType);
166 s->AddPerGroupFeederCrdsaPacketCollision(outputType);
167 s->AddPerGroupFeederEssaPacketCollision(outputType);
169 s->AddPerGroupCapacityRequest(outputType);
171 s->AddPerGroupResourcesGranted(outputType);
175 main(
int argc,
char* argv[])
178 LogComponentEnable(
"sat-group-example", LOG_LEVEL_INFO);
182 uint32_t endUsersPerUt(1);
183 uint32_t utsPerBeam(20);
185 uint32_t packetSize(1500);
186 Time interval(Seconds(1.0));
188 Time appStartTime = Seconds(0.1);
189 Time simLength(Seconds(60.0));
191 Ptr<SimulationHelper> simulationHelper = CreateObject<SimulationHelper>(
"sat-group-example");
195 cmd.AddValue(
"UtsPerBeam",
"Number of UTs per beam", utsPerBeam);
196 cmd.AddValue(
"PacketSize",
"UDP packet size (in bytes)", packetSize);
197 cmd.AddValue(
"Interval",
"CBR interval (in seconds, or add unit)", interval);
198 cmd.AddValue(
"SimLength",
"Simulation length (in seconds, or add unit)", simLength);
199 simulationHelper->AddDefaultUiArguments(cmd);
200 cmd.Parse(argc, argv);
203 Config::SetDefault(
"ns3::SatEnvVariables::EnableSimulationOutputOverwrite", BooleanValue(
true));
204 Config::SetDefault(
"ns3::SatHelper::PacketTraceEnabled", BooleanValue(
true));
206 simulationHelper->SetSimulationTime(simLength);
207 simulationHelper->SetUserCountPerUt(endUsersPerUt);
208 simulationHelper->SetUtCountPerBeam(utsPerBeam);
211 std::stringstream beamsEnabled;
212 beamsEnabled << beamId;
213 simulationHelper->SetBeams(beamsEnabled.str());
215 Ptr<SatGroupHelper> groupHelper = simulationHelper->GetGroupHelper();
219 groupHelper->CreateUtNodesFromPosition(5, 10,
GeoCoordinate(56.4243, -16.042, 122.427), 100000);
222 Ptr<SatHelper> satHelper = simulationHelper->CreateSatScenario();
225 NodeContainer utNodes = satHelper->UtNodes();
231 groupHelper->AddUtNodeToGroup(1, utNodes.Get(0));
233 NodeContainer nodes2To10;
234 for (uint32_t i = 2; i < 11; i++)
236 nodes2To10.Add(utNodes.Get(i));
238 groupHelper->AddUtNodesToGroup(2, nodes2To10);
243 groupHelper->CreateGroupFromPosition(
251 std::vector<uint32_t> groups = {1, 2, 3};
252 groupHelper->CreateGroupsUniformly(groups, utNodes);
256 NS_FATAL_ERROR(
"Unknown value of GroupCreationMethod_t: " << creationMethod);
260 Config::SetDefault(
"ns3::CbrApplication::Interval", TimeValue(interval));
261 Config::SetDefault(
"ns3::CbrApplication::PacketSize", UintegerValue(packetSize));
264 Ptr<SatTrafficHelper> trafficHelper = simulationHelper->GetTrafficHelper();
268 satHelper->GetGwUsers().Get(0),
269 satHelper->GetUtUsers(groupHelper->GetUtNodes(2)),
271 appStartTime + simLength,
277 satHelper->GetGwUsers().Get(0),
278 satHelper->GetUtUsers(groupHelper->GetUtNodes(0)),
280 appStartTime + simLength,
284 satHelper->GetGwUsers().Get(0),
285 satHelper->GetUtUsers(groupHelper->GetUtNodes(1)),
287 appStartTime + simLength,
292 satHelper->GetGwUsers().Get(0),
293 satHelper->GetUtUsers(groupHelper->GetUtNodes(5)),
295 appStartTime + simLength,
298 NS_LOG_INFO(
"--- sat-group-example ---");
299 NS_LOG_INFO(
" Packet size in bytes: " << packetSize);
300 NS_LOG_INFO(
" Packet sending interval: " << interval.GetSeconds());
301 NS_LOG_INFO(
" Simulation length: " << simLength.GetSeconds());
302 NS_LOG_INFO(
" Number total of UTs: " << satHelper->UtNodes().GetN());
303 NS_LOG_INFO(
" Number of end users per UT: " << endUsersPerUt);
304 NS_LOG_INFO(
" Number of groups: " << groupHelper->GetN());
305 NS_LOG_INFO(
" Nodes in default group: " << groupHelper->GetUtNodes(0).GetN());
306 std::list<uint32_t> groupIds = groupHelper->GetGroups();
308 for (uint32_t groupId : groupIds)
310 NS_LOG_INFO(
" Nodes in group " << groupId <<
": "
311 << groupHelper->GetUtNodes(groupId).GetN());
316 Ptr<SatStatsHelperContainer> s = simulationHelper->GetStatisticsContainer();
317 simulationHelper->EnableProgressLogs();
319 Config::SetDefault(
"ns3::ConfigStore::Filename", StringValue(
"output-attributes.xml"));
320 Config::SetDefault(
"ns3::ConfigStore::FileFormat", StringValue(
"Xml"));
321 Config::SetDefault(
"ns3::ConfigStore::Mode", StringValue(
"Save"));
322 ConfigStore outputConfig;
323 outputConfig.ConfigureDefaults();
327 simulationHelper->RunSimulation();
GeoCoordinate class is used to store and operate with geodetic coordinates.
Keep track of the current position and velocity of an object in satellite network.
GeoCoordinate GetGeoPosition(void) const
OutputType_t
Possible types and formats of statistics output.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.
void ConfigureAllStats(Ptr< SatStatsHelperContainer > s)