Msg3 — RRCSetupRequest
Using the UL grant received in the RAR (RBs 0–5, MCS 4) and the corrected uplink timing (TA=31), the UE transmits Msg3 on the PUSCH. Msg3 contains the RRCSetupRequest message which identifies the UE and states why it is connecting.
// RRCSetupRequest ASN.1: RRCSetupRequest ::= SEQUENCE { ue-Identity: randomValue = 0x3F2A1C ← 39-bit random number // (no valid IMSI-derived identity yet) establishmentCause = mo-Data // Other values: emergency, highPriorityAccess, // mt-Access, mo-Signalling, mo-VoiceCall... } // Transport: CCCH (Common Control Channel) logical channel // Physical: PUSCH, RBs 0–5, slot 3 (after TA applied) // RNTI: TC-RNTI = 0x3A7F (from RAR)
Contention resolution — the hidden problem
Recall from 6.1: two UEs may have picked the same preamble. Both received the same RAR. Both sent Msg3 at the same time, on the same resources. Their transmissions collided at the gNB.
The gNB may have partially decoded one of them. Msg4 contains a contention resolution identity — the UE's own identity from Msg3. Each UE compares this against what it sent. Only one matches. The other UE declares failure and retries RACH.
Msg4 — RRCSetup (Contention Resolution)
Msg4 is delivered on the PDSCH, addressed by the TC-RNTI = 0x3A7F. It contains two things packed together in a MAC PDU:
RRCSetup — what it contains
The RRCSetup message is the most important RRC message for initial access. It provides the complete radio bearer and channel configuration the UE needs to operate in RRC_CONNECTED state.
// RRCSetup ASN.1 (key fields): RRCSetup ::= SEQUENCE { rrc-TransactionIdentifier = 0, criticalExtensions: rrcSetup: // Radio Bearer Configuration radioBearerConfig: srb-ToAddModList: SRB1 → established // SRB0: used for Msg3/4 (CCCH) // SRB1: first dedicated bearer → RLC-AM → PDCP // Master Cell Group configuration masterCellGroup: cellGroupId = 0 // RLC bearer config for SRB1 rlc-BearerToAddModList: logicalChannelId = 1 ← DCCH (Dedicated Control Channel) rlc-Config: am ← Acknowledged Mode mac-LogicalChannelConfig: priority=1 // MAC config mac-CellGroupConfig: bsr-Config: periodicBSR-Timer = sf10 sr-Config: ← Scheduling Request config // Physical layer config physicalCellGroupConfig: p-NR-FR1 = 23 dBm ← UE max power // Serving cell config spCellConfig: servingCellIndex = 0 spCellConfigDedicated: // Initial UL BWP uplinkConfig: initialUplinkBWP: pucch-Config: ... pusch-Config: ... // PDSCH/PDCCH for connected mode pdsch-ServingCellConfig: ... }
After Msg4 — what changes
Once the UE successfully receives and decodes Msg4 with matching contention resolution identity, a series of state transitions happen simultaneously: