A Discrete-Event Network Simulator
API
service-flow.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2007,2008, 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  * Author: Jahanzeb Farooq <jahanzeb.farooq@sophia.inria.fr>
18  * Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
19  */
20 
21 #ifndef SERVICE_FLOW_H
22 #define SERVICE_FLOW_H
23 
24 #include "cs-parameters.h"
25 #include "wimax-connection.h"
26 #include "wimax-mac-header.h"
27 #include "wimax-phy.h"
28 
29 #include <cstdint>
30 
31 namespace ns3
32 {
33 
34 class ServiceFlowRecord;
35 class WimaxConnection;
36 class WimaxMacQueue;
37 
43 {
44  public:
46  enum Direction
47  {
50  };
51 
53  enum Type
54  {
58  };
59 
62  {
69  SF_TYPE_ALL = 255
70  };
71 
74  {
75  ATM = 99,
76  IPV4 = 100,
77  IPV6 = 101,
78  ETHERNET = 102,
79  VLAN = 103,
83  IPV6_OVER_VLAN = 107
84  };
85 
88  {
96  };
97 
102  Tlv ToTlv() const;
107  ServiceFlow(Tlv tlv);
118  bool CheckClassifierMatch(Ipv4Address srcAddress,
119  Ipv4Address dstAddress,
120  uint16_t srcPort,
121  uint16_t dstPort,
122  uint8_t proto) const;
126  ServiceFlow();
132  ServiceFlow(Direction direction);
138  ServiceFlow(const ServiceFlow& sf);
146  ServiceFlow(uint32_t sfid, Direction direction, Ptr<WimaxConnection> connection);
150  ~ServiceFlow();
156  ServiceFlow& operator=(const ServiceFlow& o);
157 
161  void InitValues();
166  void SetDirection(Direction direction);
171  Direction GetDirection() const;
177 
182  void SetType(Type type);
187  Type GetType() const;
192  void SetConnection(Ptr<WimaxConnection> connection);
199 
204  void SetIsEnabled(bool isEnabled);
209  bool GetIsEnabled() const;
210 
215  void SetRecord(ServiceFlowRecord* record);
220  ServiceFlowRecord* GetRecord() const;
221 
222  // wrapper functions
237  bool HasPackets() const;
243  bool HasPackets(MacHeaderType::HeaderType packetType) const;
244 
248  void CleanUpQueue();
249 
253  void PrintQoSParameters() const;
254 
259  char* GetSchedulingTypeStr() const;
260 
265  uint32_t GetSfid() const;
270  uint16_t GetCid() const;
275  std::string GetServiceClassName() const;
280  uint8_t GetQosParamSetType() const;
285  uint8_t GetTrafficPriority() const;
290  uint32_t GetMaxSustainedTrafficRate() const;
295  uint32_t GetMaxTrafficBurst() const;
300  uint32_t GetMinReservedTrafficRate() const;
305  uint32_t GetMinTolerableTrafficRate() const;
315  uint32_t GetRequestTransmissionPolicy() const;
320  uint32_t GetToleratedJitter() const;
325  uint32_t GetMaximumLatency() const;
330  uint8_t GetFixedversusVariableSduIndicator() const;
335  uint8_t GetSduSize() const;
340  uint16_t GetTargetSAID() const;
345  uint8_t GetArqEnable() const;
350  uint16_t GetArqWindowSize() const;
355  uint16_t GetArqRetryTimeoutTx() const;
360  uint16_t GetArqRetryTimeoutRx() const;
365  uint16_t GetArqBlockLifeTime() const;
370  uint16_t GetArqSyncLoss() const;
375  uint8_t GetArqDeliverInOrder() const;
380  uint16_t GetArqPurgeTimeout() const;
385  uint16_t GetArqBlockSize() const;
400  uint16_t GetUnsolicitedGrantInterval() const;
405  uint16_t GetUnsolicitedPollingInterval() const;
410  bool GetIsMulticast() const;
416 
421  void SetSfid(uint32_t sfid);
426  void SetServiceClassName(std::string name);
431  void SetQosParamSetType(uint8_t type);
436  void SetTrafficPriority(uint8_t priority);
441  void SetMaxSustainedTrafficRate(uint32_t maxSustainedRate);
446  void SetMaxTrafficBurst(uint32_t maxTrafficBurst);
451  void SetMinReservedTrafficRate(uint32_t minResvRate);
456  void SetMinTolerableTrafficRate(uint32_t minJitter);
466  void SetRequestTransmissionPolicy(uint32_t policy);
471  void SetToleratedJitter(uint32_t jitter);
476  void SetMaximumLatency(uint32_t MaximumLatency);
481  void SetFixedversusVariableSduIndicator(uint8_t sduIndicator);
486  void SetSduSize(uint8_t sduSize);
491  void SetTargetSAID(uint16_t targetSaid);
496  void SetArqEnable(uint8_t arqEnable);
501  void SetArqWindowSize(uint16_t arqWindowSize);
506  void SetArqRetryTimeoutTx(uint16_t timeout);
511  void SetArqRetryTimeoutRx(uint16_t timeout);
516  void SetArqBlockLifeTime(uint16_t lifeTime);
521  void SetArqSyncLoss(uint16_t syncLoss);
526  void SetArqDeliverInOrder(uint8_t inOrder);
531  void SetArqPurgeTimeout(uint16_t timeout);
536  void SetArqBlockSize(uint16_t size);
547 
552  void SetUnsolicitedGrantInterval(uint16_t unsolicitedGrantInterval);
557  void SetUnsolicitedPollingInterval(uint16_t unsolicitedPollingInterval);
562  void SetIsMulticast(bool isMulticast);
567  void SetModulation(WimaxPhy::ModulationType modulationType);
568 
569  private:
570  uint32_t m_sfid;
571  std::string m_serviceClassName;
575  uint32_t m_maxTrafficBurst;
580  uint32_t m_toleratedJitter;
581  uint32_t m_maximumLatency;
583  uint8_t m_sduSize;
584  uint16_t m_targetSAID;
585  uint8_t m_arqEnable;
586  uint16_t m_arqWindowSize;
590  uint16_t m_arqSyncLoss;
592  uint16_t m_arqPurgeTimeout;
593  uint16_t m_arqBlockSize;
601  bool m_isEnabled;
604  // will be used by the BS
606 };
607 
608 } // namespace ns3
609 
610 #endif /* SERVICE_FLOW_H */
CsParameters class.
Definition: cs-parameters.h:36
Ipv4 addresses are stored in host order in this class.
Definition: ipv4-address.h:42
HeaderType
Header type enumeration.
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
uint16_t m_targetSAID
target SAID
Definition: service-flow.h:584
uint32_t m_requestTransmissionPolicy
request transmission policy
Definition: service-flow.h:579
uint16_t GetArqSyncLoss() const
Get ARQ sync loss.
void SetTargetSAID(uint16_t targetSaid)
Set target SAID.
void SetRequestTransmissionPolicy(uint32_t policy)
Set request transmission policy.
void SetDirection(Direction direction)
Set direction.
uint16_t m_arqBlockSize
ARQ block size.
Definition: service-flow.h:593
void SetSfid(uint32_t sfid)
Set SFID.
void SetCsSpecification(CsSpecification spec)
Set CS specification.
uint16_t GetTargetSAID() const
Get target SAID.
ServiceFlow & operator=(const ServiceFlow &o)
assignment operator
std::string m_serviceClassName
service class name
Definition: service-flow.h:571
uint32_t GetRequestTransmissionPolicy() const
Get request transmission policy.
uint32_t m_toleratedJitter
tolerated jitter
Definition: service-flow.h:580
ServiceFlow::SchedulingType GetServiceSchedulingType() const
Get service scheduling type.
uint16_t GetArqWindowSize() const
Get ARQ retry timeout transmit.
uint32_t GetMaxSustainedTrafficRate() const
Get max sustained traffic rate.
void SetArqEnable(uint8_t arqEnable)
Set ARQ enable.
void SetArqBlockSize(uint16_t size)
Set ARQ block size.
uint32_t GetMaxTrafficBurst() const
Get max traffic burst.
void SetServiceClassName(std::string name)
Set service class name.
uint32_t GetSfid() const
Get SFID.
uint32_t m_maximumLatency
maximum latency
Definition: service-flow.h:581
uint32_t m_minTolerableTrafficRate
minimum tolerable traffic rate
Definition: service-flow.h:577
uint32_t GetMaximumLatency() const
Get maximum latency.
uint8_t GetFixedversusVariableSduIndicator() const
Get fixed versus variable SDU indicator.
void PrintQoSParameters() const
Print QoS parameters.
uint16_t m_arqBlockLifeTime
ARQ block life time.
Definition: service-flow.h:589
ModulationType
Modulation type enumeration, Table 356 and 362.
Definition: service-flow.h:88
ServiceFlow::SchedulingType GetSchedulingType() const
Get scheduling type.
~ServiceFlow()
Destructor.
uint16_t m_unsolicitedGrantInterval
unsolicited grant interval
Definition: service-flow.h:596
uint16_t GetUnsolicitedPollingInterval() const
Get unsolicited polling interval.
CsParameters m_convergenceSublayerParam
convergence sublayer parameters
Definition: service-flow.h:595
bool m_isEnabled
is enabled?
Definition: service-flow.h:601
std::string GetServiceClassName() const
Get service class name.
uint16_t m_arqRetryTimeoutTx
ARQ retry timeout transmit.
Definition: service-flow.h:587
uint8_t m_trafficPriority
traffic priority
Definition: service-flow.h:573
uint32_t m_minReservedTrafficRate
minimum reserved traffic rate
Definition: service-flow.h:576
Ptr< WimaxConnection > m_connection
connection
Definition: service-flow.h:600
void SetMaxTrafficBurst(uint32_t maxTrafficBurst)
Set maximum traffic burst.
void SetArqSyncLoss(uint16_t syncLoss)
Set ARQ sync loss.
void SetServiceSchedulingType(ServiceFlow::SchedulingType schedType)
Set service scheduling type.
Tlv ToTlv() const
creates a TLV from this service flow
uint8_t GetQosParamSetType() const
Get QOS parameter set type.
uint32_t m_maxSustainedTrafficRate
maximum sustained traffic rate
Definition: service-flow.h:574
void SetMaximumLatency(uint32_t MaximumLatency)
Set maximum latency.
uint8_t m_arqDeliverInOrder
ARQ deliver in order.
Definition: service-flow.h:591
void SetModulation(WimaxPhy::ModulationType modulationType)
Set modulation.
uint16_t GetArqRetryTimeoutRx() const
Get ARQ retry timeout receive.
void InitValues()
Initialize values.
void SetQosParamSetType(uint8_t type)
Set QOS parameter set type.
uint32_t m_maxTrafficBurst
maximum traffic burst
Definition: service-flow.h:575
uint16_t m_unsolicitedPollingInterval
unsolicited polling interval
Definition: service-flow.h:597
uint8_t m_qosParamSetType
QOS parameter type.
Definition: service-flow.h:572
SchedulingType
section 11.13.11 Service flow scheduling type, page 701
Definition: service-flow.h:62
ServiceFlow()
Default constructor.
Definition: service-flow.cc:45
uint16_t m_arqSyncLoss
ARQ sync loss.
Definition: service-flow.h:590
void SetArqWindowSize(uint16_t arqWindowSize)
Set ARQ retry timeout transmit.
void SetConvergenceSublayerParam(CsParameters csparam)
Set convergence sublayer parameters.
void SetSduSize(uint8_t sduSize)
Set SDU size.
void SetRecord(ServiceFlowRecord *record)
Set service flow record.
char * GetSchedulingTypeStr() const
Get scheduling type string.
uint8_t GetTrafficPriority() const
Get traffic priority.
bool m_isMulticast
is multicast?
Definition: service-flow.h:602
uint8_t GetArqEnable() const
Get ARQ enable.
uint32_t GetMinReservedTrafficRate() const
Get minimum reserved traffic rate.
void SetArqPurgeTimeout(uint16_t timeout)
Set ARQ purge timeout.
uint16_t m_arqPurgeTimeout
ARQ purge timeout.
Definition: service-flow.h:592
Type
Type enumeration.
Definition: service-flow.h:54
uint16_t GetCid() const
Get CID.
bool GetIsEnabled() const
Get is enabled flag.
void SetTrafficPriority(uint8_t priority)
Set traffic priority.
ServiceFlowRecord * m_record
service flow record
Definition: service-flow.h:605
bool HasPackets() const
Check if packets are present.
uint8_t GetSduSize() const
Get SDU size.
void SetArqBlockLifeTime(uint16_t lifeTime)
Set ARQ block lifetime.
CsSpecification GetCsSpecification() const
Get CS specification.
void CopyParametersFrom(ServiceFlow sf)
Copy parameters from another service flow.
uint16_t GetArqRetryTimeoutTx() const
Get ARQ retry timeout transmit.
void SetMinTolerableTrafficRate(uint32_t minJitter)
Set minimum tolerable traffic rate.
uint16_t m_arqWindowSize
ARQ window size.
Definition: service-flow.h:586
void SetIsMulticast(bool isMulticast)
Set is multicast.
uint8_t GetArqDeliverInOrder() const
Get ARQ deliver in order.
void SetArqRetryTimeoutTx(uint16_t timeout)
Set ARQ retry timeout transmit.
ServiceFlow::SchedulingType m_schedulingType
scheduling type
Definition: service-flow.h:578
Type GetType() const
Get type of service flow.
uint8_t m_arqEnable
ARQ enable.
Definition: service-flow.h:585
uint8_t m_fixedversusVariableSduIndicator
fixed versus variable SDI indicator
Definition: service-flow.h:582
uint32_t GetMinTolerableTrafficRate() const
Get minimum tolerable traffic rate.
void SetToleratedJitter(uint32_t jitter)
Set tolerated jitter.
WimaxPhy::ModulationType GetModulation() const
Get modulation.
void SetUnsolicitedGrantInterval(uint16_t unsolicitedGrantInterval)
Set unsolicited grant interval.
ServiceFlowRecord * GetRecord() const
Get service flow record.
uint8_t m_sduSize
SDU size.
Definition: service-flow.h:583
void SetArqDeliverInOrder(uint8_t inOrder)
Set ARQ deliver in order.
uint16_t GetArqBlockLifeTime() const
Get ARQ block lifetime.
uint16_t m_arqRetryTimeoutRx
ARQ retry timeout receive.
Definition: service-flow.h:588
uint16_t GetArqBlockSize() const
Get ARQ block size.
void SetArqRetryTimeoutRx(uint16_t timeout)
Set ARQ retry timeout receive.
void SetUnsolicitedPollingInterval(uint16_t unsolicitedPollingInterval)
Set unsolicited polling interval.
void SetMinReservedTrafficRate(uint32_t minResvRate)
Set minimum reserved traffic rate.
void SetType(Type type)
Set type of service flow.
uint16_t GetArqPurgeTimeout() const
Get ARQ purge timeout.
bool GetIsMulticast() const
Get is multicast.
CsSpecification
section 11.13.19.2 CS parameter encoding rules, page 707
Definition: service-flow.h:74
bool CheckClassifierMatch(Ipv4Address srcAddress, Ipv4Address dstAddress, uint16_t srcPort, uint16_t dstPort, uint8_t proto) const
check classifier match.
CsSpecification m_csSpecification
CS specification.
Definition: service-flow.h:594
uint32_t GetToleratedJitter() const
Get tolerated jitter.
Direction
Direction enumeration.
Definition: service-flow.h:47
Ptr< WimaxMacQueue > GetQueue() const
Get pointer to queue.
uint16_t GetUnsolicitedGrantInterval() const
Get unsolicited grant interval.
uint32_t m_sfid
SFID.
Definition: service-flow.h:570
void SetFixedversusVariableSduIndicator(uint8_t sduIndicator)
Set fixed versus variable SDU indicator.
Direction GetDirection() const
Get direction.
Direction m_direction
direction
Definition: service-flow.h:598
CsParameters GetConvergenceSublayerParam() const
Get convergence sublayer.
void SetMaxSustainedTrafficRate(uint32_t maxSustainedRate)
Set max sustained traffic rate.
Ptr< WimaxConnection > GetConnection() const
Can return a null connection is this service flow has not been associated yet to a connection.
void CleanUpQueue()
Shall be called only by BS.
WimaxPhy::ModulationType m_modulationType
modulation type
Definition: service-flow.h:603
void SetConnection(Ptr< WimaxConnection > connection)
Set connection.
void SetIsEnabled(bool isEnabled)
Set is enabled flag.
this class implements a structure to manage some parameters and statistics related to a service flow
This class implements the Type-Len-Value structure channel encodings as described by "IEEE Standard f...
Definition: wimax-tlv.h:87
ModulationType
ModulationType enumeration.
Definition: wimax-phy.h:54
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::Time timeout