RA-RNTI — finding the RAR on PDCCH
The gNB does not send the RAR directly to the UE — it doesn't know the UE's identity yet. Instead, the RAR is addressed to an RA-RNTI derived from the PRACH occasion parameters. Any UE that transmitted in that occasion will monitor for this RA-RNTI.
RA-RNTI = 1 + s_id + 14·t_id + 14·80·f_id + 14·80·8·ul_carrier_id
where s_id is the index of the first OFDM symbol of the PRACH occasion, t_id is the index of the first slot of the PRACH occasion in a system frame, f_id is the index of the PRACH occasion in the frequency domain, and ul_carrier_id is the uplink carrier used.
// Our PRACH occasion parameters: s_id = 0 (first OFDM symbol of PRACH = symbol 0) t_id = 0 (first slot of the PRACH subframe = slot 0) f_id = 0 (only 1 PRACH occasion in freq, msg1-FDM=1) ul_carrier_id = 0 (normal uplink carrier) // Calculation: RA-RNTI = 1 + 0 + 14×0 + 14×80×0 + 14×80×8×0 = 1 // UE monitors PDCCH for DCI 1_0 with CRC masked by RA-RNTI = 0x0001 // Within the RAR window: slots 2+1 to 2+10 = slots 3..12 // (Msg1 was in slot 2, ra-ResponseWindow = sl10)
RAR window — when to look
After sending Msg1 in slot 2, the UE opens a RAR window lasting ra-ResponseWindow = sl10 = 10 slots = 5 ms. During this window, the UE monitors the PDCCH (using the initial DL BWP CORESET) for the RA-RNTI. If no RAR is found within the window, the attempt is considered failed.
RAR contents — MAC subPDU structure
The RAR is carried in a MAC PDU that can contain multiple sub-headers and sub-PDUs — one per preamble detected by the gNB. Each sub-PDU contains one RAR, identifying which preamble it responds to and providing the resources for Msg3.
// MAC subheader: RAPID = 27 ← Random Access Preamble IDentifier // (UE matches RAPID=27 against the preamble index it sent) // RAR payload (6 bytes = 48 bits): Timing Advance Command (12 bits) = 31 // TA = 31 → actual advance = 31 × 16 × T_s = 31 × 16 / 30.72MHz ≈ 16.1 μs // Meaning: UE must start transmitting 16.1 μs earlier than it currently does UL Grant (27 bits): Frequency resource = RBs 0–5 ← 6 RBs for Msg3 PUSCH Time resource = row 3 ← slot offset + symbol allocation MCS = 4 ← QPSK, low rate — conservative TPC command = 0 dB ← no power adjustment yet Temporary C-RNTI (16 bits) = 0x3A7F // Temporary identity used for Msg3 and contention resolution
Timing Advance — what it means physically
The gNB measured that the UE's preamble arrived 16.1 μs late relative to the uplink timing reference. This corresponds to a one-way propagation delay of ~8 μs, meaning the UE is approximately 8 μs × 3×10⁸ m/s = 2.4 km from the gNB.
By advancing its transmit timing by 16.1 μs, the UE compensates for both the uplink and downlink propagation delays, ensuring its signal arrives at the gNB in the correct timing window.
After receiving the RAR
When the UE successfully decodes the RAR and finds its RAPID (=27), it: