ns3::LoraNetworkStatus Class Reference

This class represents the knowledge about the state of the network that is available at the Network Server. More...

#include "lora-network-status.h"

+ Inheritance diagram for ns3::LoraNetworkStatus:
+ Collaboration diagram for ns3::LoraNetworkStatus:

Public Member Functions

 LoraNetworkStatus ()
 
virtual ~LoraNetworkStatus ()
 
void AddGateway (Ptr< Node > gw, Address &address, Ptr< LoraGatewayStatus > gwStatus)
 Add this gateway to the list of gateways connected to the network. More...
 
void AddNode (Ptr< LorawanMacEndDeviceClassA > edMac)
 Add a device to the ones that are tracked by this LoraNetworkStatus object. More...
 
int CountEndDevices (void)
 Return the number of end devices currently managed by the server. More...
 
Address GetBestGatewayForDevice (LoraDeviceAddress deviceAddress, int window)
 Return whether we have a gateway that is available to send a reply to the specified device. More...
 
Ptr< LoraEndDeviceStatusGetEndDeviceStatus (LoraDeviceAddress address)
 Get the EndDeviceStatus corresponding to a LoraDeviceAddress. More...
 
Ptr< LoraEndDeviceStatusGetEndDeviceStatus (Ptr< const Packet > packet)
 Get the EndDeviceStatus for the device that sent a packet. More...
 
Ptr< Packet > GetReplyForDevice (LoraDeviceAddress edAddress, int windowNumber)
 Get the reply for the specified device address. More...
 
bool NeedsReply (LoraDeviceAddress deviceAddress)
 Return whether the specified device needs a reply. More...
 
void OnReceivedPacket (Ptr< const Packet > packet, const Address &gwaddress)
 Update network status on the received packet. More...
 
void SendThroughGateway (Ptr< Packet > packet, Address gwAddress)
 Send a packet through a Gateway. More...
 

Static Public Member Functions

static TypeId GetTypeId (void)
 

Public Attributes

std::map< LoraDeviceAddress, Ptr< LoraEndDeviceStatus > > m_endDeviceStatuses
 
SatEnums::RegenerationMode_t m_forwardLinkRegenerationMode
 
std::map< Address, Ptr< LoraGatewayStatus > > m_gatewayStatuses
 
std::map< Ptr< Node >, Ptr< PointToPointNetDevice > > m_gws
 
Ptr< UniformRandomVariable > m_uniform
 

Detailed Description

This class represents the knowledge about the state of the network that is available at the Network Server.

It is essentially a collection of two maps: one containing DeviceStatus objects, and the other containing GatewayStatus objects.

This class is meant to be queried by NetworkController components, which can decide to take action based on the current status of the network.

Definition at line 50 of file lora-network-status.h.

Constructor & Destructor Documentation

◆ LoraNetworkStatus()

ns3::LoraNetworkStatus::LoraNetworkStatus ( )

Definition at line 58 of file lora-network-status.cc.

References m_forwardLinkRegenerationMode, and m_uniform.

◆ ~LoraNetworkStatus()

ns3::LoraNetworkStatus::~LoraNetworkStatus ( )
virtual

Definition at line 66 of file lora-network-status.cc.

Member Function Documentation

◆ AddGateway()

void ns3::LoraNetworkStatus::AddGateway ( Ptr< Node >  gw,
Address &  address,
Ptr< LoraGatewayStatus gwStatus 
)

Add this gateway to the list of gateways connected to the network.

Each GW is identified by its Address in the NS-GW network.

Definition at line 93 of file lora-network-status.cc.

References m_gatewayStatuses, and m_gws.

◆ AddNode()

void ns3::LoraNetworkStatus::AddNode ( Ptr< LorawanMacEndDeviceClassA edMac)

Add a device to the ones that are tracked by this LoraNetworkStatus object.

Definition at line 72 of file lora-network-status.cc.

References m_endDeviceStatuses, and ns3::LoraDeviceAddress::Print().

+ Here is the call graph for this function:

◆ CountEndDevices()

int ns3::LoraNetworkStatus::CountEndDevices ( void  )

Return the number of end devices currently managed by the server.

Definition at line 310 of file lora-network-status.cc.

References m_endDeviceStatuses.

◆ GetBestGatewayForDevice()

Address ns3::LoraNetworkStatus::GetBestGatewayForDevice ( LoraDeviceAddress  deviceAddress,
int  window 
)

Return whether we have a gateway that is available to send a reply to the specified device.

Parameters
deviceAddressthe address of the device we are interested in.

Definition at line 150 of file lora-network-status.cc.

References ns3::SatNetDevice::GetMac(), m_endDeviceStatuses, m_forwardLinkRegenerationMode, m_gatewayStatuses, m_gws, m_uniform, and ns3::SatEnums::REGENERATION_NETWORK.

+ Here is the call graph for this function:

◆ GetEndDeviceStatus() [1/2]

Ptr< LoraEndDeviceStatus > ns3::LoraNetworkStatus::GetEndDeviceStatus ( LoraDeviceAddress  address)

Get the EndDeviceStatus corresponding to a LoraDeviceAddress.

Definition at line 293 of file lora-network-status.cc.

References m_endDeviceStatuses.

◆ GetEndDeviceStatus() [2/2]

Ptr< LoraEndDeviceStatus > ns3::LoraNetworkStatus::GetEndDeviceStatus ( Ptr< const Packet >  packet)

Get the EndDeviceStatus for the device that sent a packet.

Definition at line 270 of file lora-network-status.cc.

References ns3::LoraFrameHeader::GetAddress(), and m_endDeviceStatuses.

+ Here is the call graph for this function:

◆ GetReplyForDevice()

Ptr< Packet > ns3::LoraNetworkStatus::GetReplyForDevice ( LoraDeviceAddress  edAddress,
int  windowNumber 
)

Get the reply for the specified device address.

Definition at line 237 of file lora-network-status.cc.

References m_endDeviceStatuses, ns3::LoraBeamTag::SetBeamId(), ns3::LoraTag::SetDataRate(), ns3::LoraTag::SetFrequency(), and ns3::LoraTag::SetModcod().

+ Here is the call graph for this function:

◆ GetTypeId()

TypeId ns3::LoraNetworkStatus::GetTypeId ( void  )
static

Definition at line 52 of file lora-network-status.cc.

◆ NeedsReply()

bool ns3::LoraNetworkStatus::NeedsReply ( LoraDeviceAddress  deviceAddress)

Return whether the specified device needs a reply.

Parameters
deviceAddressthe address of the device we are interested in.

Definition at line 143 of file lora-network-status.cc.

References m_endDeviceStatuses.

◆ OnReceivedPacket()

void ns3::LoraNetworkStatus::OnReceivedPacket ( Ptr< const Packet >  packet,
const Address &  gwaddress 
)

Update network status on the received packet.

Parameters
packetthe received packet.
addressthe gateway this packet was received from.

Definition at line 122 of file lora-network-status.cc.

References ns3::LoraFrameHeader::GetAddress(), m_endDeviceStatuses, and ns3::LoraFrameHeader::SetAsUplink().

+ Here is the call graph for this function:

◆ SendThroughGateway()

void ns3::LoraNetworkStatus::SendThroughGateway ( Ptr< Packet >  packet,
Address  gwAddress 
)

Send a packet through a Gateway.

This function assumes that the packet is already tagged with a LoraTag that will inform the gateway of the parameters to use for the transmission.

Definition at line 229 of file lora-network-status.cc.

References m_gatewayStatuses.

Member Data Documentation

◆ m_endDeviceStatuses

std::map<LoraDeviceAddress, Ptr<LoraEndDeviceStatus> > ns3::LoraNetworkStatus::m_endDeviceStatuses

◆ m_forwardLinkRegenerationMode

SatEnums::RegenerationMode_t ns3::LoraNetworkStatus::m_forwardLinkRegenerationMode

Definition at line 128 of file lora-network-status.h.

Referenced by LoraNetworkStatus(), and GetBestGatewayForDevice().

◆ m_gatewayStatuses

std::map<Address, Ptr<LoraGatewayStatus> > ns3::LoraNetworkStatus::m_gatewayStatuses

Definition at line 124 of file lora-network-status.h.

Referenced by AddGateway(), GetBestGatewayForDevice(), and SendThroughGateway().

◆ m_gws

std::map<Ptr<Node>, Ptr<PointToPointNetDevice> > ns3::LoraNetworkStatus::m_gws

Definition at line 126 of file lora-network-status.h.

Referenced by AddGateway(), and GetBestGatewayForDevice().

◆ m_uniform

Ptr<UniformRandomVariable> ns3::LoraNetworkStatus::m_uniform

Definition at line 130 of file lora-network-status.h.

Referenced by LoraNetworkStatus(), and GetBestGatewayForDevice().


The documentation for this class was generated from the following files: