/usr/include/ns3.27/ns3/service-flow.h is in libns3-dev 3.27+dfsg-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 | /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2007,2008, 2009 INRIA, UDcast
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation;
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* Author: Jahanzeb Farooq <jahanzeb.farooq@sophia.inria.fr>
* Mohamed Amine Ismail <amine.ismail@sophia.inria.fr>
*/
#ifndef SERVICE_FLOW_H
#define SERVICE_FLOW_H
#include <stdint.h>
#include "wimax-phy.h"
#include "wimax-connection.h"
#include "cs-parameters.h"
namespace ns3 {
class ServiceFlowRecord;
class WimaxConnection;
/**
* \ingroup wimax
* This class implements service flows as described by the IEEE-802.16 standard
*/
class ServiceFlow
{
public:
/// Direction enumeration
enum Direction
{
SF_DIRECTION_DOWN,
SF_DIRECTION_UP
};
/// Type enumeration
enum Type
{
SF_TYPE_PROVISIONED,
SF_TYPE_ADMITTED,
SF_TYPE_ACTIVE
};
/// section 11.13.11 Service flow scheduling type, page 701
enum SchedulingType
{
SF_TYPE_NONE = 0,
SF_TYPE_UNDEF = 1,
SF_TYPE_BE = 2,
SF_TYPE_NRTPS = 3,
SF_TYPE_RTPS = 4,
SF_TYPE_UGS = 6,
SF_TYPE_ALL = 255
};
/// section 11.13.19.2 CS parameter encoding rules, page 707
enum CsSpecification
{
ATM = 99,
IPV4 = 100,
IPV6 = 101,
ETHERNET = 102,
VLAN = 103,
IPV4_OVER_ETHERNET = 104,
IPV6_OVER_ETHERNET = 105,
IPV4_OVER_VLAN = 106,
IPV6_OVER_VLAN = 107
};
/// Modulation type enumeration, Table 356 and 362
enum ModulationType
{
MODULATION_TYPE_BPSK_12,
MODULATION_TYPE_QPSK_12,
MODULATION_TYPE_QPSK_34,
MODULATION_TYPE_QAM16_12,
MODULATION_TYPE_QAM16_34,
MODULATION_TYPE_QAM64_23,
MODULATION_TYPE_QAM64_34
};
/**
* \brief creates a TLV from this service flow
* \return the created tlv
*/
Tlv ToTlv (void) const;
/**
* \brief creates a service flow from a TLV
* \param tlv the tlv from which the service flow will be created
*/
ServiceFlow (Tlv tlv);
/**
* \return true if the passed parameters match the classifier of the service flow, false otherwise
* \param srcAddress the source ip address
* \param dstAddress the destination ip address
* \param srcPort the source port
* \param dstPort the destination port
* \param proto the layer 4 protocol
*/
bool CheckClassifierMatch (Ipv4Address srcAddress,
Ipv4Address dstAddress,
uint16_t srcPort,
uint16_t dstPort,
uint8_t proto) const;
/// default constructor
ServiceFlow ();
/**
* Constructor
*
* \param direction the direction
*/
ServiceFlow (enum Direction direction);
/**
* Constructor
*
* \param sf service flow
*/
ServiceFlow (const ServiceFlow & sf);
/**
* Constructor
*
* \param sfid the SFID
* \param direction the direction
* \param connection the connection object
*/
ServiceFlow (uint32_t sfid,
enum Direction direction,
Ptr<WimaxConnection> connection);
~ServiceFlow (void);
/**
* assignment operator
* \param o the service flow to assign
* \returns the service flow
*/
ServiceFlow & operator = (ServiceFlow const& o);
/// Initial values
void InitValues (void);
/**
* Set direction
* \param direction the direction value
*/
void SetDirection (enum Direction direction);
/**
* Get direction
* \returns the direction
*/
enum Direction GetDirection (void) const;
/**
* Copy parameters from another service flow
* \param sf the service flow
*/
void CopyParametersFrom (ServiceFlow sf);
/**
* Set type of service flow
* \param type the type value
*/
void SetType (enum Type type);
/**
* Get type of service flow
* \returns the type
*/
enum Type GetType (void) const;
/**
* Set connection
* \param connection the connection
*/
void SetConnection (Ptr<WimaxConnection> connection);
/**
* Can return a null connection is this service flow has not
* been associated yet to a connection.
* \returns pointer to the WimaxConnection
*/
Ptr<WimaxConnection> GetConnection (void) const;
/**
* Set is enabled flag
* \param isEnabled is enabled flag
*/
void SetIsEnabled (bool isEnabled);
/**
* Get is enabled flag
* \returns is enabled
*/
bool GetIsEnabled (void) const;
/**
* Set service flow record
* \param record pointer to the service flow record
*/
void SetRecord (ServiceFlowRecord *record);
/**
* Get service flow record
* \returns pointer to the service flow record
*/
ServiceFlowRecord* GetRecord (void) const;
// wrapper functions
/**
* Get pointer to queue
* \returns pointer to the wimax mac queue
*/
Ptr<WimaxMacQueue> GetQueue (void) const;
/**
* Get scheduling type
* \returns the scheduling type
*/
enum ServiceFlow::SchedulingType GetSchedulingType (void) const;
/**
* Check if packets are present
* \returns true if there are packets
*/
bool HasPackets (void) const;
/**
* Check if packets of particular type are present
* \param packetType the packet type to select
* \returns true if there are packets of the packet type
*/
bool HasPackets (MacHeaderType::HeaderType packetType) const;
/// shall be called only by BS
void CleanUpQueue (void);
/// Print QOS parameters
void PrintQoSParameters (void) const;
/**
* Get scheduling type string
* \returns the name of the scheduling type
*/
char* GetSchedulingTypeStr (void) const;
/**
* Get SFID
* \returns the SFID
*/
uint32_t GetSfid (void) const;
/**
* Get CID
* \returns the CID
*/
uint16_t GetCid (void) const;
/**
* Get service class name
* \returns the service class name
*/
std::string GetServiceClassName () const;
/**
* Get QOS parameter set type
* \returns the QOS parameter set type
*/
uint8_t GetQosParamSetType (void) const;
/**
* Get traffic priority
* \returns the traffic priority
*/
uint8_t GetTrafficPriority (void) const;
/**
* Get max sustained traffic rate
* \returns the maximum sustained traffic rate
*/
uint32_t GetMaxSustainedTrafficRate (void) const;
/**
* Get max traffic burst
* \returns the maximum traffic burst
*/
uint32_t GetMaxTrafficBurst (void) const;
/**
* Get minimum reserved traffic rate
* \returns the minimum reserved traffic rate
*/
uint32_t GetMinReservedTrafficRate (void) const;
/**
* Get minimum tolerable traffic rate
* \returns the minimum tolerable traffic rate
*/
uint32_t GetMinTolerableTrafficRate (void) const;
/**
* Get service scheduling type
* \returns the scheduling type
*/
enum ServiceFlow::SchedulingType GetServiceSchedulingType (void) const;
/**
* Get request transmission policy
* \returns the request transmission policy
*/
uint32_t GetRequestTransmissionPolicy (void) const;
/**
* Get tolerated jitter
* \returns the tolerated jitter
*/
uint32_t GetToleratedJitter (void) const;
/**
* Get maximum latency
* \returns the maximum latency
*/
uint32_t GetMaximumLatency (void) const;
/**
* Get fixed versus varaiable SDU indicator
* \returns the fixed vs variable SDU indicator
*/
uint8_t GetFixedversusVariableSduIndicator (void) const;
/**
* Get SDU size
* \returns the SDU size
*/
uint8_t GetSduSize (void) const;
/**
* Get target SAID
* \returns the target SAID
*/
uint16_t GetTargetSAID (void) const;
/**
* Get ARQ enable
* \returns the ARQ enable
*/
uint8_t GetArqEnable (void) const;
/**
* Get ARQ retry timeout transmit
* \returns the ARQ retry timeout
*/
uint16_t GetArqWindowSize (void) const;
/**
* Get ARQ retry timeout transmit
* \returns the ARQ retry timeout transmit
*/
uint16_t GetArqRetryTimeoutTx (void) const;
/**
* Get ARQ retry timeout receive
* \returns the ARQ retry timeout receive
*/
uint16_t GetArqRetryTimeoutRx (void) const;
/**
* Get ARQ block lifetime
* \returns the ARQ block lifetime
*/
uint16_t GetArqBlockLifeTime (void) const;
/**
* Get ARQ sync loss
* \returns the ARQ snyc loss value
*/
uint16_t GetArqSyncLoss (void) const;
/**
* Get ARQ deliver in order
* \returns the ARQ deliver in order
*/
uint8_t GetArqDeliverInOrder (void) const;
/**
* Get ARQ purge timeout
* \returns the ARQ purge timeout value
*/
uint16_t GetArqPurgeTimeout (void) const;
/**
* Get ARQ block size
* \returns the ARQ block size
*/
uint16_t GetArqBlockSize (void) const;
/**
* Get CS specification
* \returns the CS specification
*/
enum CsSpecification GetCsSpecification (void) const;
/**
* Get convergence sublayer
* \returns the convergence sublayer
*/
CsParameters GetConvergenceSublayerParam (void) const;
/**
* Get unsolicited grant interval
* \returns the unsolicited grant interval
*/
uint16_t GetUnsolicitedGrantInterval (void) const;
/**
* Get unsolicited polling interval
* \returns the unsolicited polling interval
*/
uint16_t GetUnsolicitedPollingInterval (void) const;
/**
* Get is multicast
* \returns the is multicast flag
*/
bool GetIsMulticast (void) const;
/**
* Get modulation
* \returns the modulation
*/
enum WimaxPhy::ModulationType GetModulation (void) const;
/**
* Set SFID
* \param sfid the SFID
*/
void SetSfid (uint32_t sfid);
/** Set service class name
* \param name the service class name
*/
void SetServiceClassName (std::string name);
/**
* Set QOS parameter set type
* \param type the QOS paraneter set type
*/
void SetQosParamSetType (uint8_t type);
/**
* Set traffic priority
* \param priority the traffic priority
*/
void SetTrafficPriority (uint8_t priority);
/**
* Set max sustained traffic rate
* \param maxSustainedRate the maximum sustained traffic rate
*/
void SetMaxSustainedTrafficRate (uint32_t maxSustainedRate);
/**
* Set maximum traffic burst
* \param maxTrafficBurst the maximum traffic burst
*/
void SetMaxTrafficBurst (uint32_t maxTrafficBurst);
/**
* Set minimum reserved traffic rate
* \param minResvRate the minimum reserved traffic rate
*/
void SetMinReservedTrafficRate (uint32_t minResvRate);
/**
* Set minimum tolerable traffic rate
* \param minJitter the minimum tolerable traffic rate
*/
void SetMinTolerableTrafficRate (uint32_t minJitter);
/**
* Set service scheduling type
* \param schedType the service scheduling type
*/
void SetServiceSchedulingType (enum ServiceFlow::SchedulingType schedType);
/**
* Set request transmission policy
* \param policy the request transmission policy
*/
void SetRequestTransmissionPolicy (uint32_t policy);
/**
* Set tolerated jitter
* \param jitter the tolerated jitter
*/
void SetToleratedJitter (uint32_t jitter);
/**
* Set maximum latency
* \param MaximumLatency the maximjum latency
*/
void SetMaximumLatency (uint32_t MaximumLatency);
/**
* Set fixed versus variable SDU indicator
* \param sduIndicator fixed vs variable SDU indicator
*/
void SetFixedversusVariableSduIndicator (uint8_t sduIndicator);
/**
* Set SDU size
* \param sduSize the SDU size
*/
void SetSduSize (uint8_t sduSize);
/**
* Set target SAID
* \param targetSaid the target SAID value
*/
void SetTargetSAID (uint16_t targetSaid);
/**
* Set ARQ enable
* \param arqEnable the ARQ enable setting
*/
void SetArqEnable (uint8_t arqEnable);
/**
* Set ARQ retry timeout transmit
* \param arqWindowSize the ARQ retry timeout transmit
*/
void SetArqWindowSize (uint16_t arqWindowSize);
/**
* Set ARQ retry timeout transmit
* \param timeout the ARQ retry timeout transmit
*/
void SetArqRetryTimeoutTx (uint16_t timeout);
/**
* Set ARQ retry timeout receive
* \param timeout the timeout
*/
void SetArqRetryTimeoutRx (uint16_t timeout);
/**
* Set ARQ block lifetime
* \param lifeTime the ARQ block life time
*/
void SetArqBlockLifeTime (uint16_t lifeTime);
/**
* Set ARQ sync loss
* \param syncLoss the ARQ sync loss
*/
void SetArqSyncLoss (uint16_t syncLoss);
/**
* Set ARQ deliver in order
* \param inOrder the deliver in order setting
*/
void SetArqDeliverInOrder (uint8_t inOrder);
/**
* Set ARQ purge timeout
* \param timeout the timeout value
*/
void SetArqPurgeTimeout (uint16_t timeout);
/**
* Set ARQ block size
* \param size the size
*/
void SetArqBlockSize (uint16_t size);
/**
* Set CS specification
* \param spec the CS specification
*/
void SetCsSpecification (enum CsSpecification spec);
/**
* Set convergence sublayer parameters
* \param csparam the convergence sublayer parameters
*/
void SetConvergenceSublayerParam (CsParameters csparam);
/**
* Set unsolicied grant interval
* \param unsolicitedGrantInterval the unsolicited grant interval
*/
void SetUnsolicitedGrantInterval (uint16_t unsolicitedGrantInterval);
/**
* Set unsolicited polling interval
* \param unsolicitedPollingInterval the unsolicited polling interval
*/
void SetUnsolicitedPollingInterval (uint16_t unsolicitedPollingInterval);
/**
* Set is multicast
* \param isMulticast the is multicast flag
*/
void SetIsMulticast (bool isMulticast);
/**
* Set modulation
* \param modulationType the modulation type
*/
void SetModulation (enum WimaxPhy::ModulationType modulationType);
private:
uint32_t m_sfid; ///< SFID
std::string m_serviceClassName; ///< service class name
uint8_t m_qosParamSetType; ///< QOS parameter type
uint8_t m_trafficPriority; ///< traffic priority
uint32_t m_maxSustainedTrafficRate; ///< maximum sustained traffic rate
uint32_t m_maxTrafficBurst; ///< maximum traffic burst
uint32_t m_minReservedTrafficRate; ///< minimum reserved traffic rate
uint32_t m_minTolerableTrafficRate; ///< minimum tolerable traffic rate
enum ServiceFlow::SchedulingType m_schedulingType; ///< scheduling type
uint32_t m_requestTransmissionPolicy; ///< request transmission policy
uint32_t m_toleratedJitter; ///< tolerated jitter
uint32_t m_maximumLatency; ///< maximum latency
uint8_t m_fixedversusVariableSduIndicator; ///< fixed versus varaible SDI indicator
uint8_t m_sduSize; ///< SDU size
uint16_t m_targetSAID; ///< traget SAID
uint8_t m_arqEnable; ///< ARQ enable
uint16_t m_arqWindowSize; ///< ARQ window size
uint16_t m_arqRetryTimeoutTx; ///< ARQ retry timeout transmit
uint16_t m_arqRetryTimeoutRx; ///< ARQ retry timeout receive
uint16_t m_arqBlockLifeTime; ///< ARQ block life time
uint16_t m_arqSyncLoss; ///< ARQ sync loss
uint8_t m_arqDeliverInOrder; ///< ARQ deliver in order
uint16_t m_arqPurgeTimeout; ///< ARQ purge timeout
uint16_t m_arqBlockSize; ///< ARQ block size
enum CsSpecification m_csSpecification; ///< CS specification
CsParameters m_convergenceSublayerParam; ///< convergence sublayer parameters
uint16_t m_unsolicitedGrantInterval; ///< unsolicited grant interval
uint16_t m_unsolicitedPollingInterval; ///< unsolicited polling interval
Direction m_direction; ///< direction
Type m_type; ///< type
Ptr<WimaxConnection> m_connection; ///< connection
bool m_isEnabled; ///< is enabled?
bool m_isMulticast; ///< is multicast?
enum WimaxPhy::ModulationType m_modulationType; ///< modulation type
// will be used by the BS
ServiceFlowRecord *m_record; ///< service flow record
};
} // namespace ns3
#endif /* SERVICE_FLOW_H */
|