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
* 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
22
namespace
ns3
23
{
24
namespace
lorawan
25
{
26
27
class
NetworkStatus;
// Forward declaration
28
class
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
*/
37
class
NetworkScheduler
:
public
Object
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
*/
56
NetworkScheduler
(
Ptr<NetworkStatus>
status,
Ptr<NetworkController>
controller);
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
*/
66
void
OnReceivedPacket
(
Ptr<const Packet>
packet);
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
:
78
TracedCallback<Ptr<const Packet>
>
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 */
ns3::Object
A base class which provides memory management and object aggregation.
Definition
object.h:78
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::LoraDeviceAddress
This class represents the device address of a LoraWAN end device.
Definition
lora-device-address.h:106
ns3::lorawan::NetworkScheduler
Network server component in charge of scheduling downling packets onto devices' reception windows.
Definition
network-scheduler.h:38
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:82
ns3::lorawan::NetworkScheduler::m_status
Ptr< NetworkStatus > m_status
A pointer to the NetworkStatus object.
Definition
network-scheduler.h:81
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:79
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 Fri Nov 8 2024 13:59:02 for ns-3 by
1.11.0