A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
ss-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 SS_SERVICE_FLOW_MANAGER_H
21#define SS_SERVICE_FLOW_MANAGER_H
22
23#include "mac-messages.h"
25#include "ss-net-device.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 WimaxConnection;
39class SubscriberStationNetDevice;
40
41/**
42 * \ingroup wimax
43 * \brief SsServiceFlowManager class
44 */
46{
47 public:
48 /// Confirmation code enumeration
49 enum ConfirmationCode // as per Table 384 (not all codes implemented)
50 {
53 };
54
55 /**
56 * Constructor
57 *
58 * Creates a service flow manager and attaches it to a device
59 *
60 * \param device the device to which the service flow manager will be attached
61 */
63 ~SsServiceFlowManager() override;
64 void DoDispose() override;
65
66 /**
67 * Register this type.
68 * \return The TypeId.
69 */
70 static TypeId GetTypeId();
71
72 /**
73 * \brief add a service flow to the list
74 * \param serviceFlow the service flow to add
75 */
76 void AddServiceFlow(ServiceFlow* serviceFlow);
77 /**
78 * \brief add a service flow to the list
79 * \param serviceFlow the service flow to add
80 */
81 void AddServiceFlow(ServiceFlow serviceFlow);
82 /**
83 * \brief sets the maximum retries on DSA request message
84 * \param maxDsaReqRetries the maximum retries on DSA request message
85 */
86 void SetMaxDsaReqRetries(uint8_t maxDsaReqRetries);
87 /**
88 * \return the maximum retries on DSA request message
89 */
90 uint8_t GetMaxDsaReqRetries() const;
91
92 /**
93 * Get DSA response timeout event
94 * \returns the DSA response timeout event
95 */
97 /**
98 * Get DSA ack timeout event
99 * \returns the DSA ack timeout event
100 */
102
103 /// Initiate service flows
105
106 /**
107 * Create DSA request
108 * \param serviceFlow the service flow
109 * \returns the DSA request
110 */
111 DsaReq CreateDsaReq(const ServiceFlow* serviceFlow);
112
113 /**
114 * Create DSA ack
115 * \returns the packet
116 */
118
119 /**
120 * Schedule DSA response
121 * \param serviceFlow the service flow
122 */
123 void ScheduleDsaReq(const ServiceFlow* serviceFlow);
124
125 /**
126 * Process DSA response
127 * \param dsaRsp the DSA response
128 */
129 void ProcessDsaRsp(const DsaRsp& dsaRsp);
130
131 private:
133
134 uint8_t m_maxDsaReqRetries; ///< maximum DSA request retries
135
136 EventId m_dsaRspTimeoutEvent; ///< DSA response timeout event
137 EventId m_dsaAckTimeoutEvent; ///< DSA ack timeout event
138
139 DsaReq m_dsaReq; ///< DSA request
140 DsaAck m_dsaAck; ///< DSA ack
141
142 uint16_t m_currentTransactionId; ///< current transaction ID
143 uint16_t m_transactionIdIndex; ///< transaction ID index
144 uint8_t m_dsaReqRetries; ///< DSA request retries
145
146 // pointer to the service flow currently being configured
147 ServiceFlow* m_pendingServiceFlow; ///< pending service flow
148};
149
150} // namespace ns3
151
152#endif /* SS_SERVICE_FLOW_MANAGER_H */
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
The same service flow manager class serves both for BS and SS though some functions are exclusive to ...
SsServiceFlowManager class.
void ScheduleDsaReq(const ServiceFlow *serviceFlow)
Schedule DSA response.
void ProcessDsaRsp(const DsaRsp &dsaRsp)
Process DSA response.
uint16_t m_currentTransactionId
current transaction ID
EventId GetDsaRspTimeoutEvent() const
Get DSA response timeout event.
uint8_t m_dsaReqRetries
DSA request retries.
EventId m_dsaAckTimeoutEvent
DSA ack timeout event.
ServiceFlow * m_pendingServiceFlow
pending service flow
EventId GetDsaAckTimeoutEvent() const
Get DSA ack timeout event.
void InitiateServiceFlows()
Initiate service flows.
ConfirmationCode
Confirmation code enumeration.
EventId m_dsaRspTimeoutEvent
DSA response timeout event.
DsaReq CreateDsaReq(const ServiceFlow *serviceFlow)
Create DSA request.
void AddServiceFlow(ServiceFlow *serviceFlow)
add a service flow to the list
Ptr< SubscriberStationNetDevice > m_device
the device
uint16_t m_transactionIdIndex
transaction ID index
uint8_t m_maxDsaReqRetries
maximum DSA request retries
static TypeId GetTypeId()
Register this type.
void DoDispose() override
Destructor implementation.
void SetMaxDsaReqRetries(uint8_t maxDsaReqRetries)
sets the maximum retries on DSA request message
Ptr< Packet > CreateDsaAck()
Create DSA ack.
a unique identifier for an interface.
Definition: type-id.h:59
Every class exported by the ns3 library is enclosed in the ns3 namespace.