This class represents the knowledge about the state of the network that is available at the Network Server. More...
#include "lora-network-status.h"
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< LoraEndDeviceStatus > | GetEndDeviceStatus (LoraDeviceAddress address) |
Get the EndDeviceStatus corresponding to a LoraDeviceAddress. More... | |
Ptr< LoraEndDeviceStatus > | GetEndDeviceStatus (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 |
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.
ns3::LoraNetworkStatus::LoraNetworkStatus | ( | ) |
Definition at line 58 of file lora-network-status.cc.
References m_forwardLinkRegenerationMode, and m_uniform.
|
virtual |
Definition at line 66 of file lora-network-status.cc.
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.
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().
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.
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.
deviceAddress | the 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.
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.
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.
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().
|
static |
Definition at line 52 of file lora-network-status.cc.
bool ns3::LoraNetworkStatus::NeedsReply | ( | LoraDeviceAddress | deviceAddress | ) |
Return whether the specified device needs a reply.
deviceAddress | the address of the device we are interested in. |
Definition at line 143 of file lora-network-status.cc.
References m_endDeviceStatuses.
void ns3::LoraNetworkStatus::OnReceivedPacket | ( | Ptr< const Packet > | packet, |
const Address & | gwaddress | ||
) |
Update network status on the received packet.
packet | the received packet. |
address | the 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().
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.
std::map<LoraDeviceAddress, Ptr<LoraEndDeviceStatus> > ns3::LoraNetworkStatus::m_endDeviceStatuses |
Definition at line 123 of file lora-network-status.h.
Referenced by AddNode(), CountEndDevices(), GetBestGatewayForDevice(), GetEndDeviceStatus(), GetReplyForDevice(), NeedsReply(), and OnReceivedPacket().
SatEnums::RegenerationMode_t ns3::LoraNetworkStatus::m_forwardLinkRegenerationMode |
Definition at line 128 of file lora-network-status.h.
Referenced by LoraNetworkStatus(), and GetBestGatewayForDevice().
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().
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().
Ptr<UniformRandomVariable> ns3::LoraNetworkStatus::m_uniform |
Definition at line 130 of file lora-network-status.h.
Referenced by LoraNetworkStatus(), and GetBestGatewayForDevice().