32NS_LOG_COMPONENT_DEFINE(
"SatTopology");
43 TypeId(
"ns3::SatTopology").SetParent<Object>().AddConstructor<SatTopology>();
50 NS_LOG_FUNCTION(
this);
55 NS_LOG_FUNCTION(
this);
63 NS_LOG_FUNCTION(
this);
73 NS_LOG_FUNCTION(
this);
75 m_gws = NodeContainer();
77 m_uts = NodeContainer();
91 NS_LOG_FUNCTION(
this << standard);
99 NS_LOG_FUNCTION(
this);
108 NS_LOG_FUNCTION(
this << forwardLinkRegenerationMode);
116 NS_LOG_FUNCTION(
this);
124 NS_LOG_FUNCTION(
this << returnLinkRegenerationMode);
132 NS_LOG_FUNCTION(
this);
140 NS_LOG_FUNCTION(
this << gw);
142 m_gwIds.insert(std::make_pair(gwId, gw));
144 m_gws = NodeContainer();
145 for (std::map<uint32_t, Ptr<Node>>::const_iterator i =
m_gwIds.begin(); i !=
m_gwIds.end(); i++)
147 m_gws.Add(i->second);
154 NS_LOG_FUNCTION(
this << ut);
162 NS_LOG_FUNCTION(
this << orbiter);
170 NS_LOG_FUNCTION(
this << gwUser);
178 NS_LOG_FUNCTION(
this << utUser);
191 NS_LOG_FUNCTION(
this << ut << gw);
195 NS_FATAL_ERROR(
"UT " << ut <<
" already in GW to UT map. Connected to GW "
205 NS_LOG_FUNCTION(
this << ut << gw);
209 NS_FATAL_ERROR(
"UT " << ut <<
" not in GW to UT map.");
218 NS_LOG_FUNCTION(
this << ut);
220 const std::map<Ptr<Node>, Ptr<Node>>::iterator it =
m_utToGwMap.find(ut);
223 NS_FATAL_ERROR(
"UT " << ut <<
" not in GW to UT map.");
234 NS_LOG_FUNCTION(
this << ut);
236 const std::map<Ptr<Node>, Ptr<Node>>::const_iterator it =
m_utToGwMap.find(ut);
239 NS_FATAL_ERROR(
"UT " << ut <<
" not in GW to UT map.");
247 NS_LOG_FUNCTION(
this << beamId << gw);
251 NS_FATAL_ERROR(
"Beam " << beamId <<
" already in GW to beam map. Connected to GW "
261 NS_LOG_FUNCTION(
this << beamId);
263 const std::map<uint32_t, Ptr<Node>>::const_iterator it =
m_beamToGwMap.find(beamId);
266 NS_FATAL_ERROR(
"Beam " << beamId <<
" not in GW to beam map.");
274 NS_LOG_FUNCTION(
this << mac << usedMac);
278 NS_FATAL_ERROR(
"Feeder MAC " << mac <<
" already associated to "
285Ptr<SatOrbiterFeederMac>
288 NS_LOG_FUNCTION(
this << mac);
290 const std::map<Ptr<SatOrbiterFeederMac>, Ptr<SatOrbiterFeederMac>>::const_iterator it =
294 NS_FATAL_ERROR(
"Feeder MAC " << mac <<
" not found");
303 NS_LOG_FUNCTION(
this << utId);
311 Ptr<Node> gwOrbiter =
m_orbiters.Get(gwSatId);
316 Ptr<SatGwMac> gwMac =
GetDvbGwMac(gwNode, gwSatId, usedBeamId);
318 NS_ASSERT_MSG(gwMac !=
nullptr,
"Got a null SatGwMac");
320 return Mac48Address::ConvertFrom(gwMac->GetAddress());
326 NS_LOG_FUNCTION(
this);
334 NS_LOG_FUNCTION(
this);
342 NS_LOG_FUNCTION(
this);
350 NS_LOG_FUNCTION(
this);
358 NS_LOG_FUNCTION(
this);
366 NS_LOG_FUNCTION(
this);
369 for (NodeContainer::Iterator i = uts.Begin(); i != uts.End(); i++)
379 NS_LOG_FUNCTION(
this << ut);
385 NS_FATAL_ERROR(
"UT which users are requested in not installed!!!");
394 for (std::map<Ptr<Node>, NodeContainer>::const_iterator it =
m_detailledUtUsers.begin();
398 for (NodeContainer::Iterator it2 = it->second.Begin(); it2 != it->second.End(); it2++)
413 NS_LOG_FUNCTION(
this);
421 NS_LOG_FUNCTION(
this);
429 NS_LOG_FUNCTION(
this);
437 NS_LOG_FUNCTION(
this);
445 NS_LOG_FUNCTION(
this);
453 NS_LOG_FUNCTION(
this << nodeId);
455 return m_gws.Get(nodeId);
461 NS_LOG_FUNCTION(
this << nodeId);
463 return m_uts.Get(nodeId);
469 NS_LOG_FUNCTION(
this << nodeId);
477 NS_LOG_FUNCTION(
this << nodeId);
485 NS_LOG_FUNCTION(
this << nodeId);
493 NS_LOG_FUNCTION(
this << nodeId);
495 NodeContainer::Iterator it;
496 for (it =
m_gws.Begin(); it !=
m_gws.End(); it++)
498 if ((*it)->GetId() == nodeId)
504 for (it =
m_uts.Begin(); it !=
m_uts.End(); it++)
506 if ((*it)->GetId() == nodeId)
514 if ((*it)->GetId() == nodeId)
522 if ((*it)->GetId() == nodeId)
530 if ((*it)->GetId() == nodeId)
536 NS_FATAL_ERROR(
"Node " << nodeId <<
" not found");
547 Ptr<SatNetDevice> netDevice,
552 NS_LOG_FUNCTION(
this << gw << gwSatId << gwBeamId << utSatId << utBeamId << netDevice << llc
562 "Gw has already a different GW satellite ID that the one in argument of this method");
565 "Gw has already a different GW beam ID that the one in argument of this method");
566 NS_ASSERT_MSG(layers.
m_netDevice.find(std::make_pair(utSatId, utBeamId)) ==
568 "Net device already stored for this GW + UT satellite and beam");
569 NS_ASSERT_MSG(layers.
m_llc.find(std::make_pair(utSatId, utBeamId)) == layers.
m_llc.end(),
570 "LLC already stored for this GW + UT satellite and beam");
571 NS_ASSERT_MSG(layers.
m_dvbMac.find(std::make_pair(utSatId, utBeamId)) ==
573 "MAC already stored for this GW + UT satellite and beam");
574 NS_ASSERT_MSG(layers.
m_phy.find(std::make_pair(utSatId, utBeamId)) == layers.
m_phy.end(),
575 "Physical layer already stored for this GW + UT satellite and beam");
583 layers.
m_netDevice.insert(std::make_pair(std::make_pair(utSatId, utBeamId), netDevice));
584 layers.
m_llc.insert(std::make_pair(std::make_pair(utSatId, utBeamId), llc));
585 layers.
m_dvbMac.insert(std::make_pair(std::make_pair(utSatId, utBeamId), mac));
586 layers.
m_phy.insert(std::make_pair(std::make_pair(utSatId, utBeamId), phy));
597 Ptr<SatNetDevice> netDevice,
598 Ptr<LorawanGroundMacGateway> mac,
601 NS_LOG_FUNCTION(
this << gw << gwSatId << gwBeamId << utSatId << utBeamId << netDevice << mac
611 "Gw has already a different GW satellite ID that the one in argument of this method");
614 "Gw has already a different GW beam ID that the one in argument of this method");
615 NS_ASSERT_MSG(layers.
m_netDevice.find(std::make_pair(utSatId, utBeamId)) ==
617 "Net device already stored for this GW + UT satellite and beam");
618 NS_ASSERT_MSG(layers.
m_loraMac.find(std::make_pair(utSatId, utBeamId)) ==
620 "MAC already stored for this GW + UT satellite and beam");
621 NS_ASSERT_MSG(layers.
m_phy.find(std::make_pair(utSatId, utBeamId)) == layers.
m_phy.end(),
622 "Physical layer already stored for this GW + UT satellite and beam");
630 layers.
m_netDevice.insert(std::make_pair(std::make_pair(utSatId, utBeamId), netDevice));
631 layers.
m_loraMac.insert(std::make_pair(std::make_pair(utSatId, utBeamId), mac));
632 layers.
m_phy.insert(std::make_pair(std::make_pair(utSatId, utBeamId), phy));
640 NS_LOG_FUNCTION(
this << gw << satId << beamId);
651 NS_LOG_FUNCTION(
this << gw);
661 NS_LOG_FUNCTION(
this << gw);
671 NS_LOG_FUNCTION(
this << gw << utSatId << utBeamId);
675 "Layers do not exist for this GW and pair UT satellite+beam");
678 NS_ASSERT_MSG(layers.
m_netDevice.find(std::make_pair(utSatId, utBeamId)) !=
680 "Net device not stored for this GW + UT satellite and beam");
682 return layers.
m_netDevice.at(std::make_pair(utSatId, utBeamId));
688 NS_LOG_FUNCTION(
this << gw << utSatId << utBeamId);
692 "Layers do not exist for this GW and pair UT satellite+beam");
695 NS_ASSERT_MSG(layers.
m_llc.find(std::make_pair(utSatId, utBeamId)) != layers.
m_llc.end(),
696 "LLC not stored for this GW + UT satellite and beam");
698 return layers.
m_llc.at(std::make_pair(utSatId, utBeamId));
704 NS_LOG_FUNCTION(
this << gw << utSatId << utBeamId);
708 "Layers do not exist for this GW and pair UT satellite+beam");
711 NS_ASSERT_MSG(layers.
m_dvbMac.find(std::make_pair(utSatId, utBeamId)) != layers.
m_dvbMac.end(),
712 "MAC not stored for this GW + UT satellite and beam");
714 return layers.
m_dvbMac.at(std::make_pair(utSatId, utBeamId));
717Ptr<LorawanGroundMacGateway>
720 NS_LOG_FUNCTION(
this << gw << utSatId << utBeamId);
724 "Layers do not exist for this GW and pair UT satellite+beam");
727 NS_ASSERT_MSG(layers.
m_loraMac.find(std::make_pair(utSatId, utBeamId)) !=
729 "MAC not stored for this GW + UT satellite and beam");
731 return layers.
m_loraMac.at(std::make_pair(utSatId, utBeamId));
737 NS_LOG_FUNCTION(
this << gw << utSatId << utBeamId);
741 "Layers do not exist for this GW and pair UT satellite+beam");
744 NS_ASSERT_MSG(layers.
m_phy.find(std::make_pair(utSatId, utBeamId)) != layers.
m_phy.end(),
745 "Physical layer not stored for this GW + UT satellite and beam");
747 return layers.
m_phy.at(std::make_pair(utSatId, utBeamId));
755 Ptr<SatNetDevice> netDevice,
760 NS_LOG_FUNCTION(
this << ut << satId << beamId << groupId << netDevice << llc << mac << phy);
773 m_utLayers.insert(std::make_pair(ut, layers));
781 Ptr<SatNetDevice> netDevice,
782 Ptr<LorawanMacEndDevice> mac,
785 NS_LOG_FUNCTION(
this << ut << satId << beamId << groupId << netDevice << mac << phy);
797 m_utLayers.insert(std::make_pair(ut, layers));
803 NS_LOG_FUNCTION(
this << ut << satId << beamId);
814 NS_LOG_FUNCTION(
this << ut << groupId);
824 NS_LOG_FUNCTION(
this << ut);
834 NS_LOG_FUNCTION(
this << ut);
844 NS_LOG_FUNCTION(
this << ut);
854 NS_LOG_FUNCTION(
this << ut);
864 NS_LOG_FUNCTION(
this << ut);
874 NS_LOG_FUNCTION(
this << ut);
881Ptr<LorawanMacEndDevice>
884 NS_LOG_FUNCTION(
this << ut);
894 NS_LOG_FUNCTION(
this << ut);
905 Ptr<SatOrbiterNetDevice> netDevice,
906 Ptr<SatOrbiterFeederLlc> llc,
907 Ptr<SatOrbiterFeederMac> mac,
908 Ptr<SatOrbiterFeederPhy> phy)
910 NS_LOG_FUNCTION(
this << orbiter << satId << utBeamId << netDevice << llc << mac << phy);
919 "Orbiter has already a different satellite ID that the one in argument of this method");
921 "Orbiter has already a different SatOrbiterNetDevice that the one in "
922 "argument of this method");
924 "Feeder LLC already stored for this pair orbiter/beam");
926 "Feeder MAC already stored for this pair orbiter/beam");
928 "Feeder physical layer already stored for this pair orbiter/beam");
936 layers.
m_feederLlc.insert(std::make_pair(utBeamId, llc));
937 layers.
m_feederMac.insert(std::make_pair(utBeamId, mac));
938 layers.
m_feederPhy.insert(std::make_pair(utBeamId, phy));
947 Ptr<SatOrbiterNetDevice> netDevice,
948 Ptr<SatOrbiterUserLlc> llc,
949 Ptr<SatOrbiterUserMac> mac,
950 Ptr<SatOrbiterUserPhy> phy)
952 NS_LOG_FUNCTION(
this << orbiter << satId << beamId << netDevice << llc << mac << phy);
961 "Orbiter has already a different satellite ID that the one in argument of this method");
963 "Orbiter has already a different SatOrbiterNetDevice that the one in "
964 "argument of this method");
966 "User LLC already stored for this pair orbiter/beam");
968 "User MAC already stored for this pair orbiter/beam");
970 "User physical layer already stored for this pair orbiter/beam");
978 layers.
m_userLlc.insert(std::make_pair(beamId, llc));
979 layers.
m_dvbUserMac.insert(std::make_pair(beamId, mac));
980 layers.
m_userPhy.insert(std::make_pair(beamId, phy));
989 Ptr<SatOrbiterNetDevice> netDevice,
990 Ptr<LorawanOrbiterMacGateway> mac,
991 Ptr<SatOrbiterUserPhy> phy)
993 NS_LOG_FUNCTION(
this << orbiter << satId << beamId << netDevice << mac << phy);
1002 "Orbiter has already a different satellite ID that the one in argument of this method");
1004 "Orbiter has already a different SatOrbiterNetDevice that the one in "
1005 "argument of this method");
1007 "User MAC already stored for this pair orbiter/beam");
1009 "User physical layer already stored for this pair orbiter/beam");
1018 layers.
m_userPhy.insert(std::make_pair(beamId, phy));
1026 NS_LOG_FUNCTION(
this << orbiter);
1029 "Layers do not exist for this UT");
1034Ptr<SatOrbiterNetDevice>
1037 NS_LOG_FUNCTION(
this << orbiter);
1040 "Layers do not exist for this UT");
1045Ptr<SatOrbiterFeederLlc>
1048 NS_LOG_FUNCTION(
this << orbiter << utBeamId);
1051 NS_ASSERT_MSG(it !=
m_orbiterLayers.end(),
"Layers do not exist for this UT");
1055 "Feeder LLC not stored for this pair orbiter/beam");
1060Ptr<SatOrbiterUserLlc>
1063 NS_LOG_FUNCTION(
this << orbiter << beamId);
1066 NS_ASSERT_MSG(it !=
m_orbiterLayers.end(),
"Layers do not exist for this UT");
1070 "Feeder LLC not stored for this pair orbiter/beam");
1075Ptr<SatOrbiterFeederMac>
1078 NS_LOG_FUNCTION(
this << orbiter << utBeamId);
1081 NS_ASSERT_MSG(it !=
m_orbiterLayers.end(),
"Layers do not exist for this UT");
1086 "Feeder MAC not stored for this pair orbiter/beam");
1091Ptr<SatOrbiterUserMac>
1094 NS_LOG_FUNCTION(
this << orbiter << beamId);
1097 NS_ASSERT_MSG(it !=
m_orbiterLayers.end(),
"Layers do not exist for this UT");
1101 "Feeder MAC not stored for this pair orbiter/beam");
1106Ptr<LorawanOrbiterMacGateway>
1109 NS_LOG_FUNCTION(
this << orbiter << beamId);
1112 NS_ASSERT_MSG(it !=
m_orbiterLayers.end(),
"Layers do not exist for this UT");
1116 "Feeder MAC not stored for this pair orbiter/beam");
1121Ptr<SatOrbiterFeederPhy>
1124 NS_LOG_FUNCTION(
this << orbiter << utBeamId);
1127 NS_ASSERT_MSG(it !=
m_orbiterLayers.end(),
"Layers do not exist for this UT");
1131 "Feeder PHY not stored for this pair orbiter/beam");
1136Ptr<SatOrbiterUserPhy>
1139 NS_LOG_FUNCTION(
this << orbiter << beamId);
1142 NS_ASSERT_MSG(it !=
m_orbiterLayers.end(),
"Layers do not exist for this UT");
1146 "Feeder PHY not stored for this pair orbiter/beam");
1154 NS_LOG_FUNCTION(
this);
1156 os <<
"Satellite topology" << std::endl;
1157 os <<
"==================" << std::endl;
1159 os <<
"Satellites" << std::endl;
1164 orbiter = *itOrbiter;
1167 os <<
" SAT: ID = " << layers.
m_satId;
1170 os <<
" Devices to ground stations " << std::endl;
1172 os <<
" " << layers.
m_netDevice->GetAddress() << std::endl;
1173 for (std::pair<uint32_t, Ptr<SatOrbiterFeederMac>> feederMac : layers.
m_feederMac)
1175 os <<
" Feeder at " << feederMac.second->GetAddress() <<
", beam "
1176 << feederMac.first << std::endl;
1179 os <<
" Feeder connected to" << std::endl;
1180 std::set<Mac48Address> gwConnected = layers.
m_netDevice->GetGwConnected();
1181 for (std::set<Mac48Address>::iterator it = gwConnected.begin(); it != gwConnected.end();
1184 os <<
" " << *it << std::endl;
1190 for (std::pair<uint32_t, Ptr<LorawanOrbiterMacGateway>> userMac : layers.
m_loraUserMac)
1192 os <<
" User at " << userMac.second->GetAddress() <<
", beam "
1193 << userMac.first << std::endl;
1198 for (std::pair<uint32_t, Ptr<SatOrbiterUserMac>> userMac : layers.
m_dvbUserMac)
1200 os <<
" User at " << userMac.second->GetAddress() <<
", beam "
1201 << userMac.first << std::endl;
1205 os <<
" User connected to" << std::endl;
1206 std::set<Mac48Address> utConnected = layers.
m_netDevice->GetUtConnected();
1207 for (std::set<Mac48Address>::iterator it = utConnected.begin(); it != utConnected.end();
1210 os <<
" " << *it << std::endl;
1213 os <<
" ISLs " << std::endl;
1214 for (uint32_t j = 0; j < orbiter->GetNDevices(); j++)
1216 Ptr<PointToPointIslNetDevice> islNetDevice =
1217 DynamicCast<PointToPointIslNetDevice>(orbiter->GetDevice(j));
1220 os <<
" " << islNetDevice->GetAddress() <<
" to SAT "
1221 << islNetDevice->GetDestinationNode()->GetId() << std::endl;
1226 os <<
"GWs" << std::endl;
1228 for (NodeContainer::Iterator itGw =
m_gws.Begin(); itGw !=
m_gws.End(); itGw++)
1232 os <<
" GW: ID = " << gwNode->GetId();
1235 os <<
" Devices " << std::endl;
1239 for (std::pair<std::pair<uint32_t, uint32_t>, Ptr<LorawanGroundMacGateway>> mac :
1242 uint32_t satId = mac.first.first;
1243 uint32_t beamId = mac.first.second;
1244 os <<
" " << mac.second->GetAddress() <<
", sat: " << satId
1245 <<
", beam: " << beamId << std::endl;
1250 for (std::pair<std::pair<uint32_t, uint32_t>, Ptr<SatGwMac>> mac : layers.
m_dvbMac)
1252 uint32_t satId = mac.first.first;
1253 uint32_t beamId = mac.first.second;
1254 os <<
" " << mac.second->GetAddress() <<
", sat: " << satId
1255 <<
", beam: " << beamId << std::endl;
1260 os <<
"UTs" << std::endl;
1262 for (NodeContainer::Iterator itUt =
m_uts.Begin(); itUt !=
m_uts.End(); itUt++)
1266 os <<
" UT: ID = " << utNode->GetId();
1269 os <<
" Devices " << std::endl;
1271 uint32_t utSatId = utLayers.
m_satId;
1272 uint32_t utBeamId = utLayers.
m_beamId;
1273 uint32_t gwSatId = gwLayers.
m_satId;
1277 os <<
" " << utLayers.
m_dvbMac->GetAddress() <<
", sat: " << utSatId
1278 <<
", beam: " << utBeamId;
1279 os <<
". Linked to GW "
1280 << gwLayers.
m_dvbMac.at(std::make_pair(gwSatId, utBeamId))->GetAddress()
1285 os <<
" " << utLayers.
m_loraMac->GetAddress() <<
", sat: " << utSatId
1286 <<
", beam: " << utBeamId;
1289 os <<
". Linked to GW "
1290 << gwLayers.
m_loraMac.at(std::make_pair(gwSatId, utBeamId))->GetAddress()
1295 os <<
". Linked to GW "
1296 << gwLayers.
m_dvbMac.at(std::make_pair(gwSatId, utBeamId))->GetAddress()
1302 os <<
"GW users" << std::endl;
1305 Ptr<Node> gwUserNode = *it;
1306 os <<
" GW user: ID = " << gwUserNode->GetId() << std::endl;
1309 os <<
"UT users" << std::endl;
1312 Ptr<Node> utUserNode = *it;
1313 os <<
" GW user: ID = " << utUserNode->GetId() << std::endl;
1316 os <<
"==================" << std::endl;
1323 NS_LOG_FUNCTION(
this << position);
1325 double distanceMin = std::numeric_limits<double>::max();
1326 uint32_t indexDistanceMin = 0;
1328 for (uint32_t i = 0; i <
m_orbiters.GetN(); i++)
1331 double distance = CalculateDistance(position.
ToVector(), satPos.
ToVector());
1332 if (distance < distanceMin)
1334 distanceMin = distance;
1335 indexDistanceMin = i;
1338 return indexDistanceMin;
GeoCoordinate class is used to store and operate with geodetic coordinates.
Vector ToVector() const
Converts Geodetic coordinates to Cartesian coordinates.
Standard_t
The global standard used.
RegenerationMode_t
The regeneration mode used in satellites.
Keep track of the current position and velocity of an object in satellite network.
Class to store topology of the whole system.
void AddGwNode(uint32_t gwId, Ptr< Node > gw)
Add a GW node to the topology.
void UpdateUtSatAndBeam(Ptr< Node > ut, uint32_t satId, uint32_t beamId)
Update satellite and beam associated to a UT.
Ptr< SatOrbiterFeederLlc > GetOrbiterFeederLlc(Ptr< Node > orbiter, uint32_t utBeamId) const
Get SatOrbiterFeederLlc instance of an orbiter serving wanted beam ID.
void AddGwLayersLora(Ptr< Node > gw, uint32_t gwSatId, uint32_t gwBeamId, uint32_t utSatId, uint32_t utBeamId, Ptr< SatNetDevice > netDevice, Ptr< LorawanGroundMacGateway > mac, Ptr< SatGwPhy > phy)
Add LORA GW layers for given node, associated to chosen satellite and beam.
Ptr< Node > GetGwNode(uint32_t nodeId) const
Get the wanted GW node.
void AddOrbiterFeederLayers(Ptr< Node > orbiter, uint32_t satId, uint32_t utBeamId, Ptr< SatOrbiterNetDevice > netDevice, Ptr< SatOrbiterFeederLlc > llc, Ptr< SatOrbiterFeederMac > mac, Ptr< SatOrbiterFeederPhy > phy)
Add orbiter feeder layers for given satellite and beam ID.
void SetStandard(SatEnums::Standard_t standard)
Set standard used (DVB or LORA).
Ptr< SatUtPhy > GetUtPhy(Ptr< Node > ut) const
Get SatUtPhy instance of a UT.
NodeContainer GetUtNodes() const
Get the list of UT nodes.
Ptr< SatUtMac > GetDvbUtMac(Ptr< Node > ut) const
Get SatUtMac instance of a DVB UT.
void Reset()
Function for resetting the variables.
NodeContainer GetUtUserNodes() const
Get the list of UT user nodes.
uint32_t GetOrbiterSatId(Ptr< Node > orbiter) const
Get ID of a given orbiter.
std::map< Ptr< Node >, GwLayers_s > m_gwLayers
std::map< Ptr< Node >, Ptr< Node > > m_utToGwMap
Ptr< LorawanOrbiterMacGateway > GetLoraOrbiterUserMac(Ptr< Node > orbiter, uint32_t beamId) const
Get LorawanOrbiterMacGateway instance of a LORA orbiter serving wanted beam ID.
Ptr< SatGwPhy > GetGwPhy(Ptr< Node > gw, uint32_t utSatId, uint32_t utBeamId) const
Get SatGwPhy instance of a GW.
void AddUtUserNode(Ptr< Node > utUser, Ptr< Node > ut)
Add a UT user node to the topology.
SatEnums::RegenerationMode_t m_returnLinkRegenerationMode
uint32_t GetGwBeamId(Ptr< Node > gw) const
Get ID of beam linked to a GW.
Ptr< Node > GetGwFromUt(Ptr< Node > ut) const
Get GW connected to a given UT.
SatEnums::Standard_t GetStandard()
Get standard used (DVB or LORA).
uint32_t GetUtGroupId(Ptr< Node > ut) const
Get ID of group linked to a UT.
Ptr< SatOrbiterUserPhy > GetOrbiterUserPhy(Ptr< Node > orbiter, uint32_t beamId) const
Get SatOrbiterUserPhy instance of an orbiter serving wanted beam ID.
Ptr< Node > GetNodeFromId(uint32_t nodeId) const
Get the wanted node from its node ID.
Ptr< SatNetDevice > GetGwNetDevice(Ptr< Node > gw, uint32_t utSatId, uint32_t utBeamId) const
Get SatNetDevice instance of a GW.
void AddUtLayersLora(Ptr< Node > ut, uint32_t satId, uint32_t beamId, uint32_t groupId, Ptr< SatNetDevice > netDevice, Ptr< LorawanMacEndDevice > mac, Ptr< SatUtPhy > phy)
Add LORA UT layers for given node, associated to chosen satellite and beam.
Ptr< Node > GetOrbiterNode(uint32_t nodeId) const
Get the wanted orbiter node.
void PrintTopology(std::ostream &os) const
Print all the satellite topology.
uint32_t GetClosestSat(GeoCoordinate position)
Get closest satellite to a ground station.
std::map< Ptr< Node >, OrbiterLayers_s > m_orbiterLayers
uint32_t GetNUtUserNodes() const
Get the number of UT user nodes.
void DoDispose()
Do needed dispose actions.
std::map< uint32_t, Ptr< Node > > m_gwIds
NodeContainer GetGwUserNodes() const
Get the list of GW user nodes.
SatEnums::RegenerationMode_t GetForwardLinkRegenerationMode()
Get forward link regeneration mode.
Ptr< LorawanGroundMacGateway > GetLoraGwMac(Ptr< Node > gw, uint32_t utSatId, uint32_t utBeamId) const
Get SatGwMac instance of a LORA GW.
Ptr< SatOrbiterUserMac > GetDvbOrbiterUserMac(Ptr< Node > orbiter, uint32_t beamId) const
Get SatOrbiterUserMac instance of a DVB orbiter serving wanted beam ID.
void ConnectGwToUt(Ptr< Node > ut, Ptr< Node > gw)
Connect a GW to a UT.
void UpdateGwConnectedToUt(Ptr< Node > ut, Ptr< Node > gw)
Connect a new GW to a UT.
std::map< Ptr< SatOrbiterFeederMac >, Ptr< SatOrbiterFeederMac > > m_orbiterFeederMacMap
SatEnums::RegenerationMode_t GetReturnLinkRegenerationMode()
Get return link regeneration mode.
void AddUtLayersDvb(Ptr< Node > ut, uint32_t satId, uint32_t beamId, uint32_t groupId, Ptr< SatNetDevice > netDevice, Ptr< SatUtLlc > llc, Ptr< SatUtMac > mac, Ptr< SatUtPhy > phy)
Add DVB UT layers for given node, associated to chosen satellite and beam.
Ptr< SatOrbiterFeederPhy > GetOrbiterFeederPhy(Ptr< Node > orbiter, uint32_t utBeamId) const
Get SatOrbiterFeederPhy instance of an orbiter serving wanted beam ID.
Ptr< SatGwMac > GetDvbGwMac(Ptr< Node > gw, uint32_t utSatId, uint32_t utBeamId) const
Get SatGwMac instance of a DVB GW.
SatEnums::Standard_t m_standard
Ptr< SatOrbiterFeederMac > GetOrbiterFeederMac(Ptr< Node > orbiter, uint32_t utBeamId) const
Get SatOrbiterFeederMac instance of an orbiter serving wanted beam ID.
Ptr< Node > GetGwUserNode(uint32_t nodeId) const
Get the wanted GW user node.
uint32_t GetNOrbiterNodes() const
Get the number of orbiter nodes.
void SetForwardLinkRegenerationMode(SatEnums::RegenerationMode_t forwardLinkRegenerationMode)
Set forward link regeneration mode.
Ptr< SatUtLlc > GetUtLlc(Ptr< Node > ut) const
Get SatUtLlc instance of a UT.
NodeContainer GetOrbiterNodes() const
Get the list of orbiter nodes.
Ptr< Node > GetUtUserNode(uint32_t nodeId) const
Get the wanted UT user node.
uint32_t GetUtBeamId(Ptr< Node > ut) const
Get ID of beam linked to a UT.
std::map< Ptr< Node >, NodeContainer > m_detailledUtUsers
void AddOrbiterFeederMacPair(Ptr< SatOrbiterFeederMac > mac, Ptr< SatOrbiterFeederMac > usedMac)
Create an association between a feeder MAC layer, and the entity really used.
NodeContainer GetGwNodes() const
Get the list of GW nodes.
Ptr< SatOrbiterNetDevice > GetOrbiterNetDevice(Ptr< Node > orbiter) const
Get SatOrbiterNetDevice instance of an orbiter.
void SetReturnLinkRegenerationMode(SatEnums::RegenerationMode_t returnLinkRegenerationMode)
Set return link regeneration mode.
void AddUtNode(Ptr< Node > ut)
Add a UT node to the topology.
Ptr< SatOrbiterFeederMac > GetOrbiterFeederMacUsed(Ptr< SatOrbiterFeederMac > mac) const
Get feeder MAC really used to connect to a GW.
void AddGwLayersDvb(Ptr< Node > gw, uint32_t gwSatId, uint32_t gwBeamId, uint32_t utSatId, uint32_t utBeamId, Ptr< SatNetDevice > netDevice, Ptr< SatGwLlc > llc, Ptr< SatGwMac > mac, Ptr< SatGwPhy > phy)
Add DVB GW layers for given node, associated to chosen satellite and beam.
void ConnectGwToBeam(uint32_t beamId, Ptr< Node > gw)
Connect a GW to a Beam.
uint32_t GetNGwNodes() const
Get the number of GW nodes.
void UpdateGwSatAndBeam(Ptr< Node > gw, uint32_t satId, uint32_t beamId)
Update satellite and beam associated to a GW.
uint32_t GetNGwUserNodes() const
Get the number of GW user nodes.
SatTopology()
Constructor.
static TypeId GetTypeId(void)
NS-3 type id function.
Ptr< SatNetDevice > GetUtNetDevice(Ptr< Node > ut) const
Get SatNetDevice instance of a UT.
void AddGwUserNode(Ptr< Node > gwUser)
Add a GW user node to the topology.
Ptr< Node > GetGwFromBeam(uint32_t beamId) const
Get GW connected to a given beam ID.
~SatTopology()
Destructor.
uint32_t GetUtSatId(Ptr< Node > ut) const
Get ID of satellite linked to a UT.
Ptr< SatGwLlc > GetGwLlc(Ptr< Node > gw, uint32_t utSatId, uint32_t utBeamId) const
Get SatGwLlc instance of a GW.
void UpdateUtGroup(Ptr< Node > ut, uint32_t groupId)
Update satellite and beam associated to a UT.
SatEnums::RegenerationMode_t m_forwardLinkRegenerationMode
void AddOrbiterNode(Ptr< Node > orbiter)
Add an orbiter node to the topology.
void AddOrbiterUserLayersDvb(Ptr< Node > orbiter, uint32_t satId, uint32_t beamId, Ptr< SatOrbiterNetDevice > netDevice, Ptr< SatOrbiterUserLlc > llc, Ptr< SatOrbiterUserMac > mac, Ptr< SatOrbiterUserPhy > phy)
Add DVB orbiter user layers for given satellite and beam ID.
void AddOrbiterUserLayersLora(Ptr< Node > orbiter, uint32_t satId, uint32_t beamId, Ptr< SatOrbiterNetDevice > netDevice, Ptr< LorawanOrbiterMacGateway > mac, Ptr< SatOrbiterUserPhy > phy)
Add LORA orbiter user layers for given satellite and beam ID.
Ptr< Node > GetUtNode(Ptr< Node > utUser) const
Get UT node linked to some UT user.
void DisconnectGwFromUt(Ptr< Node > ut)
Disconnect a GW from a UT.
Ptr< SatOrbiterUserLlc > GetOrbiterUserLlc(Ptr< Node > orbiter, uint32_t beamId) const
Get SatOrbiterUserLlc instance of an orbiter serving wanted beam ID.
std::map< uint32_t, Ptr< Node > > m_beamToGwMap
Mac48Address GetGwAddressInUt(uint32_t utId)
Set the value of GW address for a UT.
Ptr< LorawanMacEndDevice > GetLoraUtMac(Ptr< Node > ut) const
Get SatUtMac instance of a LORA UT.
std::map< Ptr< Node >, UtLayers_s > m_utLayers
uint32_t GetNUtNodes() const
Get the number of UT nodes.
uint32_t GetGwSatId(Ptr< Node > gw) const
Get ID of satellite linked to a GW.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.
std::map< std::pair< uint32_t, uint32_t >, Ptr< SatGwLlc > > m_llc
std::map< std::pair< uint32_t, uint32_t >, Ptr< SatGwPhy > > m_phy
std::map< std::pair< uint32_t, uint32_t >, Ptr< SatNetDevice > > m_netDevice
std::map< std::pair< uint32_t, uint32_t >, Ptr< LorawanGroundMacGateway > > m_loraMac
std::map< std::pair< uint32_t, uint32_t >, Ptr< SatGwMac > > m_dvbMac
std::map< uint32_t, Ptr< SatOrbiterUserPhy > > m_userPhy
std::map< uint32_t, Ptr< SatOrbiterUserLlc > > m_userLlc
Ptr< SatOrbiterNetDevice > m_netDevice
std::map< uint32_t, Ptr< SatOrbiterFeederLlc > > m_feederLlc
std::map< uint32_t, Ptr< SatOrbiterFeederPhy > > m_feederPhy
std::map< uint32_t, Ptr< SatOrbiterFeederMac > > m_feederMac
std::map< uint32_t, Ptr< SatOrbiterUserMac > > m_dvbUserMac
std::map< uint32_t, Ptr< LorawanOrbiterMacGateway > > m_loraUserMac
Ptr< LorawanMacEndDevice > m_loraMac
Ptr< SatNetDevice > m_netDevice