A Discrete-Event Network Simulator
Go to the documentation of this file.
1/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
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
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 */
22#ifndef SERVICE_FLOW_H
23#define SERVICE_FLOW_H
25#include <stdint.h>
26#include "wimax-phy.h"
27#include "wimax-connection.h"
28#include "cs-parameters.h"
30namespace ns3 {
32class ServiceFlowRecord;
33class WimaxConnection;
44 {
47 };
50 enum Type
51 {
55 };
59 {
66 SF_TYPE_ALL = 255
67 };
70 {
71 ATM = 99,
72 IPV4 = 100,
73 IPV6 = 101,
74 ETHERNET = 102,
75 VLAN = 103,
79 IPV6_OVER_VLAN = 107
80 };
83 {
91 };
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);
149 void InitValues (void);
154 void SetDirection (enum Direction direction);
159 enum Direction GetDirection (void) const;
170 void SetType (enum Type type);
175 enum Type GetType (void) const;
180 void SetConnection (Ptr<WimaxConnection> connection);
192 void SetIsEnabled (bool isEnabled);
197 bool GetIsEnabled (void) const;
203 void SetRecord (ServiceFlowRecord *record);
208 ServiceFlowRecord* GetRecord (void) const;
210 // wrapper functions
215 Ptr<WimaxMacQueue> GetQueue (void) const;
225 bool HasPackets (void) const;
231 bool HasPackets (MacHeaderType::HeaderType packetType) const;
234 void CleanUpQueue (void);
237 void PrintQoSParameters (void) const;
243 char* GetSchedulingTypeStr (void) const;
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;
279 uint32_t GetMaxTrafficBurst (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;
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);
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);
535 void SetUnsolicitedGrantInterval (uint16_t unsolicitedGrantInterval);
540 void SetUnsolicitedPollingInterval (uint16_t unsolicitedPollingInterval);
545 void SetIsMulticast (bool isMulticast);
550 void SetModulation (enum WimaxPhy::ModulationType modulationType);
556 std::string m_serviceClassName;
568 uint8_t m_sduSize;
569 uint16_t m_targetSAID;
570 uint8_t m_arqEnable;
575 uint16_t m_arqSyncLoss;
578 uint16_t m_arqBlockSize;
589 // will be used by the BS
593} // namespace ns3
595#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:41
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:40
uint8_t GetArqDeliverInOrder(void) const
Get ARQ deliver in order.
uint16_t m_targetSAID
traget SAID
Definition: service-flow.h:569
uint32_t m_requestTransmissionPolicy
request transmission policy
Definition: service-flow.h:564
enum WimaxPhy::ModulationType GetModulation(void) const
Get modulation.
void SetTargetSAID(uint16_t targetSaid)
Set target SAID.
void SetRequestTransmissionPolicy(uint32_t policy)
Set request transmission policy.
uint16_t m_arqBlockSize
ARQ block size.
Definition: service-flow.h:578
enum WimaxPhy::ModulationType m_modulationType
modulation type
Definition: service-flow.h:588
void SetSfid(uint32_t sfid)
enum CsSpecification m_csSpecification
CS specification.
Definition: service-flow.h:579
std::string m_serviceClassName
service class name
Definition: service-flow.h:556
uint32_t m_toleratedJitter
tolerated jitter
Definition: service-flow.h:565
uint16_t GetArqRetryTimeoutTx(void) const
Get ARQ retry timeout transmit.
enum Type GetType(void) const
Get type of service flow.
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:563
uint32_t GetMinReservedTrafficRate(void) const
Get minimum reserved traffic rate.
enum ServiceFlow::SchedulingType GetServiceSchedulingType(void) const
Get service scheduling type.
uint8_t GetArqEnable(void) const
Get ARQ enable.
void SetServiceClassName(std::string name)
Set service class name.
uint8_t GetSduSize(void) const
Get SDU size.
uint32_t m_maximumLatency
maximum latency
Definition: service-flow.h:566
uint32_t m_minTolerableTrafficRate
minimum tolerable traffic rate
Definition: service-flow.h:562
uint16_t GetUnsolicitedPollingInterval(void) const
Get unsolicited polling interval.
uint16_t m_arqBlockLifeTime
ARQ block life time.
Definition: service-flow.h:574
uint16_t GetArqRetryTimeoutRx(void) const
Get ARQ retry timeout receive.
Modulation type enumeration, Table 356 and 362.
Definition: service-flow.h:83
uint16_t GetUnsolicitedGrantInterval(void) const
Get unsolicited grant interval.
uint16_t m_unsolicitedGrantInterval
unsolicited grant interval
Definition: service-flow.h:581
void SetType(enum Type type)
Set type of service flow.
CsParameters m_convergenceSublayerParam
convergence sublayer parameters
Definition: service-flow.h:580
bool m_isEnabled
is enabled?
Definition: service-flow.h:586
std::string GetServiceClassName() const
Get service class name.
uint8_t GetFixedversusVariableSduIndicator(void) const
Get fixed versus varaiable SDU indicator.
uint16_t m_arqRetryTimeoutTx
ARQ retry timeout transmit.
Definition: service-flow.h:572
uint8_t m_trafficPriority
traffic priority
Definition: service-flow.h:558
uint32_t m_minReservedTrafficRate
minimum reserved traffic rate
Definition: service-flow.h:561
Ptr< WimaxConnection > m_connection
Definition: service-flow.h:585
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.
uint32_t m_maxSustainedTrafficRate
maximum sustained traffic rate
Definition: service-flow.h:559
uint16_t GetArqBlockSize(void) const
Get ARQ block size.
void SetMaximumLatency(uint32_t MaximumLatency)
Set maximum latency.
enum Direction GetDirection(void) const
Get direction.
uint8_t m_arqDeliverInOrder
ARQ deliver in order.
Definition: service-flow.h:576
Ptr< WimaxMacQueue > GetQueue(void) const
Get pointer to queue.
bool HasPackets(void) const
Check if packets are present.
void SetQosParamSetType(uint8_t type)
Set QOS parameter set type.
uint32_t m_maxTrafficBurst
maximum traffic burst
Definition: service-flow.h:560
enum ServiceFlow::SchedulingType GetSchedulingType(void) const
Get scheduling type.
uint16_t GetTargetSAID(void) const
Get target SAID.
uint32_t GetMaxTrafficBurst(void) const
Get max traffic burst.
void SetCsSpecification(enum CsSpecification spec)
Set CS specification.
uint16_t m_unsolicitedPollingInterval
unsolicited polling interval
Definition: service-flow.h:582
uint8_t m_qosParamSetType
QOS parameter type.
Definition: service-flow.h:557
section 11.13.11 Service flow scheduling type, page 701
Definition: service-flow.h:59
default constructor
Definition: service-flow.cc:43
uint16_t m_arqSyncLoss
ARQ sync loss.
Definition: service-flow.h:575
void SetArqWindowSize(uint16_t arqWindowSize)
Set ARQ retry timeout transmit.
void SetConvergenceSublayerParam(CsParameters csparam)
Set convergence sublayer parameters.
uint8_t GetQosParamSetType(void) const
Get QOS parameter set type.
uint16_t GetArqPurgeTimeout(void) const
Get ARQ purge timeout.
void SetSduSize(uint8_t sduSize)
Set SDU size.
void SetRecord(ServiceFlowRecord *record)
Set service flow record.
bool m_isMulticast
is multicast?
Definition: service-flow.h:587
void SetArqPurgeTimeout(uint16_t timeout)
Set ARQ purge timeout.
uint32_t GetMinTolerableTrafficRate(void) const
Get minimum tolerable traffic rate.
uint16_t GetArqBlockLifeTime(void) const
Get ARQ block lifetime.
uint16_t m_arqPurgeTimeout
ARQ purge timeout.
Definition: service-flow.h:577
char * GetSchedulingTypeStr(void) const
Get scheduling type string.
Type enumeration.
Definition: service-flow.h:51
uint8_t GetTrafficPriority(void) const
Get traffic priority.
void SetTrafficPriority(uint8_t priority)
Set traffic priority.
ServiceFlowRecord * m_record
service flow record
Definition: service-flow.h:590
ServiceFlowRecord * GetRecord(void) const
Get service flow record.
Ptr< WimaxConnection > GetConnection(void) const
Can return a null connection is this service flow has not been associated yet to a connection.
void SetArqBlockLifeTime(uint16_t lifeTime)
Set ARQ block lifetime.
uint16_t GetCid(void) const
Get CID.
void CopyParametersFrom(ServiceFlow sf)
Copy parameters from another service flow.
void SetMinTolerableTrafficRate(uint32_t minJitter)
Set minimum tolerable traffic rate.
void InitValues(void)
Initial values.
void CleanUpQueue(void)
shall be called only by BS
uint16_t m_arqWindowSize
ARQ window size.
Definition: service-flow.h:571
void SetIsMulticast(bool isMulticast)
Set is multicast.
bool GetIsEnabled(void) const
Get is enabled flag.
void SetArqRetryTimeoutTx(uint16_t timeout)
Set ARQ retry timeout transmit.
uint8_t m_arqEnable
ARQ enable.
Definition: service-flow.h:570
uint8_t m_fixedversusVariableSduIndicator
fixed versus variable SDI indicator
Definition: service-flow.h:567
CsParameters GetConvergenceSublayerParam(void) const
Get convergence sublayer.
uint32_t GetMaximumLatency(void) const
Get maximum latency.
void SetToleratedJitter(uint32_t jitter)
Set tolerated jitter.
void SetUnsolicitedGrantInterval(uint16_t unsolicitedGrantInterval)
Set unsolicied grant interval.
uint8_t m_sduSize
SDU size.
Definition: service-flow.h:568
uint16_t GetArqWindowSize(void) const
Get ARQ retry timeout transmit.
void SetArqDeliverInOrder(uint8_t inOrder)
Set ARQ deliver in order.
bool GetIsMulticast(void) const
Get is multicast.
uint16_t m_arqRetryTimeoutRx
ARQ retry timeout receive.
Definition: service-flow.h:573
void SetServiceSchedulingType(enum ServiceFlow::SchedulingType schedType)
Set service scheduling type.
void SetArqRetryTimeoutRx(uint16_t timeout)
Set ARQ retry timeout receive.
enum CsSpecification GetCsSpecification(void) const
Get CS specification.
void SetUnsolicitedPollingInterval(uint16_t unsolicitedPollingInterval)
Set unsolicited polling interval.
void SetMinReservedTrafficRate(uint32_t minResvRate)
Set minimum reserved traffic rate.
section CS parameter encoding rules, page 707
Definition: service-flow.h:70
bool CheckClassifierMatch(Ipv4Address srcAddress, Ipv4Address dstAddress, uint16_t srcPort, uint16_t dstPort, uint8_t proto) const
Tlv ToTlv(void) const
creates a TLV from this service flow
Direction enumeration.
Definition: service-flow.h:44
uint32_t GetToleratedJitter(void) const
Get tolerated jitter.
uint32_t m_sfid
Definition: service-flow.h:555
uint16_t GetArqSyncLoss(void) const
Get ARQ sync loss.
ServiceFlow & operator=(ServiceFlow const &o)
assignment operator
void SetFixedversusVariableSduIndicator(uint8_t sduIndicator)
Set fixed versus variable SDU indicator.
uint32_t GetRequestTransmissionPolicy(void) const
Get request transmission policy.
Direction m_direction
Definition: service-flow.h:583
void SetMaxSustainedTrafficRate(uint32_t maxSustainedRate)
Set max sustained traffic rate.
void PrintQoSParameters(void) const
Print QOS parameters.
uint32_t GetMaxSustainedTrafficRate(void) const
Get max sustained traffic rate.
uint32_t GetSfid(void) const
void SetConnection(Ptr< WimaxConnection > connection)
Set connection.
void SetIsEnabled(bool isEnabled)
Set is enabled flag.
void SetDirection(enum Direction direction)
Set direction.
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:84
ModulationType enumeration.
Definition: wimax-phy.h:52
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::Time timeout