23 #include <ns3/arp-cache.h>
24 #include <ns3/csma-helper.h>
25 #include <ns3/double.h>
26 #include <ns3/internet-stack-helper.h>
27 #include <ns3/ipv4-interface.h>
28 #include <ns3/ipv4-routing-table-entry.h>
29 #include <ns3/ipv4-static-routing-helper.h>
31 #include <ns3/lora-device-address-generator.h>
32 #include <ns3/lora-forwarder-helper.h>
33 #include <ns3/lora-network-server-helper.h>
34 #include <ns3/mobility-helper.h>
35 #include <ns3/names.h>
36 #include <ns3/queue.h>
37 #include <ns3/satellite-env-variables.h>
38 #include <ns3/satellite-id-mapper.h>
39 #include <ns3/satellite-log.h>
40 #include <ns3/satellite-lora-conf.h>
41 #include <ns3/satellite-point-to-point-isl-net-device.h>
42 #include <ns3/satellite-position-allocator.h>
43 #include <ns3/satellite-rtn-link-time.h>
44 #include <ns3/satellite-sgp4-mobility-model.h>
45 #include <ns3/satellite-traced-mobility-model.h>
46 #include <ns3/satellite-typedefs.h>
47 #include <ns3/satellite-ut-handover-module.h>
48 #include <ns3/singleton.h>
49 #include <ns3/string.h>
50 #include <ns3/system-path.h>
51 #include <ns3/type-id.h>
55 NS_LOG_COMPONENT_DEFINE(
"SatHelper");
60 NS_OBJECT_ENSURE_REGISTERED(SatHelper);
66 TypeId(
"ns3::SatHelper")
68 .AddConstructor<SatHelper>()
69 .AddAttribute(
"Standard",
70 "The global standard used. Can be either DVB or Lora",
74 .AddAttribute(
"SatRtnConfFileName",
75 "Name of the satellite network RTN link configuration file.",
76 StringValue(
"Scenario72RtnConf.txt"),
79 .AddAttribute(
"SatFwdConfFileName",
80 "Name of the satellite network FWD link configuration file.",
81 StringValue(
"Scenario72FwdConf.txt"),
84 .AddAttribute(
"GwPosFileName",
85 "Name of the GW positions configuration file.",
86 StringValue(
"Scenario72GwPos.txt"),
89 .AddAttribute(
"SatMobilitySGP4Enabled",
90 "The satellite moves following a SGP4 model.",
94 .AddAttribute(
"SatMobilitySGP4TleFileName",
95 "TLE input filename used for SGP4 mobility.",
96 StringValue(
"tle_iss_zarya.txt"),
99 .AddAttribute(
"SatConstellationEnabled",
100 "Use a constellation of satellites.",
103 MakeBooleanChecker())
104 .AddAttribute(
"SatConstellationFolder",
105 "Folder where are stored satellite constellation data.",
106 StringValue(
"eutelsat-geo-2-sats"),
109 .AddAttribute(
"GeoSatPosFileName",
110 "Name of the geostationary satellite position configuration file.",
111 StringValue(
"Scenario72GeoPos.txt"),
114 .AddAttribute(
"RtnLinkWaveformConfFileName",
115 "Name of the RTN link waveform configuration file.",
116 StringValue(
"dvbRcs2Waveforms.txt"),
119 .AddAttribute(
"UtCount",
120 "The count of created UTs in beam (full or user-defined scenario)",
123 MakeUintegerChecker<uint32_t>(1))
124 .AddAttribute(
"GwUsers",
125 "The number of created GW users (full or user-defined scenario)",
128 MakeUintegerChecker<uint32_t>(1))
129 .AddAttribute(
"UtUsers",
130 "The number of created UT users per UT (full or user-defined scenario)",
133 MakeUintegerChecker<uint32_t>(1))
135 "BeamNetworkAddress",
136 "Initial network number to use "
137 "during allocation of satellite devices "
138 "(mask set by attribute 'BeamNetworkMask' will be used as the network mask)",
139 Ipv4AddressValue(
"40.1.0.0"),
141 MakeIpv4AddressChecker())
142 .AddAttribute(
"BeamNetworkMask",
143 "Network mask to use during allocation of satellite devices.",
144 Ipv4MaskValue(
"255.255.0.0"),
146 MakeIpv4MaskChecker())
149 "Initial network number to use "
150 "during allocation of GW, router, and GW users "
151 "(mask set by attribute 'GwNetworkMask' will be used as the network mask)",
152 Ipv4AddressValue(
"90.1.0.0"),
154 MakeIpv4AddressChecker())
155 .AddAttribute(
"GwNetworkMask",
156 "Network mask to use during allocation of GW, router, and GW users.",
157 Ipv4MaskValue(
"255.255.0.0"),
159 MakeIpv4MaskChecker())
162 "Initial network number to use "
163 "during allocation of UT and UT users "
164 "(mask set by attribute 'UtNetworkMask' will be used as the network mask)",
165 Ipv4AddressValue(
"10.1.0.0"),
167 MakeIpv4AddressChecker())
168 .AddAttribute(
"UtNetworkMask",
169 "Network mask to use during allocation of UT and UT users.",
170 Ipv4MaskValue(
"255.255.0.0"),
172 MakeIpv4MaskChecker())
173 .AddAttribute(
"PacketTraceEnabled",
174 "Packet tracing enable status.",
177 MakeBooleanChecker())
178 .AddAttribute(
"ScenarioCreationTraceEnabled",
179 "Scenario creation trace output enable status.",
182 MakeBooleanChecker())
183 .AddAttribute(
"DetailedScenarioCreationTraceEnabled",
184 "Detailed scenario creation trace output enable status.",
187 MakeBooleanChecker())
188 .AddAttribute(
"ScenarioCreationTraceFileName",
189 "File name for the scenario creation trace output",
190 StringValue(
"CreationTraceScenario"),
193 .AddAttribute(
"UtCreationTraceFileName",
194 "File name for the UT creation trace output",
195 StringValue(
"CreationTraceUt"),
198 .AddTraceSource(
"Creation",
201 "ns3::SatTypedefs::CreationCallback")
202 .AddTraceSource(
"CreationSummary",
203 "Creation summary traces",
205 "ns3::SatTypedefs::CreationCallback")
214 NS_LOG_FUNCTION(
this);
220 : m_rtnConfFileName(
"Scenario72RtnConf.txt"),
221 m_fwdConfFileName(
"Scenario72FwdConf.txt"),
222 m_gwPosFileName(
"Scenario72GwPos.txt"),
223 m_geoPosFileName(
"Scenario72GeoPos.txt"),
224 m_waveformConfFileName(
"dvbRcs2Waveforms.txt"),
225 m_scenarioCreated(false),
226 m_creationTraces(false),
227 m_detailedCreationTraces(false),
228 m_packetTraces(false),
232 m_utPositionsByBeam(),
234 m_mobileUtsUsersByBeam()
236 NS_LOG_FUNCTION(
this);
239 ObjectBase::ConstructSelf(AttributeConstructionList());
241 Singleton<SatEnvVariables>::Get()->Initialize();
242 Singleton<SatIdMapper>::Get()->Reset();
252 NodeContainer geoNodes;
253 std::vector<std::pair<uint32_t, uint32_t>> isls;
259 NS_FATAL_ERROR(
"Forward regeneration must be network when using constellations");
263 NS_FATAL_ERROR(
"Return regeneration must be network when using constellations");
266 std::vector<std::string> tles;
272 for (uint32_t i = 0; i < tles.size(); i++)
275 Ptr<Node> geoSatNode = CreateObject<Node>();
282 geoNodes.Add(geoSatNode);
299 Ptr<Node> geoSatNode = CreateObject<Node>();
313 geoNodes.Add(geoSatNode);
317 CreateObject<SatBeamHelper>(geoNodes,
323 m_satConf->GetForwardLinkRegenerationMode(),
324 m_satConf->GetReturnLinkRegenerationMode());
332 "Must use constant speed propagation delay model if satellite mobility is enabled");
337 Ptr<SatRtnLinkTime> rtnTime = Singleton<SatRtnLinkTime>::Get();
338 rtnTime->Initialize(
m_satConf->GetSuperframeSeq());
342 m_beamHelper->SetAttribute(
"CarrierFrequencyConverter", CallbackValue(converterCb));
347 m_userHelper->SetAttribute(
"PropagationDelayGetter", CallbackValue(delayModelCb));
353 NS_LOG_FUNCTION(
this);
370 NS_FATAL_ERROR(
"Not supported predefined scenario.");
378 NS_LOG_FUNCTION(
this);
380 AsciiTraceHelper asciiTraceHelper;
382 std::stringstream outputPathCreation;
383 std::stringstream outputPathUt;
384 outputPathCreation << Singleton<SatEnvVariables>::Get()->GetOutputPath() <<
"/"
386 outputPathUt << Singleton<SatEnvVariables>::Get()->GetOutputPath() <<
"/"
390 m_utTraceStream = asciiTraceHelper.CreateFileStream(outputPathUt.str());
392 TraceConnectWithoutContext(
"CreationSummary",
409 std::vector<std::string>& tles,
410 std::vector<std::pair<uint32_t, uint32_t>>& isls)
412 NS_LOG_FUNCTION(
this << path);
414 std::string dataPath =
415 Singleton<SatEnvVariables>::Get()->LocateDataDirectory() +
"/constellations/" + path;
417 if (!(Singleton<SatEnvVariables>::Get()->IsValidDirectory(dataPath)))
419 NS_FATAL_ERROR(
"Directory '" << dataPath
420 <<
"' does not exist, no constellation can be created.");
423 m_satConf->SetUtPositionInputFileName(
"constellations/" + path +
"/ut_positions.txt");
427 "constellations/" + path +
"/gw_positions.txt",
433 tles =
m_satConf->LoadTles(dataPath +
"/tles.txt");
434 isls =
m_satConf->LoadIsls(dataPath +
"/isls.txt");
440 NS_LOG_FUNCTION(
this);
442 CallbackBase creationCb =
444 TraceConnect(
"Creation",
"SatHelper", creationCb);
453 NS_LOG_FUNCTION(
this);
461 NS_LOG_FUNCTION(
this);
463 Ptr<Ipv4> ipv4 = node->GetObject<Ipv4>();
464 return ipv4->GetAddress(1, 0)
471 NS_LOG_FUNCTION(
this);
486 for (NodeContainer::Iterator i = utNodes.Begin(); i != utNodes.End(); i++)
496 NS_LOG_FUNCTION(
this);
504 NS_LOG_FUNCTION(
this);
511 NS_LOG_FUNCTION(
this);
518 NS_LOG_FUNCTION(
this << groupHelper);
525 NS_LOG_FUNCTION(
this);
529 Ptr<SatAntennaGainPatternContainer>
538 NS_LOG_FUNCTION(
this);
545 NS_LOG_FUNCTION(
this);
553 NS_LOG_FUNCTION(
this);
557 beamUserInfos[std::make_pair(0, 8)] = beamInfo;
567 NS_LOG_FUNCTION(
this);
573 beamUserInfos[std::make_pair(0, 12)] = beamInfo;
574 beamUserInfos[std::make_pair(0, 22)] = beamInfo;
580 beamUserInfos[std::make_pair(0, 3)] = beamInfo;
590 NS_LOG_FUNCTION(
this);
592 uint32_t beamCount =
m_satConf->GetBeamCount();
595 for (uint32_t i = 1; i < (beamCount + 1); i++)
597 BeamUserInfoMap_t::iterator beamInfo =
m_beamUserInfos.find(std::make_pair(0, i));
602 info = beamInfo->second;
609 beamUserInfos[std::make_pair(0, i)] = info;
620 NS_LOG_FUNCTION(
this);
631 NS_LOG_FUNCTION(
this);
637 Ptr<SatListPositionAllocator> posAllocator)
639 NS_LOG_FUNCTION(
this << beamId);
648 NS_LOG_FUNCTION(
this);
650 uint32_t positionIndex = 1;
657 for (BeamUserInfoMap_t::iterator it = infos.begin(); it != infos.end(); it++)
659 for (uint32_t i = 0; i < it->second.GetUtCount(); i++)
661 if (positionIndex >
m_satConf->GetUtCount())
663 NS_FATAL_ERROR(
"Not enough positions available in SatConf for UTs!!!");
675 if (bestBeamId != it->first.second)
677 NS_FATAL_ERROR(
"The beam: " << it->first <<
" is not the best beam ("
679 <<
") for the position: " << position);
695 NS_LOG_FUNCTION(
this);
697 NS_ASSERT_MSG(info.size() > 0,
"There must be at least one satellite");
701 for (uint32_t i = 0; i <
m_satConf->GetUtCount(); i++)
709 std::vector<std::pair<GeoCoordinate, uint32_t>> positions =
710 info.at(std::pair(satId, bestBeamId)).GetPositions();
711 positions.push_back(std::make_pair(position, 0));
712 info.at(std::pair(satId, bestBeamId)).SetPositions(positions);
713 uint32_t nbUsers = getNextUtUserCountCallback();
714 info.at(std::pair(satId, bestBeamId)).AppendUt(nbUsers);
717 for (uint32_t i = 0; i <
m_satConf->GetGwCount(); i++)
733 NS_LOG_FUNCTION(
this);
737 Singleton<SatLog>::Get()->AddToLog(
740 "Scenario tried to re-create with SatHelper. Creation can be done only once.");
754 InternetStackHelper internet;
757 NodeContainer gwNodes;
759 internet.Install(gwNodes);
762 for (BeamUserInfoMap_t::iterator info = beamInfos.begin(); info != beamInfos.end(); info++)
764 uint32_t satId = info->first.first;
765 uint32_t beamId = info->first.second;
768 std::vector<std::pair<GeoCoordinate, uint32_t>> positionsAndGroupId =
769 info->second.GetPositions();
771 uts.Create(info->second.GetUtCount() - positionsAndGroupId.size());
774 NodeContainer utsFromPosition;
775 utsFromPosition.Create(positionsAndGroupId.size());
777 uts.Add(utsFromPosition);
780 std::map<uint32_t, NodeContainer>::iterator mobileUts =
m_mobileUtsByBeam.find(beamId);
783 uts.Add(mobileUts->second);
788 internet.Install(uts);
790 for (uint32_t i = 0; i < info->second.GetUtCount(); ++i)
793 m_userHelper->InstallUt(uts.Get(i), info->second.GetUtUserCount(i));
796 std::pair<std::multimap<uint32_t, uint32_t>::iterator,
797 std::multimap<uint32_t, uint32_t>::iterator>
800 std::multimap<uint32_t, uint32_t>::iterator it = mobileUsers.first;
801 for (uint32_t i = info->second.GetUtCount(); i < uts.GetN() && it != mobileUsers.second;
808 std::vector<uint32_t> rtnConf =
810 std::vector<uint32_t> fwdConf =
825 std::pair<Ptr<NetDevice>, NetDeviceContainer> netDevices =
837 for (uint32_t utId = 0; utId < uts.GetN(); utId++)
848 if (satId == gwSatId)
850 DynamicCast<SatGeoNetDevice>(
851 m_beamHelper->GetGeoSatNodes().Get(gwSatId)->GetDevice(0))
852 ->ConnectGw(Mac48Address::ConvertFrom(netDevices.first->GetAddress()));
857 DynamicCast<SatGeoNetDevice>(
m_beamHelper->GetGeoSatNodes().Get(0)->GetDevice(0))
858 ->ConnectGw(Mac48Address::ConvertFrom(netDevices.first->GetAddress()));
865 for (uint32_t utIndex = 0; utIndex < uts.GetN(); utIndex++)
867 DynamicCast<SatGeoNetDevice>(
868 m_beamHelper->GetGeoSatNodes().Get(satId)->GetDevice(0))
870 Mac48Address::ConvertFrom(netDevices.second.Get(utIndex)->GetAddress()));
896 uint32_t nwkAddr = 1864;
897 Ptr<LoraDeviceAddressGenerator> addrGen =
898 CreateObject<LoraDeviceAddressGenerator>(nwkId, nwkAddr);
901 for (uint32_t indexUt = 0; indexUt <
UtNodes().GetN(); indexUt++)
903 utNode =
UtNodes().Get(indexUt);
904 Ptr<SatLorawanNetDevice> dev =
907 addrGen->NextAddress());
911 Ptr<LoraNetworkServerHelper> loraNetworkServerHelper =
912 CreateObject<LoraNetworkServerHelper>();
913 Ptr<LoraForwarderHelper> forHelper = CreateObject<LoraForwarderHelper>();
915 loraNetworkServerHelper->SetGateways(
GwNodes());
916 loraNetworkServerHelper->SetEndDevices(
UtNodes());
918 NodeContainer networkServer;
919 networkServer.Create(1);
921 loraNetworkServerHelper->Install(networkServer);
940 NS_LOG_FUNCTION(
this);
943 for (uint32_t utId = 0; utId <
m_beamHelper->GetUtNodes().GetN(); utId++)
948 Ptr<SatUtMac> satUtMac;
952 uint32_t utBeamId = 0;
953 uint32_t utSatNetDeviceCount = 0;
954 for (uint32_t ndId = 0; ndId <
m_beamHelper->GetUtNodes().Get(utId)->GetNDevices(); ndId++)
956 Ptr<SatNetDevice> utNd =
957 DynamicCast<SatNetDevice>(
m_beamHelper->GetUtNodes().Get(utId)->GetDevice(ndId));
960 utSatNetDeviceCount++;
961 utBeamId = utNd->GetMac()->GetBeamId();
962 satUtMac = DynamicCast<SatUtMac>(utNd->GetMac());
965 NS_ASSERT_MSG(utSatNetDeviceCount == 1,
"UT must have exactly on SatNetDevice");
966 NS_ASSERT_MSG(satUtMac !=
nullptr,
"UT must have a SatUtMac for beam");
970 uint32_t usedBeamId = 0;
971 uint32_t gwSatGeoNetDeviceCount = 0;
972 for (uint32_t ndId = 0; ndId <
m_beamHelper->GetGeoSatNodes().Get(gwSatId)->GetNDevices();
975 Ptr<SatGeoNetDevice> gwNd = DynamicCast<SatGeoNetDevice>(
976 m_beamHelper->GetGeoSatNodes().Get(gwSatId)->GetDevice(ndId));
979 gwSatGeoNetDeviceCount++;
980 usedBeamId = gwNd->GetFeederMac(utBeamId)->GetBeamId();
983 NS_ASSERT_MSG(gwSatGeoNetDeviceCount == 1,
"SAT must have exactly on SatGeoNetDevice");
984 NS_ASSERT_MSG(usedBeamId != 0,
"Incorrect beam ID");
987 Mac48Address gwAddress;
988 uint32_t gwSatNetDeviceCount = 0;
989 for (uint32_t ndId = 0; ndId < gw->GetNDevices(); ndId++)
991 Ptr<SatNetDevice> gwNd = DynamicCast<SatNetDevice>(gw->GetDevice(ndId));
992 if (gwNd && gwNd->GetMac()->GetBeamId() == usedBeamId &&
993 gwNd->GetMac()->GetSatId() == gwSatId)
995 gwSatNetDeviceCount++;
996 gwAddress = Mac48Address::ConvertFrom(gwNd->GetAddress());
999 NS_ASSERT_MSG(gwSatNetDeviceCount == 1,
1000 "GW must have exactly on SatNetDevice for beam "
1001 << usedBeamId <<
" and satellite " << gwSatId);
1003 satUtMac->SetGwAddress(gwAddress);
1010 NS_LOG_FUNCTION(
this);
1012 for (uint32_t gwId = 0; gwId <
GwNodes().GetN(); gwId++)
1014 Ptr<Node> gw =
GwNodes().Get(gwId);
1015 for (uint32_t ndId = 0; ndId < gw->GetNDevices(); ndId++)
1017 if (DynamicCast<SatNetDevice>(gw->GetDevice(ndId)))
1019 Ptr<SatNetDevice> gwNd = DynamicCast<SatNetDevice>(gw->GetDevice(ndId));
1023 for (uint32_t i = 0; i < utNd.GetN(); i++)
1025 ut.Add(utNd.Get(i)->GetNode());
1027 m_userHelper->PopulateBeamRoutings(ut, utNd, gw, gwNd);
1035 const std::string& folderName,
1036 Ptr<RandomVariableStream> utUsers)
1038 if (!(Singleton<SatEnvVariables>::Get()->IsValidDirectory(folderName)))
1040 NS_LOG_INFO(
"Directory '" << folderName
1041 <<
"' does not exist, no mobile UTs will be created.");
1045 for (std::string& filename : SystemPath::ReadFiles(folderName))
1047 std::string filepath = folderName +
"/" + filename;
1048 if (Singleton<SatEnvVariables>::Get()->IsValidDirectory(filepath))
1050 NS_LOG_INFO(
"Skipping directory '" << filename <<
"'");
1058 std::map<uint32_t, NodeContainer>::iterator it =
m_mobileUtsByBeam.find(bestBeamId);
1061 std::pair<std::map<uint32_t, NodeContainer>::iterator,
bool> inserted =
1063 NS_ASSERT_MSG(inserted.second,
1064 "Failed to create a new beam when reading UT mobility files");
1068 it->second.Add(utNode);
1077 NS_LOG_INFO(
"Installing Mobility Observers for mobile UTs starting in beam "
1078 << mobileUtsForBeam.first);
1087 Ptr<SatTracedMobilityModel> mobility =
1089 Ptr<Node> utNode = CreateObject<Node>();
1090 utNode->AggregateObject(mobility);
1098 NS_LOG_FUNCTION(
this);
1100 NodeContainer gwNodes = NodeContainer(gw);
1101 MobilityHelper mobility;
1102 Ptr<SatListPositionAllocator> gwPosAllocator = CreateObject<SatListPositionAllocator>();
1104 gwPosAllocator->Add(
m_satConf->GetGwPosition(gwIndex));
1106 mobility.SetPositionAllocator(gwPosAllocator);
1107 mobility.SetMobilityModel(
"ns3::SatConstantPositionMobilityModel");
1108 mobility.Install(gwNodes);
1116 NS_LOG_FUNCTION(
this);
1118 MobilityHelper mobility;
1120 Ptr<SatPositionAllocator> allocator;
1138 mobility.SetPositionAllocator(allocator);
1139 mobility.SetMobilityModel(
"ns3::SatConstantPositionMobilityModel");
1140 mobility.Install(uts);
1144 for (uint32_t i = 0; i < uts.GetN(); ++i)
1148 "Installing mobility observer on Ut Node at "
1149 << position <<
" with antenna gain of "
1161 std::vector<std::pair<GeoCoordinate, uint32_t>> positionsAndGroupId)
1163 NS_LOG_FUNCTION(
this << beamId);
1165 MobilityHelper mobility;
1167 Ptr<SatListPositionAllocator> allocator = CreateObject<SatListPositionAllocator>();
1169 NS_ASSERT_MSG(uts.GetN() == positionsAndGroupId.size(),
1170 "Inconsistent number of nodes and positions");
1172 for (uint32_t i = 0; i < positionsAndGroupId.size(); i++)
1174 allocator->Add(positionsAndGroupId[i].first);
1175 m_groupHelper->AddNodeToGroupAfterScenarioCreation(positionsAndGroupId[i].second,
1179 mobility.SetPositionAllocator(allocator);
1180 mobility.SetMobilityModel(
"ns3::SatConstantPositionMobilityModel");
1181 mobility.Install(uts);
1185 for (uint32_t i = 0; i < uts.GetN(); ++i)
1189 "Installing mobility observer on Ut Node at "
1190 << position <<
" with antenna gain of "
1197 Ptr<SatSpotBeamPositionAllocator>
1206 Ptr<SatSpotBeamPositionAllocator> beamAllocator =
1209 Ptr<UniformRandomVariable> altRnd = CreateObject<UniformRandomVariable>();
1210 altRnd->SetAttribute(
"Min", DoubleValue(0.0));
1211 altRnd->SetAttribute(
"Max", DoubleValue(500.0));
1212 beamAllocator->SetAltitude(altRnd);
1213 return beamAllocator;
1219 NS_LOG_FUNCTION(
this);
1221 MobilityHelper mobility;
1223 Ptr<SatListPositionAllocator> geoSatPosAllocator = CreateObject<SatListPositionAllocator>();
1224 geoSatPosAllocator->Add(
m_satConf->GetGeoSatPosition());
1226 mobility.SetPositionAllocator(geoSatPosAllocator);
1227 mobility.SetMobilityModel(
"ns3::SatConstantPositionMobilityModel");
1228 mobility.Install(node);
1234 NS_LOG_FUNCTION(
this);
1236 Ptr<Object>
object = node;
1238 if (model ==
nullptr)
1240 ObjectFactory mobilityFactory;
1241 mobilityFactory.SetTypeId(
"ns3::SatSGP4MobilityModel");
1243 if (model ==
nullptr)
1245 NS_FATAL_ERROR(
"The requested mobility model is not a mobility model: \""
1246 << mobilityFactory.GetTypeId().GetName() <<
"\"");
1248 object->AggregateObject(model);
1253 model->SetTleInfo(
m_satConf->GetSatTle());
1257 model->SetTleInfo(tle);
1264 NS_LOG_FUNCTION(
this);
1266 for (NodeContainer::Iterator i = nodes.Begin(); i != nodes.End(); i++)
1270 if (observer ==
nullptr)
1276 NS_ASSERT(ownMobility != NULL);
1279 observer = CreateObject<SatMobilityObserver>(
1284 (*i)->AggregateObject(observer);
1291 NodeContainer receivers,
1292 Ipv4Address sourceAddress,
1293 Ipv4Address groupAddress)
1295 NS_LOG_FUNCTION(
this);
1298 Ptr<NetDevice> routerUserOutputDev;
1299 Ptr<Node> sourceUtNode =
m_userHelper->GetUtNode(source);
1314 destNode = sourceUtNode;
1322 if (!beamInfo.empty() || (sourceUtNode && routerUserOutputDev))
1326 Ptr<NetDevice> routerInputDev = NULL;
1327 Ptr<NetDevice> gwOutputDev = NULL;
1330 NetDeviceContainer gwInputDevices =
1335 (
bool)routerUserOutputDev,
1338 Ipv4StaticRoutingHelper multicast;
1347 else if (!sourceUtNode)
1352 std::pair<Ptr<NetDevice>, Ptr<NetDevice>> devices;
1356 routerInputDev = devices.second;
1360 NetDeviceContainer routerOutputDevices;
1362 if (routerUserOutputDev)
1364 routerOutputDevices.Add(routerUserOutputDev);
1367 for (NetDeviceContainer::Iterator it = gwInputDevices.Begin(); it != gwInputDevices.End();
1374 routerOutputDevices.Add(matchingDevice);
1381 if (routerInputDev && (routerOutputDevices.GetN() > 0))
1383 multicast.AddMulticastRoute(routerNode,
1387 routerOutputDevices);
1394 std::string context,
1397 *stream->GetStream() << context <<
", " << info << std::endl;
1403 NS_LOG_FUNCTION(
this);
1412 NS_LOG_FUNCTION(
this);
1414 std::ostringstream oss;
1416 oss << std::endl << std::endl << title << std::endl << std::endl;
1417 oss <<
"--- User Info ---" << std::endl << std::endl;
1418 oss <<
"Created GW users: " <<
m_userHelper->GetGwUserCount() <<
", ";
1419 oss <<
"Created UT users: " <<
m_userHelper->GetUtUserCount() << std::endl << std::endl;
1420 oss <<
m_userHelper->GetRouterInfo() << std::endl << std::endl;
1429 NS_LOG_FUNCTION(
this);
1443 NS_LOG_FUNCTION(
this);
1445 os <<
"Satellite topology" << std::endl;
1446 os <<
"==================" << std::endl;
1448 os <<
"Satellites" << std::endl;
1449 NodeContainer satNodes =
m_beamHelper->GetGeoSatNodes();
1450 for (uint32_t i = 0; i < satNodes.GetN(); i++)
1452 Ptr<Node> node = satNodes.Get(i);
1453 os <<
" SAT: ID = " << satNodes.Get(i)->GetId();
1456 os <<
" Devices to ground stations " << std::endl;
1457 for (uint32_t j = 0; j < node->GetNDevices(); j++)
1459 Ptr<SatGeoNetDevice> geoNetDevice = DynamicCast<SatGeoNetDevice>(node->GetDevice(j));
1462 os <<
" " << geoNetDevice->GetAddress() << std::endl;
1463 std::map<uint32_t, Ptr<SatMac>> feederMac = geoNetDevice->GetAllFeederMac();
1464 for (std::map<uint32_t, Ptr<SatMac>>::iterator it = feederMac.begin();
1465 it != feederMac.end();
1468 os <<
" Feeder at " << it->second->GetAddress() <<
", beam " << it->first
1471 std::map<uint32_t, Ptr<SatMac>> userMac = geoNetDevice->GetUserMac();
1472 for (std::map<uint32_t, Ptr<SatMac>>::iterator it = userMac.begin();
1473 it != userMac.end();
1476 os <<
" User at " << it->second->GetAddress() <<
", beam " << it->first
1479 std::set<Mac48Address> gwConnected = geoNetDevice->GetGwConnected();
1480 os <<
" Feeder connected to" << std::endl;
1481 for (std::set<Mac48Address>::iterator it = gwConnected.begin();
1482 it != gwConnected.end();
1485 os <<
" " << *it << std::endl;
1489 os <<
" ISLs " << std::endl;
1490 for (uint32_t j = 0; j < node->GetNDevices(); j++)
1492 Ptr<PointToPointIslNetDevice> islNetDevice =
1493 DynamicCast<PointToPointIslNetDevice>(node->GetDevice(j));
1496 os <<
" " << islNetDevice->GetAddress() <<
" to SAT "
1497 << islNetDevice->GetDestinationNode()->GetId() << std::endl;
1502 os <<
"GWs" << std::endl;
1504 for (uint32_t i = 0; i < gwNodes.GetN(); i++)
1506 Ptr<Node> node = gwNodes.Get(i);
1507 os <<
" GW: ID = " << gwNodes.Get(i)->GetId();
1510 os <<
" Devices " << std::endl;
1511 for (uint32_t j = 0; j < node->GetNDevices(); j++)
1513 Ptr<SatNetDevice> netDevice = DynamicCast<SatNetDevice>(node->GetDevice(j));
1516 Ptr<SatMac> mac = netDevice->GetMac();
1517 os <<
" " << mac->GetAddress() <<
", sat: " << mac->GetSatId()
1518 <<
", beam: " << mac->GetBeamId() << std::endl;
1523 os <<
"UTs" << std::endl;
1525 for (uint32_t i = 0; i < utNodes.GetN(); i++)
1527 Ptr<Node> node = utNodes.Get(i);
1528 os <<
" UT: ID = " << utNodes.Get(i)->GetId();
1531 os <<
" Devices " << std::endl;
1532 for (uint32_t j = 0; j < node->GetNDevices(); j++)
1534 Ptr<SatNetDevice> netDevice = DynamicCast<SatNetDevice>(node->GetDevice(j));
1537 Ptr<SatUtMac> mac = DynamicCast<SatUtMac>(netDevice->GetMac());
1538 os <<
" " << mac->GetAddress() <<
", sat: " << mac->GetSatId()
1539 <<
", beam: " << mac->GetBeamId();
1540 os <<
". Linked to GW " << mac->GetGwAddress() << std::endl;
1545 os <<
"GW users" << std::endl;
1546 NodeContainer gwUserNodes =
m_userHelper->GetGwUsers();
1547 for (uint32_t i = 0; i < gwUserNodes.GetN(); i++)
1549 Ptr<Node> node = gwUserNodes.Get(i);
1550 os <<
" GW user: ID = " << gwUserNodes.Get(i)->GetId() << std::endl;
1553 os <<
"UT users" << std::endl;
1554 NodeContainer utUserNodes =
m_userHelper->GetUtUsers();
1555 for (uint32_t i = 0; i < utUserNodes.GetN(); i++)
1557 Ptr<Node> node = utUserNodes.Get(i);
1558 os <<
" UT user: ID = " << utUserNodes.Get(i)->GetId() << std::endl;
1561 os <<
"==================" << std::endl;
1568 std::pair<Ptr<NetDevice>, Ptr<NetDevice>>& matchingDevices)
1572 for (uint32_t i = 1; ((i < nodeA->GetNDevices()) && !found); i++)
1574 Ptr<NetDevice> devA = nodeA->GetDevice(i);
1579 matchingDevices = std::make_pair(devA, devB);
1590 Ptr<NetDevice> matchingDevice = NULL;
1592 Ipv4Address addressA =
1593 devA->GetNode()->GetObject<Ipv4L3Protocol>()->GetAddress(devA->GetIfIndex(), 0).GetLocal();
1595 devA->GetNode()->GetObject<Ipv4L3Protocol>()->GetAddress(devA->GetIfIndex(), 0).GetMask();
1597 Ipv4Address netAddressA = addressA.CombineMask(maskA);
1599 for (uint32_t j = 1; j < nodeB->GetNDevices(); j++)
1601 Ipv4Address addressB = nodeB->GetObject<Ipv4L3Protocol>()->GetAddress(j, 0).GetLocal();
1602 Ipv4Mask maskB = nodeB->GetObject<Ipv4L3Protocol>()->GetAddress(j, 0).GetMask();
1604 Ipv4Address netAddressB = addressB.CombineMask(maskB);
1606 if (netAddressA == netAddressB)
1608 matchingDevice = nodeB->GetDevice(j);
1612 return matchingDevice;
1618 NS_LOG_FUNCTION(
this);
1620 std::pair<Ptr<NetDevice>, Ptr<NetDevice>> devices;
1624 Ipv4StaticRoutingHelper multicast;
1625 Ptr<Ipv4StaticRouting> staticRouting =
1626 multicast.GetStaticRouting(source->GetObject<ns3::Ipv4>());
1629 bool defaultMulticastRouteExists =
false;
1630 Ipv4Address defMulticastNetwork = Ipv4Address(
"224.0.0.0");
1631 Ipv4Mask defMulticastNetworkMask = Ipv4Mask(
"240.0.0.0");
1633 for (uint32_t i = 0; i < staticRouting->GetNRoutes(); i++)
1635 if (staticRouting->GetRoute(i).GetDestNetwork() == defMulticastNetwork &&
1636 staticRouting->GetRoute(i).GetDestNetworkMask() == defMulticastNetworkMask)
1638 defaultMulticastRouteExists =
true;
1643 if (!defaultMulticastRouteExists)
1645 multicast.SetDefaultMulticastRoute(source, devices.first);
1652 NodeContainer receivers,
1654 Ptr<NetDevice>& routerUserOutputDev)
1656 NS_LOG_FUNCTION(
this);
1658 bool routeToSourceNertwork =
false;
1660 routerUserOutputDev = NULL;
1663 for (uint32_t i = 0; i < receivers.GetN(); i++)
1665 Ptr<Node> receiverNode = receivers.Get(i);
1666 Ptr<Node> utNode =
m_userHelper->GetUtNode(receiverNode);
1676 if (sourceUtNode == utNode)
1680 routeToSourceNertwork =
true;
1686 MulticastBeamInfo_t::iterator it = beamInfo.find(beamId);
1689 if (it == beamInfo.end())
1691 std::pair<MulticastBeamInfo_t::iterator, bool> result =
1700 NS_FATAL_ERROR(
"Cannot insert beam to map container");
1705 it->second.insert(utNode);
1710 NS_FATAL_ERROR(
"UT node's beam ID is invalid!!");
1715 if (!routerUserOutputDev)
1719 std::pair<Ptr<NetDevice>, Ptr<NetDevice>> devices;
1723 routerUserOutputDev = devices.second;
1728 routeToSourceNertwork =
true;
1734 NS_FATAL_ERROR(
"Multicast receiver node is expected to be connected UT or GW node!!!");
1738 return routeToSourceNertwork;
1744 NS_LOG_FUNCTION(
this);
1746 std::set<uint32_t> networkAddresses;
1747 std::pair<std::set<uint32_t>::const_iterator,
bool> addressInsertionResult;
1754 if (!addressInsertionResult.second)
1756 NS_FATAL_ERROR(
"GW network address is invalid (same as Beam network address)");
1761 if (!addressInsertionResult.second)
1763 NS_FATAL_ERROR(
"UT network address is invalid (same as Beam or GW network address)");
1767 uint32_t utNetworkAddressCount = 0;
1768 uint32_t utHostAddressCount = 0;
1769 uint32_t beamHostAddressCount = 0;
1770 uint32_t gwNetworkAddressCount = 1;
1772 std::set<uint32_t> gwIds;
1774 for (BeamUserInfoMap_t::const_iterator it = info.begin(); it != info.end(); it++)
1776 uint32_t beamUtCount = it->second.GetUtCount();
1777 utNetworkAddressCount += beamUtCount;
1779 if (beamUtCount > beamHostAddressCount)
1781 beamHostAddressCount = beamUtCount;
1784 for (uint32_t i = 0; i < beamUtCount; i++)
1786 if (it->second.GetUtUserCount(i) > utHostAddressCount)
1788 utHostAddressCount = it->second.GetUtUserCount(i);
1794 if (gwIds.insert(
m_beamHelper->GetGwId(it->first.first, it->first.second)).second)
1796 gwNetworkAddressCount++;
1806 beamHostAddressCount);
1811 gwNetworkAddressCount,
1817 utNetworkAddressCount,
1818 utHostAddressCount);
1828 const Ipv4Address& firstNetwork,
1829 const Ipv4Mask& mask,
1830 const std::set<uint32_t>& networkAddresses,
1831 uint32_t networkCount,
1832 uint32_t hostCount)
const
1834 NS_LOG_FUNCTION(
this);
1836 uint16_t addressPrefixLength = mask.GetPrefixLength();
1842 NS_FATAL_ERROR(networkName
1843 <<
" network mask value out of range (0xFFFFFF70 to 0x10000000).");
1847 if ((firstNetwork.Get() & mask.GetInverse()) != 0)
1849 NS_FATAL_ERROR(networkName <<
" network address and mask inconsistent.");
1852 std::set<uint32_t>::const_iterator currentAddressIt = networkAddresses.find(firstNetwork.Get());
1855 if (currentAddressIt != networkAddresses.end())
1859 uint32_t hostAddressCount = std::pow(2, (32 - addressPrefixLength)) - 2;
1860 uint32_t firstAddressValue = firstNetwork.Get();
1861 uint32_t networkAddressCount =
1862 mask.Get() - firstAddressValue +
1870 if ((currentAddressIt != networkAddresses.end()) &&
1871 (firstAddressValue + (networkCount << (32 - addressPrefixLength))) >= *currentAddressIt)
1873 NS_FATAL_ERROR(networkName <<
" network's addresses overlaps with some other network)");
1877 if (networkCount > networkAddressCount)
1879 NS_FATAL_ERROR(
"Not enough network addresses for '" << networkName <<
"' network");
1883 if (hostCount > hostAddressCount)
1885 NS_FATAL_ERROR(
"Not enough host addresses for '" << networkName <<
"' network");
1890 NS_FATAL_ERROR(networkName
1891 <<
"network's initial address number not among of the given addresses");
GeoCoordinate class is used to store and operate with geodetic coordinates.
Class representing the MAC layer of a Class A LoRaWAN device.
SatChannel::CarrierFreqConverter CarrierFreqConverter
Define type CarrierFreqConverter.
Ptr< PropagationDelayModel > GetPropagationDelayModel(uint32_t satId, uint32_t beamId, SatEnums::ChannelType_t channelType)
Class that holds information for each beam regarding UTs and their users camped in each beam.
void AppendUt(uint32_t userCount)
Appends new UT to end of the list with given user count for the appended UT.
void SetUtUserCount(uint32_t utIndex, uint32_t userCount)
Sets user count for the UT with given uIndex.
double GetCarrierBandwidthHz(SatEnums::ChannelType_t chType, uint32_t carrierId, SatEnums::CarrierBandwidthType_t bandwidthType)
Convert carrier id and sequence id to to bandwidth value.
static const uint32_t GW_ID_INDEX
Definition for GW ID index (column) in m_conf.
static const uint32_t BEAM_ID_INDEX
Definition for beam ID index (column) in m_conf.
double GetCarrierFrequencyHz(SatEnums::ChannelType_t chType, uint32_t freqId, uint32_t carrierId)
Convert carrier id, sequency id and frequency id to real frequency value.
static const uint32_t U_FREQ_ID_INDEX
Definition for user frequency ID index (column) in m_conf.
static const uint32_t F_FREQ_ID_INDEX
Definition for feeder frequency ID index (column) in m_conf.
void PrintTopology(std::ostream &os) const
Print all the satellite topology.
void CreateConstellationScenario(BeamUserInfoMap_t &info, GetNextUtUserCountCallback getNextUtUserCountCallback)
Creates satellite objects according to constellation parameters.
void LoadMobileUTsFromFolder(uint32_t satId, const std::string &folderName, Ptr< RandomVariableStream > utUsers)
Load UTs with a SatTracedMobilityModel associated to them from the files found in the given folder.
void LoadConstellationTopology(std::string path, std::vector< std::string > &tles, std::vector< std::pair< uint32_t, uint32_t >> &isls)
Load a constellation topology.
Ptr< SatUserHelper > GetUserHelper() const
void CreatePredefinedScenario(PreDefinedScenario_t scenario)
Create a pre-defined SatHelper to make life easier when creating Satellite topologies.
Ptr< Node > LoadMobileUtFromFile(uint32_t satId, const std::string &filename)
Load an UT with a SatTracedMobilityModel associated to them from the given file.
Ipv4Mask m_beamNetworkMask
Network mask number of satellite devices.
std::string m_utCreationFileName
File name for UT creation trace output.
SatHelper()
Create a base SatHelper for creating customized Satellite topologies.
static void CreationDetailsSink(Ptr< OutputStreamWrapper > stream, std::string context, std::string info)
Sink for creation details traces.
SatEnums::Standard_t m_standard
std::multimap< uint32_t, uint32_t > m_mobileUtsUsersByBeam
List of users by mobile UT by beam ID.
void SetUtMobilityFromPosition(NodeContainer uts, uint32_t satId, uint32_t beamId, std::vector< std::pair< GeoCoordinate, uint32_t >> positionsAndGroupId)
Sets mobility to created UT nodes when position is known.
Ptr< SatSpotBeamPositionAllocator > GetBeamAllocator(uint32_t beamId)
Create a SatSpotBeamPositionAllocator able to generate random position within the given beam.
Ipv4Address m_beamNetworkAddress
Initial network number of satellite devices, e.g., 10.1.1.0.
void CreateLargerScenario()
Creates satellite objects according to larger scenario.
Ipv4Address m_gwNetworkAddress
Initial network number of GW, router, and GW users, e.g., 10.2.1.0.
Callback< uint32_t > GetNextUtUserCountCallback
Get number of Users for a UT.
void CheckNetwork(std::string networkName, const Ipv4Address &firstNetwork, const Ipv4Mask &mask, const std::set< uint32_t > &networkAddresses, uint32_t networkCount, uint32_t hostCount) const
Check validity of the configured network space.
Ipv4Mask m_utNetworkMask
Network mask number of UT and UT users.
void InstallMobilityObserver(uint32_t satId, NodeContainer nodes) const
Install Satellite Mobility Observer to nodes, if observer doesn't exist already in a node.
static TypeId GetTypeId(void)
Get the type ID.
std::string m_scenarioCreationFileName
File name for scenario creation trace output.
BeamUserInfoMap_t m_beamUserInfos
Info for beam creation in user defined scenario.
void DoCreateScenario(BeamUserInfoMap_t &info, uint32_t gwUsers)
Creates satellite objects according to given beam info.
uint32_t m_utsInBeam
Number of UTs created per Beam in full or user-defined scenario.
bool m_satMobilitySGP4Enabled
The satellite moves following a SGP4 model.
std::string m_gwPosFileName
Ipv4Address GetUserAddress(Ptr< Node > node)
void SetCustomUtPositionAllocator(Ptr< SatListPositionAllocator > posAllocator)
Set custom position allocator.
void SetGroupHelper(Ptr< SatGroupHelper > groupHelper)
set the group helper.
std::string m_fwdConfFileName
bool m_creationTraces
flag to indicate if creation trace should be enabled for scenario creation.
void SetBeamRoutingConstellations()
Populate the routes, when using constellations.
SatBeamHelper::MulticastBeamInfo_t MulticastBeamInfo_t
std::map< Ptr< Node >, Ptr< Node > > m_gwDistribution
Map indicating the GW node associated to each UT node.
static const uint16_t MAX_ADDRESS_PREFIX_LENGTH
TypeId GetInstanceTypeId(void) const
Get the type ID of object instance.
Ptr< SatConf > m_satConf
Configuration for satellite network.
void SetAntennaGainPatterns(Ptr< SatAntennaGainPatternContainer > antennaGainPattern)
Set the antenna gain patterns.
Ptr< OutputStreamWrapper > m_creationTraceStream
Stream wrapper used for creation traces.
bool ConstructMulticastInfo(Ptr< Node > sourceUtNode, NodeContainer receivers, MulticastBeamInfo_t &beamInfo, Ptr< NetDevice > &routerUserOutputDev)
Construct multicast information from source UT node and group receivers.
std::string m_rtnConfFileName
Configuration file names as attributes of this class.
bool m_packetTraces
flag to indicate if packet trace should be enabled after scenario creation.
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.
Ptr< SatAntennaGainPatternContainer > GetAntennaGainPatterns()
TracedCallback< std::string > m_creationSummaryTrace
Trace callback for creation traces (summary)
void SetUtMobility(NodeContainer uts, uint32_t satId, uint32_t beamId)
Sets mobility to created UT nodes.
void EnableCreationTraces()
Enables creation traces to be written in given file.
bool m_detailedCreationTraces
flag to indicate if detailed creation trace should be enabled for scenario creation.
void CreationSummarySink(std::string title)
Sink for creation summary traces.
std::string CreateCreationSummary(std::string title)
Creates trace summary starting with give title.
Ptr< OutputStreamWrapper > m_utTraceStream
Stream wrapper used for UT position traces.
void SetGwMobility(uint32_t satId, Ptr< Node > gw, uint32_t gwIndex)
Sets mobilities to created GW nodes.
Ptr< SatUserHelper > m_userHelper
User helper.
NodeContainer GetGwUsers() const
std::string m_geoPosFileName
void SetUtPositionAllocatorForBeam(uint32_t beamId, Ptr< SatListPositionAllocator > posAllocator)
Set custom position allocator for specific beam.
void EnablePacketTrace()
Enable packet traces.
void SetGeoSatMobility(Ptr< Node > node)
Sets mobility to created Sat Geo node.
uint32_t GetBeamCount() const
Get count of the beams (configurations).
SatBeamHelper::MulticastBeamInfoItem_t MulticastBeamInfoItem_t
void CreateUserDefinedScenarioFromListPositions(uint32_t satId, BeamUserInfoMap_t &info, bool checkBeam)
Creates satellite objects according to user defined scenario.
void SetSatMobility(Ptr< Node > node, std::string tle="")
Sets SGP4 mobility to created Sat node.
Ptr< SatAntennaGainPatternContainer > m_antennaGainPatterns
Antenna gain patterns for all spot-beams.
void CreateFullScenario()
Creates satellite objects according to full scenario.
std::map< uint32_t, NodeContainer > m_mobileUtsByBeam
List of mobile UTs by beam ID.
Ptr< SatGroupHelper > GetGroupHelper() const
void CreateSimpleScenario()
Creates satellite objects according to simple scenario.
bool m_scenarioCreated
flag to check if scenario is already created.
Ptr< SatGroupHelper > m_groupHelper
Group helper.
void SetNetworkAddresses(BeamUserInfoMap_t &info, uint32_t gwUsers) const
Set configured network addresses to user and beam helpers.
void SetMulticastRouteToSourceNetwork(Ptr< Node > source, Ptr< Node > destination)
Set multicast traffic to source's nwtwork by finding source network utilizing given destination node.
Ipv4Address m_utNetworkAddress
Initial network number of UT and UT users, e.g., 10.3.1.0.
uint32_t GetClosestSat(GeoCoordinate position)
Get closest satellite to a ground station.
uint32_t m_utUsers
Number of users created in end user network (behind every UT) in full or user-defined scenario.
Ptr< NetDevice > FindMatchingDevice(Ptr< NetDevice > devA, Ptr< Node > nodeB)
Find given device's counterpart (device belonging to same network) device from given node.
void SetGwAddressInUt()
Set the value of GW address for each UT.
TracedCallback< std::string > m_creationDetailsTrace
Trace callback for creation traces (details)
std::map< std::pair< uint32_t, uint32_t >, SatBeamUserInfo > BeamUserInfoMap_t
definition for beam map key is pair sat ID / beam ID and value is UT/user info.
NodeContainer GetUtUsers() const
static const uint16_t MIN_ADDRESS_PREFIX_LENGTH
std::map< uint32_t, Ptr< SatListPositionAllocator > > m_utPositionsByBeam
User defined UT positions by beam ID.
Ipv4Mask m_gwNetworkMask
Network mask number of GW, router, and GW users.
std::string m_waveformConfFileName
bool FindMatchingDevices(Ptr< Node > nodeA, Ptr< Node > nodeB, std::pair< Ptr< NetDevice >, Ptr< NetDevice >> &matchingDevices)
Find counterpart (device belonging to same network) devices from given nodes.
Ptr< SatBeamHelper > m_beamHelper
Beam helper.
void CreateUserDefinedScenario(BeamUserInfoMap_t &info)
Creates satellite objects according to user defined scenario.
std::string m_satMobilitySGP4TleFileName
TLE input filename used for SGP4 mobility.
void DoDispose()
Dispose of this class instance.
std::map< Ptr< NetDevice >, NetDeviceContainer > m_utsDistribution
Map indicating all UT NetDevices associated to each GW NetDevice.
std::map< uint32_t, uint32_t > m_gwSats
Map of closest satellite for each GW.
void SetMulticastGroupRoutes(Ptr< Node > source, NodeContainer receivers, Ipv4Address sourceAddress, Ipv4Address groupAddress)
Set multicast group to satellite network and IP router.
uint32_t m_gwUsers
Number of users created in public network (behind GWs) in full or user-defined scenario.
Ptr< SatBeamHelper > GetBeamHelper() const
bool m_satConstellationEnabled
Use a constellation of satellites.
std::string m_satConstellationFolder
Folder where are stored satellite constellation data.
void EnableDetailedCreationTraces()
Enables creation traces in sub-helpers.
Ptr< SatListPositionAllocator > m_utPositions
User defined UT positions from SatConf (or manually set)
@ LOG_WARNING
LOG_WARNING.
A configuration class for the GEO satellite reference system.
void setSatConfAttributes(Ptr< SatConf > satConf)
SatLorawanNetDevice to be utilized in the UT and GW nodes for IoT configuration.
Keep track of the current position and velocity of an object in satellite network.
Observes given mobilities and keeps track of certain wanted properties.
Ptr< SatMac > GetMac(void) const
Get a Mac pointer.
Keep track of the current position and velocity of satellite using SGP4 model.
Satellite mobility model for which the current position change based on values read from a file.
Callback< Ptr< PropagationDelayModel >, uint32_t, uint32_t, SatEnums::ChannelType_t > PropagationDelayCallback
void UpdateGwRoutes(Address ut, Address oldGateway, Address newGateway)
Update ARP cache and default route on the terrestrial network so packets are properly routed to the U...
void UpdateUtRoutes(Address ut, Address newGateway)
Update ARP cache and default route on an UT so packets are properly routed to the new GW as their nex...
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.
Ptr< SatMobilityModel > satMobility