Skip to content

Commit 9c2bf83

Browse files
Fix a problem (possible division by 0) within the BaseStationStatsCollector
1 parent f7a2f05 commit 9c2bf83

File tree

5 files changed

+17
-14
lines changed

5 files changed

+17
-14
lines changed

simulations/NR/mec/multiMecHost/omnetpp.ini

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,13 @@ num-rngs = 3
2929
*.configurator.config = xmldoc("./demo.xml")
3030

3131

32+
# tcp settings
33+
**.tcp.typename = "Tcp"
34+
**.tcp.advertisedWindow = 65535 # in bytes, corresponds with the maximal receiver buffer capacity (Note: normally, NIC queues should be at least this size)
35+
**.tcp.tcpAlgorithmClass = "TcpReno" # TcpReno/TcpTahoe/TcpNewReno/TcpNoCongestionControl/DumbTcp
36+
**.tcp.sackSupport = true # Selective Acknowledgment (RFC 2018, 2883, 3517) support (header option) (SACK will be enabled for a connection if both endpoints support it)
37+
38+
3239
#------------------------------------#
3340
# Config MultiMec
3441
#
@@ -113,14 +120,9 @@ network = simu5g.simulations.NR.mec.multiMecHost.MultiMecHost
113120
*.ue[*].app[1].positionY = 600
114121
#------------------------------------#
115122

123+
116124
############ MEC Configuration ############
117-
**.hasRNISupport = true
118125

119-
# tcp settings
120-
**.tcp.typename = "Tcp"
121-
**.tcp.advertisedWindow = 65535 # in bytes, corresponds with the maximal receiver buffer capacity (Note: normally, NIC queues should be at least this size)
122-
**.tcp.tcpAlgorithmClass = "TcpReno" # TcpReno/TcpTahoe/TcpNewReno/TcpNoCongestionControl/DumbTcp
123-
**.tcp.sackSupport = true # Selective Acknowledgment (RFC 2018, 2883, 3517) support (header option) (SACK will be enabled for a connection if both endpoints support it)
124126

125127
# MEC Hosts
126128
**.mecHost*.virtualisationInfrastructure.ipv4.forwarding = true

simulations/NR/mec/singleMecHost/omnetpp.ini

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ network = simu5g.simulations.NR.mec.singleMecHost.singleMecHost
105105
**.tcp.tcpAlgorithmClass = "TcpReno" # TcpReno/TcpTahoe/TcpNewReno/TcpNoCongestionControl/DumbTcp
106106
**.tcp.sackSupport = true # Selective Acknowledgment (RFC 2018, 2883, 3517) support (header option) (SACK will be enabled for a connection if both endpoints support it)
107107

108-
**.hasRNISupport = true
109108
##########################################################
110109
# App Layer #
111110
##########################################################

src/corenetwork/statsCollector/BaseStationStatsCollector.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,7 @@ void BaseStationStatsCollector::initialize(int stage){
8080
EV << collectorType_ << "::initialize - packetFlowManager reference" << endl;
8181
packetFlowManager_ = check_and_cast<PacketFlowManagerEnb *>(getParentModule()->getSubmodule("cellularNic")->getSubmodule("packetFlowManager"));
8282
}
83-
else
84-
{
85-
EV << "NON CI STA" << endl;
86-
}
83+
8784
cellInfo_ = check_and_cast<CellInfo *>(getParentModule()->getSubmodule("cellInfo"));
8885
ecgi_.cellId = cellInfo_->getMacCellId(); // at least stage 2
8986

@@ -336,7 +333,10 @@ void BaseStationStatsCollector::add_ul_nongbr_pdr_cell()
336333
pair.total += temp.total;
337334
}
338335

339-
pdr = ((double)pair.discarded * 1000000)/ pair.total;
336+
if (pair.total == 0)
337+
pdr = 0.0;
338+
else
339+
pdr = ((double)pair.discarded * 1000000)/ pair.total;
340340
ul_nongbr_pdr_cell.addValue((int)pdr);
341341
}
342342

src/stack/packetFlowManager/PacketFlowManagerEnb.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -823,6 +823,8 @@ double PacketFlowManagerEnb::getDiscardedPktPerUe(MacNodeId id)
823823

824824
double PacketFlowManagerEnb::getDiscardedPkt()
825825
{
826+
if (pktDiscardCounterTotal_.total == 0)
827+
return 0.0;
826828
return ((double)pktDiscardCounterTotal_.discarded * 1000000)/pktDiscardCounterTotal_.total;
827829
}
828830

tests/fingerprint/mec/mec.csv

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# workingdir, args, simtimelimit, fingerprint,
2-
/simulations/NR/mec/singleMecHost, -f omnetpp.ini -c SingleMec -r 0, 20s, 105e-03d6/tlx,PASS,
3-
/simulations/NR/mec/multiMecHost, -f omnetpp.ini -c MultiMec -r 0, 20s, 4cf8-bd34/tlx,PASS,
2+
/simulations/NR/mec/singleMecHost, -f omnetpp.ini -c SingleMec -r 0, 20s, bf93-3e95/tlx,PASS,
3+
/simulations/NR/mec/multiMecHost, -f omnetpp.ini -c MultiMec -r 0, 20s, 4e70-3039/tlx,PASS,
44
/simulations/NR/mec/RNIDelay, -f omnetpp.ini -c Test -r 0, 5s, eadb-62b5/tlx,PASS,

0 commit comments

Comments
 (0)