Msg2-Random Access Response (RAR) Process in 5G NR RACH
Msg2-Random Access Response (RAR) Process in 5G NR RACH
The Random Access (RA) procedure in 5G New Radio (NR) is a fundamental process that enables a UE to establish initial access to the network or regain synchronization when the radio link quality deteriorates. The second message in this procedure, the Random Access Response (RAR), is critical for assigning initial resources to the UE and synchronizing its uplink transmissions.
"Overview of the Random Access Channel (RACH) procedure in 5G NR."
This post provides a detailed explanation of the Msg2-RAR process in 5G NR.
Overview of the Random Access Procedure
The Random Access procedure is initiated by the UE when it needs to access the network. This can occur during:
- Initial Access: When a UE powers on or is out of coverage and needs to connect to the network.
- RRC Re-establishment: When the UE loses connection with the network and attempts to restore it.
- Handover: When the UE is handed over to a new cell.
- Uplink Data Transmission: When the UE has data to send but no uplink resources are allocated.
The RA procedure consists of four messages:
- Msg1: Preamble Transmission (PRACH)
- Msg2: Random Access Response (RAR)
- Msg3: RRC Setup/Connection Establishment
- Msg4: RRC Setup Complete/Connection Establishment Complete
This post focuses on Msg2, the Random Access Response.
What is Msg2-Random Access Response (RAR)?
Msg2, or the Random Access Response (RAR), is transmitted by the gNB (base station) in response to a successful preamble detection from the UE. It is a downlink message that contains critical information for the UE, including:
- Uplink Resource Allocation: Temporary C-RNTI (Cell Radio Network Temporary Identifier) and UL-GUTI (Uplink Generic User Equipment Identifier) for identification.
- Timing Advance: Adjustment needed for the UE's uplink transmission timing.
- Power Control: Initial power level for the UE's uplink transmissions.
- Backoff Indicator: Delay before retransmitting if the preamble was not detected.
Key Characteristics of RAR
- Transmission Medium: RAR is transmitted on the Physical Downlink Shared Channel (PDSCH).
- Detection: The UE detects RAR by monitoring the Physical Downlink Control Channel (PDCCH) for scheduling information.
- RNTI Masking: RAR messages are masked with a specific RNTI to ensure only the intended UE processes them.
The RAR Window in 5G NR
The RAR window defines the time interval during which the gNB expects to receive a preamble from the UE and the time interval during which the UE expects to receive the RAR in response.
RAR Window Size
The RAR window size is configurable by the network and is signaled to the UE via the randomAccessWindowLength parameter in the RACH-ConfigCommon or RACH-ConfigDedicated IE.
randomAccessWindowLength | RAR Window Size (Slots) | RAR Window Duration (ms) |
|---|---|---|
oneT | 1 | 0.5 |
twoT | 2 | 1.0 |
fourT | 4 | 2.0 |
eightT | 8 | 4.0 |
Note: The duration depends on the slot duration, which varies with the numerology (e.g., 1 ms for 15 kHz SCS, 0.5 ms for 30 kHz SCS).
RAR Window Timing
The RAR window starts at the end of the PRACH occasion (Msg1 transmission) and lasts for the duration specified by randomAccessWindowLength.
- Start Time: The RAR window begins at the end of the PRACH occasion where the preamble was transmitted.
- End Time: The window ends after the specified number of slots.
- UE Expectation: The UE expects to receive the RAR within this window. If no RAR is received, the UE will retransmit the preamble (up to the maximum number of attempts).
RNTI Masking for RAR Detection
The gNB masks the RAR messages with a specific Random Access Radio Network Temporary Identifier (RA-RNTI) to ensure that only the UE that transmitted the preamble processes the response.
RA-RNTI Calculation
The RA-RNTI is calculated based on the PRACH occasion (frequency and time resources) used by the UE for Msg1 transmission.
RA-RNTI = 1 + scrambled_ID mod 65537
Where:
scrambled_IDis derived from the PRACH preamble index (0 to 63) and the frequency domain resource used for transmission.- The scrambling is performed using a cell-specific scrambling sequence.
RNTI Masking Process
- UE Transmits Preamble: The UE selects a PRACH preamble and transmits it on a specific frequency domain resource within a PRACH occasion.
- gNB Detects Preamble: The gNB detects the preamble and identifies the PRACH preamble index and frequency domain resource used.
- gNB Calculates RA-RNTI: The gNB calculates the RA-RNTI corresponding to that specific PRACH occasion.
- gNB Masks RAR: The gNB masks the RAR message with the calculated RA-RNTI.
- UE Monitors PDCCH: The UE monitors the PDCCH for scheduling information using the calculated RA-RNTI.
- UE Detects RAR: If the UE detects a PDCCH message with its RA-RNTI, it knows that a RAR is available for decoding.
Why RNTI Masking is Important
- Collision Avoidance: Multiple UEs may transmit preambles simultaneously. RNTI masking ensures that each UE only processes its own response.
- Efficient Detection: The UE only needs to monitor PDCCH for its specific RA-RNTI, reducing processing overhead.
- Security: Masking provides a basic level of security by ensuring that only the intended recipient can decode the RAR.
RAR Content and UE Actions
The RAR message contains several fields that provide the UE with the necessary information to complete the random access procedure.
Key Fields in RAR
| Field | Description | UE Action |
|---|---|---|
| Random Access Preamble Identifier | Identifies which preamble was detected | Used to confirm successful detection |
| Timing Advance Command | Adjustment needed for UL timing | UE adjusts its transmission timing |
| UL Grant | Temporary UL resource allocation | UE schedules its Msg3 transmission |
| Temporary C-RNTI | Temporary identifier for the UE | Used for initial communication |
| Backoff Indicator | Delay before retransmission | UE waits for the specified duration |
UE Actions Upon Receiving RAR
- Verify Preamble: The UE checks if the Random Access Preamble Identifier in the RAR matches the preamble it transmitted.
- Apply Timing Advance: If a timing advance command is present, the UE adjusts its uplink transmission timing to synchronize with the gNB.
- Schedule Msg3: The UE uses the UL grant to schedule its Msg3 transmission (RRC Setup/Connection Establishment).
- Store Temporary C-RNTI: The UE stores the temporary C-RNTI for use in subsequent messages.
- Check Backoff Indicator: If a backoff indicator is present, the UE waits for the specified duration before retransmitting (if no RAR was received).
RAR Transmission Timing
The timing of RAR transmission is critical for the success of the random access procedure. The gNB must transmit the RAR within the RAR window, starting from the end of the PRACH occasion.
Timing Advance Command Calculation
The timing advance command in the RAR is calculated based on the propagation delay between the UE and the gNB. The gNB measures the arrival time of the preamble and determines the necessary adjustment to ensure that the UE's subsequent uplink transmissions (Msg3) arrive at the gNB within the cyclic prefix of the target symbol.
N_TA = T_A × 16 × 64 / 2^μ
 "Common failure scenarios during the Msg2-RAR reception phase."
Further Reading
- 5G NR RACH Trigger Reasons with Details
- Common Causes of MSG2 RACH Failure
- RACH Failure reasons in 5G-NR
- Scheduling Request in 5G-NR
Interactive Tools
WirelessBrew Team
Technical expert at WirelessBrew, specializing in 5G NR, LTE, and wireless system optimization. Committed to providing accurate, 3GPP-compliant engineering tools.
Up Next
More 5g nr Articles →