Unipisa / Simu5G

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

Question about event priority #123

Closed Jiacheng188 closed 1 year ago

Jiacheng188 commented 1 year ago

Hello, when I was running a simulation, I found that the UE sent a RAC Request to gNB at 0.030s, and gNB received the request at 0.031s, and UE received the Rac response and UL grant at 0.032s and 0.033s, respectively. When I studied the source code, I found that in LteMacEnb::initialize , the priority of the timer _ttiTick__ was set to one, and the code annotation said "TTI TICK after other messages". However the simulation manual of omnet++ indicates that " If arrival times are equal, the one with the higher scheduling priority (smaller numeric value) is executed first. " . This way the gNB had finished its selfMessage triggered by _ttiTick__ before sending Rac response and UL grant. I wonder if it's reasonable and correct.


additional remarks: Maybe the problem hasn't been described clearly, For phy layer, the priority of the airframes is set to 10. For mac layer, the priority of _ttiTick__ is set to 1. However the comments in LtePhyBase.h said

AirFrames use a slightly higher priority than normal to ensure
channel consistency. This means that before anything else happens
at a time point t every AirFrame which ended at t has been removed and
every AirFrame started at t has been added to the channel.

The two priorities mentioned above will cause the following situation: when gNB's Mac is triggered by _ttiTick__, the airframes which come at the same time cannot be processed by Mac since the _ttiTick__ is prior to airframes . Is it resonable?

Jiacheng188 commented 1 year ago

And another question, in /Simu5G-master/src/stack/mac/amc/NRAmc.cc: the function NRAmc::computeReqRbs uses

for(j = 0; j < 110; ++j)   // TODO check number of blocks
        if(computeCodewordTbs(&info, cw, dir, numRe) >= bits)
            break;

We will always get the same Tbs in the loop. Do you mean:

for(j = 0; j < 110; ++j)   // TODO check number of blocks
        if(computeCodewordTbs(&info, cw, dir, (j+1)*numRe) >= bits)
            break;
giovanninardini commented 1 year ago

And another question, in /Simu5G-master/src/stack/mac/amc/NRAmc.cc: the function NRAmc::computeReqRbs uses

for(j = 0; j < 110; ++j)   // TODO check number of blocks
        if(computeCodewordTbs(&info, cw, dir, numRe) >= bits)
            break;

We will always get the same Tbs in the loop. Do you mean:

for(j = 0; j < 110; ++j)   // TODO check number of blocks
        if(computeCodewordTbs(&info, cw, dir, (j+1)*numRe) >= bits)
            break;

Thank you for pointing this out. Actually, that function was used in a way that it always returned either 0 or 1. So it was consuming time without being really useful... I just modified the code (in the master branch) so that this function is not used anymore.