Random Access

Msg1 —
The preamble transmission

Msg1 is the UE's first uplink transmission. It sends a Zadoff-Chu preamble sequence on a PRACH resource linked to the beam it received. The preamble is chosen at random from 64 available sequences. The gNB uses the received preamble to measure the UE's timing offset and compute the Timing Advance.

TS 38.211 §6.3.3 TS 38.213 §8.1 TS 38.321 §5.1.2

Zadoff-Chu preamble sequences

PRACH preambles are generated from Zadoff-Chu (ZC) sequences — complex exponential sequences with constant amplitude and ideal cyclic autocorrelation properties. They are ideal for timing estimation because their autocorrelation has a single sharp peak at zero lag and zero everywhere else.

The PRACH preamble sequence x_u,v(n) is generated according to:

x_u,v(n) = x_u((n + C_v) mod L_RA)

where x_u(n) = e^(−jπun(n+1)/L_RA) is a Zadoff-Chu sequence of length L_RA with root index u.
3GPP TS 38.211, Section 6.3.3.1, Equation 6.3.3.1-2

For preamble format 0 (our prach-ConfigIndex=16): L_RA = 839 (long preamble). Different root indices u and cyclic shifts C_v generate the 64 preambles assigned to this cell.

Preamble generation — format 0, root u=22TS 38.211 §6.3.3.1
// ZC sequence length (format 0):
L_RA = 839

// Root ZC sequence (root index u=22, for example):
x_22(n) = e^(−jπ×22×n×(n+1)/839),  n = 0, 1, ..., 838

// First 4 values (complex exponentials on unit circle):
x_22(0) = e^(0)              = 1.000 + 0.000j
x_22(1) = e^(−jπ×44/839)    = 0.9930.163j
x_22(2) = e^(−jπ×132/839)   = 0.9720.236j
x_22(3) = e^(−jπ×264/839)   = 0.8970.442j

// Preamble i (0..63): cyclic shift of root sequence
x_u,i(n) = x_22((n + i×N_CS) mod 839)
// N_CS = cyclic shift (from zeroCorrelationZoneConfig=13 → N_CS=38)
// 839 / 38 = 22 preambles per root → need ceil(64/22) = 3 root sequences

Why ZC sequences are ideal for timing estimation

At the gNB receiver, the received preamble is correlated against all 64 locally generated preamble sequences. The correlation peak position tells the gNB exactly when the preamble arrived — from which the propagation delay (and hence Timing Advance) is computed.

The cyclic shift N_CS creates an interference-free zone between different preambles: even if two UEs at very different distances transmit the same root preamble, their correlation peaks appear at different offsets and do not overlap, as long as the timing difference is less than N_CS × T_s.

PRACH resource — where and when

The UE must transmit on the correct PRACH occasion — the time-frequency resource linked to SSB beam index 3. SIB1's RACH configuration defines these occasions.

PRACH resource derivation — SSB index 3, our SIB1 configTS 38.213 §8.1
// From SIB1 (rach-ConfigCommon):
prach-ConfigIndex        = 16   → preamble format 0, long preamble (839 seq)
msg1-FrequencyStart      = 4    → PRACH starts at RB 4 from BWP start
msg1-FDM                 = 1    → 1 PRACH occasion in frequency
ra-ResponseWindow        = sl10 → UE waits up to 10 slots for Msg2

// PRACH occasion timing (from prach-ConfigIndex=16, TS 38.211 Table 6.3.3.2-3):
Subframe index = 0  (first subframe of each frame where PRACH occurs)
PRACH symbol   = 0

// Frequency position:
PRACH_start_RB = msg1-FrequencyStart = 4
PRACH_start_Hz = Point_A + 4 × 12 × 30 kHz
               = 3496.38 + 1.44 MHz = 3497.82 MHz

// SSB-to-PRACH mapping (TS 38.213 §8.1):
SSB index 3 → maps to PRACH occasion offset 3 × (PRACH_per_SSB)
// The UE transmits on the PRACH occasion associated with SSB 3

Transmit power calculation

The UE does not transmit the preamble at maximum power — it uses open-loop power control to target the correct received power at the gNB. The formula uses the path loss estimated from the SSB RSRP measurement.

The UE shall set the PRACH preamble transmit power P_PRACH to:

P_PRACH = min(P_CMAX, preambleReceivedTargetPower + PL)
3GPP TS 38.213, Section 7.4, Equation 7.4-1
Preamble transmit power — our exampleTS 38.213 §7.4
// Path loss estimate (from SSB measurement):
PL = P_SSB_tx − RSRP_measured
   = 43 dBm − (−85 dBm) = 128 dB
// (P_SSB_tx = gNB EIRP, obtained from SIB1 or assumed)

// Target received preamble power (from SIB1):
preambleReceivedTargetPower = −110 dBm

// Required transmit power:
P_PRACH = preambleReceivedTargetPower + PL
        = −110 + 128
        = +18 dBm

// Capped at UE max power P_CMAX = 23 dBm:
P_PRACH = min(23, 18) = 18 dBm  ← well within UE capability

Power ramping — what if no response?

If the UE sends Msg1 and does not receive a response within the RAR window (10 slots), it retransmits the preamble with higher power. Each retry increases power by powerRampingStep = 4 dB from SIB1.

Power ramping — up to preambleTransMax = 7 attemptsTS 38.321 §5.1.2
// Each failed attempt increases power by 4 dB:
Attempt 1: P = 18 dBm  (initial)
Attempt 2: P = 22 dBm  (+4 dB)
Attempt 3: P = 23 dBm  (+4 dB, capped at P_CMAX)
Attempt 4: P = 23 dBm  (capped)
...
Attempt 7: P = 23 dBm  (max — final attempt)

// If no response after 7 attempts:
→ RACH failure reported to upper layers
→ Connection establishment failure
→ UE may try again after backoff timer
Msg1 — what the UE transmits
Preamble       → random index from 0–63 (say index 27)
Sequence       → Zadoff-Chu, L_RA=839, root u=22, cyclic shift
Frequency      → PRACH at 3497.82 MHz (RB 4 from Point A)
Beam           → PRACH occasion linked to SSB index 3
Power          → 18 dBm (target −110 dBm at gNB + 128 dB PL)
Next           → Wait up to 10 slots for RAR (Msg2)