30#include "ns3/net-device.h"
31#include "ns3/node-container.h"
32#include "ns3/packet.h"
33#include "ns3/point-to-point-net-device.h"
48 TypeId(
"ns3::NetworkServer")
50 .AddConstructor<NetworkServer>()
53 "Trace source that is fired when a packet arrives at the network server",
55 "ns3::Packet::TracedCallback")
56 .SetGroupName(
"lorawan");
92 for (
uint32_t i = 0; i < gateway->GetNDevices(); i++)
108 Address gatewayAddress = p2pNetDevice->GetAddress();
111 Ptr<GatewayStatus> gwStatus = Create<GatewayStatus>(gatewayAddress, netDevice, gwMac);
113 m_status->AddGateway(gatewayAddress, gwStatus);
123 for (it =
nodes.Begin(); it !=
nodes.End(); it++)
136 for (
uint32_t i = 0; i < node->GetNDevices(); i++)
138 loraNetDevice = node->GetDevice(i)->GetObject<
LoraNetDevice>();
172 m_status->OnReceivedPacket(packet, address);
a polymophic address class
The base class for all ns3 applications.
keep track of a set of node pointers.
std::vector< Ptr< Node > >::const_iterator Iterator
Node container iterator.
Ptr< T > GetObject() const
Get a pointer to the requested aggregated Object.
A Device for a Point to Point Network Link.
Smart pointer class similar to boost::intrusive_ptr.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Class representing the MAC layer of a Class A LoRaWAN device.
Class representing the MAC layer of a LoRaWAN gateway.
Hold together all LoRa related objects.
This class collects a series of components that deal with various aspects of managing the network,...
Network server component in charge of scheduling downling packets onto devices' reception windows.
void AddNode(Ptr< Node > node)
Inform the NetworkServer application that this node is connected to the network.
NetworkServer()
Default constructor.
Ptr< NetworkStatus > GetNetworkStatus()
Get the NetworkStatus object of this NetworkServer application.
void AddGateway(Ptr< Node > gateway, Ptr< NetDevice > netDevice)
Add the gateway to the list of gateways connected to this network server.
TracedCallback< Ptr< const Packet > > m_receivedPacket
The ReceivedPacket trace source.
bool Receive(Ptr< NetDevice > device, Ptr< const Packet > packet, uint16_t protocol, const Address &sender)
Receive a packet from a gateway.
void StopApplication() override
Stop the network server application.
static TypeId GetTypeId()
Register this type.
Ptr< NetworkScheduler > m_scheduler
Ptr to the NetworkScheduler object.
Ptr< NetworkStatus > m_status
Ptr to the NetworkStatus object.
void AddNodes(NodeContainer nodes)
Inform the NetworkServer application that these nodes are connected to the network.
~NetworkServer() override
Destructor.
void AddComponent(Ptr< NetworkControllerComponent > component)
Add a NetworkControllerComponent to this NetworkServer application.
void StartApplication() override
Start the network server application.
Ptr< NetworkController > m_controller
Ptr to the NetworkController object.
This class represents the knowledge about the state of the network that is available at the network s...
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_FUNCTION_NOARGS()
Output the name of the function.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Ptr< T > Create(Ts &&... args)
Create class instances by constructors with varying numbers of arguments and return them by Ptr.
Ptr< const TraceSourceAccessor > MakeTraceSourceAccessor(T a)
Create a TraceSourceAccessor which will control access to the underlying trace source.
Every class exported by the ns3 library is enclosed in the ns3 namespace.