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.
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).
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).
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.
One cell group · the common case.
Dual connectivity — two independent entities (separate HARQ, timers, RA).
Source + target entities run together, briefly, for near-zero interruption.
The entity gains a PC5 path for direct device-to-device traffic.
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.
| Direction | Logical channel(s) | → Transport channel |
|---|---|---|
| UL | CCCH · DCCH · DTCH | UL-SCH |
| UL | — (preamble only) | RACH |
| DL | BCCH (MIB) | BCH |
| DL | BCCH (SIBs) · CCCH · DCCH · DTCH · MCCH · MTCH | DL-SCH |
| DL | PCCH | PCH |
| SL | SCCH · STCH | SL-SCH |
| SL | SBCCH | SL-BCH |
One transport channel (esp. DL-SCH) carries many logical channels at once — which is exactly why MAC must multiplex.
Everything MAC does, in one list. Every later procedure is one of these, zoomed in.
Logical channels → transport channels.
Pack SDUs + CEs into a transport block (tx); split it back (rx).
Error correction by retransmission. One HARQ entity per serving cell; MAC-controlled, PHY-assisted (soft combining).
SR (ask for room), BSR (how much), PHR (how much power).
Between UEs (dynamic scheduling) and between logical channels (LCP) + padding.
MAC never invents behaviour — RRC supplies the timers, priorities, and rules.
Each links to its full cinematic module.
The clocks and tallies that govern MAC behaviour. Almost every field-tuning fix lives here.
| Area | Timer / counter | Role |
|---|---|---|
| Random Access | ra-ResponseWindow | Window to receive the RAR (Msg2). |
| Random Access | ra-ContentionResolutionTimer | Wait for Msg4; restarts per Msg3 retx. |
| Random Access | preambleTransMax · PREAMBLE_POWER_RAMPING_COUNTER | Max preamble attempts; power-ramp step counter. |
| Timing Advance | timeAlignmentTimer (per TAG) | UL aligned while running; expiry → stop UL, re-RA for pTAG. |
| Scheduling Request | sr-ProhibitTimer · sr-TransMax | Min gap between SRs; max SRs before RA fallback. |
| BSR | periodicBSR-Timer · retxBSR-Timer | Periodic refresh; re-trigger if no grant. |
| PHR | phr-PeriodicTimer · phr-ProhibitTimer | Periodic report; min gap; + pathloss-change trigger. |
| DRX | drx-onDurationTimer · drx-InactivityTimer | Scheduled awake window; activity-driven extension. |
| DRX | drx-HARQ-RTT-TimerDL/UL · drx-RetransmissionTimerDL/UL | Sleep through the RTT; wake for the retx window. |
| DRX | drx-ShortCycle · drx-ShortCycleTimer · drx-LongCycle | Short cycle first; then long cycle. |
| BWP | bwp-InactivityTimer | Expiry → switch to the (narrow) default BWP. |
| SCell / CA | sCellDeactivationTimer | No activity → auto-deactivate the SCell. |
| Beam failure | beamFailureDetectionTimer · beamFailureInstanceMaxCount | Count BFD instances; reach max → failure declared. |
| Beam failure | beamFailureRecoveryTimer | Bounds recovery; expiry → radio link failure. |
| Data inactivity | dataInactivityTimer | No data for a long time → go to RRC_IDLE. |
MAC's own messages, multiplexed into the PDU and flagged by a reserved LCID (or eLCID). ↓ = network→device, ↑ = device→network.
| Dir | Control element | Purpose |
|---|---|---|
| ↑ | C-RNTI | Device identity (in Msg3). |
| ↓ | UE Contention Resolution Identity | Resolve a RA collision (Msg4). |
| ↓ | Timing Advance Command · Absolute TA | Adjust / set uplink timing. |
| ↓ | DRX Command · Long DRX Command | Sleep 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 / Deactivation | Bitmap to switch carriers on/off. |
| ↑ | BFR | Failed cell + new candidate beam. |
| ↓ | TCI / SP-CSI / SP-SRS / PUCCH spatial | Fast beam & measurement control. |
| ↑ | LBT Failure · Delay Status · TA Report | Unlicensed / delay-critical / NTN reports. |
| ↓ | LTM Cell Switch · NCR / IAB CEs | L1/L2 mobility · repeater / relay control. |
Priority order (highest first): C-RNTI/CCCH → CG-Confirmation → BSR → PHR → data → padding-BSR. See Module 17.
A chain of sub-PDUs, each = a subheader + (SDU | CE | padding). DL order: CEs → SDUs → padding. UL order: SDUs → CEs → padding.
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.
The diagnostic table — read it backwards: start at the symptom, follow to the procedure.
| MAC area | KPI impact | Typical symptom → suspect |
|---|---|---|
| Random Access | Accessibility · setup success | Low setup success → preamble capacity / config / congestion |
| HARQ | Throughput · residual BLER | Throughput sags, good RSRP → interference / soft buffer |
| SR / BSR | Uplink latency | High UL latency, good RF → grant-request path / TA loss |
| PHR | Uplink coverage | Cell-edge UL fails → power-limited (persistent −ve PHR) |
| DRX | Battery ⇄ latency | Dead battery / laggy voice → cycle & on-duration tuning |
| BWP | Power ⇄ throughput | Battery drain / tput dips → bwp-InactivityTimer |
| SCell / CA | Aggregated throughput | Low aggregate, good RF → SCells not activated |
| BFR | Mobility · FR2 drop rate | High-band drops → beam management / candidate list |