RINASim  October 2016
Documentation of framework for OMNeT++
QoSCube.h
Go to the documentation of this file.
1 // The MIT License (MIT)
2 //
3 // Copyright (c) 2014-2016 Brno University of Technology, PRISTINE project
4 //
5 // Permission is hereby granted, free of charge, to any person obtaining a copy
6 // of this software and associated documentation files (the "Software"), to deal
7 // in the Software without restriction, including without limitation the rights
8 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 // copies of the Software, and to permit persons to whom the Software is
10 // furnished to do so, subject to the following conditions:
11 //
12 // The above copyright notice and this permission notice shall be included in
13 // all copies or substantial portions of the Software.
14 //
15 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 // THE SOFTWARE.
22 
23 /*
24  * @file QoSCube.h
25  * @author Marcel Marek
26  * @date Apr 28, 2014
27  * @brief
28  * @detail
29  */
30 
31 #ifndef QOSCUBE_H_
32 #define QOSCUBE_H_
33 
34 //Standard libraries
35 #include <vector>
36 //RINASim libraries
37 #include "Policy.h"
38 #include "ExternConsts.h"
39 #include "EFCPPolicySet.h"
40 
41 extern const char* STR_DONOTCARE;
42 extern const char* STR_YES;
43 extern const char* STR_NO;
44 extern const int VAL_DEFAULT_QOS;
45 extern const std::string VAL_UNDEF_QOSID;
46 extern const std::string VAL_MGMTQOSID;
47 
48 extern const char* ELEM_ATIME;
49 extern const char* ELEM_EFCPPOL;
50 
57 class QoSCube {
58 
59  protected:
63  std::string qoSId;
64 
68  int avgBand ; //Average bandwidth (measured at the application in bits/sec)
69 
73  int avgSDUBand; //Average SDU bandwidth (measured in SDUs/sec)
74 
78  int peakBandDuration; //Peak bandwidth-duration (measured in bits/sec);
79 
83  int peakSDUBandDuration; //Peak SDU bandwidth-duration (measured in SDUs/sec);
84 
88  int burstPeriod; //Burst period measured in useconds
89 
93  int burstDuration; //Burst duration, measured in useconds fraction of Burst Period
94 
98  double undetectedBitErr; //Undetected bit error rate measured as a probability
99 
103  double pduDropProbability; //Probability of dropping PDUs
104 
108  int maxSDUsize; //MaxSDUSize measured in bytes
109 
113  bool partDeliv; //Partial Delivery - Can SDUs be delivered in pieces rather than all at once? (SHOULD NOT be part of QoS cube see EFCPSpec)
114 
118  bool incompleteDeliv; //Incomplete Delivery - Can SDUs with missing pieces be delivered? (SHOULD NOT be part of QoS cube see EFCPSpec)
119 
123  bool forceOrder; //Must SDUs be delivered in-order bits
124 
128  int maxAllowGap; //Max allowable gap in SDUs, (a gap of N SDUs is considered the same as all SDUs delivered, i.e. a gap of N is a "don't care.")
129 
133  int delay; //Delay in usecs
134 
138  int jitter; //Jitter in usecs
139 
143  int costTime; //measured in $/ms
144 
148  int costBits; //measured in $/Mb
149 
153  double aTime; //A-Timer in ms
154 
158  bool rxOn; //Is retransmission active
159 
163  bool windowFCOn; //Is Window-based Flow Control active
164 
168  bool rateFCOn; //Is Rate-based Flow Control active
169 
174 
179 
180  public:
184  QoSCube();
185 
186  QoSCube(cXMLElementList& attrs);
187 
188  QoSCube(std::string tqosid,
189  int tavgBand, int tavgSDUBand, int tpeakBandDuration, int tpeakSDUBandDuration, int tburstPeriod, int tburstDuration,
190  double tundetectedBitErr, double tpduDropProbab,
191  int tmaxSDUsize, bool tpartDeliv, bool tincompleteDeliv, bool tforceOrder,
192  unsigned int tmaxAllowGap, int tdelay, int tjitter, int tcosttime, int tcostbits,
193  double tatime, bool trxon, bool twinfcon, bool tratefcon
194  );
195 
199  virtual ~QoSCube();
200 
201  static const QoSCube MANAGEMENT;
202 
203  bool isDefined();
204 
209  std::string getQosId() const;
210 
215  void setQosId(std::string qoSId);
216 
221  int getAvgBand() const;
222 
227  void setAvgBand(int avgBand);
228 
233  int getAvgSduBand() const;
234 
239  void setAvgSduBand(int avgSduBand);
240 
245  int getPeakBandDuration() const;
246 
251  void setPeakBandDuration(int peakBandDuration);
252 
257  int getPeakSduBandDuration() const;
258 
263  void setPeakSduBandDuration(int peakSduBandDuration);
264 
269  int getBurstDuration() const;
270 
275  void setBurstDuration(int burstDuration);
276 
281  int getBurstPeriod() const;
282 
287  void setBurstPeriod(int burstPeriod);
288 
293  int getMaxSduSize() const;
294 
299  void setMaxSduSize(int maxSdUsize);
300 
305  double getUndetectedBitErr() const;
306 
311  void setUndetectedBitErr(double undetectedBitErr);
312 
317  double getPduDropProbability() const;
318 
323  void setPduDropProbability(double pduDropProbability);
324 
329  bool isPartialDelivery() const;
330 
335  void setPartialDelivery(bool partDeliv);
336 
341  bool isIncompleteDelivery() const;
342 
347  void setIncompleteDelivery(bool incompleteDeliv);
348 
353  bool isForceOrder() const;
354 
359  void setForceOrder(bool forceOrder);
360 
365  int getMaxAllowGap() const;
366 
371  void setMaxAllowGap(int maxAllowGap);
372 
377  int getDelay() const;
378 
383  void setDelay(int delay);
384 
389  int getJitter() const;
390 
395  void setJitter(int jitter);
396 
401  double getCostTime() const;
402 
407  void setCostTime(double costTime);
408 
413  double getCostBits() const;
414 
419  void setCostBits(double costBits);
420 
425  double getATime() const;
426 
431  void setATime(double aTime);
432 
437  bool isDTCPNeeded() const;
438 
443  int getResiliencyFactor() const {
444  return resiliencyFactor;
445  }
446 
451  void setResiliencyFactor(int resiliencyFactor) {
452  this->resiliencyFactor = resiliencyFactor;
453  }
454 
459  std::string info() const;
460 
461  const EFCPPolicySet* getEfcpPolicies() const;
462  void setEfcpPolicies(EFCPPolicySet* efcpPolicies);
463  bool isRateFcOn() const;
464  bool isRxOn() const;
465  bool isWindowFcOn() const;
466  void setRateFcOn(bool rateFcOn);
467  void setRxOn(bool rxOn);
468  void setWindowFcOn(bool windowFcOn);
469 };
470 
471 //Free function
478 std::ostream& operator<< (std::ostream& os, const QoSCube& cube);
479 
480 #endif /* QOSCUBE_H_ */
static const QoSCube MANAGEMENT
Definition: QoSCube.h:201
void setMaxAllowGap(int maxAllowGap)
Sets Maximum Allowable Gap in SDUs parameter.
Definition: QoSCube.cc:320
bool isDTCPNeeded() const
Returns true if DTCP module is needed in order to support this QoScube.
Definition: QoSCube.cc:396
virtual ~QoSCube()
Destructor assigning default uninitialized values.
Definition: QoSCube.cc:212
int avgBand
Attribute holding average bandwidth.
Definition: QoSCube.h:68
std::ostream & operator<<(std::ostream &os, const QoSCube &cube)
Definition: QoSCube.cc:248
int getBurstPeriod() const
Gets Burst Period parameter.
Definition: QoSCube.cc:276
void setPartialDelivery(bool partDeliv)
Sets partial delivery flag.
Definition: QoSCube.cc:336
int getBurstDuration() const
Gets Burst Duration parameter.
Definition: QoSCube.cc:268
const char * ELEM_EFCPPOL
void setPeakBandDuration(int peakBandDuration)
Sets Peak Band Duration parameter.
Definition: QoSCube.cc:344
const EFCPPolicySet * getEfcpPolicies() const
Definition: QoSCube.cc:473
int getAvgBand() const
Gets Average Bandwidth parameter.
Definition: QoSCube.cc:252
void setAvgSduBand(int avgSduBand)
Sets Average SDU Bandwidth parameter.
Definition: QoSCube.cc:264
void setMaxSduSize(int maxSdUsize)
Sets Maximum SDU Size parameter.
Definition: QoSCube.cc:328
bool isRateFcOn() const
Definition: QoSCube.cc:478
EFCPPolicySet * efcpPolicies
Vector of bound default policies.
Definition: QoSCube.h:173
double getPduDropProbability() const
Gets PDU Dropping Probability parameter.
Definition: QoSCube.cc:400
QoSCube()
Constructor of QoSCube with undefined values.
Definition: QoSCube.cc:39
int burstDuration
Attribute holding burst durating as usec fraction of burst period.
Definition: QoSCube.h:93
bool windowFCOn
Attribute holding whether Window-based Flow Control is active.
Definition: QoSCube.h:163
int jitter
Attribute holding accepted jitter.
Definition: QoSCube.h:138
int getPeakBandDuration() const
Gets Peak Band Duration parameter.
Definition: QoSCube.cc:340
void setEfcpPolicies(EFCPPolicySet *efcpPolicies)
Definition: QoSCube.cc:506
int maxAllowGap
Attribute holding maximum allowd gap in SDUs.
Definition: QoSCube.h:128
const std::string VAL_UNDEF_QOSID
Definition: QoSCube.cc:36
int getJitter() const
Gets Jitter parameter.
Definition: QoSCube.cc:308
int maxSDUsize
Attribute holding maximum SDU size.
Definition: QoSCube.h:108
const char * STR_DONOTCARE
Definition: QoSCube.cc:32
double getCostBits() const
Gets Cost-bits parameter.
Definition: QoSCube.cc:368
int peakBandDuration
Attribute holding peak bandwidth duration.
Definition: QoSCube.h:78
bool isDefined()
Definition: QoSCube.cc:493
void setBurstDuration(int burstDuration)
Sets Burst Duration parameter.
Definition: QoSCube.cc:272
int getMaxSduSize() const
Gets Maximum SDU Size parameter.
Definition: QoSCube.cc:324
double getUndetectedBitErr() const
Gets Undetected Bit Error Rate parameter.
Definition: QoSCube.cc:356
double getATime() const
Gets A-Timer parameter.
Definition: QoSCube.cc:384
void setUndetectedBitErr(double undetectedBitErr)
Sets Undetected Bit Error Rate parameter.
Definition: QoSCube.cc:360
const char * STR_NO
Definition: QoSCube.cc:34
int peakSDUBandDuration
Attribute holding peak SDU bandwidth duration.
Definition: QoSCube.h:83
void setRxOn(bool rxOn)
Definition: QoSCube.cc:517
void setDelay(int delay)
Sets Delay parameter.
Definition: QoSCube.cc:288
int getResiliencyFactor() const
Gets Resiliency Factor parameter.
Definition: QoSCube.h:443
void setATime(double aTime)
Sets A-Timer parameter.
Definition: QoSCube.cc:388
void setJitter(int jitter)
Sets Jitter parameter.
Definition: QoSCube.cc:312
bool isIncompleteDelivery() const
Gets incomplete delivery flag.
Definition: QoSCube.cc:300
void setRateFcOn(bool rateFcOn)
Definition: QoSCube.cc:512
int resiliencyFactor
Attribute holding resiliency information, see PRISTINE D4.3 for more.
Definition: QoSCube.h:178
const std::string VAL_MGMTQOSID
Definition: QoSCube.cc:37
const char * ELEM_ATIME
int delay
Attribute holding accepted delay.
Definition: QoSCube.h:133
void setCostTime(double costTime)
Sets Cost-time parameter.
Definition: QoSCube.cc:380
void setResiliencyFactor(int resiliencyFactor)
Sets Resiliency Factor parameter.
Definition: QoSCube.h:451
void setPduDropProbability(double pduDropProbability)
Sets PDU Dropping Probability parameter.
Definition: QoSCube.cc:404
std::string info() const
Prints QoSCube information as string.
Definition: QoSCube.cc:408
int burstPeriod
Attribute holding burst period in usecs.
Definition: QoSCube.h:88
void setIncompleteDelivery(bool incompleteDeliv)
Sets incomplete delivery flag.
Definition: QoSCube.cc:304
int costTime
Attribute holding connection's time price.
Definition: QoSCube.h:143
const char * STR_YES
Definition: QoSCube.cc:33
int avgSDUBand
Attribute holding average SDU bandwidth.
Definition: QoSCube.h:73
Class representing QoSCube with all its properties that is primarily used by FA, RMT and RA Specifica...
Definition: QoSCube.h:57
bool isRxOn() const
Definition: QoSCube.cc:483
void setQosId(std::string qoSId)
Sets QoSCube identifier.
Definition: QoSCube.cc:392
double getCostTime() const
Gets Cost-time parameter.
Definition: QoSCube.cc:376
bool isPartialDelivery() const
Gets partial delivery flag.
Definition: QoSCube.cc:332
bool isForceOrder() const
Gets in-order delivery flag.
Definition: QoSCube.cc:292
void setForceOrder(bool forceOrder)
Sets in-order delivery flag.
Definition: QoSCube.cc:296
std::string qoSId
Attribute holding QoSCube identifier. Beaware, value 0 is reserved for Flow QoS demands! ...
Definition: QoSCube.h:63
std::string getQosId() const
Gets QoSCube identifier.
Definition: QoSCube.cc:364
double undetectedBitErr
Attribute holding probability of undetected bit error rate.
Definition: QoSCube.h:98
bool rxOn
Attribute holding whether Retransmission Control is active.
Definition: QoSCube.h:158
void setWindowFcOn(bool windowFcOn)
Definition: QoSCube.cc:522
void setPeakSduBandDuration(int peakSduBandDuration)
Sets Peak SDU Duration parameter.
Definition: QoSCube.cc:352
void setAvgBand(int avgBand)
Sets Average Bandwidth parameter.
Definition: QoSCube.cc:256
bool isWindowFcOn() const
Definition: QoSCube.cc:488
void setCostBits(double costBits)
Sets Cost-bits parameter.
Definition: QoSCube.cc:372
double pduDropProbability
Attribute holding probability of dropping PDUs.
Definition: QoSCube.h:103
void setBurstPeriod(int burstPeriod)
Sets Burst Period parameter.
Definition: QoSCube.cc:280
int getDelay() const
Gets Delay parameter.
Definition: QoSCube.cc:284
int costBits
Attribute holding connection's transmission size price.
Definition: QoSCube.h:148
bool partDeliv
Attribute holding partial delivery flag.
Definition: QoSCube.h:113
double aTime
Attribute holding A-Timer size in ms.
Definition: QoSCube.h:153
int getPeakSduBandDuration() const
Gets Peak SDU Duration parameter.
Definition: QoSCube.cc:348
bool forceOrder
Attribute holding in-order delivery flag.
Definition: QoSCube.h:123
int getAvgSduBand() const
Gets Average SDU Bandwidth parameter.
Definition: QoSCube.cc:260
bool rateFCOn
Attribute holding whether Rate-based Flow Control is active.
Definition: QoSCube.h:168
const int VAL_DEFAULT_QOS
Definition: QoSCube.cc:35
bool incompleteDeliv
Attribute holding incomplete delivery flag.
Definition: QoSCube.h:118
int getMaxAllowGap() const
Gets Maximum Allowable Gap in SDUs parameter.
Definition: QoSCube.cc:316