A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
network-scheduler.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_SCHEDULER_H
10#define NETWORK_SCHEDULER_H
11
12#include "lora-device-address.h"
13#include "lora-frame-header.h"
14#include "lorawan-mac-header.h"
15#include "network-controller.h"
16#include "network-status.h"
17
18#include "ns3/core-module.h"
19#include "ns3/object.h"
20#include "ns3/packet.h"
21
22namespace ns3
23{
24namespace lorawan
25{
26
27class NetworkStatus; // Forward declaration
28class NetworkController; // Forward declaration
29
30/**
31 * @ingroup lorawan
32 *
33 * Network server component in charge of scheduling downling packets onto devices' reception windows
34 *
35 * @todo We should probably add getters and setters or remove default constructor
36 */
38{
39 public:
40 /**
41 * Register this type.
42 * @return The object TypeId.
43 */
44 static TypeId GetTypeId();
45
46 NetworkScheduler(); //!< Default constructor
47 ~NetworkScheduler() override; //!< Destructor
48
49 /**
50 * Construct a new NetworkScheduler providing the NetworkStatus and the NetworkController
51 * objects.
52 *
53 * @param status A pointer to the NetworkStatus object.
54 * @param controller A pointer to the NetworkController object.
55 */
57
58 /**
59 * Method called by NetworkServer application to inform the Scheduler of a newly arrived uplink
60 * packet.
61 *
62 * This function schedules the OnReceiveWindowOpportunity events 1 and 2 seconds later.
63 *
64 * @param packet A pointer to the new Packet instance.
65 */
67
68 /**
69 * Method that is scheduled after packet arrival in order to take action on
70 * sender's receive windows openings.
71 *
72 * @param deviceAddress The Address of the end device.
73 * @param window The reception window number (1 or 2).
74 */
75 void OnReceiveWindowOpportunity(LoraDeviceAddress deviceAddress, int window);
76
77 private:
79 m_receiveWindowOpened; //!< Trace callback source for reception windows openings.
80 //!< \todo Never called. Place calls in the right places.
81 Ptr<NetworkStatus> m_status; //!< A pointer to the NetworkStatus object.
82 Ptr<NetworkController> m_controller; //!< A pointer to the NetworkController object.
83};
84
85} // namespace lorawan
86
87} // namespace ns3
88#endif /* NETWORK_SCHEDULER_H */
Object()
Constructor.
Definition object.cc:96
Smart pointer class similar to boost::intrusive_ptr.
Definition ptr.h:66
Forward calls to a chain of Callback.
a unique identifier for an interface.
Definition type-id.h:49
This class represents the device address of a LoraWAN end device.
This class collects a series of components that deal with various aspects of managing the network,...
~NetworkScheduler() override
Destructor.
void OnReceivedPacket(Ptr< const Packet > packet)
Method called by NetworkServer application to inform the Scheduler of a newly arrived uplink packet.
Ptr< NetworkController > m_controller
A pointer to the NetworkController object.
Ptr< NetworkStatus > m_status
A pointer to the NetworkStatus object.
NetworkScheduler()
Default constructor.
static TypeId GetTypeId()
Register this type.
void OnReceiveWindowOpportunity(LoraDeviceAddress deviceAddress, int window)
Method that is scheduled after packet arrival in order to take action on sender's receive windows ope...
TracedCallback< Ptr< const Packet > > m_receiveWindowOpened
Trace callback source for reception windows openings.
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.