Blog

5G MAC Protocol

Medium Access Control (MAC) protocol specification written in (3GPP TS 38.321).


 
 
  • MAC is a protocol layer above the physical layer and below the RLC layer.
  • The ‘Medium Access Control’ (MAC) layer receives both the user plane and control plane data from the set of logical channels provided by the RLC layer.
  • Multiplexes and Demultiplexes MAC SDUs belonging to one or different logical channels into from transport blocks delivered to from the physical layer on transport channels
  • Performs error correction through the Hybrid Automatic Repeat Request (HARQ) mechanism
  • Handles priority between different UEs and different types of data (logical channels) within a single UE.
  • It also handles scheduling functions.
  • Add padding bits.
MAC structure overview
MAC structure overview
  • The MAC provides services to the RLC in the form of logical channels. 
  • Set of Logical channel is specified for NR( BCCH, CCCH, PCCH, DCCH, DTCH,)
  1. Broadcast Control Channel(BCCH): This is used to broadcast system information from gNB to all the devices in a cell. RRC messages for MIB, SIB1, and SystemInformation
    message.
  2. Paging Control Channel (PCCH): This is used for the paging of devices whose location on a cell level is not known to the network.
  3. Common Control Channel (CCCH): This is used for transmission of control information in conjunction with random access. Signalling on SRB0
  4. Dedicated Control Channel (DCCH): This used for transmission of control information to/from a device. Signalling on SRB1 or SRB2,SRB3
  5. The Dedicated Traffic Channel (DTCH): This used for the transmission of user data from a device.( User Plane data)

Set of Transport  Channel specified for NR(DL-SCH,BCH,PCH,UL-SCH,RACH)

  1. Broadcast Channel (BCH) : BCH is used to deliver master information block(MIB) to the UE.
  2. Paging Channel (PCH): PCH is used for delivering paging messages to the UE.
  3. Uplink Shared Channel (UL-SCH) : UL-SCH is used to carry user data in uplink.
  4. Random Access Channel (RACH): RACH channel is used for random access procedure.

MAC Entities:

  • The MAC entity of the UE handles the following transport channels:
    Broadcast Channel (BCH)
    Downlink Shared Channel(s) (DL-SCH)
    Paging Channel (PCH)
    Uplink Shared Channel(s) (UL-SCH)
    Random Access Channel(s) (RACH)
MAC structure overview with two MAC entities
MAC structure overview with two MAC entities
MAC Procedures
  • Random Access procedure: The random access procedures including contention-based random access (CBRA) and contention-free random access as well as Physical Dedicated Control Channel (PDCCH) order , There is only one Random Access procedure ongoing at any point in time in a MAC entity. There are two types of random access procedures; CBRA procedure, and contention-free random access (CFRA) procedure. In the CBRA procedure, multiple users randomly select a preamble from a pool of preambles, a contention resolution phase determines which user, if any, had its data successfully received by the network. Contention resolution resolves contention between two or more users selecting the same preamble. In the CFRA procedure, a preamble is uniquely pre-allocated to the user, hence there is no possibility of preamble the collision between users and no need for contention resolution
  • Maintenance of Uplink Time Alignment:  In Mac Layer RRC configure below parameters for the maintenance of UL time alignment. timeAlignmentTimer (per TAG) which controls how long the MAC entity considers the Serving Cells belonging to the associated TAG to be uplink time aligned. 
  • Timing advance command: This MAC CE is used for timing advance value adjustment after RACH. It comprises a single octet containing TAG Identity (TAG ID) and timing advance command (0-63).
  • DL-SCH data transfer : The main job for DL-SCH is DL assignment, HARQ operation & Disassembly and multiplexing. Downlink assignments received on the PDCCH both indicate that there is a transmission on a DL-SCH for a particular MAC entity and provide the relevant HARQ information. When the MAC entity has a C-RNTI, Temporary C-RNTI, or CS-RNTI, the MAC entity shall for each PDCCH occasion during which it monitors PDCCH and for each Serving Cell.
  • UL-SCH data transfer: This one we used for HARQ Operation, Multiplexing and assembly, scheduling request,buffer status reporting, power header room reporting.
  • Discontinuous Reception (DRX): This MAC CE is used to send UE into CONNECTEDmode DRX. The MAC entity may be configured by RRC with a DRX functionality that controls the UE’s PDCCH monitoring activity for the MAC entity’s C-RNTI, CS-RNTI, INT-RNTI, SFI-RNTI, SP-CSI-RNTI, TPC-PUCCH-RNTI, TPCPUSCH- RNTI, and TPC-SRS-RNTI, When using DRX operation, the MAC entity shall also monitor PDCCH according to requirements found in other clauses of this specification. It has a fixed size of 0 bits, the UE recognizes the MAC CE type from the LCID subheader.
  • Activation/Deactivation of SCells : This MAC CE is used if a UE is configured with carrier aggregation in order to activate or deactivate SCells configured for the UE.If the MAC entity is configured with one or more SCells, the network may activate and deactivate the configured SCells. Upon configuration of an SCell, the SCell is deactivated.The SCell activation/deactivation MAC CE consists of either one or four octets that are identified by MAC PDU subheaders with LCID indices 58 or 57, respectively.
  • Activation/Deactivation of PDCP duplication:If one or more DRBs are configured with PDCP duplication, the network may activate and deactivate the PDCP duplication for the configured DRB(s).The duplication activation/deactivation MAC CE consists of one octet that is identified by a MAC PDU subheader with LCID index 56.
  • Transmission and reception without dynamic scheduling:Semi-Persistent Scheduling (SPS) is configured by RRC per Serving Cell and per BWP. Activation and deactivation of the DL SPS are independent among the Serving Cells.   

There are two types of transmission without dynamic grant:
1. configured grant Type 1 where an uplink grant is provided by RRC, and stored as configured uplink grant.
2.configured grant Type 2 where an uplink grant is provided by PDCCH, and stored or cleared as configured uplink grant based on L1 signalling indicating configured uplink grant activation or deactivation

 

  • Beam Failure Detection and Recovery procedure:The MAC entity may be configured by RRC with a beam failure recovery procedure which is used for indicating to the serving gNB of a new SSB or CSI-RS when beam failure is detected on the serving SSB(s)/CSI-RS(s). Beam failure is detected by counting beam failure instance indication from the lower layers to the MAC entity.

Handling of MAC CEs:

  1. SP CSI-RS/CSI-IM Resource Set Activation/Deactivation MAC CE.
  2. Aperiodic CSI Trigger State Subselection MAC CE.
  3. TCI States Activation/Deactivation for UE-specific PDSCH MAC CE.
  4. TCI State Indication for UE-specific PDCCH MAC CE.
  5. SP CSI reporting on PUCCH Activation/Deactivation MAC CE.
  6. SP SRS Activation/Deactivation MAC CE.
  7. PUCCH spatial relation Activation/Deactivation MAC CE.
  8. SP ZP CSI-RS Resource Set Activation/Deactivation MAC CE.
  9. Recommended Bit Rate MAC CE.

     

  • Activation/Deactivation of Semi-persistent CSI-RS/CSI-IM resource set: The network may activate and deactivate the configured SP CSI-RS/CSI-IM resource sets of a serving cell by sending the SP CSI-RS/CSI-IM resource set activation deactivation MAC CE. The configured SP CSI-RS/CSI-IM resource sets are initially deactivated upon configuration and after a handover.
  • Aperiodic CSI Trigger State Subselection:The network may select among the configured aperiodic CSI trigger states of a serving cell by sending the aperiodic CSI trigger state sub-selection MAC CE.
  • Activation/Deactivation of UE-specific PDSCH TCI state : The network may activate and deactivate the configured TCI states for physical downlink shared channel (PDSCH) of a serving cell by sending the TCI states activation ,deactivation for UE-specific PDSCH MAC CE. The configured TCI states for PDSCH are initially deactivated upon configuration and after a handover.
  • Activation/Deactivation of Semi-persistent SRS : The network may activate and deactivate the configured Semi-persistent SRS resource sets of a Serving Cell by sending
    the SP SRS Activation/Deactivation MAC CE . The configured Semi-persistent SRS resource sets are initially deactivated upon configuration and after a handover.
  • Activation/Deactivation of spatial relation of PUCCH resource:The network may activate and deactivate a spatial relation for a PUCCH resource of a Serving Cell by sending the PUCCH spatial relation Activation/Deactivation MAC CE.
  • Activation/Deactivation of semi-persistent ZP CSI-RS resource set:The network may activate and deactivate the configured Semi-persistent ZP CSI-RS resource set of a Serving Cell bysending the SP ZP CSI-RS Resource Set Activation/Deactivation MAC CE .. The configured Semi-persistent ZP CSI-RS resource sets are initially deactivated upon configuration and after a handover
  • Recommended Bit Rate:The recommended bit rate procedure is used to provide the MAC entity with information about the physical layer bit rate which the gNB recommends. An averaging window with default size of 2 seconds is applied. The gNB may transmit the recommended bit rate MAC CE to the receiver-side MAC entity to indicate the recommended bit rate for the UE for a specific logical channel and downlink/uplink direction.

MAC PDU :

MAC PDU DL

 

MAC PDU UL
  • A MAC PDU is a bit string that is octet-aligned and consists of one or more MAC sub- PDUs.
  • Each MAC subPDU consists of one of the following: 
  • – A MAC subheader only (including padding)
    – A MAC subheader and a MAC SDU
    – A MAC subheader and a MAC CE
    – A MAC subheader and padding
  • The MAC SDUs have variable sizes, where each MAC subheader corresponds to either a MAC SDU, a MAC CE, or padding.
  • A MAC subheader typically consists of four header fields R/F/LCID/L .
  • However, a MAC subheader for fixed-sized MAC CE, padding, and a MAC SDU containing uplink common control channel (CCCH), consists of two header fields R/LCID. MAC control elements are placed together.
  • The downlink MAC subPDU(s) with MAC CE(s) is placed before any MAC subPDU with MAC SDU and MAC subPDU with padding.
  • The uplink MAC subPDU(s) with MAC CE(s) is placed after all MAC subPDU(s) with MAC SDU and before the MAC subPDU with padding in the MAC PDU.
  • Note that the size of padding can be zero.
  • At most one MAC PDU can be transmitted per transport block per MAC entity. 

MAC PDU (DL-SCH and UL-SCH except transparent MAC and Random Access Response):

R/F/LCID/L MAC subheader with 8-bit L field

 
R/F/LCID/L MAC subheader with 16-bit L field

 

R/LCID MAC subheader
  • LCID: The LCID field identifies the logical channel instance of the corresponding MAC SDU or the type of the corresponding MAC CE or padding. There is one LCID field per MAC subheader whose size is 6 bits.
  • L: The length field indicates the length of the corresponding MAC SDU or variablesized MAC CE in bytes. There is one L field per MAC subheader except for subheaders corresponding to fixed-sized MAC CEs, padding, and MAC SDUs containing uplink CCCH. The size of the L field is indicated by the F field.
  • F: The format field indicates the size of the length field. There is one F field per MAC subheader except for subheaders corresponding to fixed-sized MAC CEs, padding, and
    MAC SDUs containing uplink CCCH. The size of the F field is 1 bit, where the 8-bit and 16-bit Length fields are indicated by F50 and F51, respectively.
  • R: Reserved bit, which is set to zero

MAC PDU (Random Access Response) : 

  • A MAC PDU consists of one or more MAC subPDUs and optionally padding. Each MAC subPDU consists one of the following:
    – a MAC subheader with Backoff Indicator only;
    – a MAC subheader with RAPID only (i.e. acknowledgment for SI request)
    – a MAC subheader with RAPID and MAC RAR.
E/T/R/R/BI MAC subheader ,

T-0 for MAC subheader means carrying h Backoff indicator

 

E/T/RAPID MAC subheader ( T=1 for mac subheader carrying for RAPID)
 
MAC PDU consisting of MAC RARs
 

MAC subheader for Random Access Response

The MAC subheaders consist of the following fields:
• E: The extension field is a flag indicating whether the MAC sub-PDU, including the MAC subheader is the last MAC sub-PDU in the MAC PDU. It is set to one to indicate at least another MAC sub-PDU follows; otherwise, it is set to zero.
• T: The type field is a flag indicating whether the MAC subheader contains a randomaccess preamble identifier (RAPID) or a backoff indicator (BI). It is set to zero to indicate the presence of a BI field in the subheader; otherwise it is set to one to indicate the presence of a RAPID field in the subheader.
• R: Reserved bit, which is set to zero.
• BI: The BI field identifies the overload condition in the cell. The size of the BI field is 4 bit.
• RAPID: The RAPID field identifies the transmitted random-access preamble. The size of the RAPID field is 6 bits. If the RAPID in the MAC subheader of a MAC sub-PDU corresponds to one of the random-access preambles configured for SI request, MAC random-access response (RAR) is not included in the MAC sub-PDU. The MAC subheader is octet aligned.
 
 

MAC Control Elements (CEs): 

  1. Buffer Status Report (BSR) MAC CEs consist of either:

 Short BSR format (fixed size); or Long BSR format (variable size); or Short Truncated BSR format (fixed size); or Long Truncated BSR format (variable size).

The BSR formats are identified by MAC subheaders with LCIDs

 
Long BSR and Long Truncated BSR MAC CE
The fields in the BSR MAC CE are defined as follows:
– LCG ID: The Logical Channel Group ID field identifies th e group of logical channel(s) whose buffer status is being reported. The length of the field is 3 bits;
LCGi: For the Long BSR format, this field indicates the presence of the Buffer Size field for the logical channel group i. The LCGi field set to 1 indicates that the Buffer Size field for the logical channel group i is reported. The LCGi field set to 0 indicates that the Buffer Size field for the logical channel group i is not reported. For the Long Truncated BSR format, this field indicates whether logical channel group i has data available. The LCGi field set to 1 indicates that the logical channel group i has data available. The LCGi field set to 0 indicates that logical channel group i does not have data available;
– Buffer Size: The Buffer Size field identifies the total amount of data available according to the data volume calculation procedure in TSs 38.322 [3] and 38.323 [4] across all logical channels of a logical channel group after the MAC PDU has been built (i.e. after the logical channel prioritization procedure, which may result the value of the Buffer Size field to zero). The amount of data is indicated in the number of bytes. The size of the RLC and MAC headers are not considered in the buffer size computation. The length of this field for the Short BSR format and the Short Truncated BSR format is 5 bits. The length of this field for the Long BSR format and the Long Truncated BSR format is 8 bits. The values for the 5-bit and 8-bit Buffer Size fields are shown in Tables 6.1.3.1-1 and 6.1.3.1-2, respectively. For the Long BSR format and the Long Truncated BSR format, the Buffer Size fields are included in ascending order based on the LCGi. For the Long Truncated BSR format, the number of Buffer Size fields included is maximized, while not exceeding the number of padding bits.
 
Values of LCID for DL-SCH
Values of LCID for UL-SCH

 

Check other articles related to protocols

https://cafetele.com/packet-data-convergence-protocolpdcp-nr/

https://cafetele.com/5g-nr-protocol-test/

https://cafetele.com/user-plane-protocol-5g/

https://cafetele.com/rrc-radio-resource-controlprotocol/

 

Leave a Reply

Your email address will not be published. Required fields are marked *

error: Content is protected !!