A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
bs-service-flow-manager.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2009 INRIA, UDcast
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 * Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
18 */
19
20#ifndef BS_SERVICE_FLOW_MANAGER_H
21#define BS_SERVICE_FLOW_MANAGER_H
22
23#include "bs-net-device.h"
24#include "mac-messages.h"
26
27#include "ns3/buffer.h"
28#include "ns3/event-id.h"
29
30#include <stdint.h>
31
32namespace ns3
33{
34
35class Packet;
36class ServiceFlow;
37class WimaxNetDevice;
38class SSRecord;
39class WimaxConnection;
40class BaseStationNetDevice;
41
42/**
43 * \ingroup wimax
44 * \brief BsServiceFlowManager
45 */
47{
48 public:
49 /// Confirmation code enumeration
50 enum ConfirmationCode // as per Table 384 (not all codes implemented)
51 {
54 };
55
56 /**
57 * Constructor
58 *
59 * \param device base station device
60 */
62 ~BsServiceFlowManager() override;
63 void DoDispose() override;
64 /**
65 * Register this type.
66 * \return The TypeId.
67 */
68 static TypeId GetTypeId();
69
70 /**
71 * \brief Add a new service flow
72 * \param serviceFlow the service flow to add
73 */
74 void AddServiceFlow(ServiceFlow* serviceFlow);
75 /**
76 * \param sfid the service flow identifier
77 * \return the service flow which has as identifier sfid
78 */
80 /**
81 * \param cid the connection identifier
82 * \return the service flow which has as connection identifier cid
83 */
84 ServiceFlow* GetServiceFlow(Cid cid) const;
85 /**
86 * \param schedulingType the scheduling type
87 * \return the list of service flows configured with schedulingType as a QoS class
88 */
89 std::vector<ServiceFlow*> GetServiceFlows(ServiceFlow::SchedulingType schedulingType) const;
90 /**
91 * \brief set the maximum Dynamic ServiceFlow Add (DSA) retries
92 * \param maxDsaRspRetries the maximum DSA response retries
93 */
94 void SetMaxDsaRspRetries(uint8_t maxDsaRspRetries);
95
96 /**
97 * \return the DSA ack timeout event
98 */
100 /**
101 * \brief allocate service flows
102 * \param dsaReq the DSA request
103 * \param cid the connection identifier
104 */
105 void AllocateServiceFlows(const DsaReq& dsaReq, Cid cid);
106 /**
107 * \brief add a multicast service flow
108 * \param sf the service flow
109 * \param modulation the wimax phy modulation type
110 */
112 /**
113 * \brief process a DSA-ACK message
114 * \param dsaAck the message to process
115 * \param cid the identifier of the connection on which the message was received
116 */
117 void ProcessDsaAck(const DsaAck& dsaAck, Cid cid);
118
119 /**
120 * \brief process a DSA-Req message
121 * \param dsaReq the message to process
122 * \param cid the identifier of the connection on which the message was received
123 * \return a pointer to the service flow
124 */
125 ServiceFlow* ProcessDsaReq(const DsaReq& dsaReq, Cid cid);
126
127 private:
128 /**
129 * Create DSA response function
130 * \param serviceFlow service flow
131 * \param transactionId transaction ID
132 * \return the DSA response
133 */
134 DsaRsp CreateDsaRsp(const ServiceFlow* serviceFlow, uint16_t transactionId);
135 /**
136 * \return the maximum DSA response retries
137 */
138 uint8_t GetMaxDsaRspRetries() const;
139 /**
140 * Create DSA response function
141 * \param serviceFlow service flow
142 * \param cid the identifier of the connection on which the message was received
143 */
144 void ScheduleDsaRsp(ServiceFlow* serviceFlow, Cid cid);
146 uint32_t m_sfidIndex; ///< SFID index
147 uint8_t m_maxDsaRspRetries; ///< maximum number of DSA response retries
148 EventId m_dsaAckTimeoutEvent; ///< DSA ack timeout event
149 Cid m_inuseScheduleDsaRspCid; ///< in use schedule DSA response CID
150};
151
152} // namespace ns3
153
154#endif /* BS_SERVICE_FLOW_MANAGER_H */
ServiceFlow * GetServiceFlow(uint32_t sfid) const
uint8_t m_maxDsaRspRetries
maximum number of DSA response retries
void AllocateServiceFlows(const DsaReq &dsaReq, Cid cid)
allocate service flows
void DoDispose() override
Destructor implementation.
Cid m_inuseScheduleDsaRspCid
in use schedule DSA response CID
void AddMulticastServiceFlow(ServiceFlow sf, WimaxPhy::ModulationType modulation)
add a multicast service flow
Ptr< WimaxNetDevice > m_device
the device
void ScheduleDsaRsp(ServiceFlow *serviceFlow, Cid cid)
Create DSA response function.
ConfirmationCode
Confirmation code enumeration.
void ProcessDsaAck(const DsaAck &dsaAck, Cid cid)
process a DSA-ACK message
std::vector< ServiceFlow * > GetServiceFlows(ServiceFlow::SchedulingType schedulingType) const
static TypeId GetTypeId()
Register this type.
void AddServiceFlow(ServiceFlow *serviceFlow)
Add a new service flow.
void SetMaxDsaRspRetries(uint8_t maxDsaRspRetries)
set the maximum Dynamic ServiceFlow Add (DSA) retries
DsaRsp CreateDsaRsp(const ServiceFlow *serviceFlow, uint16_t transactionId)
Create DSA response function.
EventId m_dsaAckTimeoutEvent
DSA ack timeout event.
ServiceFlow * ProcessDsaReq(const DsaReq &dsaReq, Cid cid)
process a DSA-Req message
Cid class.
Definition: cid.h:37
This class implements the DSA-ACK message described by "IEEE Standard for Local and metropolitan area...
Definition: mac-messages.h:590
This class implements the DSA-REQ message described by "IEEE Standard for Local and metropolitan area...
Definition: mac-messages.h:386
This class implements the DSA-RSP message described by "IEEE Standard for Local and metropolitan ar...
Definition: mac-messages.h:490
An identifier for simulation events.
Definition: event-id.h:55
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
SchedulingType
section 11.13.11 Service flow scheduling type, page 701
Definition: service-flow.h:62
The same service flow manager class serves both for BS and SS though some functions are exclusive to ...
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.