Main Content

nrGNB

5G NR base station node

Since R2023a

    Download Required: To use nrGNB, first download the Communications Toolbox Wireless Network Simulation Library add-on.

    Description

    Use the nrGNB object to create and configure 5G new radio (NR) base station (gNB) nodes.

    Creation

    Description

    example

    gnb = nrGNB creates a default gNB object.

    example

    gnb = nrGNB(Name=Value) creates one or more similar gNB objects, and sets properties using one or more optional name-value arguments. For example, Position=[100 100 0; 5000 100 0],Name=["gNB1","gNB2"] creates two gNB objects, one with the name "gNB1" and the other named "gNB2", positioned at [100 100 0] and [5000 100 0], respectively. The number of rows in the Position argument defines the number of gNB objects created. If you create N nodes but supply M names, where M is greater than N, the nrGNB object uses only the first N names. If M is less than N, the object uses default names for the trailing (N-M) nodes.

    Properties

    expand all

    Name of the gNB node, specified as a character vector, string scalar, string array, or cell array of character vectors.

    If you do not set the Name property, the nrGNB object sets a default name, NodeX, where X is the ID of the node.

    To set the value of this property for multiple gNB nodes simultaneously, you must specify it at object creation. After object creation, you can set the value of this property for one gNB object at a time.

    Data Types: char | string

    Node position in 3-D Cartesian coordinates, specified as a three-element numeric row vector or N-by-3 matrix. N is the number of nrGNB objects to create using the creation function. Each row specifies the position of the node in Cartesian x-, y-, and z- coordinates. Units are in meters.

    To set the value of this property for multiple gNB nodes simultaneously, you must specify it at object creation. After object creation, you can set the value of this property for one gNB object at a time.

    Data Types: double

    This property is read-only.

    Noise figure, specified as a nonnegative finite scalar. Units are in dB.

    To set the value of this property, you must specify it at object creation.

    Data Types: double

    This property is read-only.

    Receiver antenna gain, specified as a nonnegative finite scalar. Units are in dB.

    To set the value of this property, you must specify it at object creation.

    Data Types: double

    This property is read-only.

    Number of transmit antennas, specified as one of these options.

    • 1

    • 2

    • 4

    • 8

    • 16

    • 32

    To set the value of this property, you must specify it at object creation.

    Data Types: double

    This property is read-only.

    Number of receive antennas, specified as one of these options.

    • 1

    • 2

    • 4

    • 8

    • 16

    • 32

    To set the value of this property, you must specify it at object creation.

    Data Types: double

    This property is read-only.

    Transmit power, specified as a finite numeric scalar. Units are in dBm. The maximum value of transmit power you can specify is 60 dBm.

    To set the value of this property, you must specify it at object creation.

    Data Types: double

    This property is read-only.

    Physical (PHY) layer abstraction method, specified as one of these options. Note that all the gNB and user equipment (UE) nodes must use the same PHY abstraction method.

    • "linkToSystemMapping" — Enable the link-to-system mapping-based abstract PHY. Abstract PHY models the link quality and performance to calculate the packet error rate (PER).

    • "none" — Enable full PHY processing. Full PHY processing involves waveform generation and decoding at the PHY layer.

    To set the value of this property, you must specify it at object creation.

    Data Types: char | string

    This property is read-only.

    Duplexing mode, specified as one of these options.

    • "FDD" — Frequency division duplex

    • "TDD" — Time division duplex

    To set the value of this property, you must specify it at object creation.

    Data Types: char | string

    This property is read-only.

    Carrier frequency, specified as a real number. Units are in Hz.

    To set the value of this property, you must specify it at object creation.

    Note

    The value of the CarrierFrequency property must be same for all interfering gNBs.

    Data Types: double

    This property is read-only.

    Channel bandwidth, specified as one of these options. Units are in Hz.

    • 5e6

    • 10e6

    • 15e6

    • 20e6

    • 30e6

    • 35e6

    • 40e6

    • 45e6

    • 50e6

    • 60e6

    • 70e6

    • 80e6

    • 90e6

    • 100e6

    • 200e6

    • 400e6

    In FDD mode, the downlink (DL) and uplink (UL) operations occur in separate bands of the specified size. In TDD mode, both DL and UL share a single band of the specified size.

    To set the value of this property, you must specify it at object creation.

    Note

    The value of the ChannelBandwidth property must be same for all interfering gNBs.

    Data Types: double

    This property is read-only.

    Subcarrier spacing (SCS) used across the cell, specified as one of these options. Units are in Hz.

    • 15e3

    • 30e3

    • 60e3

    • 120e3

    To set the value of this property, you must specify it at object creation.

    Note

    The value of the SubcarrierSpacing property must be same for all interfering gNBs.

    Data Types: double

    This property is read-only.

    Number of resource blocks in the channel bandwidth, specified as an integer in the range [4,273].

    In the FDD mode, the DL bandwidth and UL bandwidth each contain resource blocks equal to NumResourceBlocks. In the TDD mode, the DL and UL bandwidths share these resource blocks. If you do not specify this name-value argument, then the nrgNB object derives it automatically from the channel bandwidth and the subcarrier spacing. The default value, 25, corresponds to the default 5e6 Hz channel bandwidth and 15e3 Hz SCS. The minimum value, 4, is the minimum required transmission bandwidth for a sounding reference signal (SRS), as defined in TS 38.211, table 6.4.1.4.3-1 [3].

    To set the value of this property, you must specify it at object creation.

    Data Types: double

    This property is read-only.

    DL and uplink UL time division configuration for TDD mode, specified as a structure. The structure contains these fields.

    • DLULPeriodicity — DL-UL pattern periodicity in milliseconds. If you specify SCS as 15e3, 30e3, 60e3, or 120e3, then the default value of the DLULPeriodicity field is 5 milliseconds, 2.5 milliseconds, 1.25 milliseconds, or 0.625 milliseconds, respectively.

    • NumDLSlots — Number of full DL slots at the start of the DL-UL pattern. The default value is 2.

    • NumDLSymbols — Number of DL symbols after the full DL slots. The default value is 12.

    • NumULSymbols — Number of full UL slots at the end of the DL-UL pattern. The default value is 1.

    • NumULSlots — Number of UL symbols before the full UL slots. The default value is 2.

    The nrGNB object sets the reference SCS for the DL-UL pattern to the value of SubcarrierSpacing. The configuration supports one S slot after the full DL slots and before the full UL slots. The S slot consists of NumDLSymbols at the start and NumULSymbols at the end. The object sets the guard period between DL and UL time to 14 - (NumDLSymbols + NumULSymbols). You can set NumULSymbols to 0 or 1. If you set NumULSymbols to 1, the gNB reserves the UL symbol for sounding reference signal (SRS).

    To set the value of this property, you must specify it at object creation.

    Dependencies

    To enable this property, set the DuplexMode property to "TDD".

    This property is read-only.

    Number of hybrid automatic repeat request (HARQ) processes used for each UE in the DL and UL directions, specified as an integer in the range [1, 16].

    To set the value of this property, you must specify it at object creation.

    Data Types: double

    This property is read-only.

    Node identifier, returned as a positive integer. This value specifies a unique identifier for the node in the simulation.

    Note

    If you create and store the gNB nodes in an uninitialized matrix, the node IDs that this property allocates to the nodes can be non-sequential because of the memory allocation to the object in the matrix. For more information about memory allocation, see How MATLAB Allocates Memory.

    Data Types: double

    This property is read-only.

    Radio network temporary identifiers (RNTIs) of the UEs connected to a gNB node, returned as a vector of positive integers.

    Data Types: double

    Since R2024a

    This property is read-only.

    IDs of the UE nodes connected to the gNB node, returned as a vector of positive integers.

    Data Types: double

    Since R2024a

    This property is read-only.

    Names of the UE nodes connected to the gNB node, returned as an array of strings.

    This property is read-only.

    Modulation and coding scheme (MCS) used for DL and UL, returned as a table. For more information about this property, see TS 38.214, table 5.1.3.1-2 [1].

    Object Functions

    configureSchedulerConfigure scheduler at gNB
    configureULPowerControlConfigure uplink power control parameters
    connectUEConnect one or more UEs to gNB
    addTrafficSourceAdd data traffic source to 5G NR node
    statisticsStatistics of gNB

    Examples

    collapse all

    Create two similar gNB nodes, one with the name "gNB1" and the other named "gNB2", positioned at [100 100 0] and [5000 100 0], respectively.

    gNBs = nrGNB(Name=["gNB1" "gNB2"],Position=[100 100 0; 5000 100 0])
    gNBs = 
      1x2 nrGNB array
    
    
    gNBs(1)
    ans = 
      nrGNB with properties:
    
                            Name: "gNB1"
                        Position: [100 100 0]
    
       Read-only properties:
                     NoiseFigure: 6
                     ReceiveGain: 6
                   TransmitPower: 34
             NumTransmitAntennas: 1
              NumReceiveAntennas: 1
            PHYAbstractionMethod: "linkToSystemMapping"
                      DuplexMode: "FDD"
                CarrierFrequency: 2.6000e+09
                ChannelBandwidth: 5000000
               SubcarrierSpacing: 15000
               NumResourceBlocks: 25
                         NumHARQ: 16
        ULPowerControlParameters: [1x1 struct]
                              ID: 5
    
       Constant properties:
                        MCSTable: [28x4 table]
    
    
    gNBs(2)
    ans = 
      nrGNB with properties:
    
                            Name: "gNB2"
                        Position: [5000 100 0]
    
       Read-only properties:
                     NoiseFigure: 6
                     ReceiveGain: 6
                   TransmitPower: 34
             NumTransmitAntennas: 1
              NumReceiveAntennas: 1
            PHYAbstractionMethod: "linkToSystemMapping"
                      DuplexMode: "FDD"
                CarrierFrequency: 2.6000e+09
                ChannelBandwidth: 5000000
               SubcarrierSpacing: 15000
               NumResourceBlocks: 25
                         NumHARQ: 16
        ULPowerControlParameters: [1x1 struct]
                              ID: 6
    
       Constant properties:
                        MCSTable: [28x4 table]
    
    

    Create a default gNB node.

    gnb = nrGNB
    gnb = 
      nrGNB with properties:
    
                            Name: "Node24"
                        Position: [0 0 0]
    
       Read-only properties:
                     NoiseFigure: 6
                     ReceiveGain: 6
                   TransmitPower: 34
             NumTransmitAntennas: 1
              NumReceiveAntennas: 1
            PHYAbstractionMethod: "linkToSystemMapping"
                      DuplexMode: "FDD"
                CarrierFrequency: 2.6000e+09
                ChannelBandwidth: 5000000
               SubcarrierSpacing: 15000
               NumResourceBlocks: 25
                         NumHARQ: 16
        ULPowerControlParameters: [1x1 struct]
                              ID: 24
    
       Constant properties:
                        MCSTable: [28x4 table]
    
    

    Create a default UE node.

    ue = nrUE
    ue = 
      nrUE with properties:
    
                        Name: "Node25"
                    Position: [0 0 0]
    
       Read-only properties:
                 NoiseFigure: 6
                 ReceiveGain: 0
               TransmitPower: 23
         NumTransmitAntennas: 1
          NumReceiveAntennas: 1
        PHYAbstractionMethod: "linkToSystemMapping"
             ConnectionState: "Idle"
                          ID: 25
    
    

    Establish a connection between the UE node and the gNB node.

    connectUE(gnb,ue)

    Initialize wireless network simulator.

    networkSimulator = wirelessNetworkSimulator.init;

    Create a gNB node with these specifications.

    • Duplex mode — Time division duplex

    • Channel bandwidth — 20 MHz

    • Subcarrier spacing — 30 KHz

    gnb = nrGNB(ChannelBandwidth=20e6,DuplexMode="TDD",SubcarrierSpacing=30e3);

    Create a UE node with a transmit power of 20 dBm.

    ue = nrUE(TransmitPower=20);

    Configure these uplink power control parameters at the gNB node.

    • Nominal transmit power of UE per resource block — 7 dBm

    • Fractional power control multiplier— 2

    configureULPowerControl(gnb,PoPUSCH=7,Alpha=0.4)

    Add a random way point mobility model to the UE node.

    addMobility(ue,BoundaryShape="rectangle")

    Establish a connection between the UE and gNB nodes.

    connectUE(gnb,ue)

    Create a voice over Internet protocol (VoIP) application traffic pattern object.

    traffic = networkTrafficVoIP(GeneratePacket=true);

    Add the data traffic source to the gNB node. Set the destination node as the UE node.

    addTrafficSource(gnb,traffic,DestinationNode=ue)

    Add the gNB node to the wireless network simulator.

    addNodes(networkSimulator,gnb)

    Add the UE node to the wireless network simulator.

    addNodes(networkSimulator,ue)

    Specify the simulation time, in seconds.

    simulationTime = 0.3;

    Run the simulation for the specified simulation time.

    run(networkSimulator,simulationTime)

    Obtain the statistics for the gNB and UE nodes.

    gnbStats = statistics(gnb);
    ueStats = statistics(ue);

    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.211. “NR; Physical channels and modulation.” 3rd Generation Partnership Project; Technical Specification Group Radio Access Network.

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

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

    Version History

    Introduced in R2023a

    expand all