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 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
7 */
8
9#ifndef BS_SERVICE_FLOW_MANAGER_H
10#define BS_SERVICE_FLOW_MANAGER_H
11
12#include "bs-net-device.h"
13#include "mac-messages.h"
15
16#include "ns3/buffer.h"
17#include "ns3/event-id.h"
18
19#include <stdint.h>
20
21namespace ns3
22{
23
24class Packet;
25class ServiceFlow;
26class WimaxNetDevice;
27class SSRecord;
28class WimaxConnection;
29class BaseStationNetDevice;
30
31/**
32 * \ingroup wimax
33 * \brief BsServiceFlowManager
34 */
36{
37 public:
38 /// Confirmation code enumeration
39 enum ConfirmationCode // as per Table 384 (not all codes implemented)
40 {
43 };
44
45 /**
46 * Constructor
47 *
48 * \param device base station device
49 */
51 ~BsServiceFlowManager() override;
52 void DoDispose() override;
53 /**
54 * Register this type.
55 * \return The TypeId.
56 */
57 static TypeId GetTypeId();
58
59 /**
60 * \brief Add a new service flow
61 * \param serviceFlow the service flow to add
62 */
63 void AddServiceFlow(ServiceFlow* serviceFlow);
64 /**
65 * \param sfid the service flow identifier
66 * \return the service flow which has as identifier sfid
67 */
69 /**
70 * \param cid the connection identifier
71 * \return the service flow which has as connection identifier cid
72 */
73 ServiceFlow* GetServiceFlow(Cid cid) const;
74 /**
75 * \param schedulingType the scheduling type
76 * \return the list of service flows configured with schedulingType as a QoS class
77 */
78 std::vector<ServiceFlow*> GetServiceFlows(ServiceFlow::SchedulingType schedulingType) const;
79 /**
80 * \brief set the maximum Dynamic ServiceFlow Add (DSA) retries
81 * \param maxDsaRspRetries the maximum DSA response retries
82 */
83 void SetMaxDsaRspRetries(uint8_t maxDsaRspRetries);
84
85 /**
86 * \return the DSA ack timeout event
87 */
89 /**
90 * \brief allocate service flows
91 * \param dsaReq the DSA request
92 * \param cid the connection identifier
93 */
94 void AllocateServiceFlows(const DsaReq& dsaReq, Cid cid);
95 /**
96 * \brief add a multicast service flow
97 * \param sf the service flow
98 * \param modulation the wimax phy modulation type
99 */
101 /**
102 * \brief process a DSA-ACK message
103 * \param dsaAck the message to process
104 * \param cid the identifier of the connection on which the message was received
105 */
106 void ProcessDsaAck(const DsaAck& dsaAck, Cid cid);
107
108 /**
109 * \brief process a DSA-Req message
110 * \param dsaReq the message to process
111 * \param cid the identifier of the connection on which the message was received
112 * \return a pointer to the service flow
113 */
114 ServiceFlow* ProcessDsaReq(const DsaReq& dsaReq, Cid cid);
115
116 private:
117 /**
118 * Create DSA response function
119 * \param serviceFlow service flow
120 * \param transactionId transaction ID
121 * \return the DSA response
122 */
123 DsaRsp CreateDsaRsp(const ServiceFlow* serviceFlow, uint16_t transactionId);
124 /**
125 * \return the maximum DSA response retries
126 */
127 uint8_t GetMaxDsaRspRetries() const;
128 /**
129 * Create DSA response function
130 * \param serviceFlow service flow
131 * \param cid the identifier of the connection on which the message was received
132 */
133 void ScheduleDsaRsp(ServiceFlow* serviceFlow, Cid cid);
135 uint32_t m_sfidIndex; ///< SFID index
136 uint8_t m_maxDsaRspRetries; ///< maximum number of DSA response retries
137 EventId m_dsaAckTimeoutEvent; ///< DSA ack timeout event
138 Cid m_inuseScheduleDsaRspCid; ///< in use schedule DSA response CID
139};
140
141} // namespace ns3
142
143#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.
BsServiceFlowManager(Ptr< BaseStationNetDevice > device)
Constructor.
ServiceFlow * ProcessDsaReq(const DsaReq &dsaReq, Cid cid)
process a DSA-Req message
Cid class.
Definition cid.h:26
This class implements the DSA-ACK message described by "IEEE Standard forLocal and metropolitan area ...
This class implements the DSA-REQ message described by "IEEE Standard forLocal and metropolitan area ...
This class implements the DSA-RSP message described by "IEEE Standard forLocal and metropolitan area ...
An identifier for simulation events.
Definition event-id.h:45
Smart pointer class similar to boost::intrusive_ptr.
This class implements service flows as described by the IEEE-802.16 standard.
SchedulingType
section 11.13.11 Service flow scheduling type, page 701
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:48
ModulationType
ModulationType enumeration.
Definition wimax-phy.h:43
Every class exported by the ns3 library is enclosed in the ns3 namespace.