A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
network-controller-components.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2017 University of Padova
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Davide Magrin <magrinda@dei.unipd.it>
7 */
8
9#ifndef NETWORK_CONTROLLER_COMPONENTS_H
10#define NETWORK_CONTROLLER_COMPONENTS_H
11
12#include "ns3/object.h"
13#include "ns3/packet.h"
14
15namespace ns3
16{
17namespace lorawan
18{
19
20class NetworkStatus;
21class EndDeviceStatus;
22
23////////////////
24// Base class //
25////////////////
26
27/**
28 * @ingroup lorawan
29 *
30 * Generic class describing a component of the NetworkController.
31 *
32 * This is the class that is meant to be extended by all NetworkController
33 * components, and provides a common interface for the NetworkController to
34 * query available components and prompt them to act on new packet arrivals.
35 */
37{
38 public:
39 /**
40 * Register this type.
41 * @return The object TypeId.
42 */
43 static TypeId GetTypeId();
44
45 NetworkControllerComponent(); //!< Default constructor
46 ~NetworkControllerComponent() override; //!< Destructor
47
48 // Virtual methods whose implementation is left to child classes
49 /**
50 * Function called as a new uplink packet is received by the NetworkServer application.
51 *
52 * @param packet The newly received packet.
53 * @param status A pointer to the status of the end device that sent the packet.
54 * @param networkStatus A pointer to the NetworkStatus object.
55 */
58 Ptr<NetworkStatus> networkStatus) = 0;
59 /**
60 * Function called as a downlink reply is about to leave the NetworkServer application.
61 *
62 * @param status A pointer to the status of the end device which we are sending the reply to.
63 * @param networkStatus A pointer to the NetworkStatus object.
64 */
66 Ptr<NetworkStatus> networkStatus) = 0;
67 /**
68 * Method that is called when a packet cannot be sent in the downlink.
69 *
70 * @param status The EndDeviceStatus of the device to which it was impossible to send a reply.
71 * @param networkStatus A pointer to the NetworkStatus object.
72 */
73 virtual void OnFailedReply(Ptr<EndDeviceStatus> status, Ptr<NetworkStatus> networkStatus) = 0;
74};
75
76/**
77 * @ingroup lorawan
78 *
79 * Network controller component for acknowledgments management.
80 */
82{
83 public:
84 /**
85 * Register this type.
86 * @return The object TypeId.
87 */
88 static TypeId GetTypeId();
89
90 ConfirmedMessagesComponent(); //!< Default constructor
91 ~ConfirmedMessagesComponent() override; //!< Destructor
92
93 /**
94 * This method checks whether the received packet requires an acknowledgment
95 * and sets up the appropriate reply in case it does.
96 *
97 * @param packet The newly received packet.
98 * @param status A pointer to the EndDeviceStatus object of the sender.
99 * @param networkStatus A pointer to the NetworkStatus object.
100 */
103 Ptr<NetworkStatus> networkStatus) override;
104
105 void BeforeSendingReply(Ptr<EndDeviceStatus> status, Ptr<NetworkStatus> networkStatus) override;
106
107 void OnFailedReply(Ptr<EndDeviceStatus> status, Ptr<NetworkStatus> networkStatus) override;
108};
109
110/**
111 * @ingroup lorawan
112 *
113 * Network controller component for LinkCheck commands management.
114 */
116{
117 public:
118 /**
119 * Register this type.
120 * @return The object TypeId.
121 */
122 static TypeId GetTypeId();
123
124 LinkCheckComponent(); //!< Default constructor
125 ~LinkCheckComponent() override; //!< Destructor
126
127 /**
128 * This method checks whether the received packet requires an acknowledgment
129 * and sets up the appropriate reply in case it does.
130 *
131 * @param packet The newly received packet.
132 * @param status A pointer to the EndDeviceStatus object of the sender.
133 * @param networkStatus A pointer to the NetworkStatus object.
134 */
137 Ptr<NetworkStatus> networkStatus) override;
138
139 void BeforeSendingReply(Ptr<EndDeviceStatus> status, Ptr<NetworkStatus> networkStatus) override;
140
141 void OnFailedReply(Ptr<EndDeviceStatus> status, Ptr<NetworkStatus> networkStatus) override;
142
143 private:
144};
145
146} // namespace lorawan
147} // namespace ns3
148
149#endif /* NETWORK_CONTROLLER_COMPONENTS_H */
Object()
Caller graph was not generated because of its size.
Definition object.cc:93
Smart pointer class similar to boost::intrusive_ptr.
Definition ptr.h:70
a unique identifier for an interface.
Definition type-id.h:50
void BeforeSendingReply(Ptr< EndDeviceStatus > status, Ptr< NetworkStatus > networkStatus) override
Function called as a downlink reply is about to leave the NetworkServer application.
void OnFailedReply(Ptr< EndDeviceStatus > status, Ptr< NetworkStatus > networkStatus) override
Method that is called when a packet cannot be sent in the downlink.
void OnReceivedPacket(Ptr< const Packet > packet, Ptr< EndDeviceStatus > status, Ptr< NetworkStatus > networkStatus) override
This method checks whether the received packet requires an acknowledgment and sets up the appropriate...
This class represents the network server's knowledge about an end device in the LoRaWAN network it is...
virtual void BeforeSendingReply(Ptr< EndDeviceStatus > status, Ptr< NetworkStatus > networkStatus)=0
Function called as a downlink reply is about to leave the NetworkServer application.
virtual void OnReceivedPacket(Ptr< const Packet > packet, Ptr< EndDeviceStatus > status, Ptr< NetworkStatus > networkStatus)=0
Function called as a new uplink packet is received by the NetworkServer application.
virtual void OnFailedReply(Ptr< EndDeviceStatus > status, Ptr< NetworkStatus > networkStatus)=0
Method that is called when a packet cannot be sent in the downlink.
This class represents the knowledge about the state of the network that is available at the network s...
Every class exported by the ns3 library is enclosed in the ns3 namespace.