Unipisa / Simu5G

Simu5G - 5G NR and LTE/LTE-A user-plane simulation model for OMNeT++ & INET
https://simu5g.org
Other
141 stars 80 forks source link

Statistics 'macCellThroughput(D2D|Ul|Dl)' use static member for total byte count producing overflow and wrong data in multi basestation scenarios #187

Open stefanSchuhbaeck opened 7 months ago

stefanSchuhbaeck commented 7 months ago

The statistics are defined in LteMac.ned

        @signal[macCellThroughputUl];
        @statistic[macCellThroughputUl](title="Cell Throughput at the MAC layer UL"; unit="Bps"; source="macCellThroughputUl"; record=mean);
        @signal[macCellThroughputDl];
        @statistic[macCellThroughputDl](title="Cell Throughput at the MAC layer DL"; unit="Bps"; source="macCellThroughputDl"; record=mean);
        @signal[macCellThroughputD2D];
        @statistic[macCellThroughputD2D](title="Cell Throughput at the MAC layer D2D"; unit="Bps"; source="macCellThroughputD2D"; record=mean); 

The recording of the statistics takes place the extractCorrectPdus method of the respective HarqBuffer ( normal or d2d enabled case). The cell throughput is calculated by dividing the total amount of bytes received by the total amount of elapsed time.

The problem is that totalCellRcvdBytes_ is a static unsigned int. See LteHarqBufferRx .

Possible fix.

Use INET ThroughputFilter result filter implementation. See for instance the ActivePacketSourceBase module of the INET queuing API. Here the throughput is calculated by the ThroughputFilter using statistics and result filter tools provided by OMNeT. It also allows to configure the interval length using ini files on a simulation by simulation basis.

@statistic[dataRate](title="data rate"; source=throughput(packetPushed); record=vector; unit=bps; interpolationmode=linear);