22 #include "ns3/applications-module.h"
23 #include "ns3/core-module.h"
24 #include "ns3/internet-module.h"
25 #include "ns3/network-module.h"
26 #include "ns3/satellite-module.h"
27 #include "ns3/traffic-module.h"
40 NS_LOG_COMPONENT_DEFINE(
"sat-arq-rtn-example");
43 main(
int argc,
char* argv[])
46 uint32_t endUsersPerUt(1);
47 uint32_t utsPerBeam(3);
48 uint32_t packetSize(128);
49 Time interval(Seconds(0.3));
50 Time simLength(Seconds(100.0));
51 Time appStartTime = Seconds(0.1);
59 Config::SetDefault(
"ns3::SatEnvVariables::EnableSimulationOutputOverwrite", BooleanValue(
true));
62 Config::SetDefault(
"ns3::SatHelper::PacketTraceEnabled", BooleanValue(
true));
63 Ptr<SimulationHelper> simulationHelper = CreateObject<SimulationHelper>(
"example-arq-rtn");
67 cmd.AddValue(
"endUsersPerUt",
"Number of end users per UT", endUsersPerUt);
68 cmd.AddValue(
"utsPerBeam",
"Number of UTs per spot-beam", utsPerBeam);
69 simulationHelper->AddDefaultUiArguments(cmd);
70 cmd.Parse(argc, argv);
72 simulationHelper->SetUtCountPerBeam(utsPerBeam);
73 simulationHelper->SetUserCountPerUt(endUsersPerUt);
74 simulationHelper->SetSimulationTime(simLength);
76 std::stringstream beamsEnabled;
77 beamsEnabled << beamId;
78 simulationHelper->SetBeams(beamsEnabled.str());
81 double errorRate(0.1);
82 Config::SetDefault(
"ns3::SatUtHelper::FwdLinkErrorModel",
84 Config::SetDefault(
"ns3::SatGwHelper::RtnLinkErrorModel",
86 Config::SetDefault(
"ns3::SatGwHelper::RtnLinkConstantErrorRate", DoubleValue(errorRate));
89 Config::SetDefault(
"ns3::SatLlc::RtnLinkArqEnabled", BooleanValue(
true));
90 Config::SetDefault(
"ns3::SatLlc::FwdLinkArqEnabled", BooleanValue(
false));
93 Config::SetDefault(
"ns3::SatReturnLinkEncapsulatorArq::MaxNoOfRetransmissions",
95 Config::SetDefault(
"ns3::SatReturnLinkEncapsulatorArq::WindowSize", UintegerValue(20));
96 Config::SetDefault(
"ns3::SatReturnLinkEncapsulatorArq::RetransmissionTimer",
97 TimeValue(Seconds(0.6)));
98 Config::SetDefault(
"ns3::SatReturnLinkEncapsulatorArq::RxWaitingTime", TimeValue(Seconds(1.8)));
100 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService0_ConstantAssignmentProvided",
102 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService0_ConstantServiceRate",
103 StringValue(
"ns3::ConstantRandomVariable[Constant=10]"));
104 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService0_RbdcAllowed",
105 BooleanValue(
false));
106 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService0_VolumeAllowed",
107 BooleanValue(
false));
109 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService3_ConstantAssignmentProvided",
111 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService3_ConstantServiceRate",
112 StringValue(
"ns3::ConstantRandomVariable[Constant=100]"));
113 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService3_RbdcAllowed", BooleanValue(
true));
114 Config::SetDefault(
"ns3::SatLowerLayerServiceConf::DaService3_VolumeAllowed",
115 BooleanValue(
false));
117 simulationHelper->LoadScenario(
"geo-33E");
120 simulationHelper->CreateSatScenario();
123 simulationHelper->GetTrafficHelper()->AddCbrTraffic(
128 NodeContainer(Singleton<SatTopology>::Get()->GetGwUserNode(0)),
129 Singleton<SatTopology>::Get()->GetUtUserNodes(),
134 NS_LOG_INFO(
"--- sat-arq-rtn-example ---");
135 NS_LOG_INFO(
" Packet size in bytes: " << packetSize);
136 NS_LOG_INFO(
" Packet sending interval: " << interval.GetSeconds());
137 NS_LOG_INFO(
" Simulation length: " << simLength.GetSeconds());
138 NS_LOG_INFO(
" Number of UTs: " << utsPerBeam);
139 NS_LOG_INFO(
" Number of end users per UT: " << endUsersPerUt);
142 simulationHelper->EnableProgressLogs();
143 simulationHelper->RunSimulation();
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.