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:
43  enum Direction
44  {
47  };
48 
50  enum Type
51  {
55  };
56 
59  {
67  };
70  {
71  ATM = 99,
72  IPV4 = 100,
73  IPV6 = 101,
74  ETHERNET = 102,
75  VLAN = 103,
80  };
83  {
91  };
92 
97  Tlv ToTlv (void) const;
102  ServiceFlow (Tlv tlv);
111  bool CheckClassifierMatch (Ipv4Address srcAddress,
112  Ipv4Address dstAddress,
113  uint16_t srcPort,
114  uint16_t dstPort,
115  uint8_t proto) const;
117  ServiceFlow ();
123  ServiceFlow (enum Direction direction);
129  ServiceFlow (const ServiceFlow & sf);
137  ServiceFlow (uint32_t sfid,
138  enum Direction direction,
139  Ptr<WimaxConnection> connection);
140  ~ServiceFlow (void);
146  ServiceFlow & operator = (ServiceFlow const& o);
147 
149  void InitValues (void);
154  void SetDirection (enum Direction direction);
159  enum Direction GetDirection (void) const;
165 
170  void SetType (enum Type type);
175  enum Type GetType (void) const;
180  void SetConnection (Ptr<WimaxConnection> connection);
186  Ptr<WimaxConnection> GetConnection (void) const;
187 
192  void SetIsEnabled (bool isEnabled);
197  bool GetIsEnabled (void) const;
198 
203  void SetRecord (ServiceFlowRecord *record);
208  ServiceFlowRecord* GetRecord (void) const;
209 
210  // wrapper functions
215  Ptr<WimaxMacQueue> GetQueue (void) const;
225  bool HasPackets (void) const;
231  bool HasPackets (MacHeaderType::HeaderType packetType) const;
232 
234  void CleanUpQueue (void);
235 
237  void PrintQoSParameters (void) const;
238 
243  char* GetSchedulingTypeStr (void) const;
244 
249  uint32_t GetSfid (void) const;
254  uint16_t GetCid (void) const;
259  std::string GetServiceClassName () const;
264  uint8_t GetQosParamSetType (void) const;
269  uint8_t GetTrafficPriority (void) const;
274  uint32_t GetMaxSustainedTrafficRate (void) const;
279  uint32_t GetMaxTrafficBurst (void) const;
284  uint32_t GetMinReservedTrafficRate (void) const;
289  uint32_t GetMinTolerableTrafficRate (void) const;
299  uint32_t GetRequestTransmissionPolicy (void) const;
304  uint32_t GetToleratedJitter (void) const;
309  uint32_t GetMaximumLatency (void) const;
314  uint8_t GetFixedversusVariableSduIndicator (void) const;
319  uint8_t GetSduSize (void) const;
324  uint16_t GetTargetSAID (void) const;
329  uint8_t GetArqEnable (void) const;
334  uint16_t GetArqWindowSize (void) const;
339  uint16_t GetArqRetryTimeoutTx (void) const;
344  uint16_t GetArqRetryTimeoutRx (void) const;
349  uint16_t GetArqBlockLifeTime (void) const;
354  uint16_t GetArqSyncLoss (void) const;
359  uint8_t GetArqDeliverInOrder (void) const;
364  uint16_t GetArqPurgeTimeout (void) const;
369  uint16_t GetArqBlockSize (void) const;
374  enum CsSpecification GetCsSpecification (void) const;
384  uint16_t GetUnsolicitedGrantInterval (void) const;
389  uint16_t GetUnsolicitedPollingInterval (void) const;
394  bool GetIsMulticast (void) const;
399  enum WimaxPhy::ModulationType GetModulation (void) const;
400 
405  void SetSfid (uint32_t sfid);
409  void SetServiceClassName (std::string name);
414  void SetQosParamSetType (uint8_t type);
419  void SetTrafficPriority (uint8_t priority);
424  void SetMaxSustainedTrafficRate (uint32_t maxSustainedRate);
429  void SetMaxTrafficBurst (uint32_t maxTrafficBurst);
434  void SetMinReservedTrafficRate (uint32_t minResvRate);
439  void SetMinTolerableTrafficRate (uint32_t minJitter);
449  void SetRequestTransmissionPolicy (uint32_t policy);
454  void SetToleratedJitter (uint32_t jitter);
459  void SetMaximumLatency (uint32_t MaximumLatency);
464  void SetFixedversusVariableSduIndicator (uint8_t sduIndicator);
469  void SetSduSize (uint8_t sduSize);
474  void SetTargetSAID (uint16_t targetSaid);
479  void SetArqEnable (uint8_t arqEnable);
484  void SetArqWindowSize (uint16_t arqWindowSize);
489  void SetArqRetryTimeoutTx (uint16_t timeout);
494  void SetArqRetryTimeoutRx (uint16_t timeout);
499  void SetArqBlockLifeTime (uint16_t lifeTime);
504  void SetArqSyncLoss (uint16_t syncLoss);
509  void SetArqDeliverInOrder (uint8_t inOrder);
514  void SetArqPurgeTimeout (uint16_t timeout);
519  void SetArqBlockSize (uint16_t size);
524  void SetCsSpecification (enum CsSpecification spec);
530 
535  void SetUnsolicitedGrantInterval (uint16_t unsolicitedGrantInterval);
540  void SetUnsolicitedPollingInterval (uint16_t unsolicitedPollingInterval);
545  void SetIsMulticast (bool isMulticast);
550  void SetModulation (enum WimaxPhy::ModulationType modulationType);
551 
552 
553 
554 private:
555  uint32_t m_sfid;
556  std::string m_serviceClassName;
560  uint32_t m_maxTrafficBurst;
565  uint32_t m_toleratedJitter;
566  uint32_t m_maximumLatency;
568  uint8_t m_sduSize;
569  uint16_t m_targetSAID;
570  uint8_t m_arqEnable;
571  uint16_t m_arqWindowSize;
575  uint16_t m_arqSyncLoss;
577  uint16_t m_arqPurgeTimeout;
578  uint16_t m_arqBlockSize;
586  bool m_isEnabled;
589  // will be used by the BS
591 };
592 
593 } // namespace ns3
594 
595 #endif /* SERVICE_FLOW_H */
void SetArqRetryTimeoutTx(uint16_t timeout)
Set ARQ retry timeout transmit.
uint32_t GetMaxSustainedTrafficRate(void) const
Get max sustained traffic rate.
CsParameters GetConvergenceSublayerParam(void) const
Get convergence sublayer.
HeaderType
Header type enumeration.
ServiceFlow()
default constructor
Definition: service-flow.cc:43
uint16_t m_unsolicitedPollingInterval
unsolicited polling interval
Definition: service-flow.h:582
bool GetIsMulticast(void) const
Get is multicast.
uint16_t GetArqRetryTimeoutRx(void) const
Get ARQ retry timeout receive.
Tlv ToTlv(void) const
creates a TLV from this service flow
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:73
enum WimaxPhy::ModulationType m_modulationType
modulation type
Definition: service-flow.h:588
void SetConnection(Ptr< WimaxConnection > connection)
Set connection.
uint16_t GetArqBlockLifeTime(void) const
Get ARQ block lifetime.
uint8_t GetArqDeliverInOrder(void) const
Get ARQ deliver in order.
void SetRequestTransmissionPolicy(uint32_t policy)
Set request transmission policy.
this class implements a structure to manage some parameters and statistics related to a service flow ...
uint16_t m_arqWindowSize
ARQ window size.
Definition: service-flow.h:571
uint16_t GetUnsolicitedGrantInterval(void) const
Get unsolicited grant interval.
uint32_t m_sfid
SFID.
Definition: service-flow.h:555
void SetArqEnable(uint8_t arqEnable)
Set ARQ enable.
void SetArqBlockLifeTime(uint16_t lifeTime)
Set ARQ block lifetime.
uint8_t GetSduSize(void) const
Get SDU size.
Ptr< WimaxConnection > m_connection
connection
Definition: service-flow.h:585
uint32_t GetMinTolerableTrafficRate(void) const
Get minimum tolerable traffic rate.
void SetToleratedJitter(uint32_t jitter)
Set tolerated jitter.
enum CsSpecification m_csSpecification
CS specification.
Definition: service-flow.h:579
uint32_t GetMaximumLatency(void) const
Get maximum latency.
std::string m_serviceClassName
service class name
Definition: service-flow.h:556
uint8_t GetArqEnable(void) const
Get ARQ enable.
enum WimaxPhy::ModulationType GetModulation(void) const
Get modulation.
uint8_t m_arqDeliverInOrder
ARQ deliver in order.
Definition: service-flow.h:576
Type m_type
type
Definition: service-flow.h:584
uint16_t m_targetSAID
traget SAID
Definition: service-flow.h:569
ns3::Time timeout
uint8_t GetTrafficPriority(void) const
Get traffic priority.
uint16_t GetArqPurgeTimeout(void) const
Get ARQ purge timeout.
uint32_t GetSfid(void) const
Get SFID.
uint16_t GetArqBlockSize(void) const
Get ARQ block size.
uint16_t m_arqRetryTimeoutTx
ARQ retry timeout transmit.
Definition: service-flow.h:572
uint8_t m_trafficPriority
traffic priority
Definition: service-flow.h:558
This class implements the Type-Len-Value structure channel encodings as described by "IEEE Standard f...
Definition: wimax-tlv.h:83
void SetSduSize(uint8_t sduSize)
Set SDU size.
void SetMinReservedTrafficRate(uint32_t minResvRate)
Set minimum reserved traffic rate.
bool GetIsEnabled(void) const
Get is enabled flag.
CsSpecification
section 11.13.19.2 CS parameter encoding rules, page 707
Definition: service-flow.h:69
uint32_t m_toleratedJitter
tolerated jitter
Definition: service-flow.h:565
enum ServiceFlow::SchedulingType GetServiceSchedulingType(void) const
Get service scheduling type.
void SetArqSyncLoss(uint16_t syncLoss)
Set ARQ sync loss.
void SetQosParamSetType(uint8_t type)
Set QOS parameter set type.
void InitValues(void)
Initial values.
SchedulingType
section 11.13.11 Service flow scheduling type, page 701
Definition: service-flow.h:58
CsParameters class.
Definition: cs-parameters.h:35
Ptr< WimaxConnection > GetConnection(void) const
Can return a null connection is this service flow has not been associated yet to a connection...
char * GetSchedulingTypeStr(void) const
Get scheduling type string.
uint32_t m_maxTrafficBurst
maximum traffic burst
Definition: service-flow.h:560
Direction
Direction enumeration.
Definition: service-flow.h:43
uint16_t GetArqRetryTimeoutTx(void) const
Get ARQ retry timeout transmit.
void SetArqDeliverInOrder(uint8_t inOrder)
Set ARQ deliver in order.
uint32_t GetToleratedJitter(void) const
Get tolerated jitter.
Direction m_direction
direction
Definition: service-flow.h:583
bool m_isMulticast
is multicast?
Definition: service-flow.h:587
uint8_t m_sduSize
SDU size.
Definition: service-flow.h:568
void CleanUpQueue(void)
shall be called only by BS
void CopyParametersFrom(ServiceFlow sf)
Copy parameters from another service flow.
void SetUnsolicitedGrantInterval(uint16_t unsolicitedGrantInterval)
Set unsolicied grant interval.
CsParameters m_convergenceSublayerParam
convergence sublayer parameters
Definition: service-flow.h:580
Ptr< WimaxMacQueue > GetQueue(void) const
Get pointer to queue.
uint8_t m_fixedversusVariableSduIndicator
fixed versus variable SDI indicator
Definition: service-flow.h:567
ServiceFlowRecord * GetRecord(void) const
Get service flow record.
uint8_t m_qosParamSetType
QOS parameter type.
Definition: service-flow.h:557
enum CsSpecification GetCsSpecification(void) const
Get CS specification.
void SetMaximumLatency(uint32_t MaximumLatency)
Set maximum latency.
uint32_t m_maxSustainedTrafficRate
maximum sustained traffic rate
Definition: service-flow.h:559
uint16_t GetCid(void) const
Get CID.
uint32_t GetMaxTrafficBurst(void) const
Get max traffic burst.
void SetTargetSAID(uint16_t targetSaid)
Set target SAID.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
void SetConvergenceSublayerParam(CsParameters csparam)
Set convergence sublayer parameters.
uint32_t GetRequestTransmissionPolicy(void) const
Get request transmission policy.
ServiceFlow & operator=(ServiceFlow const &o)
assignment operator
void SetRecord(ServiceFlowRecord *record)
Set service flow record.
uint16_t m_arqPurgeTimeout
ARQ purge timeout.
Definition: service-flow.h:577
This class implements service flows as described by the IEEE-802.16 standard.
Definition: service-flow.h:39
uint32_t GetMinReservedTrafficRate(void) const
Get minimum reserved traffic rate.
std::string GetServiceClassName() const
Get service class name.
enum Type GetType(void) const
Get type of service flow.
uint16_t m_arqRetryTimeoutRx
ARQ retry timeout receive.
Definition: service-flow.h:573
uint16_t m_arqBlockSize
ARQ block size.
Definition: service-flow.h:578
uint16_t GetTargetSAID(void) const
Get target SAID.
ModulationType
Modulation type enumeration, Table 356 and 362.
Definition: service-flow.h:82
bool CheckClassifierMatch(Ipv4Address srcAddress, Ipv4Address dstAddress, uint16_t srcPort, uint16_t dstPort, uint8_t proto) const
uint32_t m_maximumLatency
maximum latency
Definition: service-flow.h:566
enum ServiceFlow::SchedulingType m_schedulingType
scheduling type
Definition: service-flow.h:563
uint16_t m_unsolicitedGrantInterval
unsolicited grant interval
Definition: service-flow.h:581
void SetModulation(enum WimaxPhy::ModulationType modulationType)
Set modulation.
void SetMinTolerableTrafficRate(uint32_t minJitter)
Set minimum tolerable traffic rate.
ModulationType
ModulationType enumeration.
Definition: wimax-phy.h:49
Ipv4 addresses are stored in host order in this class.
Definition: ipv4-address.h:40
enum ServiceFlow::SchedulingType GetSchedulingType(void) const
Get scheduling type.
void SetDirection(enum Direction direction)
Set direction.
void SetIsEnabled(bool isEnabled)
Set is enabled flag.
uint16_t m_arqSyncLoss
ARQ sync loss.
Definition: service-flow.h:575
void SetType(enum Type type)
Set type of service flow.
void SetUnsolicitedPollingInterval(uint16_t unsolicitedPollingInterval)
Set unsolicited polling interval.
uint16_t m_arqBlockLifeTime
ARQ block life time.
Definition: service-flow.h:574
void SetMaxTrafficBurst(uint32_t maxTrafficBurst)
Set maximum traffic burst.
Type
Type enumeration.
Definition: service-flow.h:50
ServiceFlowRecord * m_record
service flow record
Definition: service-flow.h:590
bool m_isEnabled
is enabled?
Definition: service-flow.h:586
void SetFixedversusVariableSduIndicator(uint8_t sduIndicator)
Set fixed versus variable SDU indicator.
void SetSfid(uint32_t sfid)
Set SFID.
uint16_t GetArqSyncLoss(void) const
Get ARQ sync loss.
uint32_t m_minTolerableTrafficRate
minimum tolerable traffic rate
Definition: service-flow.h:562
uint8_t GetFixedversusVariableSduIndicator(void) const
Get fixed versus varaiable SDU indicator.
uint32_t m_requestTransmissionPolicy
request transmission policy
Definition: service-flow.h:564
bool HasPackets(void) const
Check if packets are present.
uint16_t GetArqWindowSize(void) const
Get ARQ retry timeout transmit.
void SetTrafficPriority(uint8_t priority)
Set traffic priority.
void SetCsSpecification(enum CsSpecification spec)
Set CS specification.
void SetMaxSustainedTrafficRate(uint32_t maxSustainedRate)
Set max sustained traffic rate.
void SetServiceClassName(std::string name)
Set service class name.
void SetIsMulticast(bool isMulticast)
Set is multicast.
uint16_t GetUnsolicitedPollingInterval(void) const
Get unsolicited polling interval.
void SetArqRetryTimeoutRx(uint16_t timeout)
Set ARQ retry timeout receive.
uint8_t m_arqEnable
ARQ enable.
Definition: service-flow.h:570
enum Direction GetDirection(void) const
Get direction.
void SetServiceSchedulingType(enum ServiceFlow::SchedulingType schedType)
Set service scheduling type.
uint32_t m_minReservedTrafficRate
minimum reserved traffic rate
Definition: service-flow.h:561
void SetArqPurgeTimeout(uint16_t timeout)
Set ARQ purge timeout.
uint8_t GetQosParamSetType(void) const
Get QOS parameter set type.
void SetArqBlockSize(uint16_t size)
Set ARQ block size.
void PrintQoSParameters(void) const
Print QOS parameters.
void SetArqWindowSize(uint16_t arqWindowSize)
Set ARQ retry timeout transmit.