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 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
7 */
8
9#ifndef SS_SERVICE_FLOW_MANAGER_H
10#define SS_SERVICE_FLOW_MANAGER_H
11
12#include "mac-messages.h"
14#include "ss-net-device.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 WimaxConnection;
28class SubscriberStationNetDevice;
29
30/**
31 * \ingroup wimax
32 * \brief SsServiceFlowManager class
33 */
35{
36 public:
37 /// Confirmation code enumeration
38 enum ConfirmationCode // as per Table 384 (not all codes implemented)
39 {
42 };
43
44 /**
45 * Constructor
46 *
47 * Creates a service flow manager and attaches it to a device
48 *
49 * \param device the device to which the service flow manager will be attached
50 */
52 ~SsServiceFlowManager() override;
53 void DoDispose() override;
54
55 /**
56 * Register this type.
57 * \return The TypeId.
58 */
59 static TypeId GetTypeId();
60
61 /**
62 * \brief add a service flow to the list
63 * \param serviceFlow the service flow to add
64 */
65 void AddServiceFlow(ServiceFlow* serviceFlow);
66 /**
67 * \brief add a service flow to the list
68 * \param serviceFlow the service flow to add
69 */
70 void AddServiceFlow(ServiceFlow serviceFlow);
71 /**
72 * \brief sets the maximum retries on DSA request message
73 * \param maxDsaReqRetries the maximum retries on DSA request message
74 */
75 void SetMaxDsaReqRetries(uint8_t maxDsaReqRetries);
76 /**
77 * \return the maximum retries on DSA request message
78 */
79 uint8_t GetMaxDsaReqRetries() const;
80
81 /**
82 * Get DSA response timeout event
83 * \returns the DSA response timeout event
84 */
86 /**
87 * Get DSA ack timeout event
88 * \returns the DSA ack timeout event
89 */
91
92 /// Initiate service flows
94
95 /**
96 * Create DSA request
97 * \param serviceFlow the service flow
98 * \returns the DSA request
99 */
100 DsaReq CreateDsaReq(const ServiceFlow* serviceFlow);
101
102 /**
103 * Create DSA ack
104 * \returns the packet
105 */
107
108 /**
109 * Schedule DSA response
110 * \param serviceFlow the service flow
111 */
112 void ScheduleDsaReq(const ServiceFlow* serviceFlow);
113
114 /**
115 * Process DSA response
116 * \param dsaRsp the DSA response
117 */
118 void ProcessDsaRsp(const DsaRsp& dsaRsp);
119
120 private:
122
123 uint8_t m_maxDsaReqRetries; ///< maximum DSA request retries
124
125 EventId m_dsaRspTimeoutEvent; ///< DSA response timeout event
126 EventId m_dsaAckTimeoutEvent; ///< DSA ack timeout event
127
128 DsaReq m_dsaReq; ///< DSA request
129 DsaAck m_dsaAck; ///< DSA ack
130
131 uint16_t m_currentTransactionId; ///< current transaction ID
132 uint16_t m_transactionIdIndex; ///< transaction ID index
133 uint8_t m_dsaReqRetries; ///< DSA request retries
134
135 // pointer to the service flow currently being configured
136 ServiceFlow* m_pendingServiceFlow; ///< pending service flow
137};
138
139} // namespace ns3
140
141#endif /* SS_SERVICE_FLOW_MANAGER_H */
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.
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
SsServiceFlowManager(Ptr< SubscriberStationNetDevice > device)
Constructor.
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:48
Every class exported by the ns3 library is enclosed in the ns3 namespace.