● Theory Deep-Dive · 3GPP TS 38.321 v19.1.0

The MAC layer, in one reference

Everything from the 21 modules, distilled into an engineer's deep-dive: where MAC sits, how the entity is built, the full channel map, the five functions, every procedure, and complete reference tables for timers, control elements, the PDU format, and KPIs.

1

Where MAC sits

§4.2 · §4.3

MAC is the lower half of Layer 2 — between RLC above and the physical layer below. It is the boundary between the logical world (per radio bearer) and the physical radio (per transport channel).

SDAPQoS flow → DRB PDCPcipher · ROHC · reorder RLCsegment · ARQ MACmap · mux · HARQ · sched PHYcode · modulate RRCconfiguresMAC params per bearer per transport ch.

Golden rule: RRC configures every MAC parameter (timers, LCP, DRX, BWP…); MAC executes them, per slot. MAC never ciphers (PDCP), segments (RLC), or modulates (PHY).

2

The MAC entity

§4.2.2

One MAC entity per cell group. With dual connectivity there are two (MCG + SCG); during a DAPS handover, briefly two; sidelink adds a PC5 path. Inside, a fixed set of functional blocks.

MAC entity LCP / Mux HARQ RA control Control Demux

Single entity

One cell group · the common case.

MCG + SCG

Dual connectivity — two independent entities (separate HARQ, timers, RA).

DAPS handover

Source + target entities run together, briefly, for near-zero interruption.

Sidelink

The entity gains a PC5 path for direct device-to-device traffic.

3

Channels & mapping

§4.5

Logical channels = what is carried; transport channels = how. MAC maps one to the other. The downlink shared channel and uplink shared channel are the workhorses.

DirectionLogical channel(s)→ Transport channel
ULCCCH · DCCH · DTCHUL-SCH
UL— (preamble only)RACH
DLBCCH (MIB)BCH
DLBCCH (SIBs) · CCCH · DCCH · DTCH · MCCH · MTCHDL-SCH
DLPCCHPCH
SLSCCH · STCHSL-SCH
SLSBCCHSL-BCH

One transport channel (esp. DL-SCH) carries many logical channels at once — which is exactly why MAC must multiplex.

4

The five functions

§4.4

Everything MAC does, in one list. Every later procedure is one of these, zoomed in.

1 · Mapping

Logical channels → transport channels.

2 · Multiplex / demultiplex

Pack SDUs + CEs into a transport block (tx); split it back (rx).

3 · HARQ

Error correction by retransmission. One HARQ entity per serving cell; MAC-controlled, PHY-assisted (soft combining).

4 · Scheduling-info reporting

SR (ask for room), BSR (how much), PHR (how much power).

5 · Priority handling

Between UEs (dynamic scheduling) and between logical channels (LCP) + padding.

Configured by RRC

MAC never invents behaviour — RRC supplies the timers, priorities, and rules.

5

Procedures at a glance

§5

Each links to its full cinematic module.

Random Access

4-step (Msg1→Msg4, power ramping, contention resolution) and 2-step (MSGA/MSGB + fallback).

Module 5 · 6 · §5.1

Timing Advance

Keep the uplink aligned; TAGs (pTAG/sTAG) + timeAlignmentTimer.

Module 7 · §5.2

HARQ (DL & UL)

NDI/RV, soft combining; UL retx signalled by the next grant (no feedback channel).

Module 8 · 9 · §5.3/§5.4

LCP & multiplexing

Token bucket (PBR/BSD), two-round fill, LCH restrictions.

Module 10 · §5.4.3

SR · BSR · PHR

Asking for, sizing, and power-bounding the uplink grant.

Module 11 · 12 · §5.4.4-6

DRX

onDuration + inactivity, HARQ-RTT nap, short/long cycle.

Module 13 · §5.7

BWP operation

Active/default BWP, switching, bwp-InactivityTimer.

Module 14 · §5.15

SCell & CA

Activation bitmap CE, sCellDeactivationTimer, dormancy.

Module 15 · §5.9

Beam Failure Recovery

BFD instances, candidate beam, CFRA / BFR-CE recovery.

Module 16 · §5.17

Sidelink

SCI, Mode 1/2 resources, PSFCH HARQ, SL-DRX.

Module 19 · §5.22

Advanced (Rel-18/19)

SDT, RACH-less HO, LTM, Cell DTX/DRX, NCR/IAB.

Module 20 · §5.27-36

Troubleshooting

Symptom → root cause → KPI → log → tune.

Module 21
6

Timers & counters reference

§5 · RRC-configured

The clocks and tallies that govern MAC behaviour. Almost every field-tuning fix lives here.

AreaTimer / counterRole
Random Accessra-ResponseWindowWindow to receive the RAR (Msg2).
Random Accessra-ContentionResolutionTimerWait for Msg4; restarts per Msg3 retx.
Random AccesspreambleTransMax · PREAMBLE_POWER_RAMPING_COUNTERMax preamble attempts; power-ramp step counter.
Timing AdvancetimeAlignmentTimer (per TAG)UL aligned while running; expiry → stop UL, re-RA for pTAG.
Scheduling Requestsr-ProhibitTimer · sr-TransMaxMin gap between SRs; max SRs before RA fallback.
BSRperiodicBSR-Timer · retxBSR-TimerPeriodic refresh; re-trigger if no grant.
PHRphr-PeriodicTimer · phr-ProhibitTimerPeriodic report; min gap; + pathloss-change trigger.
DRXdrx-onDurationTimer · drx-InactivityTimerScheduled awake window; activity-driven extension.
DRXdrx-HARQ-RTT-TimerDL/UL · drx-RetransmissionTimerDL/ULSleep through the RTT; wake for the retx window.
DRXdrx-ShortCycle · drx-ShortCycleTimer · drx-LongCycleShort cycle first; then long cycle.
BWPbwp-InactivityTimerExpiry → switch to the (narrow) default BWP.
SCell / CAsCellDeactivationTimerNo activity → auto-deactivate the SCell.
Beam failurebeamFailureDetectionTimer · beamFailureInstanceMaxCountCount BFD instances; reach max → failure declared.
Beam failurebeamFailureRecoveryTimerBounds recovery; expiry → radio link failure.
Data inactivitydataInactivityTimerNo data for a long time → go to RRC_IDLE.
7

Control element catalogue

§6.1.3

MAC's own messages, multiplexed into the PDU and flagged by a reserved LCID (or eLCID). ↓ = network→device, ↑ = device→network.

DirControl elementPurpose
C-RNTIDevice identity (in Msg3).
UE Contention Resolution IdentityResolve a RA collision (Msg4).
Timing Advance Command · Absolute TAAdjust / set uplink timing.
DRX Command · Long DRX CommandSleep now / go to long cycle.
BSR (Short / Long / Truncated)Buffer per logical channel group.
PHR (Single / Multiple Entry)Spare transmit power per carrier.
SCell Activation / DeactivationBitmap to switch carriers on/off.
BFRFailed cell + new candidate beam.
TCI / SP-CSI / SP-SRS / PUCCH spatialFast beam & measurement control.
LBT Failure · Delay Status · TA ReportUnlicensed / delay-critical / NTN reports.
LTM Cell Switch · NCR / IAB CEsL1/L2 mobility · repeater / relay control.

Priority order (highest first): C-RNTI/CCCH → CG-Confirmation → BSR → PHR → data → padding-BSR. See Module 17.

8

MAC PDU format

§6.1.2 · §6.2

A chain of sub-PDUs, each = a subheader + (SDU | CE | padding). DL order: CEs → SDUs → padding. UL order: SDUs → CEs → padding.

sh MAC CE sh MAC SDU (DTCH) sh MAC SDU (DCCH) PADDING subheader fields: R · F · LCID(6b) [· eLCID] · L(8/16b)

Fixed-size CEs carry no L field. LCID = 6 bits (64 values); an escape value selects the extended eLCID. Special PDUs: RAR (RAPID + TA/grant/TC-RNTI, optional BI), MSGB, SL-SCH (with SRC/DST), transparent (BCH/PCH). See Module 18.

9

MAC → KPI map

field reference

The diagnostic table — read it backwards: start at the symptom, follow to the procedure.

MAC areaKPI impactTypical symptom → suspect
Random AccessAccessibility · setup successLow setup success → preamble capacity / config / congestion
HARQThroughput · residual BLERThroughput sags, good RSRP → interference / soft buffer
SR / BSRUplink latencyHigh UL latency, good RF → grant-request path / TA loss
PHRUplink coverageCell-edge UL fails → power-limited (persistent −ve PHR)
DRXBattery ⇄ latencyDead battery / laggy voice → cycle & on-duration tuning
BWPPower ⇄ throughputBattery drain / tput dips → bwp-InactivityTimer
SCell / CAAggregated throughputLow aggregate, good RF → SCells not activated
BFRMobility · FR2 drop rateHigh-band drops → beam management / candidate list
10

The golden rules

RRC configures · MAC executes. Almost every fix is a configured parameter — a timer, a threshold, a priority.
Failing vs waiting. Failing → radio / HARQ / coverage. Waiting → grants / scheduling / timers. Ask first; halve the search.
One HARQ entity per serving cell. HARQ is MAC-controlled, PHY-assisted (soft combining lives in PHY).
MAC's lane. Maps · multiplexes · HARQ · reports · prioritizes · pads. It does not cipher, segment, or modulate.
Shrink when idle. DRX sleeps the receiver · BWP narrows the band · SCell deactivates · Cell DTX/DRX rests the whole cell.
The log is the dialogue. Every grant, report, and control element, in order — name the procedure, find its CE/timer, check timing, correlate, tune.
← Back to the 21 modules