Skip to content

Commit

Permalink
Added DTCP parameters initialization to QoSCube
Browse files Browse the repository at this point in the history
  • Loading branch information
screw committed Jun 8, 2015
1 parent d191b85 commit d793524
Show file tree
Hide file tree
Showing 7 changed files with 227 additions and 185 deletions.
146 changes: 55 additions & 91 deletions Makefile

Large diffs are not rendered by default.

32 changes: 30 additions & 2 deletions examples/SimpleRelayCongestion/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,28 @@
</DA>
</Router>

<QoSReqSet>
<QosReq id="1">
<AverageBandwidth>12000000</AverageBandwidth>
<AverageSDUBandwidth>1000</AverageSDUBandwidth>
<PeakBandwidthDuration>24000000</PeakBandwidthDuration>
<PeakSDUBandwidthDuration>2000</PeakSDUBandwidthDuration>
<BurstPeriod>10000000</BurstPeriod>
<BurstDuration>1000000</BurstDuration>
<UndetectedBitError>0.01</UndetectedBitError>
<PDUDroppingProbability>0</PDUDroppingProbability>
<MaxSDUSize>1500</MaxSDUSize>
<PartialDelivery>0</PartialDelivery>
<IncompleteDelivery>0</IncompleteDelivery>
<ForceOrder>0</ForceOrder>
<MaxAllowableGap>0</MaxAllowableGap>
<Delay>1000000</Delay>
<Jitter>500000</Jitter>
<CostTime>0</CostTime>
<CostBits>0</CostBits>
</QosReq>
</QoSReqSet>

<QoSCubesSet>
<QoSCube id="1">
<AverageBandwidth>12000000</AverageBandwidth>
Expand All @@ -115,7 +137,10 @@
<Jitter>500000</Jitter>
<CostTime>0</CostTime>
<CostBits>0</CostBits>
<ATime>0</ATime>
<ATime>0</ATime>
<RxOn>1</RxOn>
<WinOn>1</WinOn>
<RateOn>0</RateOn>
</QoSCube>
<QoSCube id="2">
<AverageBandwidth>12000000</AverageBandwidth>
Expand All @@ -135,7 +160,10 @@
<Jitter>500000</Jitter>
<CostTime>0</CostTime>
<CostBits>0</CostBits>
<ATime>0</ATime>
<ATime>0</ATime>
<RxOn>1</RxOn>
<WinOn>1</WinOn>
<RateOn>0</RateOn>
</QoSCube>
</QoSCubesSet>
</Configuration>
2 changes: 1 addition & 1 deletion examples/SimpleRelayCongestion/omnetpp.ini
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ seed-set = ${runnumber}


#Specify timeout of CreateRequest message
**.fa.createRequestTimeout = 15s
#**.fa.createRequestTimeout = 15s
**.host1.applicationProcess1.applicationEntity.iae.forceOrder = true
[Config CongestionPing]
fingerprint = "eb02-6de8"
Expand Down
5 changes: 5 additions & 0 deletions src/Common/ExternConsts.cc
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,11 @@ const char* ELEM_DELAY = "Delay";
const char* ELEM_JITTER = "Jitter";
const char* ELEM_COSTTIME = "CostTime";
const char* ELEM_COSTBITS = "CostBits";
const char* ELEM_ATIME = "ATime";
const char* ELEM_RXON = "RxOn";
const char* ELEM_WINON = "WinOn";
const char* ELEM_RATEON = "RateOn";
const char* ELEM_EFCPPOL = "EFCPPolicySet";


//Values
Expand Down
6 changes: 6 additions & 0 deletions src/Common/ExternConsts.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,12 @@ extern const char* ELEM_JITTER;
extern const char* ELEM_COSTTIME;
extern const char* ELEM_COSTBITS;

extern const char* ELEM_ATIME;
extern const char* ELEM_RXON;
extern const char* ELEM_WINON;
extern const char* ELEM_RATEON;
extern const char* ELEM_EFCPPOL;

//Values
extern const int VAL_QOSPARDONOTCARE;
extern const bool VAL_QOSPARDEFBOOL;
Expand Down
219 changes: 129 additions & 90 deletions src/Common/QoSCube.cc
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ const int VAL_DEFAULT_QOS = 0;
const std::string VAL_UNDEF_QOSID = "UNDEF-QoSCube";
const std::string VAL_MGMTQOSID = "MGMT-QoSCube";

const char* ELEM_ATIME = "ATime";
const char* ELEM_EFCPPOL = "EFCPPolicySet";


QoSCube::QoSCube() : qoSId(VAL_UNDEF_QOSID),
avgBand(VAL_DEFAULT_QOS), avgSDUBand(VAL_DEFAULT_QOS), peakBandDuration(VAL_DEFAULT_QOS), peakSDUBandDuration(VAL_DEFAULT_QOS),
Expand All @@ -52,95 +51,135 @@ QoSCube::QoSCube(cXMLElementList& attrs) : qoSId(VAL_UNDEF_QOSID),
costTime(VAL_QOSPARDONOTCARE), costBits(VAL_QOSPARDONOTCARE), aTime(VAL_DEFAULT_QOS),
rxOn(false), windowFCOn(false), rateFCOn(false), efcpPolicies(new EFCPPolicySet())
{
for (cXMLElementList::iterator jt = attrs.begin(); jt != attrs.end(); ++jt) {
cXMLElement* n = *jt;

if ( !strcmp(n->getTagName(), ELEM_AVGBW) ) {
avgBand = n->getNodeValue() ? atoi(n->getNodeValue()) : VAL_QOSPARDONOTCARE;
if (avgBand < 0)
avgBand = VAL_QOSPARDONOTCARE;
}
else if (!strcmp(n->getTagName(), ELEM_AVGSDUBW)) {
avgSDUBand = n->getNodeValue() ? atoi(n->getNodeValue()) : VAL_QOSPARDONOTCARE;
if (avgSDUBand < 0)
avgSDUBand = VAL_QOSPARDONOTCARE;
}
else if (!strcmp(n->getTagName(), ELEM_PEAKBWDUR)) {
peakBandDuration = n->getNodeValue() ? atoi(n->getNodeValue()) : VAL_QOSPARDONOTCARE;
if (peakBandDuration < 0)
peakBandDuration = VAL_QOSPARDONOTCARE;
}
else if (!strcmp(n->getTagName(), ELEM_PEAKSDUBWDUR)) {
peakSDUBandDuration = n->getNodeValue() ? atoi(n->getNodeValue()) : VAL_QOSPARDONOTCARE;
if (peakSDUBandDuration < 0)
peakSDUBandDuration = VAL_QOSPARDONOTCARE;
}
else if (!strcmp(n->getTagName(), ELEM_BURSTPERIOD)) {
burstPeriod = n->getNodeValue() ? atoi(n->getNodeValue()) : VAL_QOSPARDONOTCARE;
if (burstPeriod < 0)
burstPeriod = VAL_QOSPARDONOTCARE;
}
else if (!strcmp(n->getTagName(), ELEM_BURSTDURATION)) {
burstDuration = n->getNodeValue() ? atoi(n->getNodeValue()) : VAL_QOSPARDONOTCARE;
if (burstDuration < 0)
burstDuration = VAL_QOSPARDONOTCARE;
}
else if (!strcmp(n->getTagName(), ELEM_UNDETECTBITERR)) {
undetectedBitErr = n->getNodeValue() ? atof(n->getNodeValue()) : VAL_QOSPARDONOTCARE;
if (undetectedBitErr < 0 || undetectedBitErr > 1 )
undetectedBitErr = VAL_QOSPARDONOTCARE;
}
else if (!strcmp(n->getTagName(), ELEM_PDUDROPPROBAB)) {
pduDropProbability = n->getNodeValue() ? atof(n->getNodeValue()) : VAL_QOSPARDONOTCARE;
if (pduDropProbability < 0 || pduDropProbability > 1 )
pduDropProbability = VAL_QOSPARDONOTCARE;
}
else if (!strcmp(n->getTagName(), ELEM_MAXSDUSIZE)) {
maxSDUsize = n->getNodeValue() ? atoi(n->getNodeValue()) : VAL_QOSPARDONOTCARE;
if (maxSDUsize < 0)
maxSDUsize = VAL_QOSPARDONOTCARE;
}
else if (!strcmp(n->getTagName(), ELEM_PARTIALDELIVER)) {
partDeliv = n->getNodeValue() ? atoi(n->getNodeValue()) : VAL_QOSPARDEFBOOL;
}
else if (!strcmp(n->getTagName(), ELEM_INCOMPLETEDELIVER)) {
incompleteDeliv = n->getNodeValue() ? atoi(n->getNodeValue()) : VAL_QOSPARDEFBOOL;
}
else if (!strcmp(n->getTagName(), ELEM_FORCEORDER)) {
forceOrder = n->getNodeValue() ? atoi(n->getNodeValue()) : VAL_QOSPARDEFBOOL;
}
else if (!strcmp(n->getTagName(), ELEM_MAXALLOWGAP)) {
maxAllowGap = n->getNodeValue() ? atoi(n->getNodeValue()) : VAL_QOSPARDONOTCARE;
if (maxAllowGap < 0)
maxAllowGap = VAL_QOSPARDONOTCARE;
}
else if (!strcmp(n->getTagName(), ELEM_DELAY)) {
delay = n->getNodeValue() ? atoi(n->getNodeValue()) : VAL_QOSPARDONOTCARE;
if (delay < 0)
delay = VAL_QOSPARDONOTCARE;
}
else if (!strcmp(n->getTagName(), ELEM_JITTER)) {
jitter = n->getNodeValue() ? atoi(n->getNodeValue()) : VAL_QOSPARDONOTCARE;
if (jitter < 0)
jitter = VAL_QOSPARDONOTCARE;
}
else if (!strcmp(n->getTagName(), ELEM_COSTTIME)) {
costTime = n->getNodeValue() ? atoi(n->getNodeValue()) : VAL_QOSPARDEFBOOL;
if (costTime < 0)
costTime = VAL_QOSPARDONOTCARE;
}
else if (!strcmp(n->getTagName(), ELEM_COSTBITS)) {
costBits = n->getNodeValue() ? atoi(n->getNodeValue()) : VAL_QOSPARDEFBOOL;
if (costBits < 0)
costBits = VAL_QOSPARDONOTCARE;
}else if (!strcmp(n->getTagName(), ELEM_ATIME)) {
aTime = n->getNodeValue() ? atof(n->getNodeValue()) : VAL_QOSPARDEFBOOL;
if (aTime < 0)
aTime = VAL_QOSPARDONOTCARE;
}else if(!strcmp(n->getTagName(), ELEM_EFCPPOL)) {
efcpPolicies->init(n);
}
for (cXMLElementList::iterator jt = attrs.begin(); jt != attrs.end(); ++jt)
{
cXMLElement* n = *jt;

if (!strcmp(n->getTagName(), ELEM_AVGBW))
{
avgBand = n->getNodeValue() ? atoi(n->getNodeValue()) : VAL_QOSPARDONOTCARE;
if (avgBand < 0)
avgBand = VAL_QOSPARDONOTCARE;
}
else if (!strcmp(n->getTagName(), ELEM_AVGSDUBW))
{
avgSDUBand = n->getNodeValue() ? atoi(n->getNodeValue()) : VAL_QOSPARDONOTCARE;
if (avgSDUBand < 0)
avgSDUBand = VAL_QOSPARDONOTCARE;
}
else if (!strcmp(n->getTagName(), ELEM_PEAKBWDUR))
{
peakBandDuration = n->getNodeValue() ? atoi(n->getNodeValue()) : VAL_QOSPARDONOTCARE;
if (peakBandDuration < 0)
peakBandDuration = VAL_QOSPARDONOTCARE;
}
else if (!strcmp(n->getTagName(), ELEM_PEAKSDUBWDUR))
{
peakSDUBandDuration = n->getNodeValue() ? atoi(n->getNodeValue()) : VAL_QOSPARDONOTCARE;
if (peakSDUBandDuration < 0)
peakSDUBandDuration = VAL_QOSPARDONOTCARE;
}
else if (!strcmp(n->getTagName(), ELEM_BURSTPERIOD))
{
burstPeriod = n->getNodeValue() ? atoi(n->getNodeValue()) : VAL_QOSPARDONOTCARE;
if (burstPeriod < 0)
burstPeriod = VAL_QOSPARDONOTCARE;
}
else if (!strcmp(n->getTagName(), ELEM_BURSTDURATION))
{
burstDuration = n->getNodeValue() ? atoi(n->getNodeValue()) : VAL_QOSPARDONOTCARE;
if (burstDuration < 0)
burstDuration = VAL_QOSPARDONOTCARE;
}
else if (!strcmp(n->getTagName(), ELEM_UNDETECTBITERR))
{
undetectedBitErr = n->getNodeValue() ? atof(n->getNodeValue()) : VAL_QOSPARDONOTCARE;
if (undetectedBitErr < 0 || undetectedBitErr > 1)
undetectedBitErr = VAL_QOSPARDONOTCARE;
}
else if (!strcmp(n->getTagName(), ELEM_PDUDROPPROBAB))
{
pduDropProbability = n->getNodeValue() ? atof(n->getNodeValue()) : VAL_QOSPARDONOTCARE;
if (pduDropProbability < 0 || pduDropProbability > 1)
pduDropProbability = VAL_QOSPARDONOTCARE;
}
else if (!strcmp(n->getTagName(), ELEM_MAXSDUSIZE))
{
maxSDUsize = n->getNodeValue() ? atoi(n->getNodeValue()) : VAL_QOSPARDONOTCARE;
if (maxSDUsize < 0)
maxSDUsize = VAL_QOSPARDONOTCARE;
}
else if (!strcmp(n->getTagName(), ELEM_PARTIALDELIVER))
{
partDeliv = n->getNodeValue() ? atoi(n->getNodeValue()) : VAL_QOSPARDEFBOOL;
}
else if (!strcmp(n->getTagName(), ELEM_INCOMPLETEDELIVER))
{
incompleteDeliv = n->getNodeValue() ? atoi(n->getNodeValue()) : VAL_QOSPARDEFBOOL;
}
else if (!strcmp(n->getTagName(), ELEM_FORCEORDER))
{
forceOrder = n->getNodeValue() ? atoi(n->getNodeValue()) : VAL_QOSPARDEFBOOL;
}
else if (!strcmp(n->getTagName(), ELEM_MAXALLOWGAP))
{
maxAllowGap = n->getNodeValue() ? atoi(n->getNodeValue()) : VAL_QOSPARDONOTCARE;
if (maxAllowGap < 0)
maxAllowGap = VAL_QOSPARDONOTCARE;
}
else if (!strcmp(n->getTagName(), ELEM_DELAY))
{
delay = n->getNodeValue() ? atoi(n->getNodeValue()) : VAL_QOSPARDONOTCARE;
if (delay < 0)
delay = VAL_QOSPARDONOTCARE;
}
else if (!strcmp(n->getTagName(), ELEM_JITTER))
{
jitter = n->getNodeValue() ? atoi(n->getNodeValue()) : VAL_QOSPARDONOTCARE;
if (jitter < 0)
jitter = VAL_QOSPARDONOTCARE;
}
else if (!strcmp(n->getTagName(), ELEM_COSTTIME))
{
costTime = n->getNodeValue() ? atoi(n->getNodeValue()) : VAL_QOSPARDEFBOOL;
if (costTime < 0)
costTime = VAL_QOSPARDONOTCARE;
}
else if (!strcmp(n->getTagName(), ELEM_COSTBITS))
{
costBits = n->getNodeValue() ? atoi(n->getNodeValue()) : VAL_QOSPARDEFBOOL;
if (costBits < 0)
costBits = VAL_QOSPARDONOTCARE;
}
else if (!strcmp(n->getTagName(), ELEM_ATIME))
{
aTime = n->getNodeValue() ? atof(n->getNodeValue()) : VAL_QOSPARDONOTCARE;
if (aTime < 0)
aTime = VAL_DEFAULT_QOS;
}
else if (!strcmp(n->getTagName(), ELEM_RXON))
{
rxOn = n->getNodeValue() ? atoi(n->getNodeValue()) : VAL_QOSPARDEFBOOL;
if (rxOn < 0)
rxOn = VAL_DEFAULT_QOS;
}
else if (!strcmp(n->getTagName(), ELEM_WINON))
{
windowFCOn = n->getNodeValue() ? atoi(n->getNodeValue()) : VAL_QOSPARDEFBOOL;
if (windowFCOn < 0)
windowFCOn = VAL_DEFAULT_QOS;
}
else if (!strcmp(n->getTagName(), ELEM_RATEON))
{
rateFCOn = n->getNodeValue() ? atoi(n->getNodeValue()) : VAL_QOSPARDEFBOOL;
if (rateFCOn < 0)
rateFCOn = VAL_DEFAULT_QOS;
}
else if (!strcmp(n->getTagName(), ELEM_EFCPPOL))
{
efcpPolicies->init(n);
}
}
}

QoSCube::QoSCube(std::string tqosid,
Expand Down
2 changes: 1 addition & 1 deletion src/DIF/EFCP/EFCPModule.ned
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ module EFCPModule

submodules:
efcpTable: EFCPTable {
@display("p=175,44");
@display("p=151,44");
}
efcp: EFCP {
@display("p=52,44;i=block/circle");
Expand Down

0 comments on commit d793524

Please sign in to comment.