20 #ifndef SATELLITE_TOPOLOGY_H
21 #define SATELLITE_TOPOLOGY_H
42 #include <ns3/node-container.h>
44 #include <ns3/object.h>
67 std::map<std::pair<uint32_t, uint32_t>, Ptr<SatNetDevice>>
m_netDevice;
68 std::map<std::pair<uint32_t, uint32_t>, Ptr<SatGwLlc>>
m_llc;
69 std::map<std::pair<uint32_t, uint32_t>, Ptr<SatGwMac>>
m_dvbMac;
70 std::map<std::pair<uint32_t, uint32_t>, Ptr<LorawanGroundMacGateway>>
m_loraMac;
71 std::map<std::pair<uint32_t, uint32_t>, Ptr<SatGwPhy>>
m_phy;
91 std::map<uint32_t, Ptr<SatOrbiterUserLlc>>
m_userLlc;
96 std::map<uint32_t, Ptr<SatOrbiterUserPhy>>
m_userPhy;
173 void AddGwNode(uint32_t gwId, Ptr<Node> gw);
341 Ptr<Node>
GetUtNode(Ptr<Node> utUser)
const;
385 Ptr<Node>
GetGwNode(uint32_t nodeId)
const;
394 Ptr<Node>
GetUtNode(uint32_t nodeId)
const;
450 Ptr<SatNetDevice> netDevice,
473 Ptr<SatNetDevice> netDevice,
474 Ptr<LorawanGroundMacGateway> mac,
513 Ptr<SatNetDevice>
GetGwNetDevice(Ptr<Node> gw, uint32_t utSatId, uint32_t utBeamId)
const;
524 Ptr<SatGwLlc>
GetGwLlc(Ptr<Node> gw, uint32_t utSatId, uint32_t utBeamId)
const;
535 Ptr<SatGwMac>
GetDvbGwMac(Ptr<Node> gw, uint32_t utSatId, uint32_t utBeamId)
const;
548 uint32_t utBeamId)
const;
559 Ptr<SatGwPhy>
GetGwPhy(Ptr<Node> gw, uint32_t utSatId, uint32_t utBeamId)
const;
577 Ptr<SatNetDevice> netDevice,
598 Ptr<SatNetDevice> netDevice,
599 Ptr<LorawanMacEndDevice> mac,
662 Ptr<SatUtLlc>
GetUtLlc(Ptr<Node> ut)
const;
680 Ptr<LorawanMacEndDevice>
GetLoraUtMac(Ptr<Node> ut)
const;
689 Ptr<SatUtPhy>
GetUtPhy(Ptr<Node> ut)
const;
706 Ptr<SatOrbiterNetDevice> netDevice,
707 Ptr<SatOrbiterFeederLlc> llc,
708 Ptr<SatOrbiterFeederMac> mac,
709 Ptr<SatOrbiterFeederPhy> phy);
725 Ptr<SatOrbiterNetDevice> netDevice,
726 Ptr<SatOrbiterUserLlc> llc,
727 Ptr<SatOrbiterUserMac> mac,
728 Ptr<SatOrbiterUserPhy> phy);
744 Ptr<SatOrbiterNetDevice> netDevice,
745 Ptr<LorawanOrbiterMacGateway> mac,
746 Ptr<SatOrbiterUserPhy> phy);
784 Ptr<SatOrbiterUserLlc>
GetOrbiterUserLlc(Ptr<Node> orbiter, uint32_t beamId)
const;
834 Ptr<SatOrbiterUserPhy>
GetOrbiterUserPhy(Ptr<Node> orbiter, uint32_t beamId)
const;
877 std::map<Ptr<SatOrbiterFeederMac>, Ptr<SatOrbiterFeederMac>>
GeoCoordinate class is used to store and operate with geodetic coordinates.
Standard_t
The global standard used.
RegenerationMode_t
The regeneration mode used in satellites.
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.
void EnableMapPrint(bool enableMapPrint)
Function for enabling the map prints.
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