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"
44 NS_LOG_COMPONENT_DEFINE(
"sat-regeneration-example");
47 main(
int argc,
char* argv[])
49 uint32_t beamIdInFullScenario = 10;
50 uint32_t packetSize = 512;
51 std::string interval =
"10ms";
52 std::string scenario =
"simple";
53 std::string forwardRegeneration =
"regeneration_network";
54 std::string returnRegeneration =
"regeneration_network";
56 std::map<std::string, SatHelper::PreDefinedScenario_t> mapScenario{
60 std::map<std::string, SatEnums::RegenerationMode_t> mapForwardRegeneration{
64 std::map<std::string, SatEnums::RegenerationMode_t> mapReturnRegeneration{
70 Ptr<SimulationHelper> simulationHelper = CreateObject<SimulationHelper>(
"example-regeneration");
74 cmd.AddValue(
"beamIdInFullScenario",
75 "Id where Sending/Receiving UT is selected in FULL scenario. (used only when "
77 beamIdInFullScenario);
78 cmd.AddValue(
"packetSize",
"Size of constant packet (bytes)", packetSize);
79 cmd.AddValue(
"interval",
"Interval to sent packets in seconds, (e.g. (1s))", interval);
80 cmd.AddValue(
"scenario",
"Test scenario to use. (simple, larger or full)", scenario);
82 "forwardRegeneration",
83 "Regeneration mode on forward link (transparent, regeneration_phy or regeneration_network)",
85 cmd.AddValue(
"returnRegeneration",
86 "Regeneration mode on forward link (transparent, regeneration_phy, "
87 "regeneration_link or regeneration_network)",
89 simulationHelper->AddDefaultUiArguments(cmd);
90 cmd.Parse(argc, argv);
94 mapForwardRegeneration[forwardRegeneration];
96 mapReturnRegeneration[returnRegeneration];
99 Config::SetDefault(
"ns3::SatConf::ForwardLinkRegenerationMode",
100 EnumValue(forwardLinkRegenerationMode));
101 Config::SetDefault(
"ns3::SatConf::ReturnLinkRegenerationMode",
102 EnumValue(returnLinkRegenerationMode));
103 Config::SetDefault(
"ns3::SatOrbiterFeederPhy::QueueSize", UintegerValue(100000));
104 Config::SetDefault(
"ns3::SatOrbiterUserPhy::QueueSize", UintegerValue(100000));
107 Config::SetDefault(
"ns3::SatBbFrameConf::AcmEnabled", BooleanValue(
true));
110 Config::SetDefault(
"ns3::SatEnvVariables::EnableSimulationOutputOverwrite", BooleanValue(
true));
113 Config::SetDefault(
"ns3::SatHelper::PacketTraceEnabled", BooleanValue(
true));
116 simulationHelper->SetOutputTag(scenario);
118 simulationHelper->SetSimulationTime(Seconds(30));
121 std::stringstream beamsEnabled;
122 beamsEnabled << beamIdInFullScenario;
123 simulationHelper->SetBeams(beamsEnabled.str());
125 LogComponentEnable(
"sat-regeneration-example", LOG_LEVEL_INFO);
127 simulationHelper->LoadScenario(
"geo-33E");
129 simulationHelper->CreateSatScenario(satScenario);
131 simulationHelper->GetTrafficHelper()->AddCbrTraffic(
136 NodeContainer(Singleton<SatTopology>::Get()->GetGwUserNode(0)),
137 Singleton<SatTopology>::Get()->GetUtUserNodes(),
142 simulationHelper->GetTrafficHelper()->AddCbrTraffic(
147 NodeContainer(Singleton<SatTopology>::Get()->GetGwUserNode(0)),
148 Singleton<SatTopology>::Get()->GetUtUserNodes(),
153 NS_LOG_INFO(
"--- sat-regeneration-example ---");
154 NS_LOG_INFO(
" Scenario used: " << scenario);
155 if (scenario ==
"full")
157 NS_LOG_INFO(
" UT used in full scenario from beam: " << beamIdInFullScenario);
159 NS_LOG_INFO(
" PacketSize: " << packetSize);
160 NS_LOG_INFO(
" Interval: " << interval);
164 Config::SetDefault(
"ns3::ConfigStore::Filename", StringValue(
"output-attributes.xml"));
165 Config::SetDefault(
"ns3::ConfigStore::FileFormat", StringValue(
"Xml"));
166 Config::SetDefault(
"ns3::ConfigStore::Mode", StringValue(
"Save"));
167 ConfigStore outputConfig;
168 outputConfig.ConfigureDefaults();
170 Ptr<SatStatsHelperContainer> s = simulationHelper->GetStatisticsContainer();
266 simulationHelper->EnableProgressLogs();
267 simulationHelper->RunSimulation();
RegenerationMode_t
The regeneration mode used in satellites.
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.