Applicable VersionsNetSim StandardNetSim Pro



Applicable Releasesv13.0v13.1



TABLE OF CONTENTS

Introduction

PRB stands for Physical Resource Block. The PRB count is determined in simulation run time by NetSim as per the inputs provided. 

How to enable the PRB Log file?

Users can observe the PRB allocation and the slot allocation in the  LTENR_MAC_PRBLOG file

The PRB log file can be enabled by modifying the LTE-NR source codes as follows:


1. Goto NetSim, select Your Work  >select  Source Code >select Open Code option (in v13.1)



2. Goto LTE_NR project, in the LTE_NR.c file, comment line no. #294 and uncomment line no. #295 in the get_ltenr_PRB_log_status() function



3. Uncomment the following line of code in the LTENR_PRB.c file


#define LTENR_PRB_LOG



4. Right-click on LTE_NR project and click on Rebuild


5. Upon successful built, the DLLs will automatically get updated in the bin directory of the current Workspace


This will provide the LTENR_MAC_PRBLOG.log file in the NetSim IO path, which can be opened via the results window.

Settings configured:

Interface(LTE_NR) Properties 
gNB Height (m)10
Tx_Power(dBm)40
Downlink_MIMO_Layer_Count2
Uplink_MIMO_Layer_Count1
CA_TypeSingle Band
CA_Configurationn78
CA_Count1
MU0
Channel Bandwidth (MHz)10
PRB Count52
MCS TableQAM64
CQI TableTable 1
X_OverheadXOH0
DL UL Ratio4:1
Outdoor ScenarioRural Macro
LOS ModeUSER_DEFINED
LOS Probability0
Channel CharacteristicsPathloss_Only
Shadow Fading ModelNone
Fading and BeamformingNo Fading (v13.0)
No Fading MIMO Unit Gain (v13.1)
O2I Building Penetration LossNone
Wired Link Properties
Link Speed (Mbps)100
BER0
Propagation Delay (µs)0
Application Properties
Packet Size (Byte)1460
Inter Arrival Time (µs)194.67
Generation Rate (Mbps)60 Mbps for each application
Transport ControlUDP
Start Time (s)1
QoSBE
Simulation Parameters
Simulation Time (s)10

NOTE: A sample experiment file for the scenario explained above is attached at the end of this article, users can change the scheduling type in the Datalink Layer of gNB and then run the simulations and observe the slot allocation for different scheduling types.


In v13.1

Network scenario:

The network consists of 4UEs connected to a gNB. They are downloading 60 Mbps of data from a server that is connected to the gNB via the 5G core. The UEs are at different distances from the gNB:

UE_8 - 300m

UE_9 - 600m

UE_10 - 900m

UE_11 - 1200m


PRB Allocation Logic


The bits per PRB depend on the CQI / MCS of the UE. These values can be seen from the LTENR log file (Refer section 3.14 of the NetSim 5G technology library manual to enable the LTENR log file.)


The per UE PRB allocation depends on the scheduling algorithm.


The CQI/MCS values for the various UEs at different distances as per the table shown below (CQI/MCS is noted from the LTENR logfile.)


UE IDDistanceCQIMCS
UE_8300m1464QAM
UE_9600m816QAM
UE_10900m1QPSK
UE_111200m2QPSK

Case 1: Round Robin Scheduling

In the Datalink Layer of the gNB, set the Scheduling type to Round Robin and we simulate the scenario for 10s


PRB Allocation

 

Since the DL-UL ratio is 4:1, the first four slots will be assigned to downlink and then the next slot will be assigned to uplink.

For UE_8, the bits per PRB is 1776, for UE_9, it is 608 bits and for UE_10 and UE_11, it is 176 and 64 bits as shown in the image below.

Table

Description automatically generated with medium confidence

 

 

The Application start time is 1s, so there are no packets to send from 0s to 1s. Hence the RLC buffer is zero during 0-1s and no PRBs are allocated.

 

The DL_PRB count is calculated as follows:

For the input settings, the NetSim GUI would calculate and display the PRB count as 52.

Downlink PRB count = Total PRB count - ceil of [ PRB Count (in GUI) x OH_DL] .  (Overhead is available in section 3.9 of NetSim 5G technology library manual) 

= 52- ceil (52 x 0.14) = 52 - ceil (7.28) = 52 - 8 = 44

 

The total PRB count is 44.  In this, the allocated PRB for UE_8 is 14 and the remaining 30 is allocated to UE_9.

 

The reason for the allocation of 14 PRBs to UE_8 is explained below:

Consider UE_8, 

Buffer size = 2,976 bytes

Bits per PRB = 1,776

Total PRB = 44

PRBs required to transmit the data in buffer equals [2,976 * 8 / 1776] ~ 14 PRBs (therefore Allocated PRB = 14)

Bits per slot = bits per PRB x allocated PRB = 14 x 1776 = 24864 bits = 3,108 bytes

The slot can transmit a maximum of 3,108 bytes.

Since the PHY transmits the packets in the buffer, it will allocate 2976 bytes to the first slot.

 

In the next slot, the total PRB count is 44 and all the 41 PRBs are allocated to UE_8 since the bytes in the RLC buffer is 8928B

Allocated PRB= 41 for UE_8,

Buffer Size = 8928 bytes

Bits per slot=bits per PRB x allocated PRB=  41 x 1776 = 72816 bits = 9102 Bytes

 

Since the slot can handle a maximum of 9102 bytes, and since the PHY transmits the packets in the buffer, it will allocate 8928 bytes to the second slot.

the packet is fragmented.  The 8928 bytes consist of six packets of size 1488 bytes. 

 

In the Packet Trace, filter the control packet type to App_1_CBR (since App_1_CBR is configured in UE_8), the Transmitter_Id to gNB_7 since the application configured is the downlink. The MAC Layer Payload shows bytes (of packets in a slot. 

 

 

In the same way, for UE_9,

The capacity of a slot (bits) is calculated as explained below:

Buffer size = 2,976 bytes

Bits per PRB = 608

Total PRB = 44

PRBs required to transmit the data in buffer equals [2,976 * 8 / 608]= 39

Allocated PRB =30, since the total PRB count is 44 and 14 PRBs are allocated to UE_8

Bits per slot = bits per PRB x allocated PRB = 30 x 608 = 18240 bits = 2,280 bytes

 

The slot can transmit a maximum of 2,280 bytes.

The PRB first allocates the packets in the buffer, it will allocate, say 2,280 bytes to the first slot.

Since the slot can transmit a maximum of  2,280 bytes, the packet is fragmented. The first fragment is 792 bytes and the second fragment is 228 bytes. The 2,280 bytes consists of one packet of size 1488 bytes and one packet fragment of size 792 bytes. 

 

In the next slot, the total PRB count is 44 and all the 3 PRBs are allocated to UE_9 since the bytes in the RLC buffer is 9624

Allocated PRB= 3 for UE_9,

Buffer Size = 9624 bytes

Bits per slot=bits per PRB x allocated PRB=  3 x  608 = 1824 bits = 228 Bytes

Since the slot can transmit a maximum of 228 bytes.  The 228 bytes consist of one packet fragment of size 228 bytes (a fragment of a packet fragmented in the previous slot), 

The same is shown in the image below.

 

In the Packet Trace, filter the control packet type to App_2_CBR (since App_2_CBR is configured in UE_9), the Transmitter_Id to gNB_7 since the application configured is the downlink. The MAC Layer Payload shows bytes of packets in a slot. 



Case 2: Proportional Fair Scheduling

In the Datalink Layer of the gNB, set the Scheduling type to Proportional Fair and simulate the scenario for 10s 


PRB Allocation

Since the DL-UL ratio is 4:1, the first four slots will be assigned to downlink and then the next slot will be assigned to uplink.

For UE_8, the bits per PRB are 1776 bits, for UE_9, it is 608 bits.


The Application start time is 1s, so there are no packets to send from zeroth second to first second, Hence the RLC buffer is zero during 0-1s and no PRBs are allocated.  


The reason for the allocation of 14 PRBs to UE_8 is explained below:

Consider UE_8, 

Buffer size = 2,976 bytes

Bits per PRB = 1,776

Total PRB = 44

PRBs required to transmit the data in buffer equals [2,976 * 8 / 1776] ~ 14 (therefore, Allocated PRB = 14)

Bits per slot = bits per PRB x allocated PRB = 14 x 1776 = 24864 bits = 3,108 bytes 

The slot can handle a maximum of 3,108 bytes.

Since the PHY transmits the packets in the buffer, it will allocate 2976 bytes to the first slot.


Similarly, the next three slots will be having packets of 2976 bytes as the allocated PRB is 14.


In the fifth slot, the total PRB count is 34 and all the PRBs are allocated to UE_8 since the bytes in the RLC buffer is 7,440 bytes.

Allocated PRB= 34 for UE_8,

Buffer Size = 7,440 bytes

Bits per slot=bits per PRB x allocated PRB=  34 x  1776 = 60384 bits = 7,548 bytes


Since the slot can handle a maximum of 7,548 bytes, the fifth slot is allocated with 7,440 bytes of data from the buffer. 

The same is shown in the image below.


In the Packet Trace, filter the control packet type to App_1_CBR (since App_1_CBR is configured in UE_8), the Transmitter_Id to gNB_7 since the application configured is the downlink. The MAC Layer Payload shows bytes of packets in a slot. 


In the same way, for UE_9,

The capacity of a slot (bits) is calculated as explained below:

Buffer size = 2,976 bytes

Bits per PRB = 608

Total PRB = 44

PRBs required to transmit the data in buffer equals [2,976 * 8 / 608]= 39

Allocated PRB =30, since the total PRB count is 44 and 14 PRBs are allocated to UE_8

Bits per slot = bits per PRB x allocated PRB = 30x 608 = 18,240 bits = 2,280 bytes

The slot can handle a maximum of 2,280 bytes to a slot.

The PHY transmits the packets in the buffer, it will allocate 2976 bytes to the first slot.


Since the slot can handle a maximum of  2,280 bytes. The 2,280 bytes consists of one packet of size 1488 bytes and one packet fragment of size 792 bytes. 


Similarly, the next three slots will be having packets of 2280 bytes as the allocated PRB is 30.


In the fifth slot, the total PRB count is 44 and 10 PRBs are allocated to UE_9 since the bytes in the RLC buffer is 8736

Allocated PRB= 10 for UE_9,

Buffer Size = 8736 bytes

Bits per slot=bits per PRB x allocated PRB=  10 x  608 = 6080 bits = 760 Bytes


The 760 bytes consist of one packet fragment of size 760 bytes. The same is shown in the image below.


In the Packet Trace, filter the control packet type to App_2_CBR (since App_2_CBR is configured in UE_9), the Transmitter_Id to gNB_7 since the application configured is the downlink. The MAC Layer Payload shows bytes of packets in a slot. 


 

In v13.0

Network scenario:

The network consists of 4UEs connected to a gNB. They are downloading 60 Mbps of data from a server which is connected to the gNB via the 5G core. The UEs are at different distances from the gNB:

UE_8 - 400m

UE_9 - 800m

UE_10 - 1200m

UE_11 - 1600m


PRB Allocation Logic


The bits per PRB depend on the CQI / MCS of the UE. These values can be seen from the LTENR log file (Refer section 3.14 of the NetSim 5G technology library manual to enable the LTENR log file.)


The per UE PRB allocation depends on the scheduling algorithm.


The CQI/MCS values for the various UEs at different distances as per the table shown below (CQI/MCS is noted from the LTENR logfile.)


UE IDDistanceCQIMCS
UE_8400m1464QAM
UE_9800m816QAM
UE_101200m1QPSK
UE_111600m2QPSK

Case 1: Round Robin Scheduling

In the Datalink Layer of the gNB, set the Scheduling type to Round Robin and we simulate the scenario for 10s


PRB Allocation


Since the DL-UL ratio is 4:1, the first four slots will be assigned to downlink and then the next slot will be assigned to uplink.

For UE_8, the bits per PRB is 1608, for UE_9, it is 608 bits and for UE_10 and UE_11, it is 72 bits as shown in the image below.


The Application start time is 1s, so there are no packets to send from 0s to 1s. Hence the RLC buffer is zero during 0-1s and no PRBs are allocated.

 

The DL_PRB count is calculated as follows:

For the input settings, the NetSim GUI would calculate and display the PRB count as 52.

Downlink PRB count = Total PRB count - ceil of [ PRB Count (in GUI) x OH_DL] .  (Overhead is available in section 3.9 of NetSim 5G technology library manual) 

= 52- ceil (52 x 0.14) = 52 - ceil (7.28) = 52 - 8 = 44


The total PRB count is 44.  In this, the allocated PRB for UE_8 is 15 and the remaining 29 is allocated to UE_9.


The reason for the allocation of 15 PRBs to UE_8 is explained below:

Consider UE_4, 

Buffer size = 2,976 bytes

Bits per PRB = 1,608

Total PRB = 44

PRBs required to transmit the data in buffer equals [2,976 * 8 / 1608]= 15 PRBs (therefore Allocated PRB = 15)

Bits per slot = bits per PRB x allocated PRB = 15 x 1608 = 24,120 bits = 3,015 bytes

The slot can transmit a maximum of 3,015 bytes.

Since the PHY transmits the packets in the buffer, it will allocate 2976 bytes to the first slot.


In the next slot, the total PRB count is 44 and all the PRBs are allocated to UE_8 since the bytes in the RLC buffer is 8,928

Allocated PRB= 44 for UE_8,

Buffer Size = 8,928 bytes

Bits per slot=bits per PRB x allocated PRB=  44 x 1608 = 70,752 bits = 8,844 Bytes


Since the slot can handle a maximum of 8,844 bytes, the packet is fragmented.  The 8844 bytes consist of five packets of size 1488 bytes. The 6th packet s fragmented; 1st fragment is 1404B and the 2nd fragment is 84B. The same is shown in the image below.


In the Packet Trace, filter the control packet type to App_1_CBR (since App_1_CBR is configured in UE_8), the Transmitter_Id to gNB_7 since the application configured is the downlink. The MAC Layer Payload shows bytes (of packets in a slot. 


 

In the same way, for UE_9,

The capacity of a slot (bits) is calculated as explained below:

Buffer size = 2,976 bytes

Bits per PRB = 608

Total PRB = 44

PRBs required to transmit the data in buffer equals [2,976 * 8 / 608]= 39

Allocated PRB =29, since the total PRB count is 44 and 15 PRBs are allocated to UE_8

Bits per slot = bits per PRB x allocated PRB = 29 x 608 = 17,632 bits = 2,204 bytes


The slot can transmit a maximum of 2,204 bytes.

The PRB first allocates the packets in the buffer, it will allocate, say 2,204 bytes to the first slot.

Since the slot can transmit a maximum of  2,204 bytes, the packet is fragmented. The first fragment is 716 bytes and the second fragment is 772 bytes. The 2,204 bytes consist of one packet of size 1488 bytes and one packet fragment of size 716 bytes. 


In the next slot, the total PRB count is 44 and all the PRBs are allocated to UE_9 since the bytes in the RLC buffer is 15,652

Allocated PRB= 44 for UE_9,

Buffer Size = 15,652 bytes

Bits per slot=bits per PRB x allocated PRB=  44 x  608 = 26,752 bits = 3,344 Bytes

Since the slot can transmit a maximum of 3,344 bytes.  The 3,344 bytes consist of one packet of size 772 bytes (a fragment of a packet fragmented in the previous slot), one packet of size 1488 bytes, and one packet fragment of size 1084 bytes. 

The same is shown in the image below.


In the Packet Trace, filter the control packet type to App_2_CBR (since App_2_CBR is configured in UE_9), the Transmitter_Id to gNB_7 since the application configured is the downlink. The MAC Layer Payload shows bytes of packets in a slot. 



Case 2: Proportional Fair Scheduling

In the Datalink Layer of the gNB, set the Scheduling type to Proportional Fair and simulate the scenario for 10s 


PRB Allocation

Since the DL-UL ratio is 4:1, the first four slots will be assigned to downlink and then the next slot will be assigned to uplink.

For UE_8, the bits per PRB are 1608 bits, for UE_9, it is 608 bits and for UE_10 and UE_11, it is 72 bits as shown below.


The Application start time is 1s, so there are no packets to send from zeroth second to first second, Hence the RLC buffer is zero during 0-1s and no PRBs are allocated.  


The reason for the allocation of 15 PRBs to UE_8 is explained below:

Consider UE_4, 

Buffer size = 2,976 bytes

Bits per PRB = 1,608

Total PRB = 44

PRBs required to transmit the data in buffer equals [2,976 * 8 / 1608]= 15 (therefore, Allocated PRB = 15)

Bits per slot = bits per PRB x allocated PRB = 15 x 1608 = 24,120 bits = 3,015 bytes

The slot can handle a maximum of 3,015 bytes.

Since the PHY transmits the packets in the buffer, it will allocate 2976 bytes to the first slot.


Similarly, the next three slots will be having packets of 2976 bytes as the allocated PRB is 15.


In the fifth slot, the total PRB count is 30 and all the PRBs are allocated to UE_8 since the bytes in the RLC buffer is 5,952 bytes.

Allocated PRB= 30 for UE_8,

Buffer Size = 5,952 bytes

Bits per slot=bits per PRB x allocated PRB=  30 x  1608 = 48,240 bits = 6,030 bytes


Since the slot can handle a maximum of 6030 bytes, the fifth slot is allocated with 5952 bytes of data from the buffer. 

The same is shown in the image below.


In the Packet Trace, filter the control packet type to App_1_CBR (since App_1_CBR is configured in UE_8), the Transmitter_Id to gNB_7 since the application configured is the downlink. The MAC Layer Payload shows bytes of packets in a slot. 


In the same way, for UE_9,

The capacity of a slot (bits) is calculated as explained below:

Buffer size = 2,976 bytes

Bits per PRB = 608

Total PRB = 44

PRBs required to transmit the data in buffer equals [2,976 * 8 / 608]= 39

Allocated PRB =29, since the total PRB count is 44 and 15 PRBs are allocated to UE_8

Bits per slot = bits per PRB x allocated PRB = 29 x 608 = 17,632 bits = 2,204 bytes

The slot can handle a maximum of 2,204 bytes to a slot.

The PHY transmits the packets in the buffer, it will allocate 2976 bytes to the first slot.


Since the slot can handle a maximum of  2,204 bytes. The 2,204 bytes consist of one packet of size 1488 bytes and one packet fragment of size 716 bytes. 


Similarly, the next three slots will be having packets of 2204 bytes as the allocated PRB is 29.


In the fifth slot, the total PRB count is 44 and 14 PRBs are allocated to UE_9 since the bytes in the RLC buffer is 7552

Allocated PRB= 14 for UE_9,

Buffer Size = 7552 bytes

Bits per slot=bits per PRB x allocated PRB=  14 x  608 = 8,512 bits = 1,064 Bytes


The 1,064 bytes consist of one packet of size 112 bytes, and one packet fragment of size 952 bytes. The same is shown in the image below.


In the Packet Trace, filter the control packet type to App_2_CBR (since App_2_CBR is configured in UE_9), the Transmitter_Id to gNB_7 since the application configured is the downlink. The MAC Layer Payload shows bytes of packets in a slot.