Main Content

NR Cell Performance Evaluation with Physical Layer Integration

This example demonstrates the integration of high fidelity 5G Toolbox™ physical layer in a 5G New Radio (NR) node. The example models a 5G NR cell consisting of a set of user equipment (UE) connected to a gNB. The NR stack on the nodes includes radio link control (RLC), medium access control (MAC), and physical (PHY) layers. The example also models channel impairments that you can customize. For faster MAC focused simulations you can switch to passthrough PHY layer or you can integrate with a custom PHY layer.

Introduction

The example considers the following operations within gNB and UEs that facilitate uplink (UL) and downlink (DL) transmissions and receptions.

gNB_UE_Operations.png

The complete PUSCH or PDSCH packet is transmitted in the first symbol of its allocated symbol set. Receiver processes the packet in the symbol just after the last symbol in the allocated symbol set.

This example models:

  • Slot based and symbol based DL and UL scheduling.

  • Configurable subcarrier spacing resulting in different slot durations.

  • Noncontiguous allocation of frequency-domain resources in terms of resource block groups (RBGs).

  • Asynchronous adaptive hybrid automatic repeat request (HARQ) mechanism in UL and DL.

  • PUSCH demodulation reference signal (DM-RS) and PDSCH DM-RS.

  • DL channel quality measurement by UEs based on the CSI-RS received from gNB. By default, the CSI-RS resource element is transmitted in each slot for each resource block (RB) in DL bandwidth for all UEs. The same CSI-RS configuration is applicable to all the UEs. The example does not model the sounding reference signal (SRS) for measuring UL channel quality. UL channel quality is assumed to be the same as the DL channel quality measured on CSI-RS.

  • Free space path loss (FSPL), additive white Gaussian noise (AWGN), and clustered delay line (CDL) propagation channel model.

  • Single input single output (SISO) antenna configuration.

  • Single bandwidth part across the whole carrier.

Control packets such as UL assignment, DL assignment, buffer status report (BSR), PDSCH feedback, and channel quality indicator (CQI) report, are assumed to be sent out of band, that is, without the need of resources for transmission and assured error-free reception.

NR Protocol Stack

A node (gNB or UE) is a composition of NR stack layers. The helper classes hNRGNB.m and hNRUE.m create gNB and UE nodes respectively, containing the RLC, MAC, and PHY layers.

RLC Layer

RLC operates in unacknowledged mode (UM) with a single logical channel (LCH). For the RLC layer, both hNRGNB.m and hNRUE.m use hNRUMEntity.m to implement the functionality of both the RLC transmitter and receiver.

MAC Layer

For the MAC layer, hNRGNB.m uses the helper class hNRGNBMAC.m to implement the gNB MAC functionality and hNRUE.m uses hNRUEMAC.m to implement the UE MAC functionality. gNB MAC has UL and DL schedulers that assign UL and DL resources, respectively to the UEs. For more details about UL and DL scheduling to assign the PUSCH and the PDSCH resources, see the NR FDD Scheduling Performance Evaluation example. Schedulers are implemented in hNRSchedulerRoundRobin.m (Round-robin strategy), hNRSchedulerProportionalFair.m (Proportional fair strategy), and hNRSchedulerBestCQI.m (Best CQI strategy) helper classes. All these schedulers are inherited from the base class hNRScheduler.m, which contains the core scheduling functionality.

PHY Layer and Channel Modeling

The example uses 5G Toolbox™ for PHY layer operations of UE and gNB. On the Tx side, the operations involve the physical layer processing of a transport block received from MAC and its transmission. On the Rx side, there is processing of received waveform and sending the decoded information to MAC. For more details on PDSCH and PUSCH processing chains, refer to the NR PDSCH Throughput example and NR PUSCH Throughput example, respectively. For the PHY layer, hNRGNB.m uses the helper class hNRGNBPhy.m to implement the gNB PHY layer functionality and hNRUE.m uses hNRUEPhy.m to implement the UE PHY layer functionality. For channel impairments, the example models FSPL, AWGN, and the CDL propagation channel model.

The example uses a lookup table to map the received signal-to-interference-plus-noise ratio (SINR) to CQI index for 0.1 block error rate (BLER). The lookup table corresponds to the CQI table as per 3GPP TS 38.214 Table 5.2.2.1-3. For more information about the process of generating this lookup table, refer to 5G NR Downlink CSI Reporting example.

MAC-PHY Interface

Following are the major interface calls between the MAC layer and PHY layer. For more details, refer to hNRPhyInterface.m.

  • txDataRequest: The request from MAC to PHY to transmit either PDSCH (by gNB) or PUSCH (by UE). MAC calls this request at the start of Tx time. The PHY processing time is not modeled in this example.

  • rxDataRequest: The request from MAC to PHY to receive either PUSCH (by gNB) or PDSCH (by UE). MAC calls this request at the start of Rx time.

  • dlControlRequest: The request from MAC to PHY for non-data downlink transmissions or receptions. For gNB, this request is sent by gNB MAC for DL transmissions. For UE, it is sent by UE MAC for DL receptions. MAC sends the request at the start of a DL slot for all the scheduled DL transmission or receptions in the slot. This interface is used for all the DL transmission and receptions, except PDSCH. txDataRequest and rxDataRequest are used for PDSCH. In this example, gNB MAC uses this interface to send CSI-RS, and UE MAC uses it to receive CSI-RS.

  • registerMACInterfaceFcn: The one-time setup call to register MAC callback functions at PHY. PHY uses the callbacks to send information up the stack to MAC. gNB PHY uses the callback to send decoded UL packets to MAC. UE PHY uses the callbacks to send decoded DL packets and DL channel quality measured on CSI-RS to MAC.

Pluggable PHY

You can plug and use different variations of PHY layer in your system. In a simulation run, all the nodes use the same variation of the PHY layer. The MAC is unaware of the type of PHY layer underneath, because the MAC uses the MAC-PHY interface to interact with the PHY layer. By default the example uses 5G Toolbox™ to model the PHY layer. To use a passthrough PHY layer, refer to NR TDD Symbol Based Scheduling Performance Evaluation examples. A passthrough PHY layer does not do any physical layer processing of packets.

Scenario Configuration

Check if the Communications Toolbox Wireless Network Simulation Library support package is installed. If the support package is not installed, MATLAB® returns an error with a link to download and install the support package.

wirelessnetworkSupportPackageCheck

Configure simulation parameters in the simParameters structure.

rng('default'); % Reset the random number generator
simParameters = []; % Clear the simParameters variable
simParameters.NumFramesSim = 30; % Simulation time in terms of number of 10 ms frames
simParameters.SchedulingType = 0; % Set the value to 0 (slot based scheduling) or 1 (symbol based scheduling)

Specify the number of UEs in the cell, assuming that UEs have sequential radio network temporary identifiers (RNTIs) from 1 to simParameters.NumUEs. If you change the number of UEs, ensure that the number of rows in simParameters.UEPosition parameter equals to the value of simParameters.NumUEs.

simParameters.NumUEs = 4;
% Assign position to the UEs assuming that the gNB is at (0, 0, 0). N-by-3
% matrix where 'N' is the number of UEs. Each row has (x, y, z) position of a
% UE (in meters)
simParameters.UEPosition = [100 0 0;
                            600 0 0;
                            1500 0 0;
                            2500 0 0];
% Validate the UE positions
validateattributes(simParameters.UEPosition,{'numeric'},{'nonempty','real','nrows',simParameters.NumUEs,'ncols',3,'finite'},'simParameters.UEPosition','UEPosition')

Set the channel bandwidth to 5 MHz and subcarrier spacing (SCS) to 15 kHz as defined in 3GPP TS 38.104 Section 5.3.2. The complete bandwidth is assumed to be allotted for PUSCH or PDSCH.

simParameters.NumRBs = 25;
simParameters.SCS = 15; % kHz
simParameters.DLCarrierFreq = 2.635e9; % Hz
simParameters.ULCarrierFreq = 2.515e9; % Hz
% The UL and DL carriers are assumed to have symmetric channel
% bandwidth
simParameters.DLBandwidth = 5e6; % Hz
simParameters.ULBandwidth = 5e6; % Hz

Specify the transmit power and antenna gain.

simParameters.UETxPower = 23; % Tx power for all the UEs in dBm
simParameters.GNBTxPower = 29; % Tx power for gNB in dBm
simParameters.GNBRxGain = 10; % Receiver antenna gain at gNB

Specify the SINR to a CQI index mapping table for a BLER of 0.1.

simParameters.SINR90pc = [-5.46 -0.46 4.54 9.05 11.54 14.04 15.54 18.04 ...
    20.04 22.43 24.93 25.43 27.43 30.43 33.43];

Specify the scheduling strategy and the maximum limit on the RBs allotted for PDSCH and PUSCH. The transmission limit applies only to new transmissions and not to the retransmissions.

simParameters.SchedulerStrategy = 'PF'; % Supported scheduling strategies: 'PF', 'RR', and 'BestCQI'
simParameters.RBAllocationLimitUL = 15; % For PUSCH
simParameters.RBAllocationLimitDL = 15; % For PDSCH

Logging and visualization configuration

The CQIVisualization and RBVisualization parameters control the display of the CQI visualization and the RB assignment visualization respectively. To enable these visualization plots, set these parameters to true.

simParameters.CQIVisualization = false;
simParameters.RBVisualization = false;

Set the enableTraces as true to log the traces. If the enableTraces is set to false, then CQIVisualization and RBVisualization are disabled automatically and traces are not logged in the simulation. To speed up the simulation, set the enableTraces to false.

enableTraces = true;

The example updates the metrics plots periodically. Set the number of updates during the simulation.

simParameters.NumMetricsSteps = 20;

Write the logs to MAT-files. The example uses these logs for post-simulation analysis and visualization.

parametersLogFile = 'simParameters'; % For logging the simulation parameters
simulationLogFile = 'simulationLogs'; % For logging the simulation traces
simulationMetricsFile = 'simulationMetrics'; % For logging the simulation metrics

% Enable packet capture (PCAP)
simParameters.PCAPLogging = false; % Set the value to true to enable packet capture for UEofInterest
simParameters.UEofInterest = 1; % Log the packets of UE with this RNTI

Application traffic configuration

Set the DL and UL application traffic pattern for UEs.

dlAppDataRate = 16e4*ones(simParameters.NumUEs,1); % DL application data rate in kilo bits per second (kbps)
ulAppDataRate = 16e4*ones(simParameters.NumUEs,1); % UL application data rate in kbps
% Validate the DL application data rate
validateattributes(dlAppDataRate,{'numeric'},{'nonempty','vector','numel',simParameters.NumUEs,'finite','>',0},'dlAppDataRate','dlAppDataRate')
% Validate the UL application data rate
validateattributes(ulAppDataRate, {'numeric'}, {'nonempty','vector','numel',simParameters.NumUEs,'finite','>', 0},'ulAppDataRate','ulAppDataRate')

Derived Parameters

Compute the derived parameters based on the primary configuration parameters specified in the previous section and set some example-specific constants.

simParameters.DuplexMode = 0; % FDD
simParameters.NCellID = 1; % Physical cell ID
simParameters.Position = [0 0 0]; % Position of gNB in (x,y,z) coordinates

Specify the CSI-RS resource configuration, assuming that all UEs measure channel quality on the same CSI-RS resource.

csirsConfig = nrCSIRSConfig('NID',simParameters.NCellID,'NumRB',simParameters.NumRBs,'RowNumber',2,'SubcarrierLocations',1,'SymbolLocations',0);
simParameters.CSIRSConfig = {csirsConfig};

Specify the CSI report configuration.

csiReportConfig = struct('SubbandSize',8,'CQIMode','Subband');
simParameters.CSIReportConfig = {csiReportConfig};

Configure the channel model.

channelModelUL = cell(1, simParameters.NumUEs);
channelModelDL = cell(1, simParameters.NumUEs);
waveformInfo = nrOFDMInfo(simParameters.NumRBs,simParameters.SCS);
for ueIdx = 1:simParameters.NumUEs
    % Configure the uplink channel model
    channel = nrCDLChannel;
    channel.DelayProfile = 'CDL-C';
    channel.DelaySpread = 300e-9;
    channel.Seed = 73 + (ueIdx - 1);
    channel.CarrierFrequency = simParameters.ULCarrierFreq;
    channel.TransmitAntennaArray.Size = [1 1 1 1 1];
    channel.ReceiveAntennaArray.Size = [1 1 1 1 1];
    channel.SampleRate = waveformInfo.SampleRate;
    channelModelUL{ueIdx} = channel;

    % Configure the downlink channel model
    channel = nrCDLChannel;
    channel.DelayProfile = 'CDL-C';
    channel.DelaySpread = 300e-9;
    channel.Seed = 73 + (ueIdx - 1);
    channel.CarrierFrequency = simParameters.DLCarrierFreq;
    channel.TransmitAntennaArray.Size = [1 1 1 1 1];
    channel.ReceiveAntennaArray.Size = [1 1 1 1 1];
    channel.SampleRate = waveformInfo.SampleRate;
    channelModelDL{ueIdx} = channel;
end

Set the PUSCH preparation time for UEs. The gNB ensures that PUSCH assignment is received at UEs PUSCHPrepTime ahead of the transmission time.

simParameters.PUSCHPrepTime = 200; % In microseconds

Compute the number of slots in the simulation.

numSlotsSim = (simParameters.NumFramesSim * 10 * simParameters.SCS)/15;

Set the interval at which the example updates metrics visualization in terms of number of slots. Because this example uses a time granularity of one slot, the MetricsStepSize field must be an integer.

simParameters.MetricsStepSize = ceil(numSlotsSim / simParameters.NumMetricsSteps);

Specify one logical channel for each UE, and set the logical channel configuration for all nodes (UEs and gNBs) in the example.

numLogicalChannels = 1; % Only 1 logical channel is assumed in each UE in this example
% Logical channel id (logical channel ID of data radio bearers starts from 4) 
simParameters.LCHConfig.LCID = 4;

Specify the RLC entity type in the range [0, 3]. The values 0, 1, 2, and 3 indicate RLC UM unidirectional DL entity, RLC UM unidirectional UL entity, RLC UM bidirectional entity, and RLC AM entity, respectively.

simParameters.RLCConfig.EntityType = 2;

Create RLC channel configuration structure.

rlcChannelConfigStruct.LCGID = 1; % Mapping between logical channel and logical channel group ID
rlcChannelConfigStruct.Priority = 1; % Priority of each logical channel
rlcChannelConfigStruct.PBR = 8; % Prioritized bitrate (PBR), in kilobytes per second, of each logical channel
rlcChannelConfigStruct.BSD = 10; % Bucket size duration (BSD), in ms, of each logical channel
rlcChannelConfigStruct.EntityType = simParameters.RLCConfig.EntityType;
rlcChannelConfigStruct.LogicalChannelID = simParameters.LCHConfig.LCID;

Set the mapping type as per the configured scheduling type.

if ~isfield(simParameters, 'SchedulingType') || simParameters.SchedulingType == 0 % If no scheduling type is specified or slot based scheduling is specified
    simParameters.PUSCHMappingType = 'A';
    simParameters.PDSCHMappingType = 'A';
else % Symbol based scheduling
    simParameters.PUSCHMappingType = 'B';
    simParameters.PDSCHMappingType = 'B';
end

gNB and UEs Setup

Create the gNB and UE objects, initialize the channel quality information for UEs, and set up the logical channel at gNB and UE. The helper classes hNRGNB.m and hNRUE.m create gNB node and UE node respectively, containing the RLC, MAC and PHY layers.

gNB = hNRGNB(simParameters); % Create gNB node
% Create scheduler
switch(simParameters.SchedulerStrategy)
    case 'RR' % Round-robin scheduler
        scheduler = hNRSchedulerRoundRobin(simParameters);
    case 'PF' % Proportional fair scheduler
        scheduler = hNRSchedulerProportionalFair(simParameters);
    case 'BestCQI' % Best CQI scheduler
        scheduler = hNRSchedulerBestCQI(simParameters);
end
addScheduler(gNB, scheduler); % Add scheduler to gNB
simParameters.ChannelModel = channelModelUL;                       
gNB.PhyEntity = hNRGNBPhy(simParameters); % Create the PHY layer instance
configurePhy(gNB, simParameters); % Configure the PHY layer
setPhyInterface(gNB); % Set the interface to PHY layer

% Create the set of UE nodes
UEs = cell(simParameters.NumUEs, 1);
for ueIdx=1:simParameters.NumUEs
    ueParam = simParameters;
    ueParam.Position = simParameters.UEPosition(ueIdx, :); % Position of the UE
    ueParam.ChannelModel = channelModelDL{ueIdx};
    ueParam.CSIReportConfig = csiReportConfig;
    UEs{ueIdx} = hNRUE(ueParam,ueIdx);
    UEs{ueIdx}.PhyEntity = hNRUEPhy(ueParam,ueIdx); % Create the PHY layer instance
    configurePhy(UEs{ueIdx},ueParam); % Configure the PHY layer
    setPhyInterface(UEs{ueIdx}); % Set up the interface to PHY layer

    % Setup logical channel at gNB for the UE
    configureLogicalChannel(gNB,ueIdx,rlcChannelConfigStruct);
    % Setup logical channel at UE
    configureLogicalChannel(UEs{ueIdx},ueIdx,rlcChannelConfigStruct);

    % Create an object for On-Off network traffic pattern and add it to the
    % specified UE. This object generates the uplink data traffic on the UE
    ulApp = networkTrafficOnOff('GeneratePacket', true, ...
        'OnTime', simParameters.NumFramesSim*10e-3,'OffTime', 0,'DataRate',ulAppDataRate(ueIdx));
    UEs{ueIdx}.addApplication(ueIdx,simParameters.LCHConfig.LCID,ulApp);

    % Create an object for On-Off network traffic pattern for the specified
    % UE and add it to the gNB. This object generates the downlink data
    % traffic on the gNB for the UE
    dlApp = networkTrafficOnOff('GeneratePacket', true, ...
        'OnTime', simParameters.NumFramesSim*10e-3,'OffTime',0,'DataRate',dlAppDataRate(ueIdx));
    gNB.addApplication(ueIdx,simParameters.LCHConfig.LCID,dlApp);
end

Enable PCAP logging.

if simParameters.PCAPLogging
    % To generate unique file name for every simulation run
    ueCapturefileName = strcat('CellID-',num2str(simParameters.NCellID),'_ue-',num2str(simParameters.UEofInterest), '_',num2str(now));
    enablePacketLogging(UEs{simParameters.UEofInterest}.PhyEntity,ueCapturefileName);
    
    % Uncomment the below code to enable packet capture at gNB
    % gnbCapturefileName = strcat('CellID-',num2str(simParameters.NCellID),'_gNB-',num2str(now));
    % enablePacketLogging(gNB.PhyEntity,gnbCapturefileName);
end

Simulation

% Initialize wireless network simulator
nrNodes = [{gNB}; UEs];
networkSimulator = hWirelessNetworkSimulator(nrNodes);

Create objects to log MAC and PHY traces.

if enableTraces
    % Create an object for MAC traces logging
    simSchedulingLogger = hNRSchedulingLogger(simParameters,networkSimulator,gNB,UEs);

    % Create an object for PHY traces logging
    simPhyLogger = hNRPhyLogger(simParameters,networkSimulator,gNB,UEs);

    % Create an object for CQI and RB grid visualization
    if simParameters.CQIVisualization || simParameters.RBVisualization
        gridVisualizer = hNRGridVisualizer(simParameters,'MACLogger',simSchedulingLogger);
    end
end

Create an object for MAC and PHY metrics visualization.

metricsVisualizer = hNRMetricsVisualizer(simParameters,'EnableSchedulerMetricsPlots',true,'EnablePhyMetricsPlots',true,'NetworkSimulator',networkSimulator,'GNB',gNB,'UEs',UEs);

Run the simulation for the specified NumFramesSim frames.

% Calculate the simulation duration (in seconds) from 'NumFramesSim'
simulationTime = simParameters.NumFramesSim * 1e-2;
% Run the simulation
run(networkSimulator,simulationTime);

Get the simulation metrics and save it in a MAT-file. The simulation metrics are saved in a MAT-file with the file name as simulationMetricsFile.

metrics = getMetrics(metricsVisualizer);
save(simulationMetricsFile,'metrics');

At the end of the simulation, the achieved value for system performance indicators is compared to their theoretical peak values (considering zero overheads). Performance indicators displayed are achieved data rate (UL and DL), achieved spectral efficiency (UL and DL), and BLER observed for UEs (DL and UL). The peak values are calculated as per 3GPP TR 37.910.

displayPerformanceIndicators(metricsVisualizer)
Peak UL Throughput: 31.11 Mbps. Achieved Cell UL Throughput: 21.40 Mbps
Achieved UL Throughput for each UE: [6.18        6.02        5.04        4.17]
Achieved Cell UL Goodput: 21.28 Mbps
Achieved UL Goodput for each UE: [6.13        5.98        5.04        4.13]
Peak UL spectral efficiency: 6.22 bits/s/Hz. Achieved UL spectral efficiency for cell: 4.26 bits/s/Hz 

Peak DL Throughput: 31.11 Mbps. Achieved Cell DL Throughput: 20.92 Mbps
Achieved DL Throughput for each UE: [5.94        5.87        5.02        4.09]
Achieved Cell DL Goodput: 20.70 Mbps
Achieved DL Goodput for each UE: [5.94        5.72        5.02        4.03]
Peak DL spectral efficiency: 6.22 bits/s/Hz. Achieved DL spectral efficiency for cell: 4.14 bits/s/Hz

Block error rate for each UE in the uplink direction: [0.006       0.007           0       0.006]
Block error rate for each UE in the downlink direction: [0       0.032           0       0.019]

Simulation Visualization

The five types of run-time visualization shown are:

  • Display of CQI values for UEs over the channel bandwidth: For details, see the 'Channel Quality Visualization' figure.

  • Display of resource grid assignment to UEs: The 2-D time-frequency grid updates every 10 ms (frame length) and shows the RB allocation to the UEs in the previous frame. The HARQ process for the PUSCH and PDSCH assignments is also shown alongside with the RNTI of the UEs. New transmissions are shown in black and retransmissions are shown in blue using the HARQ process ID of each UE, a retransmission assignment can be mapped to its previously failed transmission. You can enable this visualization in the 'Scenario Configuration' section. For details, see the 'Resource Grid Allocation' figure.

  • Display of UL scheduling metrics plots: The four plots displayed in 'Uplink Scheduler Performance Metrics' figure represent: UL throughput (per UE and cell), UL goodput (per UE and cell), resource share percentage among UEs (out of the total UL resources) to convey the fairness of scheduling, and pending UL buffer-status of UEs to show whether UEs are getting sufficient resources. The maximum achievable data rate value for UL throughput is shown with a dashed line in throughput and goodput plots. The performance metrics plots update for every metricsStepSize slots. The UL throughput plot shows the rate of MAC data transmission for each UE and across the cell. The calculation includes transport block size (TBS) of new transmissions as well as the TBS of retransmissions. The units are in megabits per second (Mbps). The goodput (in Mbps) calculation only considers new transmission MAC data.

  • Display of DL scheduling metrics plots: Like UL metrics plots, 'Downlink Scheduler Performance Metrics' displays corresponding subplots for DL direction. The performance metrics plots update for every metricsStepSize slots.

  • Display of DL and UL Block Error Rates: The two sub-plots displayed in 'Block Error Rate (BLER) Visualization' shows the BLER (for each UE) observed in the uplink and downlink directions, as the simulation progresses. The plot is updated every metricsStepSize slots.

Simulation Logs

The parameters used for simulation and the simulation logs are saved in MAT-files for post-simulation analysis and visualization. The simulation parameters are saved in a MAT-file with the file name as the value of configuration parameter parametersLogFile. The per time step logs, scheduling assignment logs, and BLER logs are saved in the MAT-file simulationLogFile. After the simulation, open the file to load DLTimeStepLogs, ULTimeStepLogs SchedulingAssignmentLogs, and RLCLogs in the workspace.

Time step logs: Both the DL and UL time step logs follow the same format. The table shows sample time step entries.

Each row of the table represents a slot and contains the following information:

  • Timestamp: Time (in milliseconds) since the start of simulation.

  • Frame: Frame number.

  • Slot: Slot number in the frame.

  • RBG Allocation Bitmap: N-by-P bitmap matrix, where N is the number of UEs and P is the number of RBGs. If an RBG is assigned to a particular UE, the corresponding bit is set to 1. For example, [ 0 0 1 1 0 1 0 1 0 1 0 0 0; 1 1 0 0 0 0 0 0 0 0 1 0 0; 0 0 0 0 1 0 1 0 1 0 0 1 1; 0 0 0 0 0 0 0 0 0 0 0 0 0] means that the bandwidth has 13 RBGs and UE-1 is assigned RBG indices: 2, 3, 5, 7 and 9; UE-2 is assigned the RBG indices 0, 1 and 10; UE-3 is assigned the RBG indices 4, 6, 8, 11 and 12 and UE-4 is not assigned any RBG.

  • MCS: Row vector of length N, where N is the number of UEs. Each value corresponds to the modulation and coding scheme (MCS) index for the transmission. For example, [10 12 8 -1] means that only UE-1, UE-2, and UE-3 are assigned resources for this slot and use MCS values 10, 12, and 8, respectively.

  • HARQ Process: Row vector of length N, where N is the number of UEs. The value is the HARQ process ID used by UE for the transmission. For example, [0 3 6 -1] means that only UE-1, UE-2, and UE-3 are assigned resources for this slot and use the HARQ process IDs 0, 3, and 6, respectively.

  • NDI: Row vector of length N, where N is the number of UEs. The value is the NDI flag value in the assignment for transmission. For example, [0 0 1 -1] means that only UE-1, UE-2, and UE-3 are assigned resources for this slot and use the NDI flag values (which determine whether a new transmission or a retransmission is used) 0, 0, and 1, respectively.

  • Tx Type: Tx Type specifies the transmission type (new transmission or retransmission). Row vector of length N, where N is the number of UEs. Possible values are either 'newTx', 'reTx', or 'noTx'. 'noTx' means that the UE is not allocated resources. For example, ['newTx' 'newTx' 'reTx' 'noTx'] means that only UE-1, UE-2, and UE-3 are assigned resources for this slot. The assigned resources correspond to a new transmission for UE-1 and UE-2 and a retransmission for UE-3.

  • CQI for UEs: N-by-P matrix, where N is the number of UEs and P is the number of RBs in the bandwidth. A matrix element at position (i, j) corresponds to the CQI value for UE with RNTI i at RB j.

  • HARQ NDI Status: N-by-P matrix, where N is the number of UEs and P is the number of HARQ processes on UEs. A matrix element at position (i, j) is the last received NDI flag at UE i for HARQ process ID j. For new transmissions, this value and the NDI flag in the assignment must toggle. For example, in slot 1 of frame 5 described in the scheduling log, UE-1 uses the HARQ ID 0 and the last NDI flag value for HARQ ID 0 at UE-1 is 1. To indicate a new transmission, the NDI flag values changes to 0 in the assignment.

  • Throughput Bytes: Row vector of length N, where N is the number of UEs. The values represent MAC bytes transmitted per UE in this slot.

  • Goodput Bytes: Row vector of length N, where N is the number of UEs. The values represent new transmission MAC bytes transmitted per UE in this slot.

  • Buffer Status of UEs: Row vector of length N, where N is the number of UEs. The values represent the amount of pending buffers per UE.

Scheduling assignment logs: Information of all the scheduling assignments and the related information is logged in this file. The table shows sample log entries.

BLER logs: Block error information observed in the uplink and downlink directions are logged in this file. This table shows the sample log entries.

Each row of the log represents one slot. The column contains the information vector of length equal to the number of UEs. Information about a UE is at an index equal to its RNTI.

if enableTraces
    simulationLogs = cell(1,1);
    % Read the logs and save them in MAT-files
    if simParameters.DuplexMode == 0 % FDD
        logInfo = struct('DLTimeStepLogs', [], 'ULTimeStepLogs', [], 'SchedulingAssignmentLogs', [], 'BLERLogs', [], 'AvgBLERLogs', []);
        [logInfo.DLTimeStepLogs, logInfo.ULTimeStepLogs] = getSchedulingLogs(simSchedulingLogger);
    else % TDD
        logInfo = struct('TimeStepLogs', [], 'SchedulingAssignmentLogs', [], 'BLERLogs', [], 'AvgBLERLogs', []);
        logInfo.TimeStepLogs = getSchedulingLogs(simSchedulingLogger);
    end
    [logInfo.BLERLogs, logInfo.AvgBLERLogs] = getBLERLogs(simPhyLogger); % BLER logs
    logInfo.SchedulingAssignmentLogs = getGrantLogs(simSchedulingLogger); % Scheduling assignments log
    simulationLogs{1} = logInfo;
    save(parametersLogFile, 'simParameters'); % Save simulation parameters in a MAT-file
    save(simulationLogFile, 'simulationLogs'); % Save simulation logs in a MAT-file
end

To obtain a post-simulation visualization of logs, you can run the script NRPostSimVisualization. The variable isLogReplay in the post-simulation script offers options to visualize the Resource Grid Allocation and Channel Quality Visualization figures. Specify isLogReplay as one of these options.

  • true — Use this option to replay the Resource Grid Allocation and Channel Quality Visualization figures.

  • false — Use this option to analyze the details of a particular simulation frame. In the Resource Grid Allocation window, input the frame number to visualize the resource assignment for the entire frame. The Channel Quality Visualization figure also uses this frame number.

Further Exploration

You can use this example to further explore these options.

Custom scheduling

You can modify the existing scheduling strategy to implement a custom one. Plug In Custom Scheduler in System-Level Simulation example explains how to create a custom scheduling strategy and plug it into system-level simulation.

Use passthrough physical layer

For MAC focused simulations, you can use the passthrough PHY layer by installing passthrough PHY layer object on nodes. For gNB create an object of type hNRGNBPassthroughPhy, and for UE create an object of type hNRUEPassthroughPhy. For details, see 'gNB and UEs setup' section of NR TDD Symbol Based Scheduling Performance Evaluation example.

Based on described simulation parameters, the example evaluates the performance of the system measured in terms of various metrics. Different visualizations show the run time performance of the system. A more thorough post-simulation analysis by using the saved logs gives a detailed picture of the operations on a per slot basis.

Use RLC AM

You can also switch the operating mode of an RLC entity from UM to acknowledged mode (AM) by modifying the input structure fields EntityType and SeqNumFieldLength in the configureLogicalChannel function of hNRNode.m. For more details, see the 'Further Exploration' section of NR TDD Symbol Based Scheduling Performance Evaluation.

References

[1] 3GPP TS 38.104. “NR; Base Station (BS) radio transmission and reception.” 3rd Generation Partnership Project; Technical Specification Group Radio Access Network.

[2] 3GPP TS 38.214. “NR; Physical layer procedures for data.” 3rd Generation Partnership Project; Technical Specification Group Radio Access Network.

[3] 3GPP TS 38.321. “NR; Medium Access Control (MAC) protocol specification.” 3rd Generation Partnership Project; Technical Specification Group Radio Access Network.

[4] 3GPP TS 38.322. “NR; Radio Link Control (RLC) protocol specification.” 3rd Generation Partnership Project; Technical Specification Group Radio Access Network.

[5] 3GPP TS 38.323. “NR; Packet Data Convergence Protocol (PDCP) specification.” 3rd Generation Partnership Project; Technical Specification Group Radio Access Network.

[6] 3GPP TS 38.331. “NR; Radio Resource Control (RRC) protocol specification.” 3rd Generation Partnership Project; Technical Specification Group Radio Access Network.

[7] 3GPP TR 37.910. “Study on self evaluation towards IMT-2020 submission.” 3rd Generation Partnership Project; Technical Specification Group Radio Access Network.

Related Topics