A Discrete-Event Network Simulator
No Matches
Go to the documentation of this file.
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
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 */
21#ifndef SERVICE_FLOW_H
22#define SERVICE_FLOW_H
24#include "cs-parameters.h"
25#include "wimax-connection.h"
26#include "wimax-mac-header.h"
27#include "wimax-phy.h"
29#include <cstdint>
31namespace ns3
34class ServiceFlowRecord;
35class WimaxConnection;
36class WimaxMacQueue;
44 public:
47 {
50 };
53 enum Type
54 {
58 };
62 {
69 SF_TYPE_ALL = 255
70 };
74 {
75 ATM = 99,
76 IPV4 = 100,
77 IPV6 = 101,
78 ETHERNET = 102,
79 VLAN = 103,
83 IPV6_OVER_VLAN = 107
84 };
88 {
96 };
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();
161 void InitValues();
166 void SetDirection(Direction direction);
171 Direction GetDirection() const;
182 void SetType(Type type);
187 Type GetType() const;
192 void SetConnection(Ptr<WimaxConnection> connection);
204 void SetIsEnabled(bool isEnabled);
209 bool GetIsEnabled() const;
215 void SetRecord(ServiceFlowRecord* record);
222 // wrapper functions
237 bool HasPackets() const;
243 bool HasPackets(MacHeaderType::HeaderType packetType) const;
248 void CleanUpQueue();
253 void PrintQoSParameters() const;
259 char* GetSchedulingTypeStr() const;
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;
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;
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);
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);
552 void SetUnsolicitedGrantInterval(uint16_t unsolicitedGrantInterval);
557 void SetUnsolicitedPollingInterval(uint16_t unsolicitedPollingInterval);
562 void SetIsMulticast(bool isMulticast);
567 void SetModulation(enum WimaxPhy::ModulationType modulationType);
569 private:
571 std::string m_serviceClassName;
583 uint8_t m_sduSize;
584 uint16_t m_targetSAID;
585 uint8_t m_arqEnable;
590 uint16_t m_arqSyncLoss;
593 uint16_t m_arqBlockSize;
604 // will be used by the BS
608} // namespace ns3
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
Header type enumeration.
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:78
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
enum WimaxPhy::ModulationType m_modulationType
modulation type
Definition: service-flow.h:603
void SetSfid(uint32_t 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
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.
enum ServiceFlow::SchedulingType m_schedulingType
scheduling type
Definition: service-flow.h:578
enum ServiceFlow::SchedulingType GetSchedulingType() const
Get scheduling type.
uint32_t GetMaxTrafficBurst() const
Get max traffic burst.
void SetServiceClassName(std::string name)
Set service class name.
uint32_t GetSfid() const
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
Modulation type enumeration, Table 356 and 362.
Definition: service-flow.h:88
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
Definition: service-flow.h:600
void SetMaxTrafficBurst(uint32_t maxTrafficBurst)
Set maximum traffic burst.
void SetArqSyncLoss(uint16_t syncLoss)
Set ARQ sync loss.
void SetModulation(enum WimaxPhy::ModulationType modulationType)
Set modulation.
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
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
section 11.13.11 Service flow scheduling type, page 701
Definition: service-flow.h:62
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 enumeration.
Definition: service-flow.h:54
uint16_t GetCid() const
Get CID.
enum ServiceFlow::SchedulingType GetServiceSchedulingType() const
Get service scheduling type.
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.
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.
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.
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.
enum WimaxPhy::ModulationType GetModulation() const
Get modulation.
uint16_t m_arqRetryTimeoutRx
ARQ retry timeout receive.
Definition: service-flow.h:588
void SetServiceSchedulingType(enum ServiceFlow::SchedulingType schedType)
Set service scheduling type.
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.
section CS parameter encoding rules, page 707
Definition: service-flow.h:74
CsSpecification GetCsSpecification() const
Get CS specification.
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 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
Definition: service-flow.h:570
void SetFixedversusVariableSduIndicator(uint8_t sduIndicator)
Set fixed versus variable SDU indicator.
Direction GetDirection() const
Get direction.
Direction m_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.
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 enumeration.
Definition: wimax-phy.h:54
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::Time timeout