A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
bs-scheduler.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2007,2008 INRIA
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * Author: Jahanzeb Farooq <jahanzeb.farooq@sophia.inria.fr>
19  */
20 
21 /* BS outbound scheduler as per in Section 6.3.5.1 */
22 
23 #ifndef BS_SCHEDULER_H
24 #define BS_SCHEDULER_H
25 
26 #include <list>
27 #include "ns3/packet.h"
28 #include "wimax-phy.h"
29 #include "ns3/packet-burst.h"
30 #include "dl-mac-messages.h"
31 #include "service-flow.h"
32 
33 namespace ns3 {
34 
35 class BaseStationNetDevice;
36 class GenericMacHeader;
37 class WimaxConnection;
38 class Cid;
39 
43 class BSScheduler : public Object
44 {
45 public:
46  BSScheduler ();
48  ~BSScheduler (void);
49 
50  static TypeId GetTypeId (void);
51 
52  /*
53  * \brief This function returns all the downlink bursts scheduled for the next
54  * downlink sub-frame
55  * \returns all the downlink bursts scheduled for the next downlink sub-frame
56  */
57  virtual std::list<std::pair<OfdmDlMapIe*, Ptr<PacketBurst> > >*
58  GetDownlinkBursts (void) const = 0;
59  /*
60  * \brief This function adds a downlink burst to the list of downlink bursts
61  * scheduled for the next downlink sub-frame
62  * \param connection a pointer to connection in wich the burst will be sent
63  * \param diuc downlink iuc
64  * \param modulationType the modulation type of the burst
65  * \param burst the downlink burst to add to the downlink sub frame
66  */
67  virtual void AddDownlinkBurst (Ptr<const WimaxConnection> connection,
68  uint8_t diuc,
69  WimaxPhy::ModulationType modulationType,
70  Ptr<PacketBurst> burst) = 0;
71 
72  /*
73  * \brief the scheduling function for the downlink subframe.
74  */
75  virtual void Schedule (void) = 0;
76  /*
77  * \brief Selects a connection from the list of connections having packets to be sent .
78  * \param connection will point to a connection that have packets to be sent
79  * \returns false if no connection has packets to be sent, true otherwise
80  */
81  virtual bool SelectConnection (Ptr<WimaxConnection> &connection) = 0;
82 
83  /*
84  * \brief Creates a downlink UGS burst
85  * \param serviceFlow the service flow of the burst
86  * \param modulationType the modulation type to be used for the burst
87  * \param availableSymbols maximum number of OFDM symbols to be used by the burst
88  * \returns a Burst (list of packets)
89  */
90  virtual Ptr<PacketBurst> CreateUgsBurst (ServiceFlow *serviceFlow,
91  WimaxPhy::ModulationType modulationType,
92  uint32_t availableSymbols) = 0;
93 
94  virtual Ptr<BaseStationNetDevice> GetBs (void);
95  virtual void SetBs (Ptr<BaseStationNetDevice> bs);
96 
97  /*
98  * \brief Check if the packet fragmentation is possible for transport connection.
99  * \param connection the downlink connection
100  * \param availableSymbols maximum number of OFDM symbols to be used by the burst
101  * \param modulationType the modulation type to be used for the burst
102  * \returns false if packet fragmentation is not possible, true otherwise
103  */
105  int availableSymbols,
106  WimaxPhy::ModulationType modulationType);
107 private:
109  std::list<std::pair<OfdmDlMapIe*, Ptr<PacketBurst> > > *m_downlinkBursts;
110 };
111 
112 } // namespace ns3
113 
114 #endif /* BS_SCHEDULER_H */
virtual void AddDownlinkBurst(Ptr< const WimaxConnection > connection, uint8_t diuc, WimaxPhy::ModulationType modulationType, Ptr< PacketBurst > burst)=0
smart pointer class similar to boost::intrusive_ptr
Definition: ptr.h:59
virtual void Schedule(void)=0
bool CheckForFragmentation(Ptr< WimaxConnection > connection, int availableSymbols, WimaxPhy::ModulationType modulationType)
Definition: bs-scheduler.cc:91
std::list< std::pair< OfdmDlMapIe *, Ptr< PacketBurst > > > * m_downlinkBursts
Definition: bs-scheduler.h:109
static TypeId GetTypeId(void)
Definition: bs-scheduler.cc:45
This class implements service flows as described by the IEEE-802.16 standard.
Definition: service-flow.h:39
virtual Ptr< BaseStationNetDevice > GetBs(void)
Definition: bs-scheduler.cc:85
virtual void SetBs(Ptr< BaseStationNetDevice > bs)
Definition: bs-scheduler.cc:80
Ptr< BaseStationNetDevice > m_bs
Definition: bs-scheduler.h:108
virtual Ptr< PacketBurst > CreateUgsBurst(ServiceFlow *serviceFlow, WimaxPhy::ModulationType modulationType, uint32_t availableSymbols)=0
virtual bool SelectConnection(Ptr< WimaxConnection > &connection)=0
virtual std::list< std::pair< OfdmDlMapIe *, Ptr< PacketBurst > > > * GetDownlinkBursts(void) const =0
a base class which provides memory management and object aggregation
Definition: object.h:63
a unique identifier for an interface.
Definition: type-id.h:49