● Formula & Parameter Cheat-Sheet · 3GPP TS 38.321 v19.1.0

Every MAC formula, on one page

The equations and parameter ranges an engineer actually reaches for: power ramping, timing-advance maths, HARQ process counts, BSR/PHR computation, the LCP token bucket, DRX cycle arithmetic, and the SR counter — each with its variables spelled out and its clause cited. Pairs with the Theory Deep-Dive.

1

Random access & power ramping

§5.1.2 – §5.1.5

Each failed preamble ramps the next transmission up by a configured step, until either a response arrives or the attempt counter maxes out and access fails.

PREAMBLE_RECEIVED_TARGET_POWER = preambleReceivedTargetPower + DELTA_PREAMBLE + (PREAMBLE_POWER_RAMPING_COUNTER 1) × PREAMBLE_POWER_RAMPING_STEP + POWER_OFFSET_2STEP_RA // 0 for 4-step
preambleReceivedTargetPower — RRC target Rx level at gNB (dBm).
DELTA_PREAMBLE — offset from the preamble format/SCS.
RAMPING_COUNTER — +1 per retx; not incremented if power held (e.g. beam switch).
RAMPING_STEPpowerRampingStep {0,2,4,6} dB.

Counter rule (§5.1.3): if no response, PREAMBLE_TRANSMISSION_COUNTER += 1; when it reaches preambleTransMax+1 → random-access problem indicated to RRC. Backoff before retry: PREAMBLE_BACKOFF = rand(0,1) × BI, where BI is the backoff-indicator value from the RAR.

attempt 1 attempt N → fail each retx +powerRampingStep dB →
2

Timing-advance maths

§5.2

The uplink must arrive time-aligned at the gNB. The Timing Advance Command MAC CE nudges it; the RAR sets it absolutely. Granularity scales with sub-carrier spacing.

TA Command MAC CE (relative)

NTA,new = NTA,old + (T_A 31) × 16 × 64 / 2μ

T_A = 6-bit field (0…63); 31 = no change. μ = SCS index (0=15 kHz … 3=120 kHz).

RAR / Absolute TA

NTA = T_A × 16 × 64 / 2μ

T_A = 12-bit field (0…3846) in the RAR. Applied as the initial uplink timing.

Lifecycle: on any TA command, (re)start timeAlignmentTimer for that TAG. While it runs the UL is aligned. On expiry → flush HARQ buffers, release PUCCH/SRS, clear configured grants; for the pTAG, all UL is suspended until a fresh RACH. Tc = 1 / (480 000 × 4096) s is the basic time unit.

3

HARQ at a glance

§5.3 · §5.4.2

One HARQ entity per serving cell, holding a fixed set of stop-and-wait processes. New data is signalled by toggling the NDI; a held NDI means "retransmit, soft-combine".

ItemValue / rule
HARQ entitiesOne per serving cell (DL and UL each).
Processes / cellnrofHARQ-ProcessesForPDSCH up to 16 (Rel-16+ extension up to 32 for some configs).
New data indicatorNDI toggled ⇒ new TB (flush soft buffer). NDI held ⇒ retransmission (soft-combine).
Redundancy versionRV typically transmitted in order {0, 2, 3, 1}; RV0 is self-decodable.
UL retransmissionNo UL HARQ feedback channel — the next grant (same process, held NDI) commands the retx.
DL feedbackACK/NACK on PUCCH/PUSCH; soft combining in PHY, process bookkeeping in MAC.
DisablingPer-process HARQ feedback can be disabled (e.g. NTN long RTT) — blind transmission instead.

See Module 8 (DL) and Module 9 (UL).

4

Buffer status report

§5.4.5 · §6.1.3.1

The BSR tells the gNB how much data waits, per logical channel group. Up to 8 LCGs (0–7). The reported value is an index into a standardised buffer-size table.

Formats & fields

FormatBuffer-size field
Short / Short-truncated1 LCG + 5-bit index (32 levels)
Long / Long-truncatedLCG bitmap + 8-bit index each (256 levels)

Long table extends to ~150 MB; short table to ~150 kB. Values are quantised ranges, not exact byte counts.

Triggers

TypeCondition
RegularNew data for an LCH of higher priority than any buffered, or first data for any LCG; also drives an SR if no grant.
PeriodicperiodicBSR-Timer expires.
PaddingGrant leftover ≥ a BSR + subheader.

retxBSR-Timer re-triggers a regular BSR if a grant never came. See Module 11.

5

Power headroom

§5.4.6 · §6.1.3.8

Headroom = how much transmit power is left before the device's ceiling. Negative headroom means it is already power-limited — a coverage signal, not interference.

PHtype1,c = P_CMAX,c { P_O_PUSCH + α·PL + 10·log₁₀(2μ·MRB) + ΔTF + f }
P_CMAX,c — configured max UE tx power on cell c.
PL — downlink pathloss estimate; α — fractional-PC factor.
M_RB — allocated PUSCH resource blocks.
f — accumulated closed-loop TPC adjustment.

Types: Type 1 = PUSCH, Type 3 = SRS. Multiple-Entry PHR reports every activated serving cell (one octet of P_CMAX,c each) for carrier aggregation. Triggers: phr-PeriodicTimer expiry, or pathloss change > phr-Tx-PowerFactorChange with phr-ProhibitTimer elapsed. See Module 12.

6

Logical-channel prioritisation

§5.4.3.1

A token bucket per logical channel guarantees each its prioritised bit rate, while still letting high-priority traffic burst. Two rounds fill the grant.

// per increment, T = elapsed Bj += PBR × T // hard cap Bj BSD × PBR
PBRprioritisedBitRate (the guaranteed rate).
BSDbucketSizeDuration (burst depth).
Bj — current tokens (bytes) for channel j.

Two-round fill

Round 1 — in decreasing priority, serve each LCH only up to its token balance Bj, decrementing Bj by the bytes served (never below 0).
Round 2 — strict priority, ignore Bj, fill until the grant is empty or data runs out.
Subject to per-LCH restrictions: allowed SCS, max PUSCH duration, configured-grant only, allowed cells.

Bj tokens +PBR×T serve LCH grant filled

See Module 10 for the full algorithm walk-through.

7

DRX cycle arithmetic

§5.7

The on-duration starts on the slot where the cycle equation hits the configured offset. Inactivity extends the awake window; HARQ-RTT lets the device nap between a transmission and its retransmission grant.

// long cycle — on-duration starts when: [ (SFN × 10) + subframe ] mod drx-LongCycle = drx-StartOffset // short cycle (if configured) — starts when: [ (SFN × 10) + subframe ] mod drx-ShortCycle = drx-StartOffset mod drx-ShortCycle
drx-onDurationTimer — length of the scheduled awake window.
drx-InactivityTimer — restarts on each new (initial) grant → stay awake.
drx-HARQ-RTT-TimerDL/UL — guaranteed sleep before a retx is possible.
drx-RetransmissionTimerDL/UL — wake to listen for the retransmission.

Active Time = any of these running: onDuration, Inactivity, Retransmission, ra-ContentionResolutionTimer; or an SR is pending; or an unACKed contention-resolution grant is awaited. Short→long fallback via drx-ShortCycleTimer. See Module 13.

onDuration +Inactivity asleep (HARQ-RTT) retx wake deep sleep → next cycle one DRX cycle = drx-LongCycle
8

Scheduling request counter

§5.4.4

An SR is a one-bit "I have data" on PUCCH. If the network never answers, the counter climbs to its ceiling and the device falls back to random access.

// on each SR transmission occasion: SR_COUNTER += 1 if (SR_COUNTER sr-TransMax) release PUCCH & SRS, clear configured grants, initiate Random Access
sr-ProhibitTimer — minimum gap between SR transmissions.
sr-TransMax — {4,8,16,32,64} max SRs before RA fallback.
schedulingRequestId — links an SR config to specific logical channels.
Pending SR — set by a regular BSR while no UL-SCH grant is available.

An SR triggers only when a regular BSR has been triggered and there is no grant to send it in. While an SR is pending the UE is in DRX Active Time. See Module 11.

9

Key parameter ranges

RRC-configured · §5

The RRC-supplied knobs MAC executes against. Ranges are the standardised enumerations; field-typical starting points are noted where useful.

ParameterRange / valuesGoverns
powerRampingStep{0, 2, 4, 6} dBRA power ramp per retx
preambleTransMax{3,4,5,6,7,8,10,20,50,100,200}Max preamble attempts
ra-ResponseWindow{1…80} slotsRAR (Msg2) wait
ra-ContentionResolutionTimer{8,16,24,…,64} subframesMsg4 wait
periodicBSR-Timer{1,5,10,…,2560} sf · infinityBSR refresh cadence
retxBSR-Timer{10,20,…,10240} sfBSR re-trigger on no grant
sr-ProhibitTimer{0,1,2,4,8,16,32,64,128} msMin gap between SRs
sr-TransMax{4,8,16,32,64}SRs before RA fallback
phr-PeriodicTimer{10,20,…,1000} sf · infinityPeriodic PHR
phr-Tx-PowerFactorChange{1,3,6} dB · infinityPathloss-change PHR trigger
drx-LongCycle{10,20,32,…,10240} msSleep cadence
drx-onDurationTimer{1…1600} ms (sub-ms steps)Awake window length
drx-InactivityTimer{0,1,2,…,2560} msStay-awake after a grant
bwp-InactivityTimer{2,3,4,…,2560} msFall back to default BWP
sCellDeactivationTimer{20,40,…,1280} ms · infinityAuto-deactivate SCell
timeAlignmentTimer{500,750,…,10240} ms · infinityUL timing validity
beamFailureInstanceMaxCount{1,2,3,4,5,6,8,10}Beam-failure declaration
dataInactivityTimer{1,2,3,5,…,180} sDrop to RRC_IDLE

Exact enumerations are defined in TS 38.331 (RRC); MAC behaviour against them is in TS 38.321. Values above are representative — always confirm against the release you target.

📖 Theory Deep-Dive ← Back to the 21 modules