Section: 5.1.2 Random Access Resource selection
Content: The Random Access Resource selection procedure shall be performed as follows: - for BL UEs or UEs in enhanced coverage or NB-IoT UEs, if EDT is initiated by the upper layers: - if the message size (UL data available for transmission plus MAC header and, where required, MAC control elements) is larger than the TB size signalled in edt-TBS for the selected enhanced coverage level for EDT; or - if the PRACH resource associated with EDT for the selected enhanced coverage level is not available: - indicate to upper layers that EDT is cancelled; - for BL UEs or UEs in enhanced coverage, select the PRACH resource set corresponding to the selected enhanced coverage level. For EDT, the PRACH resource set shall correspond to the set associated with EDT for the selected enhanced coverage level. - if, except for NB-IoT, ra-PreambleIndex (Random Access Preamble) and ra-PRACH-MaskIndex (PRACH Mask Index) have been explicitly signalled and ra-PreambleIndex is not 000000: - the Random Access Preamble and the PRACH Mask Index are those explicitly signalled; - else if, for NB-IoT, ra-PreambleIndex (Random Access Preamble) and PRACH resource have been explicitly signalled: - the PRACH resource is that explicitly signalled; - if the ra-PreambleIndex signalled is not 000000: - if ra-CFRA-Config is configured: - the Random Access Preamble is set to nprach-SubcarrierOffset + nprach-NumCBRA-StartSubcarriers + (ra-PreambleIndex modulo (nprach-NumSubcarriers - nprach-NumCBRA-StartSubcarriers)), where nprach-SubcarrierOffset, nprach-NumCBRA-StartSubcarriers and nprach-NumSubcarriers are parameters in the currently used PRACH resource. - else: - the Random Access Preamble is set to nprach-SubcarrierOffset + (ra-PreambleIndex modulo nprach-NumSubcarriers), where nprach-SubcarrierOffset and nprach-NumSubcarriers are parameters in the currently used PRACH resource. - else: - select the Random Access Preamble group according to the PRACH resource and the support for multi-tone Msg3 transmission. A UE supporting multi-tone Msg3 shall only select the single-tone Msg3 Random Access Preambles group if there is no multi-tone Msg3 Random Access Preambles group. - randomly select a Random Access Preamble within the selected group. - else the Random Access Preamble shall be selected by the MAC entity as follows: - if the UE is a BL UE or UE in enhanced coverage and EDT is initiated: - select the Random Access Preambles group corresponding to PRACH resource for EDT for the selected enhanced coverage level. - else if the UE is a BL UE or UE in enhanced coverage and Random Access Preamble group B does not exist: - select the Random Access Preambles group corresponding to the selected enhanced coverage level. - else if the UE is an NB-IoT UE: - if the UE supports carrier specific NRSRP thresholds for NPRACH resource selection and rsrp-ThresholdsPrachInfoList-r16 is signalled for a carrier in ul-ConfigList: - if the measured RSRP is lower than the RSRP threshold corresponding to the selected enhanced coverage level in rsrp-ThresholdsPrachInfoList-r16: - do not consider the PRACH resource on this non-anchor carrier for PRACH resource selection. - randomly select one of the PRACH resources corresponding to the selected enhanced coverage level according to the configured probability distribution, and select the Random Access Preambles group corresponding to the PRACH resource and the support for multi-tone Msg3 transmission. A UE supporting multi-tone Msg3 shall only select the single-tone Msg3 Random Access Preambles group if there is no multi-tone Msg3 Random Access Preambles group. For EDT, the PRACH resource shall correspond to resource associated with EDT for the selected enhanced coverage level. - else if Msg3 has not yet been transmitted, the MAC entity shall: - if Random Access Preambles group B exists and any of the following events occur: - the potential message size (UL data available for transmission plus MAC header and, where required, MAC control elements) is greater than messageSizeGroupA and the pathloss is less than PCMAX,c (of the Serving Cell performing the Random Access Procedure) – preambleInitialReceivedTargetPower – deltaPreambleMsg3 – messagePowerOffsetGroupB; - the Random Access procedure was initiated for the CCCH logical channel and the CCCH SDU size plus MAC header is greater than messageSizeGroupA; - select the Random Access Preambles group B; - else: - select the Random Access Preambles group A. - else, if Msg3 is being retransmitted, the MAC entity shall: - select the same group of Random Access Preambles as was used for the preamble transmission attempt corresponding to the first transmission of Msg3. - randomly select a Random Access Preamble within the selected group. The random function shall be such that each of the allowed selections can be chosen with equal probability; - except for NB-IoT, set PRACH Mask Index to 0. - determine the next available subframe containing PRACH permitted by the restrictions given by the prach-ConfigIndex (except for NB-IoT), the PRACH Mask Index (except for NB-IoT, see clause 7.3), physical layer timing requirements, as specified in TS 36.213[ Evolved Universal Terrestrial Radio Access (E-UTRA); Physical layer procedures ]  [2], and in case of NB-IoT, the subframes occupied by PRACH resources related to a higher enhanced coverage level (a MAC entity may take into account the possible occurrence of measurement gaps when determining the next available PRACH subframe); - except for NB-IoT: - if the transmission mode is TDD and the PRACH Mask Index is equal to zero: - if ra-PreambleIndex was explicitly signalled and it was not 000000 (i.e., not selected by MAC): - randomly select, with equal probability, one PRACH from the PRACHs available in the determined subframe. - else: - randomly select, with equal probability, one PRACH from the PRACHs available in the determined subframe and the next two consecutive subframes. - else: - determine a PRACH within the determined subframe in accordance with the requirements of the PRACH Mask Index, if any. - for NB-IoT UEs, BL UEs or UEs in enhanced coverage, select the ra-ResponseWindowSize and mac-ContentionResolutionTimer corresponding to the selected enhanced coverage level and PRACH. - proceed to the transmission of the Random Access Preamble (see clause 5.1.3).