MAC Protocol Overview, PDU Structure & Reset

Architecture, function interconnections, MAC PDU assembly, reset/re-establishment & 6G evolution

Scheduling BSR LCP SR & RA SPS & CG DL Assign HARQ PHR TA DRX RACH ★ CA ★ DC ★ BFR ★ Sidelink ☆ NTN MAC ☆ Energy-Saving ☆ AI Scheduling ☆ ISAC ☆ IAB MAC ☆ Cell-Free

1. MAC Architecture — Where MAC Sits

The MAC layer bridges RLC (above) and PHY (below), providing data transfer, scheduling, and control services. One MAC entity per cell group (MCG/SCG), managing up to 32 SCells.

🏗️ MAC Architecture — Data Flow Through the Stack

Animated protocol stack showing data flow: SDAP → RLC → MAC (with all sub-functions) → PHY. Watch packets traverse the layers.

Services to RLC

Data transfer (DL-SCH/UL-SCH), radio resource allocation, and MAC-internal control via CEs.

Channel Mapping

Logical channels (CCCH/DCCH/DTCH) map to transport channels (DL-SCH/UL-SCH/BCH/PCH/RACH).

One MAC Entity

Per cell group: 1 PCell + up to 32 SCells, 4 BWPs each. DC has 2 MAC entities (MCG + SCG).

2. MAC Functions — The Complete List

MAC has 12 core functions that work together as an interconnected system. Each has a dedicated deep-dive page.

#FunctionPurposeDeep Dive
1SchedulinggNB decides who gets resourcesScheduling.md
2LCPToken-bucket grant fillingLCP.md
3HARQError correction via reTXHARQ.md
4BSRReport buffer status to gNBBSR.md
5SR + RA FallbackRequest grants, fallback to RACHSRAndRACHFallback.md
6PHRReport TX power marginPHR.md
7TA MaintenanceKeep UL timing alignedTAMaintenance.md
8DRXPower-saving sleep cyclesDRX.md
9Random AccessInitial access, RA fallbackUE-RACH-Procedure.md
10CG / SPSPre-allocated periodic resourcesSPSAndConfiguredGrants.md
11DL AssignmentN1, preemption, priorityDLAssignmentHandling.md
12Mux/Demux + ResetPDU assembly, state cleanupThis page

3. MAC PDU Structure — The Envelope

Every MAC transmission is a MAC PDU: a sequence of subPDUs, each containing a subheader (LCID + length) and a payload (MAC SDU, MAC CE, or padding).

📦 MAC PDU Builder — Interactive Assembly

Add MAC CEs and SDUs to build a MAC PDU. See subheaders, payload, and byte layout update in real-time.

Subheader FieldShort (≤255B)Long (>255B)
R (reserved)1 bit1 bit
F (format)0 (8-bit L)1 (16-bit L)
LCID6 bits6 bits
L (length)8 bits16 bits
Total2 bytes3 bytes

4. MAC Multiplexing & Demultiplexing

Multiplexing (TX side): CEs first, then SDUs by LCP priority, then padding. Demultiplexing (RX side): parse subheaders → route CEs to MAC handlers, SDUs to RLC entities, discard padding.

🔄 Multiplexing Animation — Multiple LCs → One MAC PDU

Watch data from 3 logical channels plus MAC CEs get assembled into a single MAC PDU, step by step.

MAC overhead: Typically 2-5% for subheaders + CEs. The main waste is padding — > 20% padding ratio suggests the gNB is scheduling oversized grants.

5. MAC Reset & Re-establishment

When the MAC entity is reset (RLF, handover, RRC reconfiguration), all state is cleared: HARQ buffers flushed, timers stopped, SPS/CG deactivated, SR/BSR/PHR cancelled.

🗑️ MAC Reset — Watch State Variables Clear

Interactive visualization: populate MAC state, then trigger reset to see all state variables cleared one by one.

MAC Reset

Clears MAC state only: HARQ, BSR, SR, PHR, TA, DRX, SPS/CG, SCells. RRC/RLC/PDCP unaffected.

MAC Re-establishment

MAC reset + RLC re-establishment + PDCP re-establishment. Triggered by RLF or handover failure.

After Reset

UE performs RACH for new TA. First data triggers new BSR. SPS/CG must be re-activated by gNB.

6. Practical Field Considerations

IssueSymptomRoot Cause
Frequent MAC resetsDL/UL throughput dropsRLF / HO failure
Stale BSR after resetgNB schedules wrong sizeBSR not triggered
TA timer expiryUL transmissions blockedNo TA MAC CE received
HARQ process exhaustionScheduling stallsAll 16 processes busy
Excessive paddingWasted UL resourcesOversized grants

LTE vs 5G NR MAC

AspectLTE5G NR
Subheader2-3 bytes (fixed)2-3 bytes (flexible)
Max LCs1133
MAC CE types~10~20+
Max LCGs (BSR)48
MAC entities1 per UE1 per cell group

7. 6G Evolution — Compressed Headers, AI Assembly, Zero-Copy

Compressed Headers

1-byte subheaders for common IoT packets (4-bit LCID + 4-bit L). 50% overhead reduction vs 5G NR.

AI PDU Assembly

AI predicts which LCs have data next TTI → pre-assembles PDU template → minimizes padding by 30-50%.

Zero-Copy Processing

Direct memory references from RLC to PHY. No buffer copies. MAC latency < 50 μs (vs ~200 μs in 5G).

🚀 MAC Evolution — 4G to 6G

Compare MAC capabilities across generations: header size, LC count, CE types, assembly strategy, and processing latency.

Dimension4G (LTE)5G NR6G (Target)
Subheader size2-3 bytes2-3 bytes1 byte
Max LCs113364+
MAC CE types~10~2030+ (AI-defined)
PDU assemblySequentialSequentialAI-preassembled
Processing latency~1 ms~200 μs< 50 μs
Scheduling BSR LCP SR & RA SPS & CG DL Assign HARQ PHR TA DRX RACH ★ CA ★ DC ★ BFR ★ Sidelink ☆ NTN MAC ☆ Energy-Saving ☆ AI Scheduling ☆ ISAC ☆ IAB MAC ☆ Cell-Free