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-scheduler.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2017 University of Padova
3
*
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License version 2 as
6
* published by the Free Software Foundation;
7
*
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU General Public License for more details.
12
*
13
* You should have received a copy of the GNU General Public License
14
* along with this program; if not, write to the Free Software
15
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16
*
17
* Author: Davide Magrin <magrinda@dei.unipd.it>
18
*/
19
20
#ifndef NETWORK_SCHEDULER_H
21
#define NETWORK_SCHEDULER_H
22
23
#include "
lora-device-address.h
"
24
#include "
lora-frame-header.h
"
25
#include "
lorawan-mac-header.h
"
26
#include "
network-controller.h
"
27
#include "
network-status.h
"
28
29
#include "ns3/core-module.h"
30
#include "ns3/object.h"
31
#include "ns3/packet.h"
32
33
namespace
ns3
34
{
35
namespace
lorawan
36
{
37
38
class
NetworkStatus;
// Forward declaration
39
class
NetworkController;
// Forward declaration
40
41
/**
42
* \ingroup lorawan
43
*
44
* Network server component in charge of scheduling downling packets onto devices' reception windows
45
*
46
* \todo We should probably add getters and setters or remove default constructor
47
*/
48
class
NetworkScheduler
:
public
Object
49
{
50
public
:
51
/**
52
* Register this type.
53
* \return The object TypeId.
54
*/
55
static
TypeId
GetTypeId
();
56
57
NetworkScheduler
();
//!< Default constructor
58
~NetworkScheduler
()
override
;
//!< Destructor
59
60
/**
61
* Construct a new NetworkScheduler providing the NetworkStatus and the NetworkController
62
* objects.
63
*
64
* \param status A pointer to the NetworkStatus object.
65
* \param controller A pointer to the NetworkController object.
66
*/
67
NetworkScheduler
(
Ptr<NetworkStatus>
status,
Ptr<NetworkController>
controller);
68
69
/**
70
* Method called by NetworkServer application to inform the Scheduler of a newly arrived uplink
71
* packet.
72
*
73
* This function schedules the OnReceiveWindowOpportunity events 1 and 2 seconds later.
74
*
75
* \param packet A pointer to the new Packet instance.
76
*/
77
void
OnReceivedPacket
(
Ptr<const Packet>
packet);
78
79
/**
80
* Method that is scheduled after packet arrival in order to take action on
81
* sender's receive windows openings.
82
*
83
* \param deviceAddress The Address of the end device.
84
* \param window The reception window number (1 or 2).
85
*/
86
void
OnReceiveWindowOpportunity
(
LoraDeviceAddress
deviceAddress,
int
window);
87
88
private
:
89
TracedCallback<Ptr<const Packet>
>
90
m_receiveWindowOpened
;
//!< Trace callback source for reception windows openings.
91
//!< \todo Never called. Place calls in the right places.
92
Ptr<NetworkStatus>
m_status
;
//!< A pointer to the NetworkStatus object.
93
Ptr<NetworkController>
m_controller
;
//!< A pointer to the NetworkController object.
94
};
95
96
}
// namespace lorawan
97
98
}
// namespace ns3
99
#endif
/* NETWORK_SCHEDULER_H */
ns3::Object
A base class which provides memory management and object aggregation.
Definition:
object.h:89
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition:
ptr.h:77
ns3::TracedCallback
Forward calls to a chain of Callback.
Definition:
traced-callback.h:54
ns3::TypeId
a unique identifier for an interface.
Definition:
type-id.h:59
ns3::lorawan::LoraDeviceAddress
This class represents the device address of a LoraWAN end device.
Definition:
lora-device-address.h:117
ns3::lorawan::NetworkScheduler
Network server component in charge of scheduling downling packets onto devices' reception windows.
Definition:
network-scheduler.h:49
ns3::lorawan::NetworkScheduler::~NetworkScheduler
~NetworkScheduler() override
Destructor.
Definition:
network-scheduler.cc:37
ns3::lorawan::NetworkScheduler::OnReceivedPacket
void OnReceivedPacket(Ptr< const Packet > packet)
Method called by NetworkServer application to inform the Scheduler of a newly arrived uplink packet.
Definition:
network-scheduler.cc:42
ns3::lorawan::NetworkScheduler::m_controller
Ptr< NetworkController > m_controller
A pointer to the NetworkController object.
Definition:
network-scheduler.h:93
ns3::lorawan::NetworkScheduler::m_status
Ptr< NetworkStatus > m_status
A pointer to the NetworkStatus object.
Definition:
network-scheduler.h:92
ns3::lorawan::NetworkScheduler::NetworkScheduler
NetworkScheduler()
Default constructor.
Definition:
network-scheduler.cc:27
ns3::lorawan::NetworkScheduler::GetTypeId
static TypeId GetTypeId()
Register this type.
Definition:
network-scheduler.cc:13
ns3::lorawan::NetworkScheduler::OnReceiveWindowOpportunity
void OnReceiveWindowOpportunity(LoraDeviceAddress deviceAddress, int window)
Method that is scheduled after packet arrival in order to take action on sender's receive windows ope...
Definition:
network-scheduler.cc:71
ns3::lorawan::NetworkScheduler::m_receiveWindowOpened
TracedCallback< Ptr< const Packet > > m_receiveWindowOpened
Trace callback source for reception windows openings.
Definition:
network-scheduler.h:90
lora-device-address.h
lora-frame-header.h
lorawan-mac-header.h
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
network-controller.h
network-status.h
src
lorawan
model
network-scheduler.h
Generated on Mon Aug 12 2024 11:16:15 for ns-3 by
1.9.6