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