22 #include "ns3/core-module.h"
23 #include "ns3/internet-module.h"
24 #include "ns3/network-module.h"
25 #include "ns3/satellite-module.h"
26 #include "ns3/traffic-module.h"
55 NS_LOG_COMPONENT_DEFINE(
"sat-http-example");
58 main(
int argc,
char* argv[])
60 std::string scenario =
"simple";
61 double duration = 1000;
64 Config::SetDefault(
"ns3::SatHelper::ScenarioCreationTraceEnabled", BooleanValue(
true));
66 auto simulationHelper = CreateObject<SimulationHelper>(
"example-http");
67 Config::SetDefault(
"ns3::SatEnvVariables::EnableSimulationOutputOverwrite", BooleanValue(
true));
71 cmd.AddValue(
"scenario",
"Test scenario to use. (simple, larger or full)", scenario);
72 cmd.AddValue(
"duration",
"Simulation duration (in seconds)", duration);
73 simulationHelper->AddDefaultUiArguments(cmd);
74 cmd.Parse(argc, argv);
76 if (scenario ==
"larger")
80 else if (scenario ==
"full")
86 simulationHelper->SetSimulationTime(duration);
87 simulationHelper->SetOutputTag(scenario);
92 LogComponentEnable(
"sat-http-example", LOG_LEVEL_INFO);
98 simulationHelper->LoadScenario(
"geo-33E");
101 simulationHelper->CreateSatScenario(satScenario);
104 NodeContainer utUsers = Singleton<SatTopology>::Get()->GetUtUserNodes();
105 NodeContainer gwUsers = Singleton<SatTopology>::Get()->GetGwUserNodes();
107 ThreeGppHttpHelper httpHelper;
108 httpHelper.InstallUsingIpv4(gwUsers.Get(0), utUsers);
109 httpHelper.GetServer().Start(Seconds(1.0));
111 auto apps = httpHelper.GetClients();
112 apps.Start(Seconds(3.0));
115 std::vector<Ptr<ClientRxTracePlot>> plots;
116 for (
auto app = apps.Begin(); app != apps.End(); app++, i++)
118 std::stringstream plotName;
119 plotName <<
"3GPP-HTTP-client-" << i <<
"-trace";
120 plots.push_back(CreateObject<ClientRxTracePlot>(*app, plotName.str()));
123 NS_LOG_INFO(
"--- sat-http-example ---");
124 NS_LOG_INFO(
" Scenario used: " << scenario);
127 simulationHelper->EnableProgressLogs();
130 Ptr<SatStatsHelperContainer> s = simulationHelper->GetStatisticsContainer();
138 simulationHelper->RunSimulation();
PreDefinedScenario_t
Values for pre-defined scenarios to be used by helper when building satellite network topology base.
@ LARGER
LARGER Larger scenario used as base.
@ FULL
FULL Full scenario used as base.
@ SIMPLE
SIMPLE Simple scenario used as base.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.