NR SA 2Step RACH
The purpose of this tutorial is to show you how to test 2Step RACH. Since I don't have any commercial UE supporting 2 step RACH I used Amari UEsim as DUT. I will put the test with commercial UE when I have any commercial UE supporting the feature. The regular RACH that is commonly used is 4 step RACH. Obviously 2 step RACH takes less steps to complete. It would shorten the signaling time greatly and I can even shorten the required timing for PUSCH transmission since PUSCH can be transmitted at the first step (Step 1) of the process. Overall process and Configuration of 2 Step RACH is as follows.

Image Source : Sharetechnote
Table of Contents
Introduction
The 2-Step Random Access Channel (RACH) procedure represents a significant advancement in 5G NR (New Radio) access technologies, designed to enhance the efficiency and responsiveness of initial access mechanisms within cellular networks. Traditional 4-Step RACH, a well-established process in LTE and early 5G deployments, involves a sequence of message exchanges between User Equipment (UE) and the gNodeB (gNB) to establish uplink synchronization and initiate communication. The 2-Step RACH procedure, introduced in 3GPP Release 16 and supported by advanced simulation platforms like Amari UEsim, streamlines this process by consolidating signaling steps. This reduction in procedural overhead allows the UE to transmit both the preamble and initial uplink data in a single step, thereby decreasing access latency and improving resource utilization. Architecturally, the 2-Step RACH integrates tightly with the 5G NR physical layer, leveraging enhancements in PUSCH (Physical Uplink Shared Channel) transmission and RACH configuration parameters. Its adoption is particularly critical for latency-sensitive applications such as massive IoT deployments, URLLC (Ultra-Reliable Low Latency Communications), and scenarios requiring rapid network access. By shortening the signaling exchange, the 2-Step RACH procedure not only optimizes network responsiveness but also contributes to improved user experience and overall system capacity in dense network environments.
- 
    Context and Background
    - The Random Access Channel (RACH) is a fundamental component of cellular network procedures, supporting initial access, handover, and uplink synchronization between the UE and gNB.
- While the conventional 4-Step RACH has been the industry standard, the evolution to 2-Step RACH addresses emerging requirements in 5G NR for lower latency and improved spectral efficiency.
- The 2-Step RACH relies on enhancements in 5G NR’s physical and MAC layers, utilizing advanced scheduling and resource allocation strategies.
 
- 
    Relevance and Importance of the Tutorial Topic
    - Understanding and testing 2-Step RACH is essential for network engineers, researchers, and developers working with 5G NR, especially in contexts where rapid access and reduced signaling overhead are critical.
- This tutorial provides practical insights by demonstrating the procedure using Amari UEsim, a widely used UE simulator, making the concepts accessible even in the absence of commercial UEs supporting this feature.
- The knowledge gained is directly applicable to real-world scenarios, including network optimization, performance analysis, and deployment of latency-sensitive 5G services.
 
- 
    What Learners Will Gain
    - A comprehensive understanding of the architectural differences between 2-Step and 4-Step RACH procedures.
- Practical experience in configuring and testing 2-Step RACH using simulation tools.
- Insights into the performance benefits and implementation considerations of 2-Step RACH in 5G NR networks.
- Awareness of the feature’s deployment status and compatibility considerations in commercial networks.
 
- 
    Prerequisite Knowledge or Skills
    - Familiarity with 5G NR network architecture and terminology (e.g., gNB, UE, PUSCH, MAC/PHY layers).
- Basic understanding of radio access procedures and the role of RACH in cellular systems.
- Experience with network testing tools or simulators such as Amari UEsim is beneficial but not mandatory.
- Some exposure to 3GPP technical specifications, particularly those related to RACH and 5G NR, will enhance comprehension.
 
Summary of the Tutorial
The tutorial demonstrates the configuration and validation of the 2-step RACH (Random Access Channel) procedure in NR Standalone (SA) mode, using an FDD duplex mode and 2x2 UL MIMO. The test utilizes an Amarisoft Callbox and UEsim, with detailed steps for both configuration and execution.
- 
        Test Setup:
        - The setup involves an Amarisoft Callbox and UEsim, connected as depicted in the provided diagram.
 
- 
        Key Configuration Parameters:
        - Parameters such as two_steps_prach, shared_ro, msga_pusch (with sub-parameters like mcs, time_domain_offset, l_crb, po_fdm, rb_start, n_symb, dmrs_cdm_group, dmrs_n_ports), msga_rsrp_threshold, msgb_response_window, and msgb_mcs are highlighted as essential for 2-step RACH operation.
 
- 
        Test Procedure: 2 step RACH with FDD, UL MIMO 2x2
        - 
                Configuration:
                - Ensure matching configurations between UEsim and Callbox. The default configuration files (ue.default.cfg and enb.default.cfg) are used as a baseline without modification.
- For UEsim, use ue-nr-sa-2step-rach.cfg (copied from ue-nr-sa.cfg). For Callbox, use gnb-sa-2step-rach.cfg (from gnb-sa.cfg).
 
- 
                Callbox Configuration Highlights:
                - Set NR_TDD to 0 (FDD mode), N_ANTENNA_DL and N_ANTENNA_UL to 2 (2x2 MIMO), and enable SRS by setting USE_SRS to 1.
- Configure desired FDD band and frequency, using band 7 (n7) in this test.
- In two_steps_prach, configure shared_ro, msgA, and msgB settings. For msga_pusch, set the relevant physical layer parameters for PUSCH.
- In srs_resource, set n_ports to match N_ANTENNA_UL for UL MIMO operation.
- Set max_rank in pusch configuration to match N_ANTENNA_UL for MIMO.
 
- 
                UEsim Configuration Highlights:
                - Ensure N_ANTENNA_DL and N_ANTENNA_UL match the Callbox.
- Set TDD to 0 (FDD mode).
- Band and frequency settings (band, dl_nr_arfcn, subcarrier_pacing) should mirror the Callbox.
- Set rx_to_tx_latency to be less than time_domain_offset of two_step_prach in Callbox.
 
- 
                Test Execution:
                - Verify cell configurations with cell phy and cell commands to ensure proper setup.
- Power on the UE using the power on command on UEsim (or turn on a commercial UE if used).
- Confirm initial attach and data flow using the 't' command. Specific 2-step RACH activity is verified via protocol logs.
 
- 
                Log Analysis:
                - Inspect SIB1 to verify RACH configuration via rach-ConfigCommon and pusch-ConfigCommon.
- Check msgA configuration in SIB1 for proper parameter settings.
- Analyze low-layer logs to confirm correct 2-step RACH operation: look for PRACH and PUSCH (Step 1), followed by PDCCH/PDSCH (Step 2).
 
 
- 
                Configuration:
                
The tutorial provides clear, stepwise methodologies for configuring both network and UE simulators, executing the test, and validating the results through command-line and log analysis. Special attention is given to ensuring configuration consistency and the specific requirements for 2-step RACH in an NR SA environment with FDD and UL MIMO.
Test Setup
Setup A
Test setup for this tutorial is as shown below.

Key Configuration Parameters
Followings are important configuration parameters for this tutorial. You may click on the items for the descriptions from Amarisoft documents.
- two_steps_prach : In this link, you will get the descriptions for all the items listed below.
- shared_ro
- cb_preambles_per_ssb_per_sro
- msga_pusch
- mcs
- time_domain_offset
- l_crb
- po_fdm
- rb_start
- n_symb
- dmrs_cdm_group
- dmrs_n_ports
- msga_rsrp_threshold
- msgb_response_window
- msgb_mcs
Test 1 : 2 step RACH with FDD, UL MIMO 2x2
This is to show how to configure and validate the 2 step RACH in NR SA. The duplex mode configured in this test is FDD and MIMO scheme for UL is 2x2.
Configuration
An important thing in using UE sim is to do proper matching between UE sim configuration and Call box configuration In this tutorial, I used the ue.default.cfg and and enb.default.cfg without any change
If you use other Network (e.g, other network simulator or real network), you have to make it sure to configure UE sim according to the settings on network side
I used ue-nr-sa-2step-rach.cfg which is copied from ue-nr-sa.cfg.

I used gnb-sa-2step-rach.cfg which is copied from gnb-sa.cfg.

Configuration for Callbox
The configuration in gnb-sa-2step-rach.cfg (Callbox) is set as follows.
NR_TDD is set to 0 which mean that FDD is used. N_ANTENNA_DL is set to 2 indicating that downlink MIMO is 2x2 and N_ANTENNA_UL is set to 2 indicating that uplink MIMO is 2x2. SRS is enabled by setting USE_SRS to 1 for proper UL MIMO.

Configure a FDD band and frequency as you desire. In this test, a frequency in band 7 (n7) is used.

Configure two_steps_prach parameter in nr_cell_default setting. The important settings you need to do in two_steps_prach configuration is shared_ro, msgA and msgB configurations. In msga_pusch parameter, you need to configure physical layer parameters for the PUSCH used for msgA.

In srs_resource configuration, n_ports is set to be same as N_ANTENNA_UL which is required for UL MIMO operation.

Also, max_rank in pusch configuration is set to be same as N_ANTENNA_UL for MIMO operation.

Configuration for UEsim
The configuration in ue-nr-sa-2step-rach.cfg (UEsim) is set as follows.
Set N_ANTENNA_DL and N_ANTENNA_UL to be same as the settings of Callbox. Set TDD to 0 which means FDD. Band and frequency (band, dl_nr_arfcn, subcarrier_pacing) is set to be same as the setting of callbox.
Set rx_to_tx_latency to be less than time_domain_offset of two_step_prach configuration in Callbox setting.

Perform the Test
Check out the cell configurations with 'cell phy' and 'cell' command and see if they are configured as intended.

Power on UE on UEsim with 'power on' command on UEsim(Turn on UE if you are using commercial phone) if the cell is configured as intended.

Confirm that the initial attach is established and phy data is flowing using 't' command. You cannot check anything specific about 2-step-RACH in trace log, you need to check those details in the captured protocol log.

Log Analysis
Check SIB1 of the cell and check if rach configuration is set as intended. You can check on these from rach-ConfigCommon. In addition, check on pusch-ConfigCommon since they will be used for both RACH procedure (msgB) and PUSCH after the RACH.

Then check on msgA configuration in SIB1. You can confirm about all the details from msgA-ConfigCommon IE.

Now check out the low layer log and see if the two step RACH really works. In this log, you see a pair of PRACH and PUSCH which corresponds to the Step 1 of the RACH procedure and then a pair of PDCCH/PDSCH which corresponds to Step 2 of the rach procedure.

RRC / NAS Signaling
SIB1 (SA)
: This is the SIB1 message sent by gNB  to configure parameters for NR 2 Step RACH. (
{
message c1: systemInformationBlockType1: {
cellSelectionInfo {
...
},
cellAccessRelatedInfo {
...
},
connEstFailureControl {
...
},
servingCellConfigCommon {
downlinkConfigCommon {
frequencyInfoDL {
...
},
initialDownlinkBWP {
genericParameters {
...
},
pdcch-ConfigCommon setup: {
...
},
pdsch-ConfigCommon setup: {
...
}
},
bcch-Config {
...
},
pcch-Config {
...
}
},
uplinkConfigCommon {
frequencyInfoUL {
...
},
initialUplinkBWP {
genericParameters {
...
},
rach-ConfigCommon setup: {
rach-ConfigGeneric {
prach-ConfigurationIndex 16,
msg1-FDM one,
msg1-FrequencyStart 7,
zeroCorrelationZoneConfig 15,
preambleReceivedTargetPower -110,
preambleTransMax n7,
powerRampingStep dB4,
ra-ResponseWindow sl10
},
ssb-perRACH-OccasionAndCB-PreamblesPerSSB one: n8,
ra-ContentionResolutionTimer sf64,
prach-RootSequenceIndex l839: 1,
restrictedSetConfig unrestrictedSet
},
pusch-ConfigCommon setup: {
...
},
pucch-ConfigCommon setup: {
...
},
msgA-ConfigCommon-r16 setup: {
rach-ConfigCommonTwoStepRA-r16 {
rach-ConfigGenericTwoStepRA-r16 {
msgB-ResponseWindow-r16 sl40
},
msgA-CB-PreamblesPerSSB-PerSharedRO-r16 16,
msgA-RSRP-Threshold-r16 56
},
msgA-PUSCH-Config-r16 {
msgA-PUSCH-ResourceGroupA-r16 {
msgA-MCS-r16 5,
nrofSlotsMsgA-PUSCH-r16 1,
nrofMsgA-PO-PerSlot-r16 one,
msgA-PUSCH-TimeDomainOffset-r16 4,
startSymbolAndLengthMsgA-PO-r16 27,
mappingTypeMsgA-PUSCH-r16 typeA,
guardBandMsgA-PUSCH-r16 0,
frequencyStartMsgA-PUSCH-r16 7,
nrofPRBs-PerMsgA-PO-r16 1,
nrofMsgA-PO-FDM-r16 four,
msgA-DMRS-Config-r16 {
msgA-PUSCH-NrofPorts-r16 1
},
nrofDMRS-Sequences-r16 1
},
msgA-TransformPrecoder-r16 disabled
}
}
},
timeAlignmentTimerCommon infinity
},
ssb-PositionsInBurst {
inOneGroup '80'H
},
...
},
ue-TimersAndConstants {
...
}
}
}