INITIAL ACCESS · TS 38.213 §8

5G RACH Procedure — 4-Step and 2-Step Random Access

RACH is how a UE first reaches the gNB after cell search. NR redesigned RACH from LTE: shorter preamble formats, optional 2-step procedure, and tight integration with mmWave beam management. This guide walks the entire procedure step-by-step.

📚 Want to go deeper? Every concept here — and 90+ more — is covered with cinematic SVG animations and audio narration in our flagship course. Enroll · $29 lifetime →

Step 0 · Preamble Selection

UE picks a PRACH preamble. For contention-based: random selection from a pool. For contention-free: gNB pre-assigned (used in handover, BFR). For mmWave: each preamble is associated with an SSB index, enabling per-beam access.

Step 1 · Msg1 = Preamble

UE transmits the Zadoff-Chu sequence on the configured PRACH occasion. The gNB detects the preamble; from the timing offset it computes T_TA. From the cyclic shift / sequence it derives RA-RNTI.

Step 2 · Msg2 = RAR

gNB sends Random Access Response on PDSCH (PDCCH scrambled with RA-RNTI). RAR contains: detected preamble ID, T_TA command, UL grant for Msg3, temp-CRNTI, BI (back-off indicator).

Step 3 · Msg3 = RRC Connection Request (or Resume)

UE transmits on the granted PUSCH using temp-CRNTI. Carries the RRC message (connection request / setup / re-establishment) and contention resolution ID.

Step 4 · Msg4 = Contention Resolution

gNB echoes back the contention resolution ID on PDSCH. UE that sees its own ID wins the contention; others back off and retry.

2-Step RACH (Rel-16)

MsgA = preamble + Msg3 PUSCH bundled (small payload, e.g., RRC Resume). MsgB = RAR + contention resolution combined. Half the latency of 4-step. Used for SDT (small data transfer) and fast handover.

Contention-Based vs Contention-Free

Contention-based: UE picks any preamble — collisions resolved via Msg4. Contention-free: gNB assigns a UE-specific preamble (handover or BFR) — no collision possible.

Timing Advance Derivation

gNB measures preamble arrival time vs expected; T_TA = 16·64 · 2^-μ · N_TA · T_c. UE applies T_TA to all subsequent uplinks, keeping UL frames aligned at the gNB.

Frequently Asked Questions

What is the difference between 4-step and 2-step RACH?

4-step: preamble → RAR → Msg3 → Msg4 (contention resolution). 2-step: MsgA (preamble + Msg3) → MsgB (RAR + contention resolution). 2-step halves the round-trips.

When is contention-free RACH used?

For handover (target gNB pre-assigns preamble to incoming UE) and beam-failure recovery (gNB pre-assigns BFR preamble to anchor UE). Contention is impossible.

What is RA-RNTI?

Random Access RNTI — temporary identifier the gNB uses to scramble RAR's PDCCH. Computed from the time-frequency-domain location of the PRACH occasion.