A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
bs-scheduler.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2007,2008 INRIA
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: Jahanzeb Farooq <jahanzeb.farooq@sophia.inria.fr>
18 */
19
20/* BS outbound scheduler as per in Section 6.3.5.1 */
21
22#ifndef BS_SCHEDULER_H
23#define BS_SCHEDULER_H
24
25#include "dl-mac-messages.h"
26#include "service-flow.h"
27#include "wimax-phy.h"
28
29#include "ns3/packet-burst.h"
30#include "ns3/packet.h"
31
32#include <list>
33
34namespace ns3
35{
36
37class BaseStationNetDevice;
38class GenericMacHeader;
39class WimaxConnection;
40class Cid;
41
42/**
43 * \ingroup wimax
44 *
45 * BaseStation Scheduler
46 */
47class BSScheduler : public Object
48{
49 public:
51 /**
52 * Constructor
53 *
54 * \param bs base station device
55 */
57 ~BSScheduler() override;
58
59 /**
60 * \brief Get the type ID.
61 * \return the object TypeId
62 */
63 static TypeId GetTypeId();
64
65 /**
66 * \brief This function returns all the downlink bursts scheduled for the next
67 * downlink sub-frame
68 * \returns all the downlink bursts scheduled for the next downlink sub-frame
69 */
70 virtual std::list<std::pair<OfdmDlMapIe*, Ptr<PacketBurst>>>* GetDownlinkBursts() const = 0;
71 /**
72 * \brief This function adds a downlink burst to the list of downlink bursts
73 * scheduled for the next downlink sub-frame
74 * \param connection a pointer to connection in which the burst will be sent
75 * \param diuc downlink iuc
76 * \param modulationType the modulation type of the burst
77 * \param burst the downlink burst to add to the downlink sub frame
78 */
80 uint8_t diuc,
81 WimaxPhy::ModulationType modulationType,
82 Ptr<PacketBurst> burst) = 0;
83
84 /**
85 * \brief the scheduling function for the downlink subframe.
86 */
87 virtual void Schedule() = 0;
88 /**
89 * \brief Selects a connection from the list of connections having packets to be sent .
90 * \param connection will point to a connection that have packets to be sent
91 * \returns false if no connection has packets to be sent, true otherwise
92 */
93 virtual bool SelectConnection(Ptr<WimaxConnection>& connection) = 0;
94
95 /**
96 * \brief Creates a downlink UGS burst
97 * \param serviceFlow the service flow of the burst
98 * \param modulationType the modulation type to be used for the burst
99 * \param availableSymbols maximum number of OFDM symbols to be used by the burst
100 * \returns a Burst (list of packets)
101 */
103 WimaxPhy::ModulationType modulationType,
104 uint32_t availableSymbols) = 0;
105
106 /**
107 * \brief Get the base station.
108 * \returns the base station net device
109 */
111 /**
112 * \brief Set the base station.
113 * \param bs the base station net device
114 */
115 virtual void SetBs(Ptr<BaseStationNetDevice> bs);
116
117 /**
118 * \brief Check if the packet fragmentation is possible for transport connection.
119 * \param connection the downlink connection
120 * \param availableSymbols maximum number of OFDM symbols to be used by the burst
121 * \param modulationType the modulation type to be used for the burst
122 * \returns false if packet fragmentation is not possible, true otherwise
123 */
125 int availableSymbols,
126 WimaxPhy::ModulationType modulationType);
127
128 private:
130 std::list<std::pair<OfdmDlMapIe*, Ptr<PacketBurst>>>* m_downlinkBursts; ///< down link bursts
131};
132
133} // namespace ns3
134
135#endif /* BS_SCHEDULER_H */
BaseStation Scheduler.
Definition: bs-scheduler.h:48
virtual std::list< std::pair< OfdmDlMapIe *, Ptr< PacketBurst > > > * GetDownlinkBursts() const =0
This function returns all the downlink bursts scheduled for the next downlink sub-frame.
virtual Ptr< PacketBurst > CreateUgsBurst(ServiceFlow *serviceFlow, WimaxPhy::ModulationType modulationType, uint32_t availableSymbols)=0
Creates a downlink UGS burst.
virtual void Schedule()=0
the scheduling function for the downlink subframe.
~BSScheduler() override
Definition: bs-scheduler.cc:67
virtual Ptr< BaseStationNetDevice > GetBs()
Get the base station.
Definition: bs-scheduler.cc:89
virtual void SetBs(Ptr< BaseStationNetDevice > bs)
Set the base station.
Definition: bs-scheduler.cc:83
virtual bool SelectConnection(Ptr< WimaxConnection > &connection)=0
Selects a connection from the list of connections having packets to be sent .
Ptr< BaseStationNetDevice > m_bs
base station
Definition: bs-scheduler.h:129
virtual void AddDownlinkBurst(Ptr< const WimaxConnection > connection, uint8_t diuc, WimaxPhy::ModulationType modulationType, Ptr< PacketBurst > burst)=0
This function adds a downlink burst to the list of downlink bursts scheduled for the next downlink su...
static TypeId GetTypeId()
Get the type ID.
Definition: bs-scheduler.cc:47
std::list< std::pair< OfdmDlMapIe *, Ptr< PacketBurst > > > * m_downlinkBursts
down link bursts
Definition: bs-scheduler.h:130
bool CheckForFragmentation(Ptr< WimaxConnection > connection, int availableSymbols, WimaxPhy::ModulationType modulationType)
Check if the packet fragmentation is possible for transport connection.
Definition: bs-scheduler.cc:95
A base class which provides memory management and object aggregation.
Definition: object.h:89
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:77
This class implements service flows as described by the IEEE-802.16 standard.
Definition: service-flow.h:43
a unique identifier for an interface.
Definition: type-id.h:59
ModulationType
ModulationType enumeration.
Definition: wimax-phy.h:54
Every class exported by the ns3 library is enclosed in the ns3 namespace.