connectUE
Description
connectUE(
connects one or more new radio (NR) user equipment (UE) nodes, gnb,ue,Name=Value)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.
Examples
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
Name-Value Arguments
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.
15102032408012816032064012802560Inf
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:
| Property | Supported Property Value |
|---|---|
CQITable |
|
CodebookType |
|
CQIFormatIndicator |
Note Built-in schedulers, such as |
PMIFormatIndicator |
|
SubbandSize |
Note The allowed values for The system does not support sub-band measurements with multi-user (MU) multiple-input multiple-output (MIMO). |
CodebookMode |
|
CodebookSubsetRestriction |
|
I2Restriction |
|
RIRestriction |
|
NumberOfBeams |
|
PhaseAlphabetSize |
|
ParameterCombination |
|
Algorithms
The gNB node automatically sets the connection parameters related to
CSI-RS and sounding reference signal (SRS). The gNB node transmits a full bandwidth CSI-RS
for downlink (DL) channel measurements. All the UE nodes connected to the gNB node use this
full bandwidth CSI-RS. The minimum value of CSI-RS transmission periodicity is
10 slots. For the frequency division duplex (FDD) mode, the CSI-RS
transmission periodicity is 10 slots. The CSI-RS transmission periodicity
for the time division duplex (TDD) mode is a multiple of the length of the DL-uplink (UL)
pattern, in slots. For UL channel measurements, the gNB node reserves one symbol for the
sounding reference signal (SRS) for every L slots across the entire
bandwidth. The minimum value of L is 5. For FDD, the
value of L is 5. For TDD, L is a
multiple of the length of the DL-UL pattern, in slots. The gNB node configures the UE nodes
to share the reserved SRS by varying the comb offset, cyclic shift, or transmission time.
The gNB uses both a comb size and maximum cyclic shift of 4. As a result,
the gNB node can configure up to 16 connected UE nodes to transmit SRS with periodicity as
L slots. If more than 16 UE nodes connect, the
scheduler increases the SRS transmission periodicity for each UE to the next multiple of
L to accommodate more UE nodes.
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 R2023aThe CSIReportConfig
name-value argument of the connectUE function enables you to
configure CSI reporting parameters. Specify CSIReportConfig
as an nrCSIReportConfig object with the
CQITable property set to 'table2'.
Starting in R2026a, this feature is available in 5G Toolbox™ and also requires a Wireless Network Toolbox license. In prior releases, the feature is available through the Communications Toolbox™ Wireless Network Simulation Library add-on.
You can now specify the custom UE context as a structure using the
customUE name-value argument of the connectUE object
function.
See Also
Objects
nrUE|nrGNB|wirelessNetworkSimulator(Wireless Network Toolbox)
Topics
- Communication Between gNB and UE Nodes
- Wireless Network Simulator (Wireless Network Toolbox)
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)