MAC Layer Overview in 5G NR
What the MAC does: channel mapping, multiplexing, HARQ, scheduling info and random access.
The MAC (Medium Access Control) layer is the traffic cop that sits between RLC and the physical layer. It decides what gets sent, when, and on which shared radio resources — packing data from many logical flows into a single transport block, retransmitting what the air corrupts, and telling the scheduler how hungry and how loud the UE is. Everything about how a UE actually gets bits onto the shared radio starts here. It is defined in TS 38.321.
Introduction
The MAC sublayer (TS 38.321) is the lowest layer of the radio protocol stack that still reasons about which data goes out and when. It sits between RLC above and the physical layer below, and it is where the abstract idea of "a UE with data to send" becomes the concrete reality of "a transport block on a shared, error-prone medium, delivered to the right UE at the right time."
It is active the entire time a UE is attached, in every direction and in every state that carries traffic. Every scheduled uplink and downlink transmission passes through it: the MAC receives a grant, fills a transport block, runs HARQ, and reports its status back to the scheduler — slot after slot. It also owns several housekeeping procedures that keep the link alive: random access, timing-advance maintenance, DRX, BWP switching and SCell control.
It matters because the air interface is one shared medium that many UEs and many logical flows must contend for, and it is fast and lossy. Higher layers cannot react quickly enough to schedule slot-by-slot or to recover from air errors in a few milliseconds. The MAC is the layer built for exactly that speed — multiplexing competing flows, correcting errors with soft-combining before RLC ever sees them, and keeping the uplink time-aligned so dozens of UEs land inside the same slot boundary.
On this page
What the MAC layer actually does
Everything above the MAC thinks in terms of logical channels — streams of a particular kind of information (signalling, user data, paging). Everything below the MAC thinks in terms of transport channels — chunks of bits the physical layer knows how to code and modulate. The MAC's core job is to bridge those two worlds and to arbitrate the one thing every UE in a cell must share: the radio. It is the lowest layer that still reasons about which data goes out, in what order, and how much of it.
A sublayer that maps logical channels to transport channels, multiplexes SDUs from several logical channels into one transport block, runs HARQ, and controls access to the shared channel via scheduling, BSR/PHR reporting, random access, timing-advance maintenance and DRX.
The air interface is one shared, error-prone medium. Something has to decide how competing flows share a transport block, retransmit corrupted data fast, keep the UE's uplink time-aligned, and let the UE sleep when idle. That "something" is the MAC.
One MAC entity per cell group. It receives grants from the scheduler, runs LCP to fill the transport block, prepends MAC subheaders and MAC CEs, hands the block to HARQ, and reports buffer/headroom status back up so the scheduler keeps feeding it.
The MAC provides data-transfer and radio-resource-allocation services to RLC above it, and uses the transport-channel services of the physical layer below. TS 38.321 enumerates its functions as a checklist, and it is worth being able to name every one of them — each is a distinct piece of machinery the layer runs.
| MAC function | What it means |
|---|---|
| Channel mapping | Maps logical channels onto transport channels (and demaps on receive). See Channel Mapping. |
| Multiplexing / demultiplexing | Packs MAC SDUs from several logical channels into one transport block delivered to PHY; unpacks on receive. |
Error correction — HARQ | Hybrid ARQ with soft-combining; one or more parallel stop-and-wait processes per carrier. See HARQ. |
Logical channel prioritization — LCP | Decides which logical channel's data fills the grant first, respecting PBR and priority. |
| Scheduling-information reporting | BSR (how much data is buffered), SR (please schedule me) and PHR (how much power headroom is left). |
| Random access | Preamble transmission and the contention-resolution procedure. See Random Access. |
| Timing-advance / UL time alignment | Applies the Timing Advance Command and runs the timeAlignmentTimer so uplink transmissions arrive time-aligned at the gNB. |
Discontinuous reception — DRX | Lets the UE stop monitoring PDCCH to save battery. See DRX. |
| BWP operation | Suspends/resumes transmission on BWP switch, and runs the bwp-InactivityTimer that falls back to the default BWP. |
SCell (de)activation | Activates and deactivates configured secondary cells via MAC CE and the sCellDeactivationTimer. |
| Priority handling between UEs | Dynamic scheduling by the gNB across UEs on the shared channel. |
| Padding | Fills any leftover bits in a transport block so it exactly matches the granted size. |
One-liner: the MAC turns "several logical streams that want to send" into "one transport block on shared radio, delivered reliably and on time." Mapping + multiplexing + HARQ + scheduling glue is the whole story.
Why the MAC layer is needed
In plain words: think of a busy post office with one loading dock (the shared radio) and many people (logical flows) with parcels to send. Someone has to decide whose parcels go in the next truck, pack them tightly so no space is wasted, re-send anything that arrives damaged, and make sure the truck leaves on schedule. The MAC is that dispatcher — and it works in milliseconds, far faster than head office (RRC) could ever manage.
Higher layers deliver neat, orderly streams and assume they will arrive. The radio makes no such promise: it is shared among every UE in the cell, its capacity changes slot by slot, and it corrupts blocks constantly. Three hard problems fall out of that, and the MAC exists to solve all three at once.
One medium, many flows and many UEs. The MAC arbitrates — LCP decides which logical channel fills the grant, and the gNB scheduler decides which UE transmits at all.
The air corrupts transport blocks routinely. Waiting for RLC ARQ would be far too slow, so HARQ retransmits with soft combining in a few slots, catching most errors before RLC ever sees them.
UEs at different distances must arrive time-aligned; battery must be conserved. Timing advance, DRX, and BSR/PHR reporting keep the uplink aligned, efficient and asleep when idle.
Everything the MAC does is in service of doing these fast and in-band — carrying control as MAC CEs inside the same transport block as the data, so a slot-timescale decision never has to wait for the slow, reliable RRC path.
Logical channels above, transport channels below
The two interfaces the MAC bridges are named and fixed. Above it, RLC delivers data on logical channels, classified by what kind of information they carry — control-plane signalling versus user-plane traffic, dedicated versus common. Below it, the physical layer offers transport channels, classified by how the information is transported over the air. The MAC's channel-mapping function is exactly the wiring between these two sets.
| Logical channel | Plane | What it carries |
|---|---|---|
BCCH (Broadcast Control Channel) | Control, DL | System information broadcast to all UEs in the cell (MIB via BCH, SIBs via DL-SCH). |
PCCH (Paging Control Channel) | Control, DL | Paging messages to reach idle/inactive UEs whose exact cell is unknown. |
CCCH (Common Control Channel) | Control, UL/DL | Signalling to/from a UE that has no dedicated RRC connection yet — used during connection setup (e.g. Msg3). |
DCCH (Dedicated Control Channel) | Control, UL/DL | Point-to-point RRC and NAS signalling for a connected UE. |
DTCH (Dedicated Traffic Channel) | User, UL/DL | The UE's actual user-plane data — the payload everything else exists to carry. |
On the transport side, the MAC deals with the DL-SCH (Downlink Shared Channel) and UL-SCH (Uplink Shared Channel) for the vast majority of traffic, the PCH (Paging Channel) for paging, the BCH (Broadcast Channel) for the fixed-format MIB, and the RACH (Random Access Channel) for preambles. The shared channels (DL-SCH/UL-SCH) are the workhorses: they support dynamic transport-block size, HARQ, link adaptation (dynamic modulation and coding) and beam-specific transmission. "Dynamic TB size" is the crucial property — every grant tells the UE exactly how many bits fit in this transmission, computed from the allocated resource blocks, the modulation-and-coding scheme and the number of layers, so the transport block is sized fresh for each slot rather than fixed in advance.
| Transport channel | Direction | Carries / notes |
|---|---|---|
BCH | DL | The MIB — fixed transport format, broadcast on the whole cell. |
DL-SCH | DL | All downlink user data and most signalling; dynamic TB size, HARQ, link adaptation, DRX, beamforming. |
PCH | DL | Paging; mapped onto physical resources shared with DL-SCH, supports DRX. |
UL-SCH | UL | All uplink user data and signalling; dynamic TB size, HARQ, link adaptation. |
RACH | UL | Carries the random-access preamble — no transport block, no HARQ. |
The mapping is many-to-one where it needs to be: BCCH maps to BCH (for the MIB) and to DL-SCH (for SIBs); PCCH maps to PCH; CCCH, DCCH and DTCH all map to DL-SCH/UL-SCH. That collapsing of many logical channels onto the shared transport channel is precisely why multiplexing and prioritization exist.
LTE → NR: the logical/transport channel families are almost identical to LTE (TS 36.321), but NR deliberately dropped the dedicated physical control-format and CFI machinery and made almost everything ride the shared channels with dynamic TB sizing and beamforming. There is no MCCH/MTCH in baseline NR, and the always-on cell-specific reference signal is gone, so the shared-channel-centric design is even more pronounced than in LTE.
One MAC entity per cell group, addressed by C-RNTI
A UE has a separate MAC entity for each cell group: one for the Master Cell Group (MCG) and, when dual connectivity is configured, one for the Secondary Cell Group (SCG). There is one MAC per UE per cell group — each entity independently runs its own HARQ, DRX, BSR, timing-advance and random-access machinery for the cells in its group, because the two groups are served by different nodes on different carriers. Within a cell group, one cell is the special cell (SpCell — the PCell for MCG or PSCell for SCG) and the rest are SCells added by carrier aggregation.
On the shared channel there is no dedicated pipe per UE, so the network needs a way to say "this grant is for you." That is the job of the RNTI — a Radio Network Temporary Identifier that scrambles the CRC of the PDCCH that carries the grant. The UE's persistent identity in a cell is its C-RNTI (Cell RNTI, a 16-bit value in the range 0x0001–0xFFEF); a PDCCH whose CRC unmasks with the UE's C-RNTI is a grant addressed to that UE. Other RNTIs address shared or transient procedures.
| RNTI | Used for |
|---|---|
C-RNTI | The UE's unique identity in the cell — addresses dynamic UL/DL grants on PDCCH. |
RA-RNTI | Addresses the Random Access Response (Msg2) during random access. |
TC-RNTI | Temporary C-RNTI assigned in Msg2, promoted to C-RNTI after contention resolution. |
SI-RNTI / P-RNTI | Address system information and paging respectively (common, not UE-specific). |
Because each MAC entity is bound to one cell group, dual-connectivity operation is cleanly partitioned: a NACK on an SCG carrier, a BSR for MCG data, or a random-access attempt on the PSCell are all handled by their own entity without touching the other. This is what lets a UE be scheduled by two schedulers at once without the two stepping on each other.
Where the MAC sits and what flows through it
The MAC lives directly below RLC and directly above the physical layer. RLC hands it PDUs (which become MAC SDUs) over logical channels; the MAC multiplexes them with any control elements into a transport block and passes it to PHY over a transport channel. Read the figure top to bottom: logical channels enter, the entity's functions act on them, and one transport block leaves.
Multiplexing, MAC PDU structure, LCP, padding and HARQ
When the scheduler grants the UE resources, the MAC must fill exactly that many bits — no more, no less. It runs LCP to decide the order in which logical channels contribute their SDUs, then assembles a MAC PDU: a sequence of MAC subPDUs, each a subheader plus either a MAC SDU, a MAC CE (control element), or padding. MAC CEs carry in-band control — a BSR, a PHR, a C-RNTI, DRX commands, SCell activation — and are placed at defined positions relative to SDUs (CEs first in the UL PDU, near the end in the DL PDU). See MAC PDU & CEs for the byte-level layout.
LCP (logical channel prioritization) gives each logical channel a priority and a Prioritized Bit Rate (PBR) with an associated bucket. In the first round each channel is served up to its PBR in strict priority order, so a high-priority channel cannot completely starve a lower one; any remaining grant is then filled by strict priority until either the data or the grant runs out. NR adds LCP restrictions — a logical channel can be mapped only to permitted numerologies, cells, or PUSCH durations (allowedSCS-List, maxPUSCH-Duration, allowedServingCells) — so latency-critical traffic is confined to fast numerologies. This is how the UE splits a single grant fairly across, say, a signalling DCCH and a data DTCH. If, after all SDUs and CEs are placed, bits remain, the MAC inserts padding (a padding subheader plus padding bits) so the PDU exactly matches the transport-block size; a padding BSR may opportunistically occupy that space instead.
Hybrid ARQ: forward error correction plus retransmission with soft combining. The receiver keeps the corrupted copy and combines it with the retransmission instead of throwing it away.
The air corrupts blocks constantly. Waiting for RLC ARQ would be far too slow; HARQ retransmits within a few slots at the MAC, so most errors never reach RLC.
Multiple parallel stop-and-wait HARQ processes (up to 16 per carrier). The receiver returns HARQ-ACK/NACK; on NACK the sender resends (chase combining or incremental redundancy). NR HARQ is asynchronous and adaptive in both directions.
Each HARQ process holds one transport block awaiting acknowledgement, identified by a HARQ process ID carried in the DCI. Because several processes run in parallel, the UE can keep transmitting new blocks while earlier ones await feedback — stop-and-wait per process, pipelined across processes. A New Data Indicator (NDI) toggle in the DCI tells the UE whether a grant carries fresh data or a retransmission of the block already buffered in that process, and the Redundancy Version selects which coded bits are sent so incremental-redundancy combining can improve the odds on each try.
LTE → NR: LTE HARQ was synchronous in the uplink — a retransmission landed at a fixed offset, so the process ID was implicit from timing. NR makes HARQ asynchronous and adaptive in both directions: the HARQ process ID is signalled explicitly in the DCI, retransmissions can be rescheduled freely, and this flexibility is what lets NR mix numerologies and short/long transmissions in the same carrier.
Reporting to the scheduler: BSR, SR, PHR, timing advance and DRX
The gNB scheduler cannot allocate uplink well unless it knows two things about the UE: how much data is waiting, and how much transmit power is left. The MAC reports both as MAC CEs, and asks for resources with a SR when it has none.
| Report | Answers the question | Triggered by |
|---|---|---|
BSR (Buffer Status Report) | "How much UL data do I have buffered, per logical channel group?" | New higher-priority data arriving (regular), a periodic timer, or leftover grant space (padding BSR). |
SR (Scheduling Request) | "I have data but no grant — please schedule me." | A BSR is triggered with no UL grant available; sent on PUCCH. |
PHR (Power Headroom Report) | "How much more power could I use beyond what I'm transmitting?" | Pathloss change beyond a threshold, a periodic timer, or configured triggers. |
The BSR reports per Logical Channel Group (LCG — up to 8 groups) rather than per channel, keeping the report compact; a regular BSR triggered by newly arrived higher-priority data is what usually kicks off an SR when the UE has nothing to send on. If even PUCCH resources for the SR are missing, the UE falls back to random access to get a grant.
Timing advance and uplink time alignment are the MAC's job of keeping uplink transmissions from different UEs arriving aligned at the gNB despite differing propagation delays. The gNB measures the UE's timing and sends a Timing Advance Command MAC CE; the UE applies the offset and (re)starts its timeAlignmentTimer for that timing-advance group (TAG). While the timer runs the uplink is considered synchronised; if it expires, the UE releases PUCCH/SRS resources and must re-acquire timing through random access before transmitting again. This is why a UE that has been silent for a while may have to do random access even though it is still in RRC_CONNECTED.
Once the UE is connected, blindly monitoring PDCCH every slot would drain the battery. DRX lets the MAC switch the receiver off on a schedule. During the On Duration the UE monitors PDCCH; if nothing is scheduled it may sleep until the next cycle. Any activity restarts the drx-InactivityTimer, keeping the UE awake while traffic flows, and a drx-RetransmissionTimer keeps it listening for pending HARQ retransmissions. See DRX for the timer details.
BWP operation, SCell (de)activation and the MAC CE catalogue
Two more control functions round out the MAC's remit, and both are driven by MAC CEs. BWP operation concerns the active Bandwidth Part — the slice of carrier bandwidth the UE is currently tuned to. A UE may be configured with several BWPs (up to four per direction) but only one is active per direction at a time. A DCI or a MAC-visible timer can switch it: the bwp-InactivityTimer runs while the UE is on a non-default BWP, and on expiry the MAC switches back to the default BWP (typically narrower) to save power. When the active BWP changes, the MAC suspends transmission on the old BWP and resumes on the new one, keeping HARQ buffers intact.
SCell (de)activation lets carrier aggregation add bandwidth only when it is needed. Configured SCells start deactivated; the gNB sends an SCell Activation/Deactivation MAC CE (a bitmap, one bit per SCell) to bring them up, and each active SCell runs an sCellDeactivationTimer that deactivates it again after a period of inactivity. Deactivating an SCell stops its PDCCH monitoring, CSI reporting and SRS, which is a large power saving when the extra carriers are idle.
All of these control functions travel in-band as MAC control elements, each identified by a reserved LCID in its subheader. The catalogue below is the working set you should recognise.
| MAC CE | Direction | Purpose |
|---|---|---|
Buffer Status Report (short / long) | UL | Reports buffered data per logical channel group to the scheduler. |
Power Headroom Report (single / multiple) | UL | Reports remaining transmit-power headroom, per cell for multi-entry. |
C-RNTI | UL | Carries the UE's identity during contention-based random access (Msg3). |
Timing Advance Command | DL | Adjusts uplink timing for a timing-advance group; restarts the timeAlignmentTimer. |
DRX Command / Long DRX Command | DL | Forces the UE into sleep immediately, ending the active time. |
SCell Activation/Deactivation | DL | Bitmap that activates or deactivates configured secondary cells. |
BFR (Beam Failure Recovery) | UL | Reports beam failure and a candidate beam for recovery. |
Padding | UL/DL | Fills any leftover bits so the PDU exactly matches the transport-block size. |
Why MAC CEs and not RRC: control that must react in a slot or two — buffer status, timing, sleep, SCell power — cannot wait for the slow, reliable RRC path. Carrying it as a MAC CE inside the same transport block makes it as fast as the data it rides with.
⚠ Common pitfalls / gotchas
- Confusing logical, transport and physical channels.
DTCH(logical) maps toUL-SCH/DL-SCH(transport) carried onPUSCH/PDSCH(physical) — three different names for three different layers of the same data path. - Assuming one MAC entity per UE. It is one entity per cell group; under dual connectivity the MCG and SCG each have their own HARQ, DRX and timing-advance state.
- Treating
BSRas per-logical-channel. It is reported per Logical Channel Group, so the scheduler sees aggregated buffer levels, not individual channels. - Forgetting that an expired
timeAlignmentTimerforces random access even inRRC_CONNECTED— the connection is fine, but the uplink is no longer time-aligned. - Expecting
HARQalone to guarantee delivery. It corrects most air errors fast, but residual errors (e.g. a NACK misread as ACK) are cleaned up by the slower RLC ARQ above it — the two layers are complementary, not redundant.
Summary
The MAC (TS 38.321) is the sublayer that turns many logical streams into one transport block on shared radio, delivered reliably and on time. It maps logical channels (BCCH/PCCH/CCCH/DCCH/DTCH) to transport channels (BCH/DL-SCH/UL-SCH/PCH/RACH), multiplexes SDUs and in-band MAC CEs into a dynamically-sized transport block via LCP and padding, and runs HARQ with soft combining to catch air errors in a few slots.
It is organised as one entity per cell group (MCG and, under dual connectivity, SCG), each with independent HARQ, DRX, BSR and timing-advance state, and it addresses grants on the shared channel by scrambling PDCCH CRC with the UE's C-RNTI. Around that core it runs the machinery that keeps the link alive and efficient: BSR/SR/PHR reporting to the scheduler, timing-advance maintenance via the timeAlignmentTimer, DRX for battery, and BWP and SCell control — all carried as fast, in-band MAC CEs rather than slow RRC signalling. Master those pieces and the deeper topics — channel mapping, MAC PDU layout, HARQ, random access, DRX — are each just one function of this layer examined up close.
Q. How many MAC entities does a UE have, and why?
A. One per configured cell group — MCG and, under dual connectivity, SCG. Each runs its own HARQ, DRX, BSR, timing advance and random access independently, because the two groups are served by different nodes on different carriers.
Q. What is the difference between HARQ and RLC ARQ?
A. HARQ is a fast, physical-layer-aware retransmission at the MAC with soft combining, correcting most air errors in a few slots. RLC ARQ is a slower, reliable backstop above it for the residual errors HARQ misses (e.g. NACK-to-ACK feedback errors).
Q. Which logical channel carries user data, and which transport channel does it map to?
A. The DTCH carries user-plane data; it maps to DL-SCH in the downlink and UL-SCH in the uplink — the shared channels that support dynamic transport-block size and HARQ.
Q. Why might a connected UE have to perform random access even though it never lost its connection?
A. Its timeAlignmentTimer expired, so its uplink is no longer time-aligned. It must re-acquire a Timing Advance Command through random access before it can transmit on the uplink again.
Q. What is the point of the Prioritized Bit Rate in LCP?
A. It guarantees each logical channel a minimum share of a grant in the first round before strict priority takes over, so a high-priority channel cannot completely starve a lower-priority one.
Q. How does the MAC make a transport block exactly the granted size?
A. After placing SDUs and MAC CEs, it inserts a padding subheader and padding bits (or an opportunistic padding BSR) to fill any remaining bits, so the PDU matches the dynamically computed TB size.
Where to go next
You now know what the MAC does, the channels it bridges, and how it is organised. Drill into the pieces it touches: