5G-NR RACH Procedure in detail
The Random-Access Channel (RACH) Procedure in 5G networks is essential for
synchronizing a UE with the gNB for initial uplink access or during other events
requiring re-synchronization.
The RACH procedure enables UEs to initiate communication with the network and
establish timing alignment for uplink transmission. RACH operates on the Physical
Random-Access Channel (PRACH), where UEs send a RACH preamble to request
resources and initiate synchronization.
Why RACH?
RACH is essential in 5G NR for several reasons:
▪ Initial Access: When a UE is first powered on, it uses RACH to establish
communication with the gNB. Without this step, the UE cannot join the
network.
▪ Uplink Synchronization: RACH helps in aligning the UE’s timing to the
network’s, enabling efficient uplink communication.
▪ Mobility Support: During handovers or beam failures, the UE may need to
resynchronize with a new gNB or beam; RACH facilitates this process.
▪ Efficient Resource Allocation: By allowing the UE to communicate its
presence and request resources, RACH helps the gNB allocate resources
accurately, avoiding unnecessary interference.
When is RACH Triggered?
RACH can be triggered in various scenarios within 5G NR networks:
▪ Initial Access from RRC_IDLE: When a UE first joins the network or
reestablishes a connection.
▪ RRC Connection Re-establishment: If the UE loses connection and needs to
reestablish its link.
▪ Handover: During mobility events, the UE may need to transition to a new cell
or beam, requiring re-synchronization.
▪ Out-of-Sync in RRC_CONNECTED: If the uplink or downlink synchronization
is lost while the UE is already connected, RACH is triggered to re-sync.
[Link]
▪ Beam Failure Recovery: If the current beam degrades due to signal loss or
blockage, RACH enables the UE to find a new beam to connect to the gNB.
▪ Transition from RRC_INACTIVE: When the UE transitions from an inactive
state to an active connection, requiring re-synchronization with the gNB.
▪ Time Alignment for SCell Addition: When adding a Secondary Cell (SCell) in
carrier aggregation, RACH is used to establish timing alignment for the new
cell.
▪ Request for Other System Information (SI): When the UE requests
additional system information beyond what is provided in the initial connection.
Types of RACH Procedure
There are two types of RACH procedures in 5G:
Contention-Based Random Access (CBRA)
Multiple UEs can initiate the same preamble, which might lead to contention, and a
contention resolution is performed.
When a UE wants to access the network, it transmits a specific signal, known as a
PRACH Preamble. This preamble acts like a "signature" to identify the UE’s access
request. Each cell has 64 unique preamble signatures available, and each UE
randomly picks one.
Since multiple UEs may pick the same preamble at the same time, there is a chance
of collision or contention. When contention happens, the network must perform
additional steps to resolve which UE will gain access.
[Link]
Steps in the Contention-Based RACH Procedure
This process generally involves four steps, as follows:
1. UE → Network: RACH Preamble Transmission (Step 1 - Msg1)
▪ The UE randomly selects a preamble and transmits it to the network on
the Physical Random-Access Channel (PRACH).
▪ The network receives this request but doesn’t yet know if multiple UEs
used the same preamble.
▪ Beam and Preamble: During synchronization, the UE finds a suitable beam
and initiates random access by sending a RACH preamble identified by a
Random-Access Preamble ID (RAPID) using a Zadoff-Chu sequence.
▪ Preamble Selection: The UE selects a preamble from the CBRA pool based
on totalNumberOfRA-Preambles or contention-based preambles linked to the
SS/PBCH block.
▪ SSB and System Info: The UE receives SSB, measures RSRP across beams,
picks one, and retrieves system information.
▪ RMSI for PRACH Configuration: In standalone or NSA scenarios, RMSI
provides PRACH configuration, including time-frequency resources and
preamble format.
RA-RNTI Calculation and Transmission
➢ s_id: Index of the first OFDM symbol in PRACH (0 to 13).
➢ t_id: Index of the first slot in PRACH within a system frame (0 to 79).
➢ f_id: Index of the PRACH in the frequency domain (0 to 7).
➢ ul_carrier_id: UL carrier for Msg1 transmission (0 for NUL, 1 for SUL).
• RA-RNTI Calculation: The UE calculates an RA-RNTI for Msg1 transmission if
conditions are met.
• Transmission and Power: The UE calculates transmission power and sends
the preamble.
• Frequency and Time Domain Setup: PRACH preamble frequency and time
locations are determined by msg1-FDM, msg1-FrequencyStart, and prach-
ConfigurationIndex.
[Link]
• RA-RNTI and PDCCH: The gNB calculates RA-RNTI based on the PRACH
occasion for addressing the UE on PDCCH.
• MAC Layer Role: MAC instructs the physical layer for PRACH transmission
using specified resources and RA-RNTI.
2. Network → UE: Random Access Response (Step 2 - Msg2)
▪ The network replies with a Random-Access Response (RAR), which
includes:
✓ Timing Advance: Helps the UE synchronize its transmission
timing with the network.
✓ Temporary C-RNTI: A temporary identifier to help distinguish
between UEs during further steps.
✓ Uplink Grant: Resources allocated for the UE’s next message.
▪ If multiple UEs used the same preamble, they all receive this RAR
message and move to the next step using the same resources.
➢ After sending the Random Access (RA) preamble, the UE waits for an
acknowledgment from the gNB via the Random-Access Response (RAR).
➢ The UE checks for RAR within a window (ra-ResponseWindow), specifically
looking for a DCI format 1_0 with CRC scrambled by RA-RNTI or C-RNTI.
➢ RAR Window: Configured by rar-WindowLength IE in a SIB message or in
rrcReconfiguration for contention-free RACH.
➢ ra-ResponseWindow: Sourced from RACH-ConfigCommon, indicating
when the UE should monitor for RAR on the PDCCH.
➢ If RAR includes a MAC subPDU with a matching RAPID (Random Access
Preamble Identifier), the UE considers the RAR successful.
RAR Content (if not initiated for "SI request"):
• RAPID: Identifies the RA preamble received by the network.
• Timing Advance Command: Adjusts the UE’s timing for uplink.
• UL Grant: Grants uplink resources for Msg3.
• Temporary C-RNTI: A temporary identifier for UE communication with
gNB.
Upon successful decoding of PDCCH, the UE reads the PDSCH carrying RAR
data.
[Link]
3. UE → Network: L2/L3 Message Transmission (Step 3 - Msg3)
▪ Each UE sends its unique Layer 2 or Layer 3 (L2/L3) message on the
allocated resources. This message can include information like
connection requests or initial registration details.
▪ If two or more UEs are using the same resources (due to contention),
their signals may interfere with each other, potentially causing the
network to fail in decoding any of the messages.
➢ For Contention-Based RACH (CBRA):
• UE sends Msg3 on the PUSCH using the uplink grant from the MAC
RAR.
• UE includes its identity in Msg3 to aid in contention resolution.
• A Temporary C-RNTI is used for Msg3 transmission.
➢ Msg3 Content Varies:
• Case 1: If UE already has a C-RNTI (e.g., in RRC_CONNECTED state):
▪ RA Initiated for Beam Failure Recovery (BFR): UE includes C-
RNTI MAC CE in Msg3.
▪ RA Initiated by PDCCH Order: If preamble ID in PDCCH is
0b0000000, UE includes C-RNTI MAC CE.
▪ RA Initiated by MAC or RRC:
✓ During CBRA in synchronized RRC reconfiguration (e.g.,
handover), UE includes RRCReconfigurationComplete in
Msg3.
✓ If SR (Scheduling Request) is not configured, has failed,
or if uplink is Out-of-Sync, UE may include Buffer Status
Report (BSR) in Msg3 for uplink resource requests.
4. Network → UE: Contention Resolution (Step 4 - Msg4)
▪ The network processes the received messages:
✓ If it successfully decodes a message from only one UE, it sends
a confirmation message to that UE. The successful UE receives a
HARQ ACK (Hybrid Automatic Repeat Request
Acknowledgement), which indicates it has successfully accessed
the network.
✓ If both messages collide and cannot be decoded, no UE receives
the HARQ ACK, and they both restart the process.
[Link]
✓ In some cases, if the network decodes multiple messages, it can
send additional steps to handle the conflict.
Case 1: UE with C-RNTI:
▪ If the UE already has a C-RNTI, the network resolves contention by addressing
the UE’s C-RNTI on the PDCCH.
▪ The UE considers the RA process successful, discards Temporary C-RNTI,
and no explicit contention resolution message is required.
▪ If no PDCCH addressed to C-RNTI is detected during the ra-
ContentionResolutionTimer, the UE assumes contention resolution failed.
Case 2: UE without C-RNTI:
▪ If the UE doesn’t have a valid C-RNTI, the gNB sends Msg4 with a “UE
Contention Resolution Identity” using Temporary C-RNTI.
▪ This identity is checked against the UE’s transmitted identity. If it matches,
contention resolution is successful.
▪ If contention resolution succeeds (except for SI requests), the UE promotes
Temporary C-RNTI to C-RNTI.
▪ If no resolution identity is received within the timer, the UE retries the RA
procedure by discarding Temporary C-RNTI and starting over.
Contention-Free Random Access (CFRA)
Specific RACH preambles are assigned to individual UEs by the network, reducing
collision chances and eliminating contention.
In specific cases, such as during a handover, the network needs to ensure there is no
contention. Here’s how the non-contention RACH procedure works:
1. UE Preparation: The network assigns a specific preamble to the UE, ensuring
no other UEs will use the same preamble, eliminating any risk of collision.
2. RACH Preamble Transmission: The UE transmits the preamble on the
PRACH.
[Link]
3. Network Response: The network responds with the RAR message, which
includes timing advance, a unique identifier (C-RNTI), and uplink grant
information.
Since each UE is assigned a unique preamble, no contention resolution is necessary
in this method. This approach is typically used when the network anticipates uplink
data, such as during handovers or high-priority situations.
What is a Preamble?
In the context of 5G NR), a preamble is a unique sequence used by the User
Equipment (UE) to initiate communication with the network by requesting access to
the gNB. The preamble acts as a form of identity and helps the gNB identify and
allocate resources to individual UEs attempting access. In 5G NR, the PRACH is used
to transmit these preambles, which are generated based on specific sequence
designs.
Preamble Structure
A 5G NR preamble is divided into two main parts:
• Cyclic Prefix (CP): A guard interval at the start of the preamble to prevent
inter-symbol interference.
• Preamble Sequence: The unique sequence based on a Zadoff–Chu (ZC)
design, optimized for high detection accuracy and minimal interference.
[Link]
The cyclic prefix length, sequence length, guard period, and number of repetitions
vary based on the preamble format, which is selected based on the cell’s radius,
speed of UE movement, and other conditions.
Preamble Format in 5G NR
Preambles in 5G NR are categorized into two main types to address different network
conditions and cell sizes:
▪ Long Sequence Preambles
▪ Short Sequence Preambles
These preamble formats vary in terms of sequence length, bandwidth, subcarrier
spacing, and application, allowing 5G networks to adapt to both small and large cell
environments.
Long Sequence Preambles
Long Sequence Preambles are typically used in larger cells where coverage range is
crucial. They are derived from a root sequence with a length of 839 symbols. The
main formats under long sequence preambles are Format 0, Format 1, Format 2, and
Format 3.
[Link]
▪ Format 0 and Format 1:
• Subcarrier Spacing: Both use a subcarrier spacing of 1.25 kHz.
• Bandwidth: The occupied bandwidth is 1.08 MHz.
• Applications: These are suitable for both low-speed UEs and cells with
wide coverage areas (Format 1 supports larger cells with a sequence
duration of 3 ms).
▪ Format 3:
• Subcarrier Spacing: This uses a wider subcarrier spacing of 5 kHz.
• Bandwidth: The occupied bandwidth increases to 4.32 MHz.
• Applications: Format 3 is optimal for high-speed UEs due to the higher
subcarrier spacing, which supports a shorter transmission time and
reduces delay in fast-moving environments.
These formats can also support restricted sets (Type A and Type B), which are
configurations used to mitigate Doppler shift effects, particularly in high-mobility
scenarios.
[Link]
Short Sequence Preambles
Short Sequence Preambles are derived from a root sequence of 139 symbols,
making them suitable for small cell environments or high-density deployments. These
are categorized as Formats A1, A2, A3, B1, B2, B3, B4, C0, and C2. Each format
within short sequences has its specific properties to suit various small cell scenarios
and beam management needs.
▪ Subcarrier Spacing: Short sequence preambles offer higher subcarrier
spacing options of 15 kHz, 30 kHz, 60 kHz, and 120 kHz.
▪ Applications: These formats are optimized for compact cells, providing
flexibility in high-density areas or for small cells deployed in urban
environments where shorter sequences and higher subcarrier spacing are
advantageous for managing interference and maintaining signal quality.
[Link]
Long Preamble
Short Preamble
PRACH Config Index
The PRACH Configuration Index is a parameter used in 5G NR to determine when
and how the PRACH sequences are transmitted in the time domain. It specifies
various aspects of the PRACH operation, such as the timing, duration, and frequency
of the PRACH transmission occasions. The purpose of PRACH Configuration Index is
to guide the UE on when to send a random-access preamble, ensuring proper
synchronization with the gNB.
The process of generating the PRACH time-domain sequence includes these steps:
▪ Frequency Domain Data Generation: A frequency-domain sequence is
created based on subcarrier spacing and preamble format.
[Link]
▪ IFFT Transformation: This sequence is converted to the time domain using
IFFT, enabling transmission over the air.
▪ Complex Equation: The equation for this sequence, detailed in 3GPP TS
38.211, Section 5.3.2, is complex, but not every term is essential for practical
understanding.
▪ Key Parameters: Important factors like preamble format, cyclic prefix length,
and guard time shape the PRACH transmission structure, while smaller
parameters are often omitted in simplified explanations.
Random access configurations for FR1 and paired spectrum/supplementary
uplink.
RACH Configuration Index settings, which control the timing and structure of PRACH
transmissions in 5G NR:
• PRACH Configuration Index: Determines the specific PRACH setup for time
and frequency resources.
• Preamble Format: Defines the PRACH preamble structure and timing, with
Format 0 shown here.
• nSFN mod x=y: Specifies that PRACH occurs only when the System Frame
Number (SFN) modulo x=16 equals y=1.
• Subframe Number: Indicates the subframe in which the PRACH transmission
is scheduled.
• Starting Symbol: Shows the starting OFDM symbol; here, PRACH begins at
symbol 0 in each subframe.
• Number of PRACH Slots within a Subframe: Indicates the count of PRACH
slots in a subframe; a dash (–) means not applicable.
• Number of Time-Domain PRACH Occasions within a PRACH Slot: Shows
PRACH occasions per slot; a dash (–) indicates none for these configurations.
• PRACH Duration: Specifies PRACH duration in OFDM symbols, with 0
indicating no additional duration.
[Link]
Example 1: PRACH Config Index 21
For PRACH Configuration Index 21, let’s calculate the starting symbol index l using
the formula:
Note l = starting symbol index for the PRACH transmission within the subframe
From the configuration and the table, we know:
• Subframe Number: 3 and 8 (PRACH transmissions can happen in these
subframes).
• Starting Symbol ( l0 ): 0 (PRACH starts at the beginning of the subframe).
• Number of PRACH Slots within a Subframe: Slots 3 and 8.
• Duration (NRA,dur ): 0 (no extra duration beyond the slot timing).
Now, let's calculate l for each PRACH slot within the designated subframes (3 and 8).
Calculation of l for Each PRACH Slot
[Link]
1. For Slot 3 in Subframe 3:
l=0+0+14×3+0=42
2. For Slot 8 in Subframe 8:
l=0+0+14×8+0=112
For PRACH Configuration Index 21:
• In Subframe 3, using PRACH Slot 3, the starting symbol index l is 42.
• In Subframe 8, using PRACH Slot 8, the starting symbol index l is 112.
Example 2: PRACH Config Index 87
▪ Preamble Format A1: This format is commonly used for PRACH with a specific
duration and bandwidth requirement, compatible with higher frequencies.
▪ Starting Symbol (0): Indicates that the PRACH starts at the very beginning of
the designated subframe.
▪ Subframe Numbers (4, 9): PRACH occasions occur in subframes 4 and 9,
meaning that within each radio frame, PRACH transmissions are scheduled at
these subframes.
▪ Number of PRACH Slots within a Subframe (1): Only one slot is available
within each of these subframes for PRACH.
[Link]
▪ Number of Time-Domain PRACH Occasions within a PRACH Slot (6): This
means there are 6 distinct PRACH transmission opportunities within each
PRACH slot in these subframes.
▪ PRACH Duration (2): This duration refers to the length of the PRACH
transmission, calculated in milliseconds or symbols based on the
configuration.
Calculation of PRACH Occasions per Frame
Since each frame has two subframes (4 and 9) allocated for PRACH, and each
subframe provides 1 slot with 6 PRACH occasions, the total PRACH occasions per
frame are calculated as follows:
Total PRACH Occasions per Frame= (PRACH Slots per Subframe) ×
(PRACH Occasions per Slot) ×(Number of Subframes)
Substitute values:
PRACH Occasions per Frame=1×6×2=12
Thus, there are 12 PRACH occasions per frame for PRACH Configuration Index 87.
[Link]
Random access configurations for FR1 and paired spectrum/supplementary uplink.
[Link]
[Link]
[Link]
[Link]
zeroCorrelationZoneConfig and Ncs
Ensures collision-free PRACH preambles, allowing multiple UEs to access the
network simultaneously. Minimizes interference, leading to reliable preamble
detection by the network.
▪ zeroCorrelationZoneConfig:
• A parameter set by the network in the RRC message to define the minimum
correlation separation needed between preamble sequences.
• It determines the cyclic shift amount (Ncs) required to minimize interference
between UEs.
▪ Ncs (Cyclic Shift Length):
• The cyclic shift applied to the base preamble sequence, calculated based on
zeroCorrelationZoneConfig.
• Ensures that each UE has a unique PRACH preamble by separating
sequences to avoid collisions.
▪ Relationship between zeroCorrelationZoneConfig and Ncs:
• Ncs is derived by looking up zeroCorrelationZoneConfig in mapping tables
(e.g., Table [Link]-5 and Table [Link]-6) for Long Sequence RACH
Preambles.
• A higher zeroCorrelationZoneConfig results in a larger Ncs value, increasing
sequence separation and reducing interference.
[Link]
Root Sequence Index
Root Sequence Index is used to generate PRACH preambles. This index determines
the base sequence from which UEs derive their unique preamble sequences by
applying cyclic shifts.
▪ In both LTE and NR, the Root Sequence Index selects a specific base
sequence for PRACH preambles.
▪ NR uses different numbering systems at the RRC layer and the Physical layer
for this index.
▪ The RRC layer assigns the PRACHRootSequenceIndex to each UE, which
needs to be translated into a sequence number (u) at the Physical layer.
[Link]
▪ Table [Link]-3 in 3GPP 38.211 defines the mapping between
PRACHRootSequenceIndex (i) and sequence number (u) for NR preamble
formats with L_RA = 839 (long sequence length).
▪ For L_RA = 1151, a separate mapping table (defined in 3GPP 38.211, Table
[Link]-4) is used to convert PRACHRootSequenceIndex (i) from the RRC
layer to sequence number (u) at the Physical layer.
▪ This mapping ensures consistency between the logical (RRC) and physical
layers in PRACH preamble generation, allowing the network to properly
identify and decode the UE’s preamble.
▪ Both L_RA = 839 and L_RA = 1151 use similar mechanisms but have distinct
tables for mapping PRACHRootSequenceIndex to sequence numbers, as
defined in 3GPP 38.211.
▪ Likewise L_RA 139 and 571 also there
[Link]
[Link]
Long vs Short PRACH Sequences: Role of
zeroCorrelationZoneConfig and Cyclic Shift (Ncs)
Unlike LTE, where a single sequence length is used, NR supports two types of
sequence lengths for PRACH: Long Sequence and Short Sequence. These
sequences serve different deployment scenarios, and each is influenced by
parameters like zeroCorrelationZoneConfig and Ncs.
▪ Long Sequences target large cells, while Short Sequences are optimized for
smaller cells and indoor environments.
▪ zeroCorrelationZoneConfig and Ncs parameters define cyclic shifts and
restricted sets, ensuring collision-free PRACH access and better signal
detection across UEs.
Long Sequence (L_RA = 839):
▪ Length: 839
▪ Preamble Formats: Four, based on LTE preamble formats, for large cell
deployments.
▪ Deployment: Only in FR1 with subcarrier spacings of 1.25 kHz or 5 kHz.
▪ zeroCorrelationZoneConfig and Ncs: Used to define restricted sets,
minimizing interference and optimizing unique cyclic shifts for each UE.
[Link]
Short Sequence (L_RA = 139):
▪ Length: 139
▪ Preamble Formats: Nine, introduced in NR for smaller cells, normal cells, and
indoor deployments.
▪ Deployment: Usable in both FR1 (15 or 30 kHz) and FR2 (60 or 120 kHz).
RACH Occasion in 5G NR
In 5G NR, a RACH Occasion (RO) is a specific time-frequency resource block
allocated for receiving PRACH preambles from UEs. The concept of RACH Occasion
is more complex in NR compared to LTE due to the use of multiple beams and the
mapping of Sync Signal Blocks (SSB) to RACH occasions.
▪ An area in both time and frequency where the network listens for RACH
preambles from UEs.
▪ In NR, multiple RACH occasions can exist to correspond with different beams.
[Link]
▪ SSBs are transmitted by the gNB (5G base station) with specific beams,
allowing UEs to choose the strongest beam.
▪ When a UE selects an SSB, it sends its PRACH preamble in a specific RACH
Occasion mapped to that SSB, helping the network identify the chosen beam.
▪ msg1-FDM: Specifies the number of RACH occasions allocated in the
frequency domain within a single time slot.
▪ ssb-perRACH-OccasionAndCB-PreamblesPerSSB: Determines the number
of SSBs mapped to each RACH Occasion and the number of unique preamble
indices assigned per SSB.
Mapping Logic:
The RACH preambles are organized based on a specific order as outlined in 3GPP
38.213 - Section 8.1:
• Preamble Indexes: Start with the lowest preamble index within each
RACH occasion.
• Frequency Resources: Increase the frequency index if multiple RACH
occasions exist in the frequency domain.
• Time Resources: Proceed with time indexing for RACH occasions
within the same slot.
• PRACH Slots: Increase the slot index in case of multiple PRACH slots.
[Link]
[Link]