A Discrete-Event Network Simulator
API
service-flow.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, 2009 INRIA, UDcast
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  * Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
20  */
21 
22 #ifndef SERVICE_FLOW_H
23 #define SERVICE_FLOW_H
24 
25 #include <stdint.h>
26 #include "wimax-phy.h"
27 #include "wimax-connection.h"
28 #include "cs-parameters.h"
29 
30 namespace ns3 {
31 
32 class ServiceFlowRecord;
33 class WimaxConnection;
34 
40 {
41 public:
42  enum Direction
43  {
45  };
46 
47  enum Type
48  {
50  };
51 
52  // section 11.13.11 Service flow scheduling type, page 701
54  {
57  };
58  // section 11.13.19.2 CS parameter encoding rules, page 707
60  {
61  ATM = 99, IPV4 = 100, IPV6 = 101, ETHERNET = 102, VLAN = 103,
64  };
65  enum ModulationType // Table 356 and 362
66  {
69  };
70 
76  Tlv ToTlv (void) const;
81  ServiceFlow (Tlv tlv);
90  bool CheckClassifierMatch (Ipv4Address srcAddress,
91  Ipv4Address dstAddress,
92  uint16_t srcPort,
93  uint16_t dstPort,
94  uint8_t proto) const;
95  ServiceFlow (enum Direction direction);
96  ServiceFlow ();
97  ServiceFlow (const ServiceFlow & sf);
98  ServiceFlow (uint32_t sfid,
99  enum Direction direction,
100  Ptr<WimaxConnection> connection);
101  ~ServiceFlow (void);
102  ServiceFlow & operator = (ServiceFlow const& o);
103 
104  void InitValues (void);
105  void SetDirection (enum Direction direction);
106  enum Direction GetDirection (void) const;
108 
109  void SetType (enum Type type);
110  enum Type GetType (void) const;
111  void SetConnection (Ptr<WimaxConnection> connection);
112  // Can return a null connection is this service flow has not
113  // been associated yet to a connection.
114  Ptr<WimaxConnection> GetConnection (void) const;
115 
116  void SetIsEnabled (bool isEnabled);
117  bool GetIsEnabled (void) const;
118 
119  void SetRecord (ServiceFlowRecord *record);
120  ServiceFlowRecord* GetRecord (void) const;
121 
122  // wrapper functions
123  Ptr<WimaxMacQueue> GetQueue (void) const;
125  bool HasPackets (void) const;
126  bool HasPackets (MacHeaderType::HeaderType packetType) const;
127 
128  // shall be called only by BS
129  void CleanUpQueue (void);
130 
131  void PrintQoSParameters (void) const;
132 
133  char* GetSchedulingTypeStr (void) const;
134 
135  uint32_t GetSfid (void) const;
136  uint16_t GetCid (void) const;
137  std::string GetServiceClassName () const;
138  uint8_t GetQosParamSetType (void) const;
139  uint8_t GetTrafficPriority (void) const;
140  uint32_t GetMaxSustainedTrafficRate (void) const;
141  uint32_t GetMaxTrafficBurst (void) const;
142  uint32_t GetMinReservedTrafficRate (void) const;
143  uint32_t GetMinTolerableTrafficRate (void) const;
145  uint32_t GetRequestTransmissionPolicy (void) const;
146  uint32_t GetToleratedJitter (void) const;
147  uint32_t GetMaximumLatency (void) const;
148  uint8_t GetFixedversusVariableSduIndicator (void) const;
149  uint8_t GetSduSize (void) const;
150  uint16_t GetTargetSAID (void) const;
151  uint8_t GetArqEnable (void) const;
152  uint16_t GetArqWindowSize (void) const;
153  uint16_t GetArqRetryTimeoutTx (void) const;
154  uint16_t GetArqRetryTimeoutRx (void) const;
155  uint16_t GetArqBlockLifeTime (void) const;
156  uint16_t GetArqSyncLoss (void) const;
157  uint8_t GetArqDeliverInOrder (void) const;
158  uint16_t GetArqPurgeTimeout (void) const;
159  uint16_t GetArqBlockSize (void) const;
160  enum CsSpecification GetCsSpecification (void) const;
162  uint16_t GetUnsolicitedGrantInterval (void) const;
163  uint16_t GetUnsolicitedPollingInterval (void) const;
164  bool GetIsMulticast (void) const;
165  enum WimaxPhy::ModulationType GetModulation (void) const;
166 
167  void SetSfid (uint32_t);
168  void SetServiceClassName (std::string);
169  void SetQosParamSetType (uint8_t);
170  void SetTrafficPriority (uint8_t);
171  void SetMaxSustainedTrafficRate (uint32_t);
172  void SetMaxTrafficBurst (uint32_t);
173  void SetMinReservedTrafficRate (uint32_t);
174  void SetMinTolerableTrafficRate (uint32_t);
176  void SetRequestTransmissionPolicy (uint32_t);
177  void SetToleratedJitter (uint32_t);
178  void SetMaximumLatency (uint32_t);
179  void SetFixedversusVariableSduIndicator (uint8_t);
180  void SetSduSize (uint8_t);
181  void SetTargetSAID (uint16_t);
182  void SetArqEnable (uint8_t);
183  void SetArqWindowSize (uint16_t);
184  void SetArqRetryTimeoutTx (uint16_t);
185  void SetArqRetryTimeoutRx (uint16_t);
186  void SetArqBlockLifeTime (uint16_t);
187  void SetArqSyncLoss (uint16_t);
188  void SetArqDeliverInOrder (uint8_t);
189  void SetArqPurgeTimeout (uint16_t);
190  void SetArqBlockSize (uint16_t);
193 
194  void SetUnsolicitedGrantInterval (uint16_t);
195  void SetUnsolicitedPollingInterval (uint16_t);
196  void SetIsMulticast (bool isMulticast);
197  void SetModulation (enum WimaxPhy::ModulationType modulationType);
198 
199 
200 
201 private:
202  uint32_t m_sfid;
203  std::string m_serviceClassName;
215  uint8_t m_sduSize;
216  uint16_t m_targetSAID;
217  uint8_t m_arqEnable;
218  uint16_t m_arqWindowSize;
222  uint16_t m_arqSyncLoss;
225  uint16_t m_arqBlockSize;
236  // will be used by the BS
238 };
239 
240 } // namespace ns3
241 
242 #endif /* SERVICE_FLOW_H */
uint16_t m_unsolicitedPollingInterval
Definition: service-flow.h:229
uint32_t GetMinTolerableTrafficRate(void) const
enum WimaxPhy::ModulationType GetModulation(void) const
uint8_t GetFixedversusVariableSduIndicator(void) const
bool GetIsEnabled(void) const
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:73
enum WimaxPhy::ModulationType m_modulationType
Definition: service-flow.h:235
enum ServiceFlow::SchedulingType GetSchedulingType(void) const
void PrintQoSParameters(void) const
void SetQosParamSetType(uint8_t)
void SetMaxSustainedTrafficRate(uint32_t)
void SetConnection(Ptr< WimaxConnection > connection)
uint32_t GetMaxTrafficBurst(void) const
uint16_t GetArqBlockSize(void) const
this class implements a structure to manage some parameters and statistics related to a service flow ...
uint16_t m_arqWindowSize
Definition: service-flow.h:218
void SetArqRetryTimeoutRx(uint16_t)
Ptr< WimaxConnection > m_connection
Definition: service-flow.h:232
enum CsSpecification m_csSpecification
Definition: service-flow.h:226
std::string m_serviceClassName
Definition: service-flow.h:203
uint32_t GetSfid(void) const
void SetArqWindowSize(uint16_t)
uint32_t GetRequestTransmissionPolicy(void) const
uint8_t m_arqDeliverInOrder
Definition: service-flow.h:223
Ptr< WimaxMacQueue > GetQueue(void) const
void SetArqBlockSize(uint16_t)
uint8_t GetArqDeliverInOrder(void) const
uint16_t m_targetSAID
Definition: service-flow.h:216
uint16_t m_arqRetryTimeoutTx
Definition: service-flow.h:219
uint8_t m_trafficPriority
Definition: service-flow.h:205
void SetMinReservedTrafficRate(uint32_t)
This class implements the Type-Len-Value structure channel encodings as described by "IEEE Standard f...
Definition: wimax-tlv.h:64
Ptr< WimaxConnection > GetConnection(void) const
void SetServiceSchedulingType(enum ServiceFlow::SchedulingType)
char * GetSchedulingTypeStr(void) const
uint32_t m_toleratedJitter
Definition: service-flow.h:212
uint32_t GetMinReservedTrafficRate(void) const
uint16_t GetArqRetryTimeoutTx(void) const
void InitValues(void)
void SetArqRetryTimeoutTx(uint16_t)
std::string GetServiceClassName() const
void SetMaxTrafficBurst(uint32_t)
uint16_t GetArqRetryTimeoutRx(void) const
uint32_t m_maxTrafficBurst
Definition: service-flow.h:207
void SetArqDeliverInOrder(uint8_t)
void SetSduSize(uint8_t)
Direction m_direction
Definition: service-flow.h:230
uint8_t GetArqEnable(void) const
uint16_t GetArqPurgeTimeout(void) const
void SetUnsolicitedPollingInterval(uint16_t)
void CleanUpQueue(void)
void CopyParametersFrom(ServiceFlow sf)
void SetArqPurgeTimeout(uint16_t)
CsParameters m_convergenceSublayerParam
Definition: service-flow.h:227
uint8_t m_fixedversusVariableSduIndicator
Definition: service-flow.h:214
void SetRequestTransmissionPolicy(uint32_t)
enum CsSpecification GetCsSpecification(void) const
void SetUnsolicitedGrantInterval(uint16_t)
void SetTargetSAID(uint16_t)
uint8_t GetQosParamSetType(void) const
uint32_t GetMaximumLatency(void) const
uint8_t m_qosParamSetType
Definition: service-flow.h:204
void SetTrafficPriority(uint8_t)
uint32_t m_maxSustainedTrafficRate
Definition: service-flow.h:206
bool CheckClassifierMatch(Ipv4Address srcAddress, Ipv4Address dstAddress, uint16_t srcPort, uint16_t dstPort, uint8_t proto) const
void SetConvergenceSublayerParam(CsParameters)
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void SetArqBlockLifeTime(uint16_t)
uint8_t GetTrafficPriority(void) const
uint8_t GetSduSize(void) const
ServiceFlow & operator=(ServiceFlow const &o)
uint16_t GetTargetSAID(void) const
void SetRecord(ServiceFlowRecord *record)
uint16_t m_arqPurgeTimeout
Definition: service-flow.h:224
This class implements service flows as described by the IEEE-802.16 standard.
Definition: service-flow.h:39
void SetMaximumLatency(uint32_t)
uint16_t m_arqRetryTimeoutRx
Definition: service-flow.h:220
uint16_t m_arqBlockSize
Definition: service-flow.h:225
void SetServiceClassName(std::string)
ServiceFlowRecord * GetRecord(void) const
uint32_t m_maximumLatency
Definition: service-flow.h:213
enum ServiceFlow::SchedulingType m_schedulingType
Definition: service-flow.h:210
uint16_t GetArqSyncLoss(void) const
uint16_t m_unsolicitedGrantInterval
Definition: service-flow.h:228
void SetModulation(enum WimaxPhy::ModulationType modulationType)
Ipv4 addresses are stored in host order in this class.
Definition: ipv4-address.h:40
enum Direction GetDirection(void) const
uint32_t GetToleratedJitter(void) const
void SetDirection(enum Direction direction)
void SetIsEnabled(bool isEnabled)
void SetMinTolerableTrafficRate(uint32_t)
uint16_t m_arqSyncLoss
Definition: service-flow.h:222
void SetType(enum Type type)
bool GetIsMulticast(void) const
uint16_t m_arqBlockLifeTime
Definition: service-flow.h:221
ServiceFlowRecord * m_record
Definition: service-flow.h:237
uint32_t m_minTolerableTrafficRate
Definition: service-flow.h:209
uint32_t m_requestTransmissionPolicy
Definition: service-flow.h:211
uint16_t GetArqWindowSize(void) const
uint32_t GetMaxSustainedTrafficRate(void) const
uint16_t GetUnsolicitedGrantInterval(void) const
void SetToleratedJitter(uint32_t)
void SetSfid(uint32_t)
enum Type GetType(void) const
void SetIsMulticast(bool isMulticast)
Tlv ToTlv(void) const
creates a TLV from this service flow
CsParameters GetConvergenceSublayerParam(void) const
void SetFixedversusVariableSduIndicator(uint8_t)
void SetArqSyncLoss(uint16_t)
uint16_t GetArqBlockLifeTime(void) const
uint32_t m_minReservedTrafficRate
Definition: service-flow.h:208
void SetCsSpecification(enum CsSpecification)
enum ServiceFlow::SchedulingType GetServiceSchedulingType(void) const
HeaderType
this class implements the mac header type field.
void SetArqEnable(uint8_t)
uint16_t GetCid(void) const
uint16_t GetUnsolicitedPollingInterval(void) const
bool HasPackets(void) const