Home / 5G / Protocols / MAC / Random Access

5G NR MAC Random Access Procedure

Random access is the MAC procedure used when the UE needs to obtain or re-obtain uplink access and move into a state where scheduled uplink signaling or data transmission can continue. Use it together with the 5G NR MAC Overview page when you want the wider MAC context.

This page focuses on the MAC view of NR random access. PHY handles the PRACH preamble transmission and related radio resources, but MAC is where Random Access Response handling, Msg3 use, contention resolution, and timing-alignment continuation become visible. For engineers, random access is one of the most important MAC procedures because many access failures happen after preamble detection, not before it.

Technology 5G NR
Protocol area MAC procedure
Main specification 3GPP TS 38.321
Architecture context 3GPP TS 38.300
Release baseline Release 18
Procedure families 4-step random access and 2-step random access
Main messages or entities PRACH preamble, Random Access Response, Msg3, contention resolution, MsgA, MsgB
Why it matters Initial access, uplink synchronization, recovery, re-entry, and many access-failure investigations depend on it

Procedure purpose

Random access is used when the UE must establish or recover the ability to send uplink information under network control. At MAC level, that means obtaining the necessary response, using the granted uplink opportunity correctly, and reaching a state where later signaling or traffic can continue. That later continuation often leads directly into RRC connection setup or another higher-layer recovery path.

In practice, random access is not only an entry procedure. It is also part of uplink synchronization maintenance, recovery, and several mobility or re-entry cases where the UE cannot simply start sending scheduled uplink traffic without first re-establishing the required MAC and PHY conditions. That makes it closely related to Timing Advance and the broader MAC procedure set.

Preconditions

  • The UE needs uplink access, re-entry, or timing-related continuation that cannot proceed with ordinary scheduled uplink use alone.
  • The random access configuration is provided through higher-layer signaling and cell configuration context, typically with relevant setup visible through RRC configuration.
  • The UE has an applicable random access occasion and knows the relevant parameters for the active access method.
  • Procedure interpretation must distinguish whether the case is 4-step or 2-step random access.

Trigger conditions

Trigger areaWhy random access starts
Initial accessThe UE needs to start the access chain before normal dedicated signaling can continue.
Uplink synchronization recoveryThe UE needs to recover timing-aligned uplink operation, often alongside Timing Advance interpretation.
Re-entry or recovery caseThe UE needs a controlled way to resume uplink procedure progression.
Mobility-related contextThe procedure or target-cell state requires access continuation before later signaling proceeds.

4-step and 2-step random access

VariantMain MAC viewWhy it matters in logs
4-step random accessClassical sequence with Random Access Response, Msg3, and contention resolution.Most detailed failure analysis happens across response handling, Msg3 progression, and contention resolution.
2-step random accessCompressed access method using MsgA and MsgB.Failure visibility and timing interpretation differ from the classical 4-step sequence and must be analyzed differently.

Step-by-step flow

For 4-step random access, the PHY-side preamble is only the beginning. MAC becomes central when the UE processes the Random Access Response, receives or derives the relevant uplink grant and timing context, transmits Msg3 on UL-SCH, and then waits for successful contention resolution before later signaling proceeds.

For 2-step random access, MsgA and MsgB compress the procedure structure. That changes where timing, response interpretation, and failure visibility appear. Engineers should therefore confirm the active access type before diagnosing a trace, then correlate it with PHY initial access and the later RRC continuation flow.

4-step random access
PRACH preamble -> Random Access Response -> Msg3 on UL-SCH -> Contention Resolution -> later signaling continues

2-step random access
MsgA -> MsgB -> later signaling continues

Messages, channels, and identifiers

ItemRole in random accessEngineering note
PRACH preamblePHY-side access indication used to begin the random access attempt.Important, but not sufficient to prove successful procedure completion.
Random Access Response (RAR)Provides the MAC-visible response that enables continuation after the preamble.RAR interpretation is one of the most critical checks in 4-step RA.
Msg3Uplink message sent using the granted opportunity after RAR.Many practical failures occur here or immediately after it.
Contention resolutionConfirms the access attempt resolved correctly so later signaling can continue.If this does not complete correctly, the procedure may look partially successful but still fail.
MsgA and MsgBKey combined procedure elements in 2-step RA.They change where procedure visibility appears compared with 4-step RA.
RA-RNTI, TC-RNTI, C-RNTI contextIdentifiers used during access progression and later continuation.Identifier interpretation is important in detailed trace analysis.
RACH and UL-SCHTransport-channel context used during access progression.RACH is not a normal payload path; Msg3 uses UL-SCH after the response stage.

Success path

A successful random access attempt means more than preamble detection. The response must be handled correctly, the granted uplink opportunity must be used correctly, timing-related continuation must remain valid, and the procedure must reach a state where later RRC or user-plane progression can continue as expected.

In 4-step random access, that usually means the UE reaches successful progression beyond Msg3 and contention resolution. In 2-step random access, success means the compressed procedure provides a stable continuation into later signaling.

Failure paths

Failure pointWhat usually goes wrongWhy engineers care
Response stageThe Random Access Response is not received, not interpreted correctly, or does not lead to stable continuation.This is a common reason why preamble success does not become procedure success.
Msg3 stageThe UE does not transmit Msg3 correctly or the network does not decode or continue it correctly.Many setup failures are effectively Msg3-path failures.
Contention resolution stageThe procedure never resolves into a stable success state.The trace can look partially successful while later signaling still fails.
Timing-alignment continuationThe access attempt starts but uplink timing does not remain usable for later progression.This often explains early success followed by unstable uplink continuation and should be checked with Timing Advance.
2-step interpretationThe procedure is analyzed as if it were 4-step, or vice versa.Wrong procedure assumptions can invalidate the whole diagnosis.

Call-flow placement

Procedure areaHow random access appears
Initial access and setupRandom access provides the entry path before later dedicated signaling can proceed.
RRC connection establishmentMsg3 and later continuation are part of the early connected-mode setup chain.
Recovery or re-entryRandom access may be used to regain usable uplink procedure state.
Mobility-related continuationCertain mobility cases require access progression before later signaling continues.

Log-analysis notes

When reading logs, separate PHY success from MAC success. A visible preamble only proves that the access attempt started. It does not prove that Random Access Response handling, Msg3 progression, contention resolution, or timing alignment succeeded. Use the PHY initial access view and the channel-mapping reference together when decoding the full sequence.

A good random-access analysis follows the full continuation chain and correlates it with the later RRC procedure. If the later setup or resume signaling stalls, the access attempt may have failed at MAC even when the earliest radio indicators looked healthy. The most common next step is to correlate the trace with RRC Connection Setup and Timing Advance.

Troubleshooting

SymptomMAC area to inspectWhy
Preamble activity is visible but setup does not continueRandom Access Response handling and immediate continuationThe failure may be after preamble detection rather than in the PHY access trigger itself.
Early uplink appears but connected signaling never stabilizesMsg3 progression and contention resolutionPartial access success often fails in these later MAC stages.
Access works sometimes but not consistentlyTiming alignment continuation, response timing, and procedure typeIntermittent access issues often involve timing sensitivity or wrong assumptions about the active RA variant.
The UE seems to reach the cell but uplink remains unusableTiming Advance context and post-access uplink stateRandom access must produce usable uplink continuation, not only a detected attempt. Check Timing Advance.
A 2-step trace looks inconsistent when analyzed like 4-step RAProcedure-family interpretationUsing the wrong procedure model leads to wrong conclusions very quickly.

FAQ

What is 5G NR MAC random access?

It is the MAC procedure used when the UE needs to obtain or re-obtain uplink access and continue into stable, scheduler-controlled uplink procedure progression.

Is random access only a PHY topic?

No. PHY handles the preamble transmission and early radio resources, but MAC is central for Random Access Response handling, Msg3 use, contention resolution, and timing-related continuation.

Why can random access fail after the preamble succeeds?

Because later MAC stages such as response handling, Msg3 progression, contention resolution, or timing-alignment continuation may still fail even when the preamble was detected.

What is Msg3 in random access?

Msg3 is the uplink message transmitted after the Random Access Response using the granted uplink opportunity in the 4-step random access procedure.

Why should 2-step and 4-step random access be analyzed differently?

Because the procedure structure changes where delay, signaling visibility, identifiers, and failure patterns appear in the trace.

Why is timing alignment important in random access?

Because the goal is not only to begin access but to continue into usable uplink operation. A detected attempt without stable timing-aligned continuation is not a complete success.

Related Content