RINASim  October 2016
Documentation of framework for OMNeT++
QoSReq.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 #ifndef QOSREQ_H_
25 #define QOSREQ_H_
26 
27 //Standard libraries
28 #include <vector>
29 //RINASim libraries
30 #include "ExternConsts.h"
31 #include "QoSCube.h"
32 
33 extern const char* STR_DONOTCARE;
34 extern const char* STR_YES;
35 extern const char* STR_NO;
36 extern const int VAL_DEFAULT_QOS;
37 
44 class QoSReq {
45 
46  protected:
47 
51  int avgBand ; //Average bandwidth (measured at the application in bits/sec)
52 
56  int avgSDUBand; //Average SDU bandwidth (measured in SDUs/sec)
57 
61  int peakBandDuration; //Peak bandwidth-duration (measured in bits/sec);
62 
66  int peakSDUBandDuration; //Peak SDU bandwidth-duration (measured in SDUs/sec);
67 
71  int burstPeriod; //Burst period measured in useconds
72 
76  int burstDuration; //Burst duration, measured in useconds fraction of Burst Period
77 
81  double undetectedBitErr; //Undetected bit error rate measured as a probability
82 
86  double pduDropProbability; //Probability of dropping PDUs
87 
91  int maxSDUsize; //MaxSDUSize measured in bytes
92 
96  bool partDeliv; //Partial Delivery - Can SDUs be delivered in pieces rather than all at once? (SHOULD NOT be part of QoS cube see EFCPSpec)
97 
101  bool incompleteDeliv; //Incomplete Delivery - Can SDUs with missing pieces be delivered? (SHOULD NOT be part of QoS cube see EFCPSpec)
102 
106  bool forceOrder; //Must SDUs be delivered in-order bits
107 
111  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.")
112 
116  int delay; //Delay in usecs
117 
121  int jitter; //Jitter in usecs
122 
126  int costTime; //measured in $/ms
127 
131  int costBits; //measured in $/Mb
132 
137 
138 
139  public:
143  QoSReq();
144 
145  QoSReq(int tavgBand, int tavgSDUBand, int tpeakBandDuration, int tpeakSDUBandDuration, int tburstPeriod, int tburstDuration,
146  double tundetectedBitErr, double tpduDropProbab,
147  int tmaxSDUsize, bool tpartDeliv, bool tincompleteDeliv, bool tforceOrder,
148  unsigned int tmaxAllowGap, int tdelay, int tjitter, int tcosttime, int tcostbits);
149 
150  QoSReq(cXMLElementList& attrs);
151 
152  static const QoSReq MANAGEMENT;
153 
157  virtual ~QoSReq();
158 
164  bool compare(const QoSReq& other) const;
165 
170  int getAvgBand() const;
171 
176  void setAvgBand(int avgBand);
177 
182  int getAvgSduBand() const;
183 
188  void setAvgSduBand(int avgSduBand);
189 
194  int getPeakBandDuration() const;
195 
200  void setPeakBandDuration(int peakBandDuration);
201 
206  int getPeakSduBandDuration() const;
207 
212  void setPeakSduBandDuration(int peakSduBandDuration);
213 
218  int getBurstDuration() const;
219 
224  void setBurstDuration(int burstDuration);
225 
230  int getBurstPeriod() const;
231 
236  void setBurstPeriod(int burstPeriod);
237 
242  int getMaxSduSize() const;
243 
248  void setMaxSduSize(int maxSdUsize);
249 
254  double getUndetectedBitErr() const;
255 
260  void setUndetectedBitErr(double undetectedBitErr);
261 
266  double getPduDropProbability() const;
267 
272  void setPduDropProbability(double pduDropProbability);
273 
278  bool isPartialDelivery() const;
279 
284  void setPartialDelivery(bool partDeliv);
285 
290  bool isIncompleteDelivery() const;
291 
296  void setIncompleteDelivery(bool incompleteDeliv);
297 
302  bool isForceOrder() const;
303 
308  void setForceOrder(bool forceOrder);
309 
314  int getMaxAllowGap() const;
315 
320  void setMaxAllowGap(int maxAllowGap);
321 
326  int getDelay() const;
327 
332  void setDelay(int delay);
333 
338  int getJitter() const;
339 
344  void setJitter(int jitter);
345 
350  double getCostTime() const;
351 
356  void setCostTime(double costTime);
357 
362  double getCostBits() const;
363 
368  void setCostBits(double costBits);
369 
374  int getResiliencyFactor() const {
375  return resiliencyFactor;
376  }
377 
382  void setResiliencyFactor(int resiliencyFactor) {
383  this->resiliencyFactor = resiliencyFactor;
384  }
385 
386 
391  std::string info() const;
392 };
393 
394 //Free function
401 std::ostream& operator<< (std::ostream& os, const QoSReq& cube);
402 
403 #endif /* QOSREQ_H_ */
double getUndetectedBitErr() const
Gets Undetected Bit Error Rate parameter.
Definition: QoSReq.cc:325
int delay
Attribute holding accepted delay.
Definition: QoSReq.h:116
void setMaxAllowGap(int maxAllowGap)
Sets Maximum Allowable Gap in SDUs parameter.
Definition: QoSReq.cc:289
void setJitter(int jitter)
Sets Jitter parameter.
Definition: QoSReq.cc:281
int maxAllowGap
Attribute holding maximum allowd gap in SDUs.
Definition: QoSReq.h:111
void setUndetectedBitErr(double undetectedBitErr)
Sets Undetected Bit Error Rate parameter.
Definition: QoSReq.cc:329
void setMaxSduSize(int maxSdUsize)
Sets Maximum SDU Size parameter.
Definition: QoSReq.cc:297
int maxSDUsize
Attribute holding maximum SDU size.
Definition: QoSReq.h:91
int costBits
Attribute holding connection's transmission size price.
Definition: QoSReq.h:131
int jitter
Attribute holding accepted jitter.
Definition: QoSReq.h:121
void setDelay(int delay)
Sets Delay parameter.
Definition: QoSReq.cc:257
bool isForceOrder() const
Gets in-order delivery flag.
Definition: QoSReq.cc:261
void setIncompleteDelivery(bool incompleteDeliv)
Sets incomplete delivery flag.
Definition: QoSReq.cc:273
QoSReq()
Constructor of QoSReq with undefined values.
Definition: QoSReq.cc:37
void setPeakBandDuration(int peakBandDuration)
Sets Peak Band Duration parameter.
Definition: QoSReq.cc:313
double getPduDropProbability() const
Gets PDU Dropping Probability parameter.
Definition: QoSReq.cc:472
void setAvgBand(int avgBand)
Sets Average Bandwidth parameter.
Definition: QoSReq.cc:225
void setPartialDelivery(bool partDeliv)
Sets partial delivery flag.
Definition: QoSReq.cc:305
double undetectedBitErr
Attribute holding probability of undetected bit error rate.
Definition: QoSReq.h:81
int costTime
Attribute holding connection's time price.
Definition: QoSReq.h:126
int avgSDUBand
Attribute holding average SDU bandwidth.
Definition: QoSReq.h:56
void setBurstDuration(int burstDuration)
Sets Burst Duration parameter.
Definition: QoSReq.cc:241
void setBurstPeriod(int burstPeriod)
Sets Burst Period parameter.
Definition: QoSReq.cc:249
int getMaxSduSize() const
Gets Maximum SDU Size parameter.
Definition: QoSReq.cc:293
int resiliencyFactor
Attribute holding resiliency information, see PRISTINE D4.3 for more.
Definition: QoSReq.h:136
int burstDuration
Attribute holding burst durating as usec fraction of burst period.
Definition: QoSReq.h:76
virtual ~QoSReq()
Destructor assigning default uninitialized values.
Definition: QoSReq.cc:202
bool partDeliv
Attribute holding partial delivery flag.
Definition: QoSReq.h:96
int peakSDUBandDuration
Attribute holding peak SDU bandwidth duration.
Definition: QoSReq.h:66
double pduDropProbability
Attribute holding probability of dropping PDUs.
Definition: QoSReq.h:86
void setCostTime(double costTime)
Sets Cost-time parameter.
Definition: QoSReq.cc:345
void setAvgSduBand(int avgSduBand)
Sets Average SDU Bandwidth parameter.
Definition: QoSReq.cc:233
std::string info() const
Prints QoSReq information as string.
Definition: QoSReq.cc:368
const int VAL_DEFAULT_QOS
Definition: QoSCube.cc:35
int burstPeriod
Attribute holding burst period in usecs.
Definition: QoSReq.h:71
int getPeakSduBandDuration() const
Gets Peak SDU Duration parameter.
Definition: QoSReq.cc:317
const char * STR_NO
Definition: QoSCube.cc:34
void setPduDropProbability(double pduDropProbability)
Sets PDU Dropping Probability parameter.
Definition: QoSReq.cc:476
std::ostream & operator<<(std::ostream &os, const QoSReq &cube)
Definition: QoSReq.cc:349
int getMaxAllowGap() const
Gets Maximum Allowable Gap in SDUs parameter.
Definition: QoSReq.cc:285
int getDelay() const
Gets Delay parameter.
Definition: QoSReq.cc:253
bool isPartialDelivery() const
Gets partial delivery flag.
Definition: QoSReq.cc:301
int getJitter() const
Gets Jitter parameter.
Definition: QoSReq.cc:277
bool forceOrder
Attribute holding in-order delivery flag.
Definition: QoSReq.h:106
double getCostTime() const
Gets Cost-time parameter.
Definition: QoSReq.cc:341
Class representing QoSReq with all its properties that is primarily used by FA, RMT and RA Specificat...
Definition: QoSReq.h:44
bool compare(const QoSReq &other) const
Definition: QoSReq.cc:355
int getPeakBandDuration() const
Gets Peak Band Duration parameter.
Definition: QoSReq.cc:309
double getCostBits() const
Gets Cost-bits parameter.
Definition: QoSReq.cc:333
bool incompleteDeliv
Attribute holding incomplete delivery flag.
Definition: QoSReq.h:101
void setForceOrder(bool forceOrder)
Sets in-order delivery flag.
Definition: QoSReq.cc:265
int getAvgBand() const
Gets Average Bandwidth parameter.
Definition: QoSReq.cc:221
const char * STR_YES
Definition: QoSCube.cc:33
const char * STR_DONOTCARE
Definition: QoSCube.cc:32
int avgBand
Attribute holding average bandwidth.
Definition: QoSReq.h:51
void setPeakSduBandDuration(int peakSduBandDuration)
Sets Peak SDU Duration parameter.
Definition: QoSReq.cc:321
int getBurstDuration() const
Gets Burst Duration parameter.
Definition: QoSReq.cc:237
void setResiliencyFactor(int resiliencyFactor)
Sets Resiliency Factor parameter.
Definition: QoSReq.h:382
int getAvgSduBand() const
Gets Average SDU Bandwidth parameter.
Definition: QoSReq.cc:229
int getResiliencyFactor() const
Gets Resiliency Factor parameter.
Definition: QoSReq.h:374
int peakBandDuration
Attribute holding peak bandwidth duration.
Definition: QoSReq.h:61
int getBurstPeriod() const
Gets Burst Period parameter.
Definition: QoSReq.cc:245
bool isIncompleteDelivery() const
Gets incomplete delivery flag.
Definition: QoSReq.cc:269
static const QoSReq MANAGEMENT
Definition: QoSReq.h:152
void setCostBits(double costBits)
Sets Cost-bits parameter.
Definition: QoSReq.cc:337