Main Content

connectUE

Connect one or more UEs to gNB

Since R2023a

    Description

    connectUE(gnb,ue,Name=Value) connects one or more new radio (NR) user equipment (UE) nodes, ue, to a NR base station node (gNB), gnb. The function sets the connection configuration parameters using one or more optional name-value arguments. For example, BSRPeriodicity=5 sets the uplink (UL) buffer status reporting periodicity to 5 subframes. You can connect multiple UE nodes to a gNB node in a single connectUE function call, but these UE nodes must all use same connection parameter values specified in the name-value arguments. This feature also requires the Wireless Network Toolbox™ product.

    Note

    When you connect more than 16 UE nodes to a gNB node using the connectUE object function, you must adjust the SRS transmission periodicity of the nrGNB object manually. For more information about this, see the SRSPeriodicityUE property.

    example

    Examples

    collapse all

    Create a default gNB node.

    gnb = nrGNB;

    Create two UE nodes positioned at [100 100 0] and [5000 100 0], with each one having a transmit power of 20 dBm.

    ueArray1 = nrUE(Position=[100 100 0; 5000 100 0],TransmitPower=20); % In Cartesian x, y, and z 

    Create two UE nodes positioned at [700 100 430] and [500 1000 657], with each one having a transmit power of 29 dBm.

    ueArray2 = nrUE(Position=[700 100 430; 500 1000 657],TransmitPower=29);

    Connect two UE nodes positioned at [100 100 0] and [5000 100 0] to the gNB node with the uplink (UL) buffer status reporting periodicity set to 5.

    connectUE(gnb,ueArray1,BSRPeriodicity=5)

    Connect two UE nodes positioned at [700 100 430] and [500 1000 657] to the gNB node with the UL buffer status reporting periodicity set to 16.

    connectUE(gnb,ueArray2,BSRPeriodicity=16)

    .Copyright 2022-2026 The MathWorks, Inc.

    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);

    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;

    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);

    Create a gNB node.

    gnb = nrGNB;

    Create four UE nodes and specify the UE positions.

    uePositions = [300 0 3; 700 0 3; 1200 0 3; 3000 0 3];
    UE = nrUE(Position=uePositions);

    Create two CSI report configurations.

    csiReportConfig1 = nrCSIReportConfig(CodebookType="type1SinglePanel",...
                                      CQITable="table2")
    csiReportConfig1 = 
      nrCSIReportConfig with properties:
    
                         NSizeBWP: []
                        NStartBWP: []
                         CQITable: 'table2'
                     CodebookType: 'type1SinglePanel'
                  PanelDimensions: [1 2 1]
               CQIFormatIndicator: "wideband"
               PMIFormatIndicator: "wideband"
                    PRGBundleSize: []
                     CodebookMode: 1
        CodebookSubsetRestriction: []
                    I2Restriction: []
                    RIRestriction: []
    
       Constant properties:
                           Tables: [1×1 struct]
    
    
    csiReportConfig2 = nrCSIReportConfig(CodebookType="eType2",...
                                      CQITable="table2")
    csiReportConfig2 = 
      nrCSIReportConfig with properties:
    
                                NSizeBWP: []
                               NStartBWP: []
                                CQITable: 'table2'
                            CodebookType: 'eType2'
                         PanelDimensions: [1 2 1]
                      CQIFormatIndicator: "wideband"
                      PMIFormatIndicator: "wideband"
                            CodebookMode: 1
               CodebookSubsetRestriction: []
                           RIRestriction: []
                    ParameterCombination: 1
        NumberOfPMISubbandsPerCQISubband: 1
    
       Constant properties:
                                  Tables: [1×1 struct]
    
    

    Assign csiReportConfig1 CSI report configuration to UE1 and UE3

    connectUE(gnb, [UE(1),UE(3)], CSIReportConfig = csiReportConfig1);

    Assign csiReportConfig2 CSI report configuration to UE2 and UE4.

    connectUE(gnb, [UE(2), UE(4)], CSIReportConfig = csiReportConfig2);

    Input Arguments

    collapse all

    gNB node, specified as an nrGNB object.

    UE node, specified as an nrUE object or a vector of nrUE objects.

    Name-Value Arguments

    collapse all

    Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

    Example: connectUE(gnb,ue,BSRPeriodicity=5) sets the uplink (UL) buffer status reporting periodicity to 5 subframes.

    Uplink (UL) buffer status reporting periodicity, specified as one of these options, in number of subframes. One subframe equals one millisecond.

    • 1

    • 5

    • 10

    • 20

    • 32

    • 40

    • 80

    • 128

    • 160

    • 320

    • 640

    • 1280

    • 2560

    • Inf

    Data Types: double

    Channel state information reference signal (CSI-RS) reporting periodicity, specified as a positive integer. Units are in slots. If you do not specify CSIReportPeriodicity, the function uses the value of CSI-RS transmission periodicity, as determined by the gNB object. The UE nodes report the rank indicator (RI), the precoding matrix indicator (PMI), and the channel quality indicator (CQI) based on measurements taken from the CSI-RS. For more information about the CSI-RS transmission periodicity, see the Algorithms section.

    • For FDD, the CSI-RS reporting periodicity must be greater than or equal to the CSI-RS transmission periodicity.

    • For TDD, the CSI-RS reporting periodicity must also be a multiple of the length of DL-UL pattern.

    Data Types: double

    Configuration of full buffer traffic for a UE, specified as one of these options.

    • "off" — Disable the full buffer traffic in both the UL and DL directions.

    • "on" — Enable the full buffer traffic in both the UL and DL directions.

    • "UL" — Enable the full buffer traffic in the UL direction.

    • "DL" — Enable the full buffer traffic in the DL direction.

    You can use this name-value argument as an alternative to the addTrafficSource object function for setting up traffic during connection configuration.

    When using the full buffer traffic, the system always attempts to send the maximum transport block size possible, given the allocated resources and channel measurements.

    Data Types: char | string

    RLC bearer configuration, specified as an nrRLCBearerConfig object or a vector of nrRLCBearerConfig objects. If you do not enable the full buffer traffic and fail to specify this name-value argument, the objects uses the default configuration of an nrRLCBearerConfig object.

    Dependencies

    To enable this name-value argument, set the FullBufferTraffic argument to "off".

    Since R2024b

    Custom UE context, specified as a structure. Use this name-value argument to specify any custom information regarding a UE node, which you can then use for your custom scheduling logic. The CustomContext property of UEContext, a property of the nrScheduler class, reflects the specified value for the corresponding UE node. The connectUE call, invokable for each UE node, utilizes the CustomContext name-value argument to provide each UE with a unique context structure, enabling variation in fields or identical fields with distinct values.

    Data Types: struct

    Since R2026a

    CSI report configuration, specified as an nrCSIReportConfig object. Use this name-value argument to configure CSI report configuration for the UE. You can configure the same CSI report configuration for multiple UEs, but configuring multiple CSI report configurations for a single UE is not supported.

    You can only configure these properties of the nrCSIReportConfig object for the UE:

    PropertySupported Property Value
    CQITable
    • "table2"

    CodebookType
    • "type1SinglePanel"

    • "type2"

    • "etype2"

    CQIFormatIndicator
    • "wideband" and "subband"

    Note

    Built-in schedulers, such as "RoundRobin", "BestCQI", and "ProportionalFair", do not use subband-level channel quality indicator (CQI) measurements. Instead, they use wideband CQI measurements. However, custom schedulers can use subband-level CQI measurements for scheduling.

    PMIFormatIndicator
    • "wideband" and "subband"

    SubbandSize
    • 4

    • 8

    • 16

    • 32

    Note

    The allowed values for SubbandSize depend on the NumResourceBlocks of nrGNB, according to TS 38.214. When the bandwidth part (BWP) size is greater than or equal to 24 PRBs, you can configure subband-based reporting for CQI and PMI.

    The system does not support sub-band measurements with multi-user (MU) multiple-input multiple-output (MIMO).

    CodebookMode
    • 1

    • 2

    CodebookSubsetRestriction
    • []

    • Binary vector

    I2Restriction
    • []

    • Binary vector

    RIRestriction
    • [1 1 1 1 0 0 0 0] for 'type1SinglePanel'

    • Supports only up to rank 4.

    • Only single codeword is supported.

    NumberOfBeams
    • 2

    • 3

    • 4

    PhaseAlphabetSize
    • 4

    • 8

    ParameterCombination
    • Integer from 1 to 8

    Algorithms

    collapse all

    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.101-1. “NR; User Equipment (UE) radio transmission and reception; Part 1: Range 1 Standalone.” 3rd Generation Partnership Project; Technical Specification Group Radio Access Network.

    Version History

    Introduced in R2023a

    expand all

    See Also

    Objects