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"
56 NS_LOG_COMPONENT_DEFINE(
"sat-list-position-ext-fading-example");
61 Ptr<SatSignalParameters> params,
68 if (!destAdd.IsBroadcast())
70 NS_LOG_INFO(
"" << params->m_channelType <<
" " << ownAdd <<
" " << destAdd <<
" "
77 main(
int argc,
char* argv[])
80 uint32_t usersPerUt = 1;
82 bool checkBeam =
false;
83 std::string extUtPositions = Singleton<SatEnvVariables>::Get()->LocateDataDirectory() +
84 "/additional-input/utpositions/BeamId-1_256_UT_Positions.txt";
86 Config::SetDefault(
"ns3::SatHelper::ScenarioCreationTraceEnabled", BooleanValue(
true));
89 auto simulationHelper = CreateObject<SimulationHelper>(
"example-list-position-external-fading");
90 Config::SetDefault(
"ns3::SatEnvVariables::EnableSimulationOutputOverwrite", BooleanValue(
true));
94 cmd.AddValue(
"beamId",
"The beam ID to be used.", beamId);
95 cmd.AddValue(
"checkBeam",
96 "Check that given beam is the best according in the configured positions.",
98 cmd.AddValue(
"utCount",
"Number of the UTs.", utCount);
99 cmd.AddValue(
"usersPerUt",
"Users per UT.", usersPerUt);
100 cmd.AddValue(
"externalUtPositionFile",
"UT position input file (in data/)", extUtPositions);
101 simulationHelper->AddDefaultUiArguments(cmd);
102 cmd.Parse(argc, argv);
107 simulationHelper->SetUserCountPerUt(usersPerUt);
108 simulationHelper->SetUtCountPerBeam(utCount);
109 simulationHelper->SetBeamSet({beamId});
110 simulationHelper->SetSimulationTime(Seconds(1.1));
113 simulationHelper->EnableExternalFadingInputTrace();
116 simulationHelper->EnableUtListPositionsFromInputFile(extUtPositions, checkBeam);
119 LogComponentEnable(
"sat-list-position-ext-fading-example", LOG_LEVEL_INFO);
121 simulationHelper->LoadScenario(
"geo-33E");
127 Ptr<SatHelper> helper = simulationHelper->CreateSatScenario();
130 Config::Connect(
"/NodeList/*/DeviceList/*/SatPhy/PhyRx/RxCarrierList/*/LinkBudgetTrace",
133 Config::Connect(
"/NodeList/*/DeviceList/*/UserPhy/*/PhyRx/RxCarrierList/*/LinkBudgetTrace",
136 Config::Connect(
"/NodeList/*/DeviceList/*/FeederPhy/*/PhyRx/RxCarrierList/*/LinkBudgetTrace",
140 simulationHelper->GetTrafficHelper()->AddCbrTraffic(
145 NodeContainer(Singleton<SatTopology>::Get()->GetGwUserNode(0)),
146 Singleton<SatTopology>::Get()->GetUtUserNodes(),
151 simulationHelper->GetTrafficHelper()->AddCbrTraffic(
156 NodeContainer(Singleton<SatTopology>::Get()->GetGwUserNode(0)),
157 Singleton<SatTopology>::Get()->GetUtUserNodes(),
162 NS_LOG_INFO(
"--- List Position External Fading Example ---");
163 NS_LOG_INFO(
"UT info (Beam ID, UT ID, Latitude, Longitude, Altitude + addresses");
166 NS_LOG_INFO(helper->GetBeamHelper()->GetUtInfo());
167 NS_LOG_INFO(
"Link results (Time, Channel type, Own address, Dest. address, Beam ID, SINR, "
168 "Composite SINR) :");
171 simulationHelper->RunSimulation();
static T LinearToDb(T linear)
Converts linear to decibels.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.
static void LinkBudgetTraceCb(std::string context, Ptr< SatSignalParameters > params, Mac48Address ownAdd, Mac48Address destAdd, double ifPower, double cSinr)