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/satellite-topology.h"
31 #include "ns3/simulator.h"
32 #include "ns3/string.h"
33 #include "ns3/trace-source-accessor.h"
38 NS_LOG_COMPONENT_DEFINE(
"LoraNetworkServerHelper");
43 NS_OBJECT_ENSURE_REGISTERED(LoraNetworkServerHelper);
48 static TypeId tid = TypeId(
"ns3::LoraNetworkServerHelper")
50 .AddConstructor<LoraNetworkServerHelper>();
56 m_factory.SetTypeId(
"ns3::LoraNetworkServer");
57 p2pHelper.SetDeviceAttribute(
"DataRate", StringValue(
"5Mbps"));
58 p2pHelper.SetChannelAttribute(
"Delay", StringValue(
"2ms"));
59 SetAdr(
"ns3::LoraAdrComponent");
81 ApplicationContainer apps;
82 for (NodeContainer::Iterator i = c.Begin(); i != c.End(); ++i)
93 NS_LOG_FUNCTION(
this << node);
98 node->AddApplication(app);
101 NodeContainer gwNodes = Singleton<SatTopology>::Get()->GetGwNodes();
102 for (NodeContainer::Iterator it = gwNodes.Begin(); it != gwNodes.End(); it++)
106 NetDeviceContainer container =
p2pHelper.Install(node, *it);
109 app->AddGateway(*it, container.Get(0));
112 for (uint32_t i = 0; i < node->GetNDevices(); i++)
114 Ptr<NetDevice> currentNetDevice = node->GetDevice(i);
120 app->AddNodes(Singleton<SatTopology>::Get()->GetUtNodes());
131 NS_LOG_FUNCTION(
this << enableAdr);
139 NS_LOG_FUNCTION(
this << type);
148 NS_LOG_FUNCTION(
this << netServer);
151 Ptr<LoraConfirmedMessagesComponent> ackSupport = CreateObject<LoraConfirmedMessagesComponent>();
152 netServer->AddComponent(ackSupport);
155 Ptr<LoraLinkCheckComponent> linkCheckSupport = CreateObject<LoraLinkCheckComponent>();
156 netServer->AddComponent(linkCheckSupport);
Generic class describing a component of the NetworkController.
~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)
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)
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.