Main Content

Composition of NR Nodes

5G Toolbox™ offers the nrGNB and nrUE objects for creating the 5G base station (gNB) and user equipment (UE) nodes, respectively, for network simulation. These new radio (NR) nodes, as illustrated in this figure, contains protocol stacks comprising the traffic, radio link control (RLC), medium access control (MAC), and physical (PHY) layers. This topic presents the functionalities of different layers implemented by the objects nrGNB and nrUE.

New Radio Protocol Stack


The traffic manager contains a set of traffic pattern objects. The Communications Toolbox™ Wireless Network Simulation Library offers four kinds of application traffic pattern objects to model real-world data traffic:

In addition to these traffic pattern objects, the Communications Toolbox Wireless Network Simulation Library supports full-buffer traffic. Full-buffer traffic means an unlimited amount of queued data awaiting transmission. For more information about full-buffer traffic, see the connectUE object function.

RLC Layer

The RLC layers of the gNB and UE nodes operate in unacknowledged mode (UM) and acknowledged mode (AM).


In UM, as depicted in this figure, a transmitting RLC entity handles the transmission, and a receiving entity manages the reception.


The transmitting RLC entity perform these operations.

  1. Generate a header, upon receiving a service data unit (SDU) from the higher layer, and place the SDU in a transmit buffer.

  2. Add the header to the SDU upon receiving a request from the MAC layer to transmit the protocol data unit (PDU).

  3. If an SDU does not fit into the given resource grant, segment the SDU and modify the RLC header.

The receiving RLC entity, on the other hand, performs these operations, opposite the transmitting RLC entity.

  1. If the PDU has a complete SDU, remove the header and deliver the PDU directly to the higher layer.

  2. If the PDU does not contain a complete SDU, store the SDU in the reception buffer. Then, remove the RLC header and reassemble the SDUs.


In UM mode, the transmitter sends the PDUs without any confirmation of their successful delivery. However, in the AM mode, as shown in this figure, the transmitter not only sends the PDUs but also keeps a copy of them in a re-transmission buffer until it receives a positive acknowledgement.

RLC Acknowledged Mode

When the transmitter receives a negative acknowledgement (NACK) for an SDU, it indicates that the receiver did not receive the PDUs correctly. In such cases, the transmitter retrieves the stored PDUs from the re-transmission buffer and sends them again. This process continues until the transmitter receives the positive acknowledgment or reaches a maximum number of re-transmission attempts.

MAC Layer

The MAC layer of the UE and gNB nodes has these common functionalities.

  • Logical channel prioritisation — Determine the amount of data for different logical channels in a MAC PDU.

  • Multiplexing — Combine the MAC SDUs (RLC PDUs) from the prioritized logical channel.

  • Demultiplexing — Separates the MAC SDUs received from the PHY layer.

  • Hybrid automatic repeat request (HARQ) management — The MAC layer controls the HARQ operation within the PHY layer. For more information about HARQ management, see the Model 5G NR Transport Channels with HARQ example.

MAC Transmitter and Receiver layers

The MAC layer of the gNB node also includes a scheduler. The scheduler allocates resources to UE nodes and decides how the gNB and UE nodes use uplink and downlink channels. Use the configureScheduler object function to configure a scheduler at a gNB. The scheduler supports three scheduling strategies:

  • Round-robin — Provides equal scheduling opportunities to all the UE nodes.

  • Best channel quality indicator (CQI) scheduler — Prioritizes the UE node with the best CQI.

  • Proportional-fair scheduler — Compromises between the round-robin and best CQI schedulers.

Physical Layer

The nrGNB and nrUE objects support two types of physical layer processing — full PHY and abstracted PHY. You can use the PHYAbstractionMethod property of the nrGNB and nrUE objects to select the link-to-system mapping-based abstracted PHY or full PHY processing. Note that all the gNB and UE nodes must use the same PHY abstraction method.

Full PHY

Full PHY, as depicted in this figure, receives and processes the MAC PDU. Full PHY processing involves waveform generation and decoding.

Full PHY processing

At the transmitter, full PHY involves these operations.

  • Downlink(DL)/Uplink (UL) shared channel processing — Perform these steps:

    • Attach cyclic redundancy check (CRC) to the MAC PDU.

    • Segment code block.

    • Apply error correction coding.

    • Perform rate matching.

  • Modulation — Map information bits to symbols.

  • Precoding — Map multiple input data streams onto a set of transmit antennas.

  • Cyclic prefix (CP)-orthogonal frequency division multiplexing (OFDM) — Perform an inverse fast Fourier transform (FFT) operation on the information symbols, and insert a cyclic prefix. For more information about CP-OFDM, see nrOFDMModulate.

At the receiver, full PHY performs these operations.

  • Timing synchronization — Determine the correct sampling instants for the incoming signal. For more information about timing synchronization, see nrTimingEstimate and nrPerfectTimingEstimate.

  • CP-OFDM demodulation — Demodulate the OFDM modulated waveform by performing an FFT on the sampled received signal. For more information about CP-OFDM demodulation, see nrOFDMDemodulate.

  • Channel estimation — Estimate amplitude scaling factors and phase shifts from the CP-OFDM demodulated symbols. For more information about channel estimation, see nrChannelEstimate and nrPerfectChannelEstimate.

  • Equalization and decoding — Equalize the CP-OFDM demodulated symbols, and decode the equalized symbols. For more information about equalization and decoding, see nrEqualizeMMSE, nrPUSCHDecode, and nrPDSCHDecode.

For more information about full PHY processing, see the examples NR PDSCH Throughput Using Channel State Information Feedback and NR PUSCH Throughput.

Abstracted PHY

Abstracted PHY models the link quality and performance to calculate the packet error rate (PER), as illustrated in this figure. Unlike full PHY, it does not involve waveform generation and decoding.

Abstracted PHY

  • Link Quality Model — Calculates the post-equalizer signal to interference and noise ratio (SINR) per subcarrier. It involves these operations.

    • Calculate transport block size (TBS)

    • Calculate precoding matrix using the previous channel estimate

    • Create path gains for small-scale fading or large scale fading (Channel modelling).

    • Perform perfect time estimation

    • Perform perfect channel estimation

    • Calculate noise variance

  • Link Performance Model — Uses the SINR per subcarrier (calculated by the link quality model) and the transmission coding parameters to predict the instantaneous PER. It consists of these steps.

    1. Combine the post-equalizer SINR per subcarrier into a single effective SINR using the received bit mutual information rate (RBIR) mapping function. The effective SINR represents the SINR at which the PER performance over an additive white Gaussian noise (AWGN) channel is equivalent to the PER performance over the fading channel.

    2. Calculate PER for an SINR for a given channel coding, modulation scheme, and coding rate using a pre-computed lookup table.

    3. Determine whether the received packet is in error.


[1] Cox, Christopher. An Introduction to 5G: The New Radio, 5G Network and Beyond. Hoboken, NJ: Wiley, 2020.

Related Topics