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-arq-fwd-example");
44 main(
int argc,
char* argv[])
47 uint32_t endUsersPerUt(3);
48 uint32_t utsPerBeam(3);
49 uint32_t packetSize(128);
50 Time interval(Seconds(0.3));
51 Time simLength(Seconds(100.0));
52 Time appStartTime = Seconds(0.1);
60 Config::SetDefault(
"ns3::SatEnvVariables::EnableSimulationOutputOverwrite", BooleanValue(
true));
63 Config::SetDefault(
"ns3::SatHelper::PacketTraceEnabled", BooleanValue(
true));
64 Ptr<SimulationHelper> simulationHelper = CreateObject<SimulationHelper>(
"example-arq-fwd");
68 cmd.AddValue(
"endUsersPerUt",
"Number of end users per UT", endUsersPerUt);
69 cmd.AddValue(
"utsPerBeam",
"Number of UTs per spot-beam", utsPerBeam);
70 simulationHelper->AddDefaultUiArguments(cmd);
71 cmd.Parse(argc, argv);
73 simulationHelper->SetDefaultValues();
74 simulationHelper->SetUtCountPerBeam(utsPerBeam);
75 simulationHelper->SetUserCountPerUt(endUsersPerUt);
76 simulationHelper->SetSimulationTime(simLength);
78 std::stringstream beamsEnabled;
79 beamsEnabled << beamId;
80 simulationHelper->SetBeams(beamsEnabled.str());
83 double errorRate(0.10);
84 Config::SetDefault(
"ns3::SatUtHelper::FwdLinkConstantErrorRate", DoubleValue(errorRate));
85 Config::SetDefault(
"ns3::SatUtHelper::FwdLinkErrorModel",
87 Config::SetDefault(
"ns3::SatGwHelper::RtnLinkErrorModel",
91 Config::SetDefault(
"ns3::SatLlc::RtnLinkArqEnabled", BooleanValue(
false));
92 Config::SetDefault(
"ns3::SatLlc::FwdLinkArqEnabled", BooleanValue(
true));
95 Config::SetDefault(
"ns3::SatGenericStreamEncapsulatorArq::MaxNoOfRetransmissions",
97 Config::SetDefault(
"ns3::SatGenericStreamEncapsulatorArq::WindowSize", UintegerValue(20));
98 Config::SetDefault(
"ns3::SatGenericStreamEncapsulatorArq::RetransmissionTimer",
99 TimeValue(Seconds(0.6)));
100 Config::SetDefault(
"ns3::SatGenericStreamEncapsulatorArq::RxWaitingTime",
101 TimeValue(Seconds(1.8)));
103 simulationHelper->LoadScenario(
"geo-33E");
106 simulationHelper->CreateSatScenario();
110 NS_LOG_INFO(
"Creating CBR applications and sinks");
112 if (endUsersPerUt * utsPerBeam > 0)
115 simulationHelper->GetTrafficHelper()->AddCbrTraffic(
120 NodeContainer(Singleton<SatTopology>::Get()->GetGwUserNode(0)),
121 Singleton<SatTopology>::Get()->GetUtUserNodes(),
128 NS_LOG_INFO(
"--- sat-arq-fwd-example ---");
129 NS_LOG_INFO(
" Packet size in bytes: " << packetSize);
130 NS_LOG_INFO(
" Packet sending interval: " << interval.GetSeconds());
131 NS_LOG_INFO(
" Simulation length: " << simLength.GetSeconds());
132 NS_LOG_INFO(
" Number of UTs: " << utsPerBeam);
133 NS_LOG_INFO(
" Number of end users per UT: " << endUsersPerUt);
136 simulationHelper->EnableProgressLogs();
137 simulationHelper->RunSimulation();
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.