23 #include "ns3/lora-network-server-helper.h"
25 #include "ns3/double.h"
27 #include "ns3/lora-adr-component.h"
28 #include "ns3/lora-network-controller-components.h"
29 #include "ns3/satellite-lorawan-net-device.h"
30 #include "ns3/simulator.h"
31 #include "ns3/string.h"
32 #include "ns3/trace-source-accessor.h"
34 NS_LOG_COMPONENT_DEFINE(
"LoraNetworkServerHelper");
39 NS_OBJECT_ENSURE_REGISTERED(LoraNetworkServerHelper);
44 static TypeId tid = TypeId(
"ns3::LoraNetworkServerHelper")
46 .AddConstructor<LoraNetworkServerHelper>();
52 m_factory.SetTypeId(
"ns3::LoraNetworkServer");
53 p2pHelper.SetDeviceAttribute(
"DataRate", StringValue(
"5Mbps"));
54 p2pHelper.SetChannelAttribute(
"Delay", StringValue(
"2ms"));
55 SetAdr(
"ns3::LoraAdrComponent");
89 ApplicationContainer apps;
90 for (NodeContainer::Iterator i = c.Begin(); i != c.End(); ++i)
101 NS_LOG_FUNCTION(
this << node);
106 node->AddApplication(app);
113 NetDeviceContainer container =
p2pHelper.Install(node, *it);
116 app->AddGateway(*it, container.Get(0));
119 for (uint32_t i = 0; i < node->GetNDevices(); i++)
121 Ptr<NetDevice> currentNetDevice = node->GetDevice(i);
138 NS_LOG_FUNCTION(
this << enableAdr);
146 NS_LOG_FUNCTION(
this << type);
155 NS_LOG_FUNCTION(
this << netServer);
158 Ptr<LoraConfirmedMessagesComponent> ackSupport = CreateObject<LoraConfirmedMessagesComponent>();
159 netServer->AddComponent(ackSupport);
162 Ptr<LoraLinkCheckComponent> linkCheckSupport = CreateObject<LoraLinkCheckComponent>();
163 netServer->AddComponent(linkCheckSupport);
Generic class describing a component of the NetworkController.
void SetGateways(NodeContainer gateways)
Set which gateways will need to be connected to this NS.
~LoraNetworkServerHelper()
PointToPointHelper p2pHelper
Helper to create PointToPoint links.
static TypeId GetTypeId(void)
Get the type ID.
LoraNetworkServerHelper()
void SetAdr(std::string type)
Set the ADR implementation to use in the Network Server created by this helper.
Ptr< Application > InstallPriv(Ptr< Node > node)
void InstallComponents(Ptr< LoraNetworkServer > netServer)
NodeContainer m_endDevices
Set of endDevices to connect to this NS.
void SetEndDevices(NodeContainer endDevices)
Set which end devices will be managed by this NS.
ApplicationContainer Install(NodeContainer c)
void EnableAdr(bool enableAdr)
Enable (true) or disable (false) the ADR component in the Network Server created by this helper.
void SetAttribute(std::string name, const AttributeValue &value)
NodeContainer m_gateways
Set of gateways to connect to this NS.
ObjectFactory m_adrSupportFactory
The LoraNetworkServer is an application standing on top of a node equipped with links that connect it...
bool Receive(Ptr< NetDevice > device, Ptr< const Packet > packet, uint16_t protocol, const Address &address)
Receive a packet from a gateway.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.