A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
Loading...
Searching...
No Matches
network-server.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2018 University of Padova
3
*
4
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
* Authors: Davide Magrin <magrinda@dei.unipd.it>
7
* Martina Capuzzo <capuzzom@dei.unipd.it>
8
*/
9
10
#ifndef NETWORK_SERVER_H
11
#define NETWORK_SERVER_H
12
13
#include "
class-a-end-device-lorawan-mac.h
"
14
#include "
gateway-status.h
"
15
#include "
lora-device-address.h
"
16
#include "
network-controller.h
"
17
#include "
network-scheduler.h
"
18
#include "
network-status.h
"
19
20
#include "ns3/application.h"
21
#include "ns3/log.h"
22
#include "ns3/net-device.h"
23
#include "ns3/node-container.h"
24
#include "ns3/object.h"
25
#include "ns3/packet.h"
26
#include "ns3/point-to-point-net-device.h"
27
28
namespace
ns3
29
{
30
namespace
lorawan
31
{
32
33
/**
34
* \ingroup lorawan
35
*
36
* The NetworkServer is an application standing on top of a node equipped with
37
* links that connect it with the gateways.
38
*
39
* This version of the NetworkServer application attempts to closely mimic an actual
40
* network server, by providing as much functionality as possible.
41
*/
42
class
NetworkServer
:
public
Application
43
{
44
public
:
45
/**
46
* Register this type.
47
* \return The object TypeId.
48
*/
49
static
TypeId
GetTypeId
();
50
51
NetworkServer
();
//!< Default constructor
52
~NetworkServer
()
override
;
//!< Destructor
53
54
/**
55
* Start the network server application.
56
*/
57
void
StartApplication
()
override
;
58
59
/**
60
* Stop the network server application.
61
*/
62
void
StopApplication
()
override
;
63
64
/**
65
* Inform the NetworkServer application that these nodes are connected to the network.
66
*
67
* This method will create a DeviceStatus object for each new node, and add
68
* it to the list.
69
*
70
* \param nodes The end device NodeContainer.
71
*/
72
void
AddNodes
(
NodeContainer
nodes
);
73
74
/**
75
* Inform the NetworkServer application that this node is connected to the network.
76
*
77
* This method will create a DeviceStatus object for the new node (if it
78
* doesn't already exist).
79
*
80
* \param node The end device Node.
81
*/
82
void
AddNode
(
Ptr<Node>
node);
83
84
/**
85
* Add the gateway to the list of gateways connected to this network server.
86
*
87
* Each gateway is identified by its Address in the network connecting it to the network
88
* server.
89
*
90
* \param gateway A pointer to the gateway Node.
91
* \param netDevice A pointer to the network server's NetDevice connected to the gateway.
92
*/
93
void
AddGateway
(
Ptr<Node>
gateway,
Ptr<NetDevice>
netDevice);
94
95
/**
96
* Add a NetworkControllerComponent to this NetworkServer application.
97
*
98
* \param component A pointer to the NetworkControllerComponent object.
99
*/
100
void
AddComponent
(
Ptr<NetworkControllerComponent>
component);
101
102
/**
103
* Receive a packet from a gateway.
104
*
105
* This function is meant to be provided to NetDevice objects as a ReceiveCallback.
106
*
107
* \copydoc ns3::NetDevice::ReceiveCallback
108
*/
109
bool
Receive
(
Ptr<NetDevice>
device,
110
Ptr<const Packet>
packet,
111
uint16_t protocol,
112
const
Address
& sender);
113
114
/**
115
* Get the NetworkStatus object of this NetworkServer application.
116
*
117
* \return A pointer to the NetworkStatus object.
118
*/
119
Ptr<NetworkStatus>
GetNetworkStatus
();
120
121
protected
:
122
Ptr<NetworkStatus>
m_status
;
//!< Ptr to the NetworkStatus object.
123
Ptr<NetworkController>
m_controller
;
//!< Ptr to the NetworkController object.
124
Ptr<NetworkScheduler>
m_scheduler
;
//!< Ptr to the NetworkScheduler object.
125
126
TracedCallback<Ptr<const Packet>
>
m_receivedPacket
;
//!< The `ReceivedPacket` trace source.
127
};
128
129
}
// namespace lorawan
130
131
}
// namespace ns3
132
#endif
/* NETWORK_SERVER_H */
class-a-end-device-lorawan-mac.h
ns3::Address
a polymophic address class
Definition
address.h:90
ns3::Application
The base class for all ns3 applications.
Definition
application.h:51
ns3::NodeContainer
keep track of a set of node pointers.
Definition
node-container.h:29
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition
mpi-test-fixtures.h:37
ns3::TracedCallback
Forward calls to a chain of Callback.
Definition
traced-callback.h:43
ns3::TypeId
a unique identifier for an interface.
Definition
type-id.h:48
ns3::lorawan::NetworkServer
The NetworkServer is an application standing on top of a node equipped with links that connect it wit...
Definition
network-server.h:43
ns3::lorawan::NetworkServer::AddNode
void AddNode(Ptr< Node > node)
Inform the NetworkServer application that this node is connected to the network.
Definition
network-server.cc:119
ns3::lorawan::NetworkServer::NetworkServer
NetworkServer()
Default constructor.
Definition
network-server.cc:49
ns3::lorawan::NetworkServer::GetNetworkStatus
Ptr< NetworkStatus > GetNetworkStatus()
Get the NetworkStatus object of this NetworkServer application.
Definition
network-server.cc:178
ns3::lorawan::NetworkServer::AddGateway
void AddGateway(Ptr< Node > gateway, Ptr< NetDevice > netDevice)
Add the gateway to the list of gateways connected to this network server.
Definition
network-server.cc:75
ns3::lorawan::NetworkServer::m_receivedPacket
TracedCallback< Ptr< const Packet > > m_receivedPacket
The ReceivedPacket trace source.
Definition
network-server.h:126
ns3::lorawan::NetworkServer::Receive
bool Receive(Ptr< NetDevice > device, Ptr< const Packet > packet, uint16_t protocol, const Address &sender)
Receive a packet from a gateway.
Definition
network-server.cc:144
ns3::lorawan::NetworkServer::StopApplication
void StopApplication() override
Stop the network server application.
Definition
network-server.cc:69
ns3::lorawan::NetworkServer::GetTypeId
static TypeId GetTypeId()
Register this type.
Definition
network-server.cc:34
ns3::lorawan::NetworkServer::m_scheduler
Ptr< NetworkScheduler > m_scheduler
Ptr to the NetworkScheduler object.
Definition
network-server.h:124
ns3::lorawan::NetworkServer::m_status
Ptr< NetworkStatus > m_status
Ptr to the NetworkStatus object.
Definition
network-server.h:122
ns3::lorawan::NetworkServer::AddNodes
void AddNodes(NodeContainer nodes)
Inform the NetworkServer application that these nodes are connected to the network.
Definition
network-server.cc:106
ns3::lorawan::NetworkServer::~NetworkServer
~NetworkServer() override
Destructor.
Definition
network-server.cc:57
ns3::lorawan::NetworkServer::AddComponent
void AddComponent(Ptr< NetworkControllerComponent > component)
Add a NetworkControllerComponent to this NetworkServer application.
Definition
network-server.cc:170
ns3::lorawan::NetworkServer::StartApplication
void StartApplication() override
Start the network server application.
Definition
network-server.cc:63
ns3::lorawan::NetworkServer::m_controller
Ptr< NetworkController > m_controller
Ptr to the NetworkController object.
Definition
network-server.h:123
gateway-status.h
lora-device-address.h
nodes
NodeContainer nodes
Definition
lr-wpan-bootstrap.cc:43
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
network-controller.h
network-scheduler.h
network-status.h
src
lorawan
model
network-server.h
Generated on Fri Nov 8 2024 13:59:02 for ns-3 by
1.11.0