Random access is the procedure which enables the UE to access the network. The key part of this procedure lies in the fact that is on Random Access that the UE can contact the gNB without being scheduled by the gNB.
In my previous post: 5G Synchronization procedure, we have explore the procedures that takes place at initial access. The final procedure of the initial access is the random access the procedures and we will explore the details in this post.

Triggers for Random Access
Similar to 4G, there are several conditions that might trigger a random access. It could be that the UE needs to access the network or read system information for other purposes or it has to recover from an out of sync scenario, among many other reasons. The following is a short list of triggers for a random access:
- UE-originated signaling in the 5G states RRC_IDLE or RRC_INACTIVE
- RRC connection re-establishment
- During a request for system information, other than MIB or SIB-1
- As a response from a network-originated system paging in the 5G states RRC_IDLE or RRC_INACTIVE
- Throughout a handover procedure, as the UE needs to initialized the timing advance for the new cell
- After a loss of timing synchronization with the gNB if the UE needs to received or forward data
- From recovery of a beam failure, if changes in the downlink propagation make the UE unable to received the current downlink beam.
Random access resources can be configured for CBRA or for CFRA:
Contention-based random access (CBRA) – initial access. CBRA allows to resolve the case when two or more UE try to access the network with the same parameters at the same time.
Contention-free random access (CFRA) – PDCCH triggered, mobility, beam failure recovery
Note also that in a beamforming scenario, is important that the gNB deliver the random access response in the same beam that the UE has satisfactory received. In the synchronization procedure the UE identifies the best downlink beam, and it will signal it as part of the random access request procedure.
Finally with the random access procedure the UE will obtain the following information and/or resources:
- An uplink scheduling grant, used for transmission of the signaling messages that are used with the random access procedure.
- An initial value of the timing advance.
- A radio access network identity, in the form of a C-RNTI.
PRACH Formats
Although the different size and bandwidth of the short and long-sequence-based preamble formats there are basically 3 elements that all have in common:
CP – Cyclic Prefix: It handles the inter-symbol interference in a multipath environment.
PRACH symbols: This is the actual transmission of one ore more PRACH symbols.
GP – Guard Period: As PRACH transmissions are usually transmitted without any timing advance information, a guard period is used to prevent PRACH transmissions from colliding with the transmission blocks that follows the PRACH (PUSCH or PUCCH transmissions).
Preamble Formats
There are several Physical Random Access Channel (or PRACH, for short) formats. The first division we can make is between the size of the PRACH sequences, which can be based on long or short sequences.
Long-Sequence–Based Preamble Formats:
The long-sequence-based preamble formats are based relative to the 1 ms subframe. There are 4 different long PRACH sequences. You might have a flashback to LTE on the format 0 as it is the same as the format 0 used in LTE. The four long sequences contains 839 samples (meaning: the length of the Zadoff-Chu root sequence is 839 samples).

Some important facts about the Long-Sequence based preambles: they are meant to be used at carrier frequencies below 6 MHz (FR1); they enable long transmissions: 1 ms or longer and support two different subcarrier spacing: 1.25 MHz and 5 MHz.

Short-Sequence–Based Preamble Formats:
The Short-sequence–based preambles are defined relative to a PRACH symbol. This means that their duration varies according to the PRACH subcarrier spacing. Short-sequence–based preambles are based on 139 sequences. These formats allow short transmissions of 2, 4, 6, or 12 OFDM symbols with CP aggregated
at the beginning of the burst and with or without guard time (GT) at the end. The short-sequence-based preamble formats are intended to be used in FR2 (carrier frequencies above 6 MHz). In FR2 they support PRACH subcarrier spacing of 60 kHz and 120 kHz, while if used in FR1, they support PRACH subcarrier spacing of 15 kHz and 30 kHz.

Notice the difference between Formats A and B that the lasts have guard time (GT) at the end, while the last first ones do not. There are also Format C (only two format C type) but I did not include them into the picture, but the details are in the table below.

(*) B2 and B3 formats are used in combination with formats A
PRACH Configurations
The PARCH transmission timing and PRACH format are defined by PRACH configuration index parameter. Note that all random access configuration information is broadcasted in all beams used for SIB1 within a cell. The following table is the Table 6.3.3.2-2 extracted from 3GPP TS 38.211 and is a substract of the PRACH preamble format 0 for FR1 in paired spectrum. If you want to obtain the whole table you can check also this website: ShareTechnote that has amazing and deep explanations on the subject.

Contention-Based and Contention-Free Random Access
In LTE there are 64 PRACH preambles. The PRACH preamble is the content of the PRACH transmission. In 5G is exactly the same amount of PRACH preambles that the gNB cell has to assign for random access. These RACH preambles are assigned to each cell during the network planning stage or by means of a SON feature.
At the beginning of this post I mentioned that is through Random Access that the UE can access the gNB without being scheduled an access grant block. If this is the case, the UE will perform a random access procedure called Contention-Based Random Access (CBRA). Note that in CBRA the UE has to choose randomly a preamble from the 64 set, which can led to collision with another UE if selects the same preamble and transmit the RA at the same time. But if the UE has a connection with the gNB prior to the random access (like in the case of handover), then the gNB can assign a preamble to the UE beforehand. In this case the UE will perform a random access called Contention-Free Random Access (CFRA).
- The Random Access Procedure starts with the UE transmitting at the selected time and with the selected initial power (for this it uses the downlink propagation loss). The UE will select the PRACH preamble index, the timing of the PRACH transmission occasion and the resource block that will use for PRACH transmission.
- The UE has to wait for the response of the gNB. It will listen to a configured search window that begins with the first PDCCH occasion and has a duration between 11 to 180 slots (maximum duration is 10 ms). If the gNB respond it will do it on the same DL beam that the UE indicated through the SS/PBCH block index.
- If there is no answer the UE will repeat the procedure increasing the transmission power by 0 to 6 dB. This procedure can be repeated from 3 to 200 times before it qualified as failed.
- If successful the gNB will transmit to the UE the preamble along with the initial value for the timing advance, a temporary R-RNTI and it will assign a scheduling grant for uplink transmission.
- The UE will utilize the PUSCH to transmit over the scheduling grant. This transmission is called Msg3 and may include the BSR (buffer status report) which states the buffer status of the UE, and how much buffer signaling the UE can send by means of the access grant.

The UE will wait for the contention resolution timer (between 8 to 64 subframes) for a contention resolution message from the gNB. The response that the UE is waiting for is the identity transmitted before. If it finds it then it will promote the R-RNTI to its actual C-RNTI and the random access is considered successful. Else, the UE will have to start the process all over again.
Cheers!
Diego Goncalves Kovadloff
References:
3GPP, “3rd Generation Partnership Project; Technical Specification Group Radio Access Network; NR; physical channels and modulation (Release 15),” 3GPP TS 38.211, v15.8.0, January 2020.
Montojo, J., Gaal, P., Zisimopoulos, H., & Chen, W. (2021). Fundamentals of 5G communications: Connectivity for enhanced mobile broadband and beyond. McGraw-Hill Education.
