>
Home5G NRCross-Layer TopicsRegistration Call Flow
🧠 Cross-Layer TopicsIntermediate

End-to-End Registration Call Flow in 5G NR

The full attach, step by step from POWER-ON: cell search (SSB/SIB1) → RACH → RRC → NAS auth → security → registration → PDU session.

📚 3GPP-basedTS 23.502TS 38.300

A UE that has completed Random Access and RRC setup has a radio connection and a C-RNTI. What it does not have is any right to use the network. The gNB does not know whose device it is, cannot bill it, cannot page it when it goes idle, and has no keys with which to protect its traffic. Registration is the procedure that supplies all four: it authenticates the subscriber against the home network, derives a key hierarchy from a secret that never leaves the USIM and the UDM, assigns a temporary identity the network can page, and returns the list of tracking areas and network slices the subscription is allowed to use.

Contents
  1. 01What Registration Is For, and What Triggers It
  2. 02The Chain Below NAS: Acquisition to RRC_CONNECTED
  3. 03What the UE Decides Before It Attempts Access
  4. 04Registration Types and the 5GMM State Machine
  5. 05Identities: SUPI, SUCI, 5G-GUTI, 5G-S-TMSI
  6. 06The Registration Request, IE by IE
  7. 07Primary Authentication: 5G-AKA End to End
  8. 08The Key Hierarchy and What Each Key Protects
  9. 09Security Activation: NAS First, Then AS
  10. 10Registration Accept, Complete, and What the UE Then Holds
  11. 11PDU Session Establishment
  12. 12Timing Budget and Worked Arithmetic
  13. 13Timers, Counters and Retry Behaviour
  14. 14Failure Modes and What Each One Means
  15. 155GMM Reject Causes and Their Lasting Effects
  16. 16Message Structures: ASN.1 and NAS Encodings
  17. 17Illustrative Message Traces
  18. 18Release Deltas: Rel-15 to Rel-18
  19. 19Reading Registration in Logs: A Checklist
  20. 20Glossary
  21. 21References

1. What Registration Is For, and What Triggers It

A UE that has completed Random Access and RRC setup has a radio connection and a C-RNTI. What it does not have is any right to use the network. The gNB does not know whose device it is, cannot bill it, cannot page it when it goes idle, and has no keys with which to protect its traffic. Registration is the procedure that supplies all four: it authenticates the subscriber against the home network, derives a key hierarchy from a secret that never leaves the USIM and the UDM, assigns a temporary identity the network can page, and returns the list of tracking areas and network slices the subscription is allowed to use.

Registration is a NAS procedure between the UE and the AMF TS 24.501 cl. 5.5.1. The gNB is a relay for it: it wraps NAS messages in RRC dedicatedNAS-Message containers on the air interface and in NGAP NAS-PDU IEs on N2, and it never inspects them. The one exception is AS security activation, where the AMF hands the gNB a key it derived and the gNB runs its own RRC-level procedure with that key -- which is why §9 matters even though it is not, strictly, part of Registration.

The registration type is what distinguishes the five reasons a UE runs this procedure, and it is carried in the very first IE of the message:

Trigger5GS registration typeIdentity presentedWhat is at stake if it fails
Power-on in a new PLMN, or after the USIM was reinserted
initial-registration
SUCI (or 5G-GUTI if a valid one is stored for this PLMN)No service at all. The UE cycles through T3510 / T3511 retries, then T3502, then re-selects a cell or a PLMN.
UE moved into a TA that is not in its stored TAI list
mobility-registration-updating
5G-GUTIThe UE keeps its current context until T3510 expires, then is de-registered locally. Downlink reachability is lost first.
T3512 expired while the UE was idle
periodic-registration-updating
5G-GUTIThe AMF eventually runs its implicit de-registration timer and drops the context. The UE does not notice until its next transaction returns 5GMM cause #10.
An emergency session is needed and no normal registration is possible
emergency-registration
SUCI, or IMEI/PEI if there is no valid USIMEmergency calling. This is the one registration a network is expected to accept with authentication skipped or failed.
Capability or parameter change the network must know about (new S-NSSAI request, MICO change, DRX change)mobility-registration-updating with 5GS update type5G-GUTIThe requested capability silently does not apply. Nothing else breaks, which makes this the hardest kind to notice.

Table 1. The five reasons a UE sends a Registration Request TS 24.501 cl. 5.5.1.2 and 5.5.1.3. SNPN-onboarding-registration and disaster-roaming-* types were added later; see §18.

💡
Key Point

Registration status and RRC state are independent. A UE can be 5GMM-REGISTERED and RRC_IDLE (the normal resting state), REGISTERED and RRC_CONNECTED, or -- briefly -- RRC_CONNECTED and not registered, which is exactly the window this document is about. Reading a log that shows RRCRelease and concluding the UE de-registered is the single most common category error in early 5G troubleshooting. See the companion 14 RRC States document.

2. The Chain Below NAS: Acquisition to RRC_CONNECTED

Nothing in §1 can happen until the UE has found a cell and got an RRC connection up. That chain is five distinct steps, each of which can fail independently and each of which has its own diagnostic signature.

Registration, Part 1: Acquisition to Registration RequestRegistration, Part 1: Acquisition to Registration RequestAcquisitionRACHRRC + first NASUEgNBAMF5GMM-DEREGISTERED, RRC_IDLE.No NAS context, no C-RNTI, no UL timing.PLMN search: stored carriers, then blind scan.PSS/SSS -> PCI, half-frame and symbol timing.SSB: PSS + SSS + PBCH (MIB)20 ms periodicity assumed initially1SIB1 on PDSCH, SI-RNTI 0xFFFFCORESET#0 from pdcch-ConfigSIB12Cell selection: cellBarred, PLMN match,Srxlev > 0 and Squal > 0, UAC check.MSG1 PRACH preamblecontention-based -- see doc 033MSG2 RAR: TA cmd, UL grant, TC-RNTITC-RNTI 0x4C214MSG3 RRCSetupRequest (CCCH)establishmentCause = mo-Signalling5MSG4 Contention Resolution CE+ RRCSetupTC-RNTI 0x4C21 promoted to C-RNTI6RRCSetupComplete (SRB1 / DCCH)dedicatedNAS-Message = Reg Request7NGAP INITIAL UE MESSAGERAN UE NGAP ID 4711, NAS-PDU, ULI8The AMF now holds an unauthenticated 5GMM context and starts authentication.UE state: 5GMM-REGISTERED-INITIATED, T3510 running.T300T300 covers RRCSetupRequest to RRCSetup only. The NAS timer T3510 starts at step 7and is what bounds Registration as a whole.
Figure 1. The first eight steps. Note that the Registration Request is not sent as a message in its own right -- it rides inside RRCSetupComplete, so the UE's first NAS transmission and its confirmation of RRC setup are the same PUSCH transport block.

2.1 PLMN and SSB search

The modem starts from stored information if it has any -- the last camped carrier, a stored PLMN-to-frequency map, a stored SSB position -- and falls back to a band-by-band scan of the GSCN raster otherwise. Within a carrier it correlates for PSS, which gives coarse timing and N_ID2 (one of three values), then SSS, which gives N_ID1 (one of 336). Together they give the Physical Cell ID: PCI = 3 x N_ID1 + N_ID2, 0..1007. PSS/SSS also resolve half-frame and symbol boundaries, which is what makes PBCH demodulation possible.

2.2 MIB, then SIB1

PBCH carries a 24-bit BCCH-BCH-Message -- the MIB plus one CHOICE bit -- and the physical layer adds eight more timing bits to make the 32-bit PBCH payload. From it the UE learns subCarrierSpacingCommon, ssb-SubcarrierOffset, dmrs-TypeA-Position, whether the cell is barred, and pdcch-ConfigSIB1, which decomposes into CORESET#0 and searchSpaceZero indices. Those two indices are the entire recipe for finding SIB1: they say where in frequency the control resource set sits relative to the SSB, how many symbols it occupies, and in which slots to monitor for a DCI with CRC scrambled by the SI-RNTI, 0xFFFF. The companion 18 MIB and SIB1 IEs document works that lookup through field by field.

SIB1 then supplies everything the UE needs to decide about the cell and to access it: cellAccessRelatedInfo (which PLMNs, which TAC, which cell identity), cellSelectionInfo (the S-criterion thresholds), servingCellConfigCommon (including rach-ConfigCommon), ue-TimersAndConstants, uac-BarringInfo, and si-SchedulingInfo for everything else. The companion 17 System Information document covers the scheduling side.

⚠️
Common Pitfall

If the UE cannot acquire SIB1, it treats the cell as barred for 300 seconds TS 38.331 cl. 5.2.2.1. The observable symptom on the network side is a cell that transmits SSB happily and receives no preambles at all from any UE -- because a mis-set pdcch-ConfigSIB1 or a CORESET#0 that falls outside the carrier makes SIB1 undecodable, and every UE independently draws the same conclusion and walks away in silence.

2.3 RACH and RRC setup

With rach-ConfigCommon in hand the UE runs contention-based Random Access. MSG3 carries RRCSetupRequest on CCCH; MSG4 carries the UE Contention Resolution Identity MAC CE plus RRCSetup. The companion 03 Random Access document covers all of it. Two details matter here:

  • The ue-Identity in RRCSetupRequest is either ng-5G-S-TMSI-Part1 (the first 39 bits of the 48-bit 5G-S-TMSI, if the UE holds a valid 5G-GUTI for this PLMN) or a 39-bit randomValue. When Part1 is used, RRCSetupComplete supplies ng-5G-S-TMSI-Part2 -- the remaining nine bits -- and the gNB reassembles the full value to put in the NGAP 5G-S-TMSI IE, which is what lets it pick the right AMF instead of any AMF.
  • establishmentCause in RRCSetupRequest is the gNB's only admission input at this stage. It is derived from the NAS access category (§3.3), so the mapping from "why the UE wants to talk" to "whether the gNB lets it" runs through two independent tables.

3. What the UE Decides Before It Attempts Access

Four independent gates stand between a decoded SIB1 and a transmitted preamble. All four are evaluated from broadcast information only, so a UE that fails any of them leaves no record whatsoever in a gNB log. When a device "will not attach" and the gNB shows nothing, one of these four is almost always the reason.

What the UE Decides Before It Sends a Registration RequestWhat the UE Decides Before It Sends a Registration RequestTS 38.304 cl. 5.2 (selection) and TS 38.331 cl. 5.3.14 (unified access control)Power on / return fromout of coveragenoLimited service:emergency onlyPLMN in HPLMN / equivalent /operator or user-controlled list?yesnoExclude cell;intraFreqReselection sets the scopecellBarred = notBarred ANDnot a forbidden TA?yesnoNot a suitable cell;keep searchingSrxlev > 0 AND Squal > 0 ?yesCamp: read SIB1 fully, adoptue-TimersAndConstantsallowedRACH +RRCSetupRequestbarredBarred:start T390UAC check for the accesscategory of this attemptEvery gate here is decided from broadcast information alone. The network sees nothing untilthe last box, so a UE that never attempts access leaves no trace in a gNB log at all.
Figure 2. The four gates, in the order the UE applies them. The barring check at the bottom is re-evaluated on every access attempt, not once at camp time.

3.1 PLMN selection

The UE builds a candidate list from the PLMN identities in plmn-IdentityInfoList and matches them against, in priority order: the registered PLMN, the equivalent-PLMN list from the last Registration Accept, the HPLMN (from the USIM's IMSI or the EHPLMN list), the user-controlled PLMN selector, and the operator-controlled selector. A PLMN on the forbidden-PLMN list is skipped entirely. A cell whose TAC places it in a forbidden tracking area is skipped for normal service but remains usable for emergency service.

3.2 Barring and the S-criterion

cellBarred in the MIB is absolute -- a barred cell is excluded for 300 seconds, and intraFreqReselection decides whether the exclusion spreads to other cells on the same frequency. Then the cell must be suitable, which means both parts of the S-criterion must be satisfied TS 38.304 cl. 5.2.3.2:

Cell suitability, TS 38.304 cl. 5.2.3.2
Srxlev = Q_rxlevmeas - (q-RxLevMin + q-RxLevMinOffset)
                     - Pcompensation - Qoffset_temp        > 0

Squal  = Q_qualmeas  - (q-QualMin  + q-QualMinOffset)
                     - Qoffset_temp                        > 0

  Q_rxlevmeas    measured SS-RSRP of the cell                   [dBm]
  Q_qualmeas     measured SS-RSRQ of the cell                   [dB]
  q-RxLevMin     SIB1 cellSelectionInfo, INTEGER (-70..-22),
                 UNIT = 2 dBm  ->  actual dBm = 2 x field value
  q-QualMin      SIB1 cellSelectionInfo, INTEGER (-43..-20), 1 dB steps
  Pcompensation  max(P_EMAX - P_PowerClass, 0)                  [dB]
  Qoffset_temp   0, or connEstFailOffset after repeated setup failures
⚠️
Common Pitfall

q-RxLevMin is in units of 2 dBm. A SIB1 that logs q-RxLevMin -60 is asking for -120 dBm, not -60 dBm. Reading the raw integer as dBm makes every cell in the network look catastrophically over-provisioned, and reading it the other way -- treating -70 as -70 dBm -- makes a perfectly normal cell look barred. The same doubling applies to q-RxLevMinOffset, which is in 2 dB units; q-QualMin and q-QualMinOffset are in plain dB.

3.3 Unified access control

The last gate is UAC TS 38.331 cl. 5.3.14. NAS maps the reason for this particular access attempt to one of the standardised access categories and supplies the UE's access identities; RRC then checks them against uac-BarringInfo from SIB1. The two dimensions do different jobs: access identity is about who the subscriber is and can exempt them outright, while access category is about what the attempt is for and is subject to a probabilistic barring factor.

Access categoryWhat it coversTypical barring policy
0MO signalling resulting from pagingNever barred -- category 0 is exempt by specification, so paging responses always get through
1Delay-tolerant service (subject to the uac-AccessCategory1-SelectionAssistanceInfo conditions)First to be barred under load; the category exists to be sacrificed
2EmergencyBarred only under extreme policy; regulators generally forbid it
3MO signalling other than a paging responseBarred moderately -- this is where periodic registration updating lands
4MO MMTel voiceUsually exempt or lightly barred
5MO MMTel videoBarred before voice
6MO SMS, SMS over NAS or SMSoIPLightly barred
7MO data not covered by another categoryThe main lever: barring category 7 sheds load without breaking calls
9MO IMS registration-related signallingUsually exempt, otherwise voice never comes back after an outage
10MO exception data (for NB-IoT-style reporting)Exempt where the deployment uses it
32-63Operator-defined, mapped by operatorDefinedAccessCategoryDefinitions in Registration AcceptWhatever the operator wrote; invisible without the Accept message

Table 2. Standardised access categories TS 24.501 cl. 4.5.2. The categories the UE actually uses depend on what the NAS layer is trying to do, so the same radio conditions produce different barring outcomes for different applications.

🧮
Worked Calculation

uac-BarringFactor = p60, uac-BarringTime = s16. The UE holds only Access Identity 0, so no bit of uac-BarringForAccessIdentity exempts it, and it must draw.

Draw rand1 = 0.72. 0.72 >= 0.60 -> access barred

Draw rand2 = 0.31 for the back-off:

T390 = (0.7 + 0.6 x rand2) x uac-BarringTime

= (0.7 + 0.186) x 16

= 0.886 x 16 = 14.2 s

T390 runs per access category. A UE barred for category 7 can still answer a page (category 0) while that 14.2 s elapses, which is why a barred cell still shows paging responses in the gNB log.

4. Registration Types and the 5GMM State Machine

5GMM state machine on the UE side5GMM States on the UE SideTS 24.501 cl. 5.1.3.1 -- the AMF runs its own, different state set5GMM-DEREGISTEREDno valid 5GMM context5GMM-REGISTERED-INITIATEDT3510 running5GMM-REGISTERED5G-GUTI + TAI list held5GMM-NULLUSIM absent or disabled5GMM-DEREGISTERED-INITIATEDT3521 running5GMM-SERVICE-REQUEST-INITIATEDT3517 runningRegistrationRequest sentReject, or attemptcounter = 5RegistrationAcceptPeriodic / mobilityregistration updatingUSIM removedDe-registration RequestDe-registration AcceptService Request /paging responseService AcceptPeriodic and mobility registration updating both re-enter 5GMM-REGISTERED-INITIATED from5GMM-REGISTERED, which is why a failed periodic update can drop a working UE all the way backto 5GMM-DEREGISTERED. 5GMM-COMMON-PROCEDURE-INITIATED is an AMF state, not a UE one.
Figure 3. The UE's six 5GMM states. Note that the AMF's state set is different -- 5GMM-COMMON-PROCEDURE-INITIATED, the state the AMF occupies while authentication or a security mode command is outstanding, has no UE counterpart.

The state machine is small, but two of its properties drive most real-world confusion. First, a failed registration update leaves the UE in 5GMM-DEREGISTERED with whatever forbidden-list side effects the cause code specified (§15) -- so a UE that was working can end up worse than a UE that has just been switched on. Second, the AMF's implicit de-registration is invisible to the UE: the UE believes it is REGISTERED, the AMF has discarded the context, and the mismatch is discovered only when the UE next transmits and gets 5GMM cause #10.

StateEntered whenTimer runningWhat the UE will accept here
5GMM-NULL
No USIM, USIM disabled, or 5GS disabled by the user--Nothing. The UE does not even do PLMN search for 5GS.
5GMM-DEREGISTERED
Power-on with no context; after a Reject; after de-registrationT3502 or T3511 in the attempting-registration substateRegistration Accept / Reject only. Paging is not monitored for 5GS service.
5GMM-REGISTERED-INITIATED
Registration Request has been sentT3510Authentication Request, Identity Request, Security Mode Command, Registration Accept, Registration Reject, Service Reject
5GMM-REGISTERED
Registration Accept received (and Complete sent if a new 5G-GUTI was assigned)T3512 while the N1 signalling connection is releasedEverything: paging, DL NAS transport, Configuration Update Command, network-initiated de-registration
5GMM-SERVICE-REQUEST-INITIATED
Service Request sent -- typically as a paging response or to resume user-plane resourcesT3517Service Accept, Service Reject, or a DL NAS message that implicitly completes the procedure
5GMM-DEREGISTERED-INITIATED
UE-initiated De-registration Request sent (switch-off, USIM removal, 5GS disable)T3521De-registration Accept. On switch-off the UE need not wait for it.

Table 3. UE 5GMM states TS 24.501 cl. 5.1.3.1. The substates of 5GMM-DEREGISTERED and 5GMM-REGISTERED (for example ATTEMPTING-REGISTRATION, NO-CELL-AVAILABLE, LIMITED-SERVICE, UPDATE-NEEDED) carry most of the useful diagnostic information and are worth logging explicitly.

5. Identities: SUPI, SUCI, 5G-GUTI, 5G-S-TMSI

5G deliberately never sends a permanent subscriber identity over the air in the clear -- the single biggest privacy change from LTE, where a plain IMSI in an Attach Request was routine and IMSI catchers exploited it. The cost is a chain of four identities that each exist for a different lifetime and are visible at a different place in the network.

IdentitySize / structureWho can read itLifetime
SUPIIMSI (MCC+MNC+MSIN) or a network-specific identifier in NAI formUSIM, UDM, and the AMF only after the AUSF returns it at the end of authenticationPermanent
SUCISUPI type + home network id + routing indicator + protection scheme id + HN public key id + scheme outputThe UE computed it; only the home network's SIDF can reverse itOne registration attempt, or 60 s while T3519 runs
5G-GUTIGUAMI (MCC + MNC + AMF Region ID 8b + AMF Set ID 10b + AMF Pointer 6b) + 5G-TMSI 32bAnyone on the path -- it is sent in the clear, which is why it is reassigned oftenUntil the AMF reassigns it, typically at least once per registration
5G-S-TMSIAMF Set ID 10b + AMF Pointer 6b + 5G-TMSI 32b = 48 bitsThe gNB, which uses it for AMF selectionSame as the 5G-GUTI it is derived from
PEIIMEI or IMEISV of the device, not the subscriptionRequested by the AMF after NAS security is up; may be sent as a Masked IMEISV to the gNBPermanent, per device
C-RNTI16 bits, cell-localThe gNB onlyOne RRC connection in one cell
RAN UE NGAP ID / AMF UE NGAP ID32 bits each, one per side of N2gNB and AMFOne UE-associated N2 logical connection

Table 4. Identity inventory TS 23.003 cl. 2.2 and 2.10. Note that no single node sees all of these: the gNB never sees SUPI or SUCI content, and the AMF never sees the C-RNTI.

5.1 SUCI concealment schemes

The SUCI conceals only the subscriber-unique part of the SUPI. MCC and MNC stay in the clear -- they have to, or no visited network could route the authentication request home. So does the routing indicator, one to four decimal digits that tell the AMF which AUSF/UDM instance in the home network holds this subscriber. Everything after that is encrypted under the home operator's public key using ECIES.

Protection scheme idSchemeEphemeral keyMAC tagWhen it appears
0
null-scheme
----Emergency registration with no valid USIM, or an unprovisioned USIM. The MSIN is sent in the clear -- functionally an IMSI.
1ECIES Profile A (Curve25519 / X25519)32 octets8 octetsThe common choice; smaller keys, faster on constrained modems
2ECIES Profile B (secp256r1, compressed point)33 octets8 octetsWhere the operator's PKI is already NIST-curve based
3-11Reserved----A decoder reporting one of these is decoding something else
12-15Operator-specific----Only the home network can interpret; a visited network still routes it correctly from MCC/MNC + routing indicator

Table 5. SUCI protection schemes TS 33.501 Annex C. The scheme is chosen by the home operator and provisioned on the USIM; the visited network has no say and no visibility.

🧮
Worked Calculation

Cost of concealment, Profile A, a 10-digit MSIN:

null-scheme SUCI

MCC+MNC (BCD) ............ 3 octets

routing indicator ........ 2 octets

scheme id + spare ........ 1 octet

HN public key id ......... 1 octet

scheme output = MSIN BCD . 5 octets

= 12 octets

Profile A SUCI

header as above .......... 7 octets

ephemeral public key ..... 32 octets

ciphertext (= plaintext) . 5 octets

MAC tag .................. 8 octets

= 52 octets

40 extra octets. Irrelevant on the PUSCH grant that carries RRCSetupComplete, but it is why the network reassigns a 5G-GUTI at the first opportunity: the 5G-GUTI form of the 5GS mobile identity IE is 13 octets and needs no elliptic-curve operation on either side.

5.2 Why the 48-bit 5G-S-TMSI is split across two messages

RRCSetupRequest has to fit in a 48-bit CCCH SDU, because that is exactly what the UE Contention Resolution Identity MAC CE echoes back in MSG4 TS 38.321 cl. 6.1.3.3. The 48 bits are fully spent:

🧮
Worked Calculation

UL-CCCH-Message encoding of RRCSetupRequest:

UL-CCCH-MessageType CHOICE (c1 / messageClassExtension) .... 1 bit

c1 CHOICE, 4 alternatives (SetupRequest / ResumeRequest /

ReestablishmentRequest / SystemInfoRequest) ...... 2 bits

ue-Identity CHOICE (ng-5G-S-TMSI-Part1 / randomValue) ...... 1 bit

ue-Identity value, BIT STRING (SIZE (39)) .................. 39 bits

establishmentCause, ENUMERATED with 16 members .............. 4 bits

spare, BIT STRING (SIZE (1)) ................................ 1 bit

-----------

48 bits

39 bits is therefore not an arbitrary choice -- it is what is left of 48 once the encoding overhead and the establishment cause are paid for. The remaining 9 bits of the 48-bit 5G-S-TMSI travel in RRCSetupComplete as ng-5G-S-TMSI-Part2, and the gNB concatenates the two halves before putting the 5G-S-TMSI in NGAP.

⚠️
Common Pitfall

If ng-5G-S-TMSI-Part2 is missing from RRCSetupComplete when Part1 was used in MSG3, the gNB has no complete 5G-S-TMSI and must fall back to selecting an AMF from the AMF Set ID or from local configuration. In a multi-AMF pool this sends the UE to an AMF that does not hold its context, which then has to run an Namf_Communication_UEContextTransfer to the old AMF -- or, if that fails, rejects with a cause that makes the UE start over from SUCI. Symptom: registrations that unexpectedly present a SUCI when the UE clearly had a 5G-GUTI.

6. The Registration Request, IE by IE

The Registration Request is a 5GMM message with an unusual property: it is normally sent before NAS security exists, so it is transmitted with no outer security header at all. Once a security context is available the same message is sent inside a security-protected container, and -- this is the part that catches people -- a partially ciphered form exists too, where the mandatory IEs are in the clear and the sensitive optional ones are repeated inside a ciphered NAS message container IE.

NAS Message Headers: Security-Protected Outer, Plain InnerNAS Message Headers: Security-Protected Outer, Plain InnerTS 24.501 cl. 9.1, cl. 9.11.3.4 (5GS mobile identity), cl. 8.2.6bit76543210Oct 1Extended protocol discriminator = 0x7E (5GMM)Oct 2Spare half octetSecurity header typeOct 3Message authentication code, octet 1 of 4Oct 4MAC octets 2-4 (NIA computed over everything below)Oct 5Sequence number = 8 LSBs of the NAS COUNTOct 6---- inner plain NAS message begins ----Oct 7Extended protocol discriminator = 0x7EOct 8Spare half octetSec hdr type = 0Oct 9Message type = 0x41 Registration RequestOct 10ngKSI5GS registration typeOct 115GS mobile identity: 2-octet length (LV-E format)Oct 125GS mobile identity value: SUCI or 5G-GUTI ...Octets 1-6 are the security-protected outer header and the plain message is nested inside it.Before the NAS Security Mode Command completes there is no outer header at all: theRegistration Request goes out as the inner message alone.
Figure 4. The two header shapes. Security header type distinguishes them: 0 = plain, 1 = integrity protected, 2 = integrity protected and ciphered, 3 and 4 = the same two with a new 5G NAS security context (used for the Security Mode Command / Complete pair).
IEPresenceContents and rangeWhy it is there
Extended protocol discriminatorM, 1 octet0x7E = 5GS mobility management; 0x2E = 5GS session managementLets one NAS connection multiplex MM and SM messages
Security header typeM, half octet0..4 as aboveTells the receiver whether to expect a MAC and sequence number
Registration request message identityM, 1 octet0x41The message type
5GS registration type
M, half octet3-bit type value plus the Follow-On Request pending (FOR) bitType drives the whole procedure; FOR tells the AMF the UE has something to send immediately, so do not release the connection
ngKSI
M, half octetTSC bit (native / mapped) + 3-bit key set identifier, 0..6, 7 = no key availableNames the security context the UE proposes to reuse. 7 forces a full authentication.
5GS mobile identity
M, LV-ESUCI, 5G-GUTI, IMEI, IMEISV or 5G-S-TMSIThe identity to authenticate or look up
Non-current native NAS key set identifierOAs ngKSILets a UE with both a mapped (from EPS) and a native context offer the native one as an alternative
5GMM capability
OBit flags: S1 mode, HO attach, LPP, RestrictEC, 5G-CP CIoT, N3 data, 5G-IPHC, SGC, ...Determines which core features the AMF will even attempt
UE security capability
OTwo octets of 5G-EA0..EA7 / 5G-IA0..IA7 bitmaps, optionally two more for EPS algorithmsThe input to algorithm selection -- and the value the AMF must replay verbatim in the Security Mode Command (§9)
Requested NSSAI
OUp to 8 S-NSSAIs, each SST (1 octet) with optional SD (3 octets)What slices the UE wants. The AMF answers with Allowed and Rejected NSSAI, which need not match.
Last visited registered TAI
OOne TAILets the AMF optimise the TAI list it hands back
UE's usage setting
Ovoice-centric / data-centricGoverns whether the UE will fall back to EPS for voice
Requested DRX parameters
O32 / 64 / 128 / 256 frames, or not-specifiedThe idle-mode paging cycle the UE wants; see the companion 19 Paging document
Uplink data status / PDU session statusO16-bit bitmaps, one bit per PDU session id 1..15What the UE believes exists, so the AMF can reconcile after a period of unreachability
NAS message container
OA ciphered copy of the whole messageThe mechanism for the partially-ciphered form
MICO indication, LADN indication, Network slicing indicationOFlags and listsFeature negotiation that would otherwise need its own procedure

Table 6. Registration Request IEs TS 24.501 cl. 8.2.6, abridged to the ones that change behaviour. M = mandatory, O = optional. LV-E = length-value with a two-octet length, needed because a Profile B SUCI does not fit a one-octet length.

🔍
What You See In Logs

ngKSI = 7 ("no key is available") in a Registration Request means the UE is telling you it has no usable security context and expects a full authentication. If you see ngKSI 7 on a UE that registered successfully an hour ago, something deleted its context: a USIM refresh, a reject with cause #3 or #6, a T3247 expiry, or an ngKSI collision. If you see a valid ngKSI and the AMF still runs full authentication, the AMF does not have that context -- usually because it is a different AMF instance in the pool.

7. Primary Authentication: 5G-AKA End to End

5G-AKA is a challenge-response protocol built on a symmetric key K that exists in exactly two places: the USIM and the home network's UDM/ARPF. It never crosses any interface. Everything else in the key hierarchy is derived from it, and the derivations are deliberately arranged so that each network function receives only the keys it needs.

Registration, Part 2: Primary Authentication with 5G-AKARegistration, Part 2: Primary Authentication with 5G-AKAVector fetchChallenge / responseUEgNBAMFAUSFUDM/ARPFNausf_UEAuthentication_Authenticate RequestSUCI + serving network name9Nudm_UEAuthentication_Get RequestSIDF de-conceals SUCI -> SUPI105G HE AV + SUPIRAND, AUTN, XRES*, K_AUSF11AUSF: HXRES* = trunc(SHA-256(RAND||XRES*))K_SEAF = KDF(K_AUSF, SN-name)5G SE AVRAND, AUTN, HXRES* only12NAS Authentication RequestngKSI 0, ABBA 0x0000, RAND, AUTN -- unprotected NAS13USIM: verify MAC-A, verify SQN freshness -> CK, IK, RESME: RES* = KDF(CK||IK, SN-name, RAND, RES)NAS Authentication ResponseRES* (128 bits)14RES* for confirmationAMF checked HRES* vs HXRES* first15Success + SUPI + K_SEAFAMF learns the real SUPI here16Two independent checks happen: the AMF verifies a 128-bit hash (HXRES*) so a visitednetwork can fail fast, and the AUSF verifies the full RES* so only the home networkcan declare success.The gNB lifeline is drawn but idle: it relays the two NAS messages transparently insideNGAP DOWNLINK / UPLINK NAS TRANSPORT and never inspects them.
Figure 5. 5G-AKA. The two-stage response check -- HXRES at the AMF, RES at the AUSF -- is the structural difference from LTE's EPS-AKA, where the visited MME held XRES and could complete authentication alone.

7.1 What the network computes

The UDM/ARPF generates an authentication vector from K and a fresh sequence number:

QuantitySizeHow it is formedWho uses it
RAND
128 bitsRandomSent to the UE; the freshness of the whole exchange depends on it
AUTN
128 bits(SQN XOR AK) 48b || AMF field 16b || MAC-A 64bThe UE verifies MAC-A to authenticate the network, and SQN to detect replay
XRES*
128 bitsKDF over CK||IK with the serving network name, RAND and RESKept at the AUSF; the final arbiter of success
HXRES*
128 bitsLeftmost 128 bits of SHA-256(RAND || XRES*)Given to the AMF so it can reject a wrong answer without a round trip home
K_AUSF
256 bitsKDF over CK||IK with the serving network nameStays in the home network; anchors SoR and UE parameter update protection
K_SEAF
256 bitsKDF(K_AUSF, serving network name)Handed to the AMF only after successful authentication

Table 7. Authentication vector contents TS 33.501 cl. 6.1.3.2 and Annex A. The serving network name -- of the form 5G:mnc<MNC>.mcc<MCC>.3gppnetwork.org -- is mixed into every derivation, which is what binds the resulting keys to one PLMN.

7.2 What the UE computes

The USIM checks MAC-A first. If MAC-A is wrong the challenge did not come from a network that knows K, and the UE answers with an Authentication Failure carrying 5GMM cause #20 MAC failure and starts T3520. If MAC-A is right but SQN is outside the acceptance window, the challenge is genuine but stale -- a replay, or a home-network sequence-number desynchronisation -- and the UE answers with cause #21 Synch failure plus an AUTS token that lets the UDM resynchronise. The distinction is diagnostically enormous:

FailureWhat the UE sendsWhat it actually meansWhere to look
MAC-A mismatchAuthentication Failure, 5GMM cause #20, T3520 startedThe network does not hold the same K, OPc or algorithm as the USIMUSIM provisioning in the UDM: wrong Ki/OPc pair, wrong milenage constants, or a subscriber provisioned in the wrong UDM
SQN out of rangeAuthentication Failure, 5GMM cause #21, with AUTSK is right; only the sequence counter has driftedUDM sequence-number state -- typical after a database restore, or when the same subscriber is served by two UDM instances
Non-5G authentication unacceptableAuthentication Failure, cause #26The UE was offered an authentication method it will not use in 5GSAUSF method selection: EAP-AKA' offered where the USIM only supports 5G-AKA, or vice versa
ngKSI already in useAuthentication Reject handling, cause #71 from the network sideThe AMF tried to install a key set under an identifier the UE already hasAMF key-set bookkeeping; usually a context-transfer bug
No response at allNothing; T3510 eventually expiresThe Authentication Request never reached the UE, or its response never reached the AMFThe RRC/NGAP relay path, not the security layer. Check for an RRCRelease between the two.

Table 8. Authentication failure taxonomy TS 24.501 cl. 5.4.1.3.7. #20 and #21 look the same in a summary counter and have completely different fixes.

📘
Spec Detail

The AMF's HXRES check exists so that a visited network can reject a wrong response immediately, without a round trip to the home network -- but it cannot accept one, because HXRES is a one-way hash and proves nothing about RES beyond equality. Only the AUSF's comparison of RES with XRES* completes authentication, and only the AUSF then releases the SUPI and K_SEAF. This is why, in a decoded trace, the AMF still has no SUPI at the moment it verifies the response.

7.3 EAP-AKA'

The alternative primary authentication method, EAP-AKA' TS 33.501 cl. 6.1.3.1, carries the same underlying AKA exchange inside EAP, transported in the EAP message IE of the NAS Authentication Request and Response. Structurally the difference that matters when reading logs is that the AUSF becomes the EAP server and the AMF a pure pass-through, so the exchange can take more than one round trip and the AMF never sees a RES* at all. Which method is used is decided by the UDM per subscriber; the UE must support both.

8. The Key Hierarchy and What Each Key Protects

5G Key Hierarchy: Where Each Key Comes From5G Key Hierarchy: Where Each Key Comes FromTS 33.501 cl. 6.2 and Annex AAKA, RANDKDF(SN-name)KDF(SN-name)KDF(SUPI, ABBA)KDF(UL NAS COUNT)KCK, IKK_AUSFK_SEAFK_AMFK_NASintK_NASencK_gNBK_N3IWFUSIM and UDM/ARPF onlyLong-term secretper-challenge, from RANDAKA outputnever leaves the home networkHome network anchorbound to the SN-nameServing network anchorbound to SUPI + ABBAAMF level-> the four AS keysnon-3GPP accessNAS and AS keysOnly K_gNB ever reaches the RAN. The gNB receives it in the NGAP Security Key IEand derives the four AS keys itself -- it never sees K_AMF, K_SEAF, K_AUSF or theSUPI-independent home-network keys.
Figure 6. Each arrow is a KDF invocation with a specific set of inputs. The inputs are what bind a key to a context -- the SN-name binds K_SEAF to one PLMN, the ABBA parameter binds K_AMF to a set of security features, and the UL NAS COUNT binds K_gNB to one point in the NAS sequence.
KeyDerived fromProtectsRefreshed when
K_AUSF
CK, IK + SN-nameSteering of Roaming and UE Parameter Update containers from the home networkEvery primary authentication
K_SEAF
K_AUSF + SN-nameNothing directly -- it is the anchor handed to the serving networkEvery primary authentication
K_AMF
K_SEAF + SUPI + ABBANothing directly; the parent of the NAS and RAN keysAuthentication, or a horizontal derivation at an AMF change
K_NASint, K_NASencK_AMF + algorithm identifiersNAS messages between UE and AMF, end to end through the gNBNAS Security Mode Command
K_gNB
K_AMF + UL NAS COUNTNothing directly; the parent of the four AS keysEvery N1 connection establishment, and on handover via the NH / NCC chain
K_RRCint, K_RRCencK_gNB + algorithm identifiersRRC signalling on SRB1/SRB2 over the airAS Security Mode Command, and every key change on handover
K_UPint, K_UPencK_gNB + algorithm identifiersUser-plane data on DRBs. UP integrity is optional and per-DRB; UP ciphering is the defaultAs for the RRC keys
K_N3IWF
K_AMFIPsec between the UE and the N3IWF for untrusted non-3GPP accessNon-3GPP registration

Table 9. Key roles TS 33.501 cl. 6.2. Note that the gNB holds only K_gNB and its four children; a compromised gNB cannot derive anything above itself, which is the whole point of the two-anchor design.

⚠️
Common Pitfall

K_gNB is derived with the uplink NAS COUNT as an input. That is why a UE and gNB can silently disagree about the AS keys: if the UE and AMF have drifted by one on the UL NAS COUNT -- a retransmitted NAS message counted once on one side and twice on the other -- both sides compute a valid-looking K_gNB from different inputs, AS security activation fails the integrity check, and the log shows SecurityModeFailure with no algorithm mismatch to blame. Check the NAS sequence numbers on both sides before suspecting the algorithms. The companion 27 AS Security Mode document covers the RRC-level side of this.

9. Security Activation: NAS First, Then AS

Registration, Part 3: Security Activation, Accept and CompleteRegistration, Part 3: Security Activation, Accept and CompleteNAS securityAS securityAcceptUEgNBAMFNAS Security Mode Commandselected NAS algorithms, replayed UE capabilities, ABBA17NAS Security Mode Completefirst ciphered NAS message; may carry IMEISV18NAS security is now active on the N1 link. AS security is still off --RRC messages so far have been integrity-unprotected.NGAP INITIAL CONTEXT SETUP REQUESTSecurity Key = K_gNB, GUAMI, Allowed NSSAI19derives K_RRCint/enc and K_UPint/enc from K_gNBRRC SecurityModeCommandcipheringAlgorithm + integrityProtAlgorithm, on SRB120RRC SecurityModeCompleteintegrity-protected with K_RRCint from this message on21NGAP INITIAL CONTEXT SETUP RESPONSE22registration completesNAS Registration Accept5G-GUTI, TAI list, allowed NSSAI, T3512 value23NAS Registration Completesent only because a new 5G-GUTI was assigned245GMM-REGISTERED. T3510 stopped, T3512 started, SUCI no longer used --the 5G-GUTI identifies the UE from here on.The order is fixed by the key hierarchy: the gNB cannot run AS security until the AMF hasderived K_gNB from K_AMF and handed it over in step 19.
Figure 7. Two security activations, in a mandatory order, keyed from different levels of the hierarchy. Steps 19-22 are not part of Registration at all -- they are an NGAP procedure that Registration happens to trigger.

9.1 NAS Security Mode Command

The Security Mode Command is the first message the AMF sends that is integrity-protected with the new K_NASint, using security header type 3. It carries three things the UE must check:

The selected NAS algorithms -- one integrity algorithm (5G-IA0..IA7) and one ciphering algorithm (5G-EA0..EA7). 5G-IA0 (null integrity) is permitted only for unauthenticated emergency service.

The replayed UE security capabilities -- byte-for-byte what the UE sent in its Registration Request. If they do not match what the UE actually sent, an attacker has modified the unprotected Registration Request to force a weaker algorithm, and the UE must respond with Security Mode Reject, 5GMM cause #23 UE security capabilities mismatch.

The ngKSI naming the key set, and the ABBA parameter, whose value is mixed into K_AMF and exists so that a future release can bind the key to a set of security features without changing the message format.

The UE answers with Security Mode Complete, which is the first NAS message that is both ciphered and integrity-protected. It optionally carries the IMEISV, because the AMF cannot ask for a permanent equipment identity until it has a protected channel on which to receive one.

9.2 Initial Context Setup and AS security

With NAS security up, the AMF derives K_gNB and sends the gNB an NGAP INITIAL CONTEXT SETUP REQUEST TS 38.413 cl. 9.2.2.1. This is the message that creates the UE context at the gNB proper -- before it, the gNB was holding a UE it knew almost nothing about.

NGAP IEContentsWhat the gNB does with it
AMF UE NGAP ID / RAN UE NGAP ID32 bits eachBinds the N2 logical connection in both directions
Security KeyK_gNB, 256 bitsDerives K_RRCint, K_RRCenc, K_UPint, K_UPenc and runs the RRC SecurityModeCommand
UE Security CapabilitiesThe same NR and E-UTRA algorithm bitmaps the UE declaredIntersects them with its own configured priority list to pick the AS algorithms
GUAMIAMF Region ID + Set ID + PointerRecords which AMF owns this UE, for paging and for later N2 messages
Allowed NSSAIThe slices the AMF authorisedAdmission control and, later, DRB-to-slice mapping
UE Aggregate Maximum Bit RateUL and DL bit/sCaps the sum of all non-GBR bearers for this UE
Mobility Restriction ListServing PLMN, equivalent PLMNs, forbidden TAIs, RAT restrictionsFilters handover candidates -- this is where a subscription-level area restriction becomes a RAN-level one
Index to RAT/Frequency Selection Priority1..256Steers idle-mode and reselection priority per subscriber class
NAS-PDURegistration Accept, in the common caseForwards it to the UE in DLInformationTransfer after AS security is active
Masked IMEISVIMEISV with the middle digits maskedLets the RAN apply per-device workarounds without learning the exact device identity

Table 10. INITIAL CONTEXT SETUP REQUEST, abridged. Piggybacking the Registration Accept in the NAS-PDU IE saves a full N2 round trip and is what most AMFs do.

🔍
What You See In Logs

The Registration Accept in the trace may therefore arrive before the RRC SecurityModeComplete has been sent, from the AMF's point of view -- the AMF handed it to the gNB in step 19, and the gNB queues it until AS security is active in step 21. If you are correlating an AMF-side and a gNB-side log and the Accept appears to arrive early, this is why. Nothing is out of order; the queueing point is inside the gNB.

10. Registration Accept, Complete, and What the UE Then Holds

Registration Accept is the payoff. Everything before it was proving identity; this message is where the network states the terms of service.

IEPresenceContentsConsequence of getting it wrong
5GS registration result
MAccess type(s) registered (3GPP / non-3GPP / both), SMS-allowed flag, and whether an emergency-registered indication appliesA UE registered only for emergency service behaves like an unregistered one for everything else
5G-GUTI
O but effectively alwaysNew GUAMI + 5G-TMSIIf absent, the UE keeps the old 5G-GUTI and does not send Registration Complete -- which changes the message count in the trace
TAI list
OUp to 16 TAI entries in three list typesToo small and the UE runs mobility registration updating constantly; too large and the AMF pages across an unnecessarily wide area
Allowed NSSAI
OUp to 8 S-NSSAIsA slice the UE requested but does not appear here cannot carry a PDU session, and the UE will not retry it until told to
Rejected NSSAI
OS-NSSAI + cause (not available in the PLMN / not available in the registration area / not available due to maximum-reached)The cause decides whether the UE ever retries. "Not available in the PLMN" is sticky until the next registration in a different PLMN.
Configured NSSAI
OThe slice set to use in this PLMN going forwardOverwrites the UE's stored configuration for that PLMN
Equivalent PLMNs
OUp to 15 PLMN identitiesCells of an equivalent PLMN are treated as the registered PLMN for selection -- omitting them breaks national roaming
T3512 value
OGPRS-timer-3 encoding; default 54 minutesSets the periodic registration interval. Long values save battery and widen the window in which the AMF's view is stale.
T3502 value
ODefault 12 minutesHow long the UE waits after five failed attempts before trying again
5GS network feature support
OIMS voice over PS, emergency service support, LADN, MPSI, restricted-eCall, IWK-N26, ...The UE uses IMS-VoPS to decide whether to stay on 5G for voice or fall back to EPS
Negotiated DRX parameters
OThe paging cycle actually grantedDiffers from the requested value more often than people expect
Service area list
OAllowed or non-allowed TAI listsA non-allowed area gives the UE signalling service only -- the classic "registered but no data" symptom
Operator-defined access category definitions
OPrecedence, category number, criteriaWithout them, UAC categories 32-63 in SIB1 mean nothing to the UE

Table 11. Registration Accept IEs TS 24.501 cl. 8.2.7, abridged. Note how many are optional: an Accept can be as short as four octets of header plus a registration result, and the UE then keeps everything it had before.

The UE returns Registration Complete only if the Accept assigned a new 5G-GUTI (or carried an SOR transparent container that needs acknowledging). A trace with no Registration Complete is therefore not necessarily broken -- check whether a 5G-GUTI was present first.

⚠️
Common Pitfall

The TAI list is the most consequential single parameter in this message and the easiest to get wrong. Every time the UE moves outside it, it runs a full mobility registration update: RACH, RRC setup, NAS, N2, and an AMF transaction. A TAI list that covers one TA on a motorway corridor generates registration signalling proportional to traffic speed. A TAI list that covers a whole region makes every page a broadcast across that region. The right answer depends on the mobility profile, not on a default.

11. PDU Session Establishment

Registration gives the UE an identity, keys and reachability. It gives it no data path at all. A PDU session is a separate 5GSM procedure TS 24.501 cl. 6.4.1, carried in NAS messages that the AMF forwards to an SMF, and it is the procedure that actually creates a DRB over the air.

Registration, Part 4: PDU Session EstablishmentRegistration, Part 4: PDU Session EstablishmentNAS + coreRAN bearer setupUEgNBAMFSMFUPFUL NAS TRANSPORT carryingPDU Session Establishment RequestPDU session id 5, PTI 1, S-NSSAI, DNN, SSC mode 125Nsmf_PDUSession_CreateSMContextSMF chosen from S-NSSAI + DNN26N4 Session EstablishmentUPF returns CN N3 tunnel info27N1N2MessageTransferNAS Accept + N2 SM information28NGAP PDU SESSION RESOURCESETUP REQUESTQoS flow list + NAS Accept29RRCReconfigurationSRB2 + DRB1, sdap-Config QFI map30RRCReconfigurationComplete31NGAP PDU SESSION RESOURCESETUP RESPONSEgNB DL N3 tunnel endpoint32User plane end to end: UE -- DRB1 -- gNB -- N3/GTP-U -- UPF -- data network.Registration alone would have given none of this.Registration and PDU session establishment are separate procedures with separate timers.A UE can be REGISTERED with no PDU session at all, and often is.
Figure 8. PDU session establishment for a UE that is already registered. The NAS Accept for the session travels inside the NGAP PDU SESSION RESOURCE SETUP REQUEST, so the RAN resource setup and the NAS confirmation reach the UE in the same RRC transaction.
Request IEContentsWho consumes it
PDU session identity1..15UE and SMF; the same value appears in the RRC sdap-Config indirectly, via the DRB the session maps to
Procedure transaction identity (PTI)1..254Correlates request and response for UE-initiated 5GSM procedures
Integrity protection maximum data rate
Per-direction, 64 kbps / full rateThe UE declaring what it can afford to integrity-protect; the gNB uses it to decide UP integrity per DRB
PDU session type
IPv4 / IPv6 / IPv4v6 / Unstructured / EthernetSMF and UPF
SSC mode
1 (anchor never changes) / 2 / 3 (make-before-break anchor relocation)SMF
S-NSSAI + DNNSlice and data network nameAMF, for SMF selection. A DNN not subscribed for that slice is the commonest cause of 5GSM cause #91.
5GSM capability
Reflective QoS, multi-homed IPv6, ...SMF

Table 12. PDU Session Establishment Request, abridged TS 24.501 cl. 8.3.1. The Requested NSSAI from Registration and the S-NSSAI here are different IEs at different layers and can legitimately disagree.

💡
Key Point

Registration succeeding and data not working is the most common "registration problem" that is not a registration problem. The tell is the cause code family: 5GMM causes (#3, #11, #12, #22, #72, ...) come from the AMF and concern the subscriber; 5GSM causes (#26 insufficient resources, #27 missing or unknown DNN, #29 user authentication failed, #67 insufficient resources for the slice and DNN, #91 DNN not supported in the slice) come from the SMF and concern the session. A UE in 5GMM-REGISTERED with no PDU session is a correct state.

12. Timing Budget and Worked Arithmetic

Illustrative Power-On to REGISTERED Timing BudgetIllustrative Power-On to REGISTERED Timing BudgetThe two dominant terms are the SI acquisition wait and the authentication round tripAcquisitionPLMN / SSB searchSIB1RACH + RRCMSG1-4NASAV fetch5G-AKASMCAcceptBearersSRB2 + DRBT3510 startsREGISTERED050100150200250300350400450Time from power-on (ms) -- illustrative, good coverage, no retriesUnlabelled blocks, left to right: RF initialisation (0-20 ms), cell selection arithmetic(200-210 ms) and RRCSetupComplete (235-240 ms). Worst case differs in two places only:SI acquisition can cost a full si-Periodicity, and each RACH retry costs a responsewindow plus a random backoff.
Figure 9. Where the time goes in a clean initial registration. The two elastic terms are the SI acquisition wait, which depends on when the UE happened to wake up relative to the SI window, and the authentication round trip, which crosses into the home network.
PhaseTypicalWorst realisticWhat makes it worse
RF init + PLMN/SSB search20-150 msseveral secondsA blind scan across many bands with no stored information; SSB periodicity longer than the 20 ms the UE assumes for initial search
SIB1 acquisition10-30 ms160 msSIB1's transmission repetition periodicity, and a failed first decode
Other SI, if needed0 msone full si-Periodicity, up to 5.12 sOn-demand SI, or waking just after the SI window closed -- see the companion 17 System Information document
Cell selection arithmetic< 5 ms< 5 msNothing; it is local
RACH (MSG1-MSG4)15-25 mshundreds of msEach retry costs ra-ResponseWindow plus a random backoff; see the companion 03 Random Access document
RRCSetupComplete to INITIAL UE MESSAGE1-5 mstens of msgNB-CU/DU F1AP hop and AMF selection
Authentication vector fetch20-60 mshundreds of msAUSF and UDM may be in a different data centre from the AMF, and in roaming they are in a different country
5G-AKA round trip40-60 mshundreds of msUSIM computation on a slow card, plus the air-interface round trip
NAS + AS security20-40 ms--Little variability
Registration Accept / Complete20-40 ms--Little variability

Table 13. Phase-by-phase budget. All values are approximate and deployment-dependent; the ratios are more informative than the absolutes.

🧮
Worked Calculation

Retry budget before the UE gives up on a PLMN. T3510 = 15 s, T3511 = 10 s, registration attempt counter limit = 5:

attempt 1 .. T3510 expires ...................... 15 s

T3511 wait ...................................... 10 s

attempt 2 .. T3510 expires ...................... 15 s

T3511 wait ...................................... 10 s

attempt 3 .. T3510 expires ...................... 15 s

T3511 wait ...................................... 10 s

attempt 4 .. T3510 expires ...................... 15 s

T3511 wait ...................................... 10 s

attempt 5 .. T3510 expires ...................... 15 s

-----------

total = 115 s

The counter now reads 5, so the UE starts T3502 (default 12 min) and stops attempting registration in this PLMN. A user watching the device sees roughly two minutes of visible effort followed by twelve minutes of apparent inactivity -- and then one more attempt. Shortening the signalled T3502 in Registration Reject is the lever for that second phase.

🧮
Worked Calculation

Implicit de-registration window. T3512 signalled as 54 min; the AMF commonly arms its implicit de-registration timer at T3512 plus a margin of about 4 minutes:

last successful contact ........................... t = 0

UE would send periodic registration updating ...... t = 54 min

AMF implicit de-registration fires ................ t ~ 58 min

A UE that loses coverage at t = 5 min and regains it at t = 70 min believes it is still 5GMM-REGISTERED and sends periodic-registration-updating with its old 5G-GUTI. The AMF has no context for that 5G-GUTI and answers with 5GMM cause #10 Implicitly de-registered, on which the UE performs a fresh initial registration with a SUCI. In logs this looks like a UE that inexplicably reverts to SUCI; the cause is a coverage gap that ended an hour earlier. The margin is an implementation choice, not a specified value.

13. Timers, Counters and Retry Behaviour

TimerDefault / rangeStarted onStopped onOn expiry
T3510
15 s (fixed)Registration Request sentRegistration Accept or Reject receivedAbort the procedure, increment the registration attempt counter, start T3511 or T3502
T3511
10 s (fixed)Registration failed abnormally and the attempt counter is below 5A new registration attempt startsRetry the registration
T3502
12 min default; network-assignable in Accept or RejectRegistration attempt counter reaches 5Successful registrationAllow one more registration attempt in this PLMN
T3512
54 min default; network-assigned in AcceptEntering 5GMM-REGISTERED with the N1 signalling connection releasedN1 connection establishedInitiate periodic registration updating
T3517
15 s (fixed)Service Request sentService Accept / Reject, or the requested DL data arrivingAbort; the UE may retry or perform registration
T3519
60 s (fixed)A SUCI is sent in a Registration Request--Delete the stored SUCI, so the next attempt computes a fresh one
T3520
15 s (fixed)Authentication Failure sent (cause #20, #21 or #26)A new Authentication Request arrivesConsider the network to have failed authentication; look for another cell
T3521
15 s (fixed)UE-initiated De-registration Request sentDe-registration AcceptRetransmit, up to four retransmissions, then abort
T3346
Network-assigned, up to ~18 hoursReject with 5GMM cause #22 and a T3346 valueCell/PLMN change in some casesAllow NAS requests again. Emergency and high-priority access are exempt while it runs.
T3247
Randomised in the range 30-60 minThe UE adds an entry to a forbidden PLMN or forbidden TAI list for certain causes, or marks the USIM invalid--Remove the entries again and retry -- the mechanism that stops a transient reject from bricking service until the next power cycle
T3540
10 s (fixed)Certain NAS messages received with a release-assistance indicationThe connection being releasedRelease the N1 signalling connection

Table 14. NAS timers relevant to registration TS 24.501 Table 10.2.1. Defaults are the specification defaults; a network may override T3502, T3512, T3346 and T3448 by signalling them.

13.1 The RRC timers that bound the same procedure

TimerASN.1 valuesTypicalWhat it bounds
T300
ms100, ms200, ms300, ms400, ms600, ms1000, ms1500, ms2000ms1000RRCSetupRequest sent -> RRCSetup received. Expiry means connection establishment failure and a connEstFailReport.
T301
Same enumeration as T300ms1000RRCReestablishmentRequest -> RRCReestablishment
T302
From RRCReject waitTime, 1..16 ssignalledHow long the UE must not attempt access after an RRCReject. All access categories except emergency are barred while it runs.
T310
ms0, ms50, ms100, ms200, ms500, ms1000, ms2000ms1000Out-of-sync indications before radio link failure; see the companion 16 RLM and RLF document
T311
ms1000, ms3000, ms5000, ms10000, ms15000, ms20000, ms30000ms10000Cell selection after RLF before giving up on re-establishment
T319
Same enumeration as T300ms1000RRCResumeRequest -> RRCResume
T390
Derived from uac-BarringTimecomputed per §3.3Per-access-category UAC back-off
N310 / N311n1, n2, n3, n4, n6, n8, n10, n20 / n1..n10n10 / n1Consecutive out-of-sync / in-sync indications that start and stop T310

Table 15. UE-TimersAndConstants from SIB1 TS 38.331. These are cell-wide defaults; a dedicated RRCReconfiguration can override some of them per UE.

14. Failure Modes and What Each One Means

Two Failure Paths: an Explicit Reject and a Silent LossTwo Failure Paths: an Explicit Reject and a Silent LossUEgNBAMFRRCSetupComplete + Registration Request5GS registration type = initial-registration, SUCINGAP INITIAL UE MESSAGEUser Location Info carries TAI 310-410-4A2F1TAI not in the subscriber's allowed areaNGAP DOWNLINK NAS TRANSPORTNAS Registration Reject5GMM cause #12 Tracking area not allowedRRCReleasereleaseCause = other; no redirectedCarrierInfoStore the TAI in the forbidden-TA list, reset the attemptcounter, search for another cell. 5GMM-DEREGISTERED.second path -- no response of any kindRRCSetupComplete + Registration RequestNGAP INITIAL UE MESSAGENo Accept, no Reject, no Authentication Request. Nothing at all.T3510 expiry: attempt counter 1..4 -> retransmit.Counter reaches 5 -> start T3502, stop trying in this PLMN.T351015 sA reject carries a cause and moves the UE deterministically. A timer expiry carriesnothing, and what happens next is decided entirely by the registration attempt counter.
Figure 10. The two shapes a registration failure takes. Only the upper one gives you a cause code; the lower one is far more common in the field and gives you nothing but a timer.
What failsWho detects itWhat the UE doesWhat it points at
No SSB found on any supported carrierUE PHYKeep scanning; report no serviceBand/GSCN configuration in the UE, SSB SCS mismatch, or a cell that is genuinely off air
MIB decoded, cellBarred = barredUE RRCExclude the cell for 300 s; intraFreqReselection decides whether same-frequency cells are excluded tooDeliberate barring, or a cell that barred itself after losing its N2 connection
SIB1 never decodesUE RRCTreat the cell as barred for 300 s -- silentlypdcch-ConfigSIB1: a CORESET#0 that falls outside the carrier, or a searchSpaceZero whose monitoring occasions do not exist in this TDD pattern
Srxlev or Squal <= 0UE RRCCell not suitable; keep searchingq-RxLevMin set too high (remember the 2 dBm units), or genuine coverage. Check Pcompensation if p-Max is below the UE power class.
UAC barringUE RRC (from NAS access category)Start T390 for that access category; no preamble is transmitteduac-BarringFactor, or the access-category-to-barring-set mapping. Nothing appears in the gNB log, which is the diagnostic signature.
preambleTransMax reachedUE MAC -> RRCConnection establishment failure; store connEstFailReport; reselectUplink coverage or PRACH configuration -- see the companion 03 Random Access document
T300 expiresUE RRCGo to RRC_IDLE; increment the connEstFailureControl counter; apply connEstFailOffset to this cellgNB admission control, RRCReject, or MSG4 not decoding. A cell that accumulates connEstFailOffset will be avoided even when its RSRP is fine.
RRCReject with waitTimegNBStart T302 and back off for every access category except emergencygNB overload, or the gNB has no usable N2 connection to any AMF in the requested slice
INITIAL UE MESSAGE sent, nothing comes backUE NAS (T3510)Abort, increment attempt counter, T3511 or T3502N2 path, AMF selection, or an AMF that dropped the message. Correlate the RAN UE NGAP ID at both ends.
Authentication Request with a bad MAC-AUE / USIMAuthentication Failure, cause #20; start T3520K / OPc provisioning mismatch between USIM and UDM
AUTN sequence number out of rangeUE / USIMAuthentication Failure, cause #21, with AUTSUDM sequence-number desynchronisation. If the network re-authenticates successfully afterwards, this was benign.
Replayed UE security capabilities do not matchUE NASSecurity Mode Reject, cause #23Either an actual bid-down attempt, or an AMF that re-encodes rather than replays the IE
NAS Security Mode Command fails its integrity checkUE NASDiscard silently; T3510 eventually expiresK_AMF mismatch -- usually an ngKSI referring to different key material on the two sides
RRC SecurityModeFailureUE RRCContinue on SRB1 without AS security; the gNB releases the connectionAS algorithm not supported, or a K_gNB derived from a different UL NAS COUNT (§8)
Registration Reject, causes #11 / #12 / #15AMFWrite the PLMN or TAI to a forbidden list and stop trying thereSubscription or roaming-agreement configuration. The effect outlives the reject -- see §15.
Registration Reject, cause #22 with T3346AMFBack off for the whole PLMN until T3346 expiresCore congestion control. Deliberate, and correct behaviour.
Accept received, but the requested S-NSSAI is in Rejected NSSAIAMFRegister successfully; do not use that sliceSlice subscription, NSSF policy, or slice admission control. Data fails while registration succeeds.
T3512 missed while out of coverageAMF (implicit de-registration)The UE does not notice until its next transaction returns cause #10, then registers afresh with a SUCINothing is broken. This is the designed behaviour -- see the worked example in §12.

Table 16. Eighteen distinct ways registration fails, ordered roughly by how early in the chain they occur. The five rows above preambleTransMax all leave the gNB log empty.

💡
Key Point

Three of these are silent on the network side: SIB1 acquisition failure, S-criterion failure and UAC barring. If a device will not register and the gNB shows no preamble from it, do not start by looking at the core. Get the UE to report the cell it saw and the SIB1 it decoded, and check the three gates in §3 in order. This one habit resolves a large fraction of "the UE won't attach" tickets.

15. 5GMM Reject Causes and Their Lasting Effects

A Registration Reject is not just a failure -- it is an instruction. Most causes tell the UE to write something to a persistent list, and that list entry survives the reject, often survives cell reselection, and sometimes survives a power cycle. This is why a single mis-provisioned subscriber record can make a device appear permanently broken on a network that is working fine for everyone else.

CauseNameWhat the UE stores or doesRecovery
#3Illegal UEDelete the 5G-GUTI, TAI list, ngKSI and security context; consider the USIM invalid for 5GS (and often for EPS)Power cycle, USIM reinsertion, or T3247 expiry. The most destructive cause in the set.
#6Illegal MESame as #3, but keyed on the equipment rather than the subscription — the PEI was blacklistedReplace or re-whitelist the device; the USIM is fine
#75GS services not allowedConsider the USIM invalid for 5GS only; the UE may still use EPSSubscription change. Diagnostic tell: the same USIM attaches on LTE.
#9UE identity cannot be derived by the networkDelete the 5G-GUTI and retry with a SUCISelf-healing. One occurrence is normal after an AMF restart; a repeating pattern is not.
#10Implicitly de-registeredPerform an initial registration with a SUCISelf-healing. See the T3512 worked example in §12.
#11PLMN not allowedAdd the PLMN to the forbidden PLMN list; delete the 5G-GUTI and TAI listRoaming agreement or subscription; or T3247
#12Tracking area not allowedAdd the TAI to forbidden tracking areas for regional provision of service; keep the PLMNSubscription service-area data, or a TAC configured on the wrong cell
#13Roaming not allowed in this tracking areaAdd the TAI to forbidden tracking areas for roaming; search for another PLMN if none remainRoaming agreement scope
#15No suitable cells in tracking areaAdd the TAI to forbidden tracking areas for roaming and search for a cell in a different TA on the same PLMNCell-level restriction. Often the most confusing cause, because the PLMN stays usable and only some cells stop working.
#22CongestionStart T3346 with the signalled value and back off for the whole PLMNWait. This is working as designed.
#27N1 mode not allowedDisable N1 mode for 3GPP access; use EPS insteadSubscription. The device looks like an LTE-only device afterwards.
#31Redirection to EPC requiredDisable N1 mode temporarily and register on EPSDeliberate steering, typically during a migration
#62No network slices availableDo not use any S-NSSAI in this PLMN until reconfiguredNSSF or subscription slice data
#72Non-3GPP access to 5GCN not allowedStop attempting 5GC registration over the non-3GPP access; 3GPP access is unaffectedSubscription flag for non-3GPP access
#73Serving network not authorizedTreat the serving network as unauthorised for this attemptSNPN or roaming authorisation data
#76Not authorized for this CAG or authorized for CAG cells onlyUpdate the stored allowed CAG list; the reject may carry a new listCAG provisioning for non-public networks
#90Payload was not forwardedRetry the payload; registration itself is not affectedApplies to control-plane CIoT data, not to registration proper
#95 / #96 / #97 / #99 / #100 / #111Semantically incorrect message / Invalid mandatory information / Message type non-existent / IE non-existent / Conditional IE error / Protocol error, unspecifiedAbort and retry; nothing persistent is storedAn encoding bug on one side. These causes indicate a software problem, never a configuration one.

Table 17. 5GMM cause values for registration TS 24.501 cl. 9.11.3.2 and Annex A. The third column is what makes these causes matter long after the message that carried them.

🔄
Release Delta

Causes #3, #6, #7, #11, #12, #13 and #15 all write to persistent lists, and before Rel-16 those entries lasted until the USIM was reinserted or the device was rebooted. A single transient mis-provisioning event could therefore take a device out of service indefinitely. T3247 TS 24.501 cl. 5.3.23 was added to bound this: on expiry the UE removes the entries it added and tries again. When you are testing reject handling, a device that recovers after 30 to 60 minutes with no intervention is exhibiting T3247, not intermittent radio.

16. Message Structures: ASN.1 and NAS Encodings

The registration chain crosses three encodings: RRC ASN.1 with unaligned PER on the air interface, NAS with hand-rolled TLV in the dedicatedNAS-Message container, and NGAP ASN.1 with aligned PER on N2. The abridged structures below are the ones worth being able to read directly.

-- TS 38.331, the RRC carriers for NAS ----------------------------------

RRCSetupRequest-IEs ::= SEQUENCE {
    ue-Identity                  InitialUE-Identity,
    establishmentCause           EstablishmentCause,
    spare                        BIT STRING (SIZE (1))
}

InitialUE-Identity ::= CHOICE {
    ng-5G-S-TMSI-Part1           BIT STRING (SIZE (39)),
    randomValue                  BIT STRING (SIZE (39))
}

EstablishmentCause ::= ENUMERATED {
    emergency, highPriorityAccess, mt-Access, mo-Signalling,
    mo-Data, mo-VoiceCall, mo-VideoCall, mo-SMS,
    mps-PriorityAccess, mcs-PriorityAccess,
    spare6, spare5, spare4, spare3, spare2, spare1
}

RRCSetupComplete-IEs ::= SEQUENCE {
    selectedPLMN-Identity        INTEGER (1..maxNrofPLMNs),
    registeredAMF                RegisteredAMF          OPTIONAL,
    guami-Type                   ENUMERATED {native, mapped} OPTIONAL,
    s-NSSAI-List                 SEQUENCE (SIZE (1..maxNrofS-NSSAI))
                                     OF S-NSSAI         OPTIONAL,
    dedicatedNAS-Message         DedicatedNAS-Message,      -- the NAS PDU
    ng-5G-S-TMSI-Value           CHOICE {
        ng-5G-S-TMSI             BIT STRING (SIZE (48)),
        ng-5G-S-TMSI-Part2       BIT STRING (SIZE (9))
    }                                                   OPTIONAL,
    ...
}

RegisteredAMF ::= SEQUENCE {
    plmn-Identity                PLMN-Identity          OPTIONAL,
    amf-Identifier               AMF-Identifier             -- BIT STRING (24)
}

SecurityModeCommand-IEs ::= SEQUENCE {
    securityConfigSMC SEQUENCE {
        securityAlgorithmConfig  SecurityAlgorithmConfig,
        ...
    },
    ...
}

SecurityAlgorithmConfig ::= SEQUENCE {
    cipheringAlgorithm           CipheringAlgorithm,    -- nea0..nea3
    integrityProtAlgorithm       IntegrityProtAlgorithm OPTIONAL,
    ...                                                 -- nia0..nia3
}

Listing 1. Abridged from TS 38.331. ... marks omitted extension markers and members. DedicatedNAS-Message is an OCTET STRING as far as RRC is concerned -- the whole point of the container.

-- TS 38.413, the N2 carriers ------------------------------------------

InitialUEMessage ::= SEQUENCE {
    protocolIEs  ProtocolIE-Container { {InitialUEMessage-IEs} },
    ...
}
  id-RAN-UE-NGAP-ID           RAN-UE-NGAP-ID          -- INTEGER (0..2^32-1)
  id-NAS-PDU                  NAS-PDU                 -- OCTET STRING
  id-UserLocationInformation  UserLocationInformation -- NR-CGI + TAI
  id-RRCEstablishmentCause    RRCEstablishmentCause
  id-FiveG-S-TMSI             FiveG-S-TMSI            -- optional
  id-AMFSetID                 AMFSetID                -- optional
  id-UEContextRequest         UEContextRequest         -- optional
  id-AllowedNSSAI             AllowedNSSAI            -- optional
  id-SelectedPLMNIdentity     PLMNIdentity            -- optional

InitialContextSetupRequest ::= SEQUENCE { ... }
  id-AMF-UE-NGAP-ID           AMF-UE-NGAP-ID
  id-RAN-UE-NGAP-ID           RAN-UE-NGAP-ID
  id-GUAMI                    GUAMI
  id-UEAggregateMaximumBitRate  UEAggregateMaximumBitRate
  id-AllowedNSSAI             AllowedNSSAI
  id-UESecurityCapabilities   UESecurityCapabilities
  id-SecurityKey              SecurityKey             -- BIT STRING (256) = K_gNB
  id-MobilityRestrictionList  MobilityRestrictionList -- optional
  id-MaskedIMEISV             MaskedIMEISV            -- optional
  id-NAS-PDU                  NAS-PDU                 -- optional
  id-PDUSessionResourceSetupListCxtReq  ...           -- optional

Listing 2. NGAP IE inventory for the two messages that matter most here, abridged. The SecurityKey IE is literally K_gNB -- the only key material that ever crosses N2 towards the RAN.

17. Illustrative Message Traces

🔍
About These Traces

Illustrative trace. Field names and encodings follow 3GPP; the values are constructed for this document and are not a capture from any deployed or lab network.

One scenario runs through §17.1 to §17.5: a UE with no stored context registering on PLMN 310-410, cell PCI 217, C-RNTI 0x4C21, RAN UE NGAP ID 4711. §17.6 and §17.7 are alternative endings to the same beginning.

17.1 RRCSetupComplete carrying the first NAS message

[RRC] RRCSetupComplete
09:41:12.318  [RRC-UL] SRB1 / DCCH  C-RNTI 0x4C21  PCI 217
  UL-DCCH-Message
   c1: rrcSetupComplete
    rrc-TransactionIdentifier ......... 0
    criticalExtensions: rrcSetupComplete
     selectedPLMN-Identity ............ 1      -- 1st entry of
                                               -- plmn-IdentityInfoList
     registeredAMF .................... (absent) -- no prior registration
     guami-Type ....................... (absent)
     s-NSSAI-List ..................... (absent)
     ng-5G-S-TMSI-Value ............... (absent) -- MSG3 used randomValue
     dedicatedNAS-Message ............. 68 bytes
       7e 00 41 79 00 0d 01 05 f0 10 14 f0 ff ff ff ff
       ff 2e 04 f0 f0 f0 f0 2f 05 04 01 00 00 01 ...

  -- The gNB does not parse dedicatedNAS-Message. It copies the octet
  -- string into the NGAP NAS-PDU IE unchanged. Any decode of the NAS
  -- content in a gNB trace comes from the analyser, not the gNB.

Listing 3. RRCSetupComplete. selectedPLMN-Identity is an index into SIB1's list, not a PLMN value -- resolving it requires the SIB1 from the same cell.

17.2 The Registration Request, decoded

[NAS] Registration Request
09:41:12.318  [NAS-UL] 5GMM, plain (security header type 0)
  Extended protocol discriminator ..... 0x7E  5GS mobility management
  Security header type ................ 0     plain NAS message
  Message type ........................ 0x41  Registration Request
  5GS registration type
    Follow-On Request pending ......... 0     no immediate UL data
    value ............................. 1     initial-registration
  ngKSI
    TSC ............................... 0     native security context
    key set identifier ................ 7     no key is available
  5GS mobile identity  (length 0x000D = 13 octets)
    type of identity .................. 1     SUCI
    SUPI format ....................... 0     IMSI
    MCC / MNC ......................... 310 / 410
    routing indicator ................. 0000  -- not provisioned; AMF
                                              -- selects any AUSF
    protection scheme id .............. 0     null-scheme
    home network public key id ........ 0
    scheme output (MSIN, cleartext) ... <redacted in this document>
  5GMM capability
    S1 mode ........................... 1     EPS interworking supported
    HO attach ......................... 1
    LPP ............................... 1
    5G-CP CIoT / N3 data .............. 0 / 0
  UE security capability
    5G-EA0 5G-EA1 5G-EA2 5G-EA3 ....... 1 1 1 0   -- NEA0/128-NEA1/2
    5G-IA0 5G-IA1 5G-IA2 5G-IA3 ....... 0 1 1 0   -- 128-NIA1/2, no null
    EPS algorithms .................... present
  Requested NSSAI
    S-NSSAI[0]  SST 1                           -- eMBB
    S-NSSAI[1]  SST 2  SD 0x000001              -- URLLC + differentiator
  UE's usage setting .................. data-centric
  Requested DRX parameters ............ 128 frames (1.28 s)
  PDU session status .................. 0x0000  -- nothing established

  -- ngKSI 7 + SUCI + PDU session status all-zero is the signature of a
  -- genuine cold start. Any one of the three being different means the
  -- UE thinks it has history.

Listing 4. A cold-start Registration Request. The null-scheme SUCI here is shown to keep the octet accounting readable; a production USIM would normally use Profile A or B (§5.1).

17.3 NGAP INITIAL UE MESSAGE

[NGAP] INITIAL UE MESSAGE
09:41:12.322  [NGAP-UL] procedureCode 15 (InitialUEMessage), initiatingMessage
  RAN-UE-NGAP-ID ...................... 4711
  NAS-PDU ............................. 68 bytes (opaque)
  UserLocationInformation: userLocationInformationNR
    nR-CGI
      pLMNIdentity .................... 310-410
      nRCellIdentity .................. 0x01A2B3C40   -- 36 bits
    tAI
      pLMNIdentity .................... 310-410
      tAC ............................. 0x4A2F1       -- 24 bits
    timeStamp ....................... 2026-xx-xx 09:41:12
  RRCEstablishmentCause ............... mo-Signalling
  FiveG-S-TMSI ........................ (absent)
  AMFSetID ............................ (absent)
  UEContextRequest .................... requested
  SelectedPLMNIdentity ................ 310-410

  -- With no FiveG-S-TMSI and no AMFSetID the gNB had no routing hint and
  -- selected an AMF from its own NG Setup state (weight factors per
  -- GUAMI). This is normal for a cold start and abnormal for a UE that
  -- was registered five minutes ago -- see the trap in S5.2.

Listing 5. INITIAL UE MESSAGE. UEContextRequest = requested is the gNB asking the AMF to set up the full UE context immediately rather than only relaying NAS.

17.4 Authentication and NAS security

[NAS] Authentication + Security Mode
09:41:12.401  [NAS-DL] Authentication Request  (plain, hdr type 0)
  ngKSI  TSC 0  key set identifier 0    -- new native context, id 0
  ABBA  length 2  value 0x0000
  Authentication parameter RAND ....... 16 octets
  Authentication parameter AUTN ....... 16 octets
    SQN xor AK .......................  6 octets
    AMF field ........................  2 octets  0x8000  -- AMF sep bit
    MAC-A ............................  8 octets

09:41:12.448  [NAS-UL] Authentication Response  (plain)
  Authentication response parameter
    RES* ............................. 16 octets
  -- USIM returned RES after verifying MAC-A and SQN. The ME, not the
  -- USIM, computed RES* from CK||IK, the SN-name and RAND.

09:41:12.472  [NAS-DL] Security Mode Command  (hdr type 3: integrity
                        protected with NEW 5G NAS security context)
  MAC ................................ 4 octets
  Sequence number .................... 0x00
  Selected NAS security algorithms
    ciphering ........................ 128-5G-EA2
    integrity ........................ 128-5G-IA2
  ngKSI  TSC 0  ksi 0
  Replayed UE security capability ..... e0 60 e0 60
  IMEISV request ...................... requested
  ABBA ................................ 0x0000

09:41:12.489  [NAS-UL] Security Mode Complete  (hdr type 4: integrity
                        protected and ciphered with NEW context)
  MAC ................................ 4 octets
  Sequence number .................... 0x00
  IMEISV ............................. <redacted in this document>

  -- Check the replayed capability against S17.2 byte for byte:
  --   sent     e0 60 e0 60
  --   replayed  e0 60 e0 60    match -> no bid-down, proceed

Listing 6. 5G-AKA and NAS security activation. The security header type moves 0 -> 3 -> 4, which is the cleanest single field for locating the security boundary in a NAS trace.

17.5 Registration Accept

[NGAP/NAS] Initial Context Setup + Registration Accept
09:41:12.601  [NGAP-DL] InitialContextSetupRequest
  AMF-UE-NGAP-ID ...................... 8801
  RAN-UE-NGAP-ID ...................... 4711
  GUAMI  310-410  region 0x02  set 0x001  pointer 0x00
  UEAggregateMaximumBitRate  DL 1000000000  UL 300000000
  AllowedNSSAI  { SST 1 }
  UESecurityCapabilities
    nRencryptionAlgorithms ............ 0xC000  -- 128-NEA1, NEA2
    nRintegrityProtectionAlgorithms ... 0xC000  -- 128-NIA1, NIA2
  SecurityKey ......................... 256 bits  (K_gNB)
  MobilityRestrictionList
    servingPLMN ....................... 310-410
  NAS-PDU ............................. 51 bytes  (Registration Accept)

09:41:12.639  [NAS-DL] Registration Accept  (hdr type 2: integrity
                        protected and ciphered)
  5GS registration result
    value ............................. 1   3GPP access
    SMS over NAS allowed .............. 0
  5G-GUTI
    MCC / MNC ......................... 310 / 410
    AMF Region ID ..................... 0x02
    AMF Set ID ........................ 0x001
    AMF Pointer ....................... 0x00
    5G-TMSI ........................... 0x0C41A97E
  TAI list  (list type: list of TACs belonging to one PLMN)
    PLMN 310-410  TAC 0x4A2F1, 0x4A2F2, 0x4A2F3
  Allowed NSSAI
    S-NSSAI[0]  SST 1
  Rejected NSSAI
    S-NSSAI  SST 2  SD 0x000001
      cause ........................... S-NSSAI not available in the
                                        current registration area
  5GS network feature support
    IMS-VoPS-3GPP ..................... 1
    EMC ............................... 1  emergency over 3GPP supported
    IWK-N26 ........................... 1  interworking with EPS
  T3512 value ......................... 54 min
  Negotiated DRX parameters ........... 128 frames

09:41:12.658  [NAS-UL] Registration Complete   -- sent because a new
                                               -- 5G-GUTI was assigned
09:41:12.658  [5GMM] state -> 5GMM-REGISTERED, T3510 stopped,
                     T3512 started (54 min)

Listing 7. Accept, with a rejected slice. The UE is fully registered and one of its two requested slices is unusable in this registration area -- it may become available after a mobility registration update elsewhere, which is the difference between this cause and "not available in the PLMN".

17.6 Failure path: registration rejected

[NAS] Registration Reject #12
09:52:03.117  [NGAP-UL] InitialUEMessage  RAN-UE-NGAP-ID 4712
                        tAC 0x4A2F1  RRCEstablishmentCause mo-Signalling
09:52:03.140  [NAS-DL] Registration Reject  (plain -- no security context
                        was ever established, so the reject cannot be
                        protected)
  Message type ........................ 0x44  Registration Reject
  5GMM cause .......................... 0x0C  #12 Tracking area not
                                              allowed
  T3502 value ......................... (absent) -> UE default 12 min
  T3346 value ......................... (absent)

09:52:03.144  [RRC-DL] RRCRelease
  releaseCause ........................ other
  redirectedCarrierInfo ............... (absent)

09:52:03.145  [5GMM] cause #12 handling per TS 24.501 cl. 5.5.1.2.5:
               - store TAI 310-410-4A2F1 in 'forbidden tracking areas
                 for regional provision of service'
               - reset the registration attempt counter
               - state -> 5GMM-DEREGISTERED.LIMITED-SERVICE
               - start T3247 (30..60 min, randomised)
               - search for a cell in a different TA of PLMN 310-410
09:52:03.145  [RRC]  cell PCI 217 is still a *suitable* cell by the
                     S-criterion. It is excluded by NAS, not by RRC.

  -- This is the shape of the problem: RRC keeps telling NAS the cell is
  -- fine, NAS keeps refusing it, and no radio measurement explains it.
  -- The answer is always in the forbidden lists.

Listing 8. A reject on cause #12 and everything it sets in motion. Note that the reject is unprotected: the UE has no way to verify it, which is precisely why T3247 exists.

17.7 Failure path: authentication synch failure

[NAS] Authentication Failure #21 and recovery
10:07:44.812  [NAS-DL] Authentication Request  ngKSI 1  RAND/AUTN present
10:07:44.851  [NAS-UL] Authentication Failure
  Message type ........................ 0x59  Authentication Failure
  5GMM cause .......................... 0x15  #21 Synch failure
  Authentication failure parameter (AUTS)  14 octets
  -- MAC-A verified correctly. Only SQN was outside the USIM's window,
  -- so K, OPc and the SN-name binding are all correct.
10:07:44.851  [5GMM] T3520 started (15 s)

10:07:44.998  [NAS-DL] Authentication Request  ngKSI 1
  -- new RAND/AUTN, generated after the UDM resynchronised from AUTS
10:07:45.036  [NAS-UL] Authentication Response  RES* present
10:07:45.036  [5GMM] T3520 stopped
10:07:45.061  [NAS-DL] Security Mode Command  ngKSI 1

  -- One #21 followed by success is benign and self-healing. A #21 on
  -- every attempt means the UDM is not consuming AUTS -- check that the
  -- resynchronisation path from AUSF to UDM is actually wired up. A #20
  -- in the same position means something entirely different (S7.2).

Listing 9. A sequence-number desynchronisation resolving itself. The diagnostic value is entirely in the cause code: #21 exonerates the key material, #20 indicts it.

18. Release Deltas: Rel-15 to Rel-18

ReleaseChangeWhy it matters when reading a registration trace
Rel-155G-AKA and EAP-AKA'; SUCI concealment; 5G-GUTI; NSSAI; the ABBA parameter; separate NAS and AS security contextsThe baseline. Everything in §6 to §10 is Rel-15.
Rel-16Non-public networks: SNPN registration and CAG cells; 5GMM causes #74, #75, #76 and #77A reject cause you have never seen may simply be an NPN cause on a public-network decoder
Rel-16T3247 and bounded forbidden-list lifetimes TS 24.501 cl. 5.3.23A UE that recovers by itself 30-60 minutes after a reject is not flapping -- see the callout in §15
Rel-16UE Radio Capability ID (RACS)UE radio capability ID in the Registration Request replaces a full capability transfer, so a registration can complete with no UE capability enquiry at all
Rel-16Wireline access (W-5GAN) and trusted non-3GPP accessRegistration result can indicate access types that have no radio interface behind them
Rel-17RedCap UEs: separate initial BWPs, separate PRACH, capability gatingTwo UE classes register through disjoint radio resources in the same cell; a registration failure can be class-specific
Rel-17Extended DRX in RRC_IDLE and the T3324 active-time negotiationRequested extended DRX parameters and T3324 value appear in the Request and Accept; a UE can be legitimately unreachable for hours
Rel-17Multi-USIM (MUSIM): paging cause, paging restriction, busy indicationA UE can decline a page for reasons that have nothing to do with radio conditions
Rel-17NTN: satellite access, ta-Common, mobility with a moving cellA TAI can change without the UE moving, generating mobility registration updating from a stationary device
Rel-17Disaster roaming, with its own registration type and supporting SIA UE may legitimately register on a PLMN that is on its forbidden list
Rel-17SNPN onboarding registrationA registration type whose only purpose is to obtain credentials for a different network
Rel-18Network slice replacement and temporarily-unavailable S-NSSAIsRejected NSSAI and Configured NSSAI can now change mid-registration in ways a Rel-15 decoder will not label
Rel-18MUSIM network-switching enhancements; 5G ProSe UE-to-network relay registrationA registration can be on behalf of a relayed device rather than the transmitting one
Rel-18Personal IoT and premises networks; further SNPN localized servicesMore registration types and more causes in the same code space

Table 18. Registration-relevant changes by release. Whether a UE supports any of these is visible in 5GMM capability and in the UE capability exchange -- see the companion 26 UE Capability document.

19. Reading Registration in Logs: A Checklist

1. Establish whether the UE ever transmitted. If there is no preamble in the gNB log, the failure is in §3 -- SIB1 acquisition, the S-criterion, or UAC barring -- and no amount of core-network investigation will find it. Get the UE-side view of the cell before anything else.

2. Read the registration type and `ngKSI` together. initial-registration with ngKSI 7 and a SUCI is a cold start. Anything else -- periodic-registration-updating, or an initial registration with a 5G-GUTI -- means the UE believes it has history, and the interesting question becomes whether the AMF agrees.

3. Check that the identity in the Request matches the routing. A SUCI with no routing indicator, or a 5G-GUTI whose AMF Set ID does not match the AMF that answered, explains a surprising amount of otherwise inexplicable re-authentication.

4. Locate the security boundary. In a NAS trace, follow the security header type: 0 (plain) up to the Security Mode Command, then 3, then 4, then 2 for everything afterwards. A message with the wrong header type for its position is either a decoder artefact or a genuine context mismatch.

5. Compare the replayed UE security capabilities byte for byte against what the Registration Request actually contained. This is a two-second check that detects both bid-down attempts and AMF re-encoding bugs, and nothing else detects either.

6. Distinguish 5GMM causes from 5GSM causes. Same numeric space, different meanings, different owners. #67 from an AMF and #67 from an SMF are unrelated problems.

7. On any reject, write down what the UE was told to store. The reject message is transient; the forbidden-PLMN or forbidden-TAI entry it creates is what you will actually be debugging an hour later (§15).

8. For authentication failures, read the cause before anything else. #20 means the key material is wrong. #21 means the key material is right and only the counter drifted. #26 means the method was wrong. These have three different owners.

9. Check whether Registration Complete was expected. No new 5G-GUTI in the Accept means no Complete, and its absence is not a failure.

10. Separate registration from session establishment. A UE in 5GMM-REGISTERED with no PDU session and no data is behaving correctly. Look for a 5GSM cause, an empty Allowed NSSAI, or a Service area list that grants signalling only.

11. Correlate the RAN UE NGAP ID and AMF UE NGAP ID across both logs. They are the only identifiers common to the gNB and AMF views; the C-RNTI never reaches the AMF and the 5G-GUTI is not present in early messages.

12. Time-stamp the T3510 window. If the Registration Request and the next downlink NAS message are more than 15 seconds apart, the UE has already abandoned the procedure and anything after that point belongs to the next attempt, not this one.

20. Glossary

TermExpansionMeaning in this document
5GMM5GS Mobility ManagementThe NAS sublayer that owns registration, de-registration, service request and paging. Protocol discriminator 0x7E.
5GSM5GS Session ManagementThe NAS sublayer that owns PDU sessions. Protocol discriminator 0x2E, carried inside 5GMM transport messages.
AMFAccess and Mobility Management FunctionThe UE's NAS peer. Terminates N1, owns the 5GMM context, derives K_gNB, assigns the 5G-GUTI.
AUSFAuthentication Server FunctionHome-network function that holds XRES* and makes the final authentication decision. The AMF cannot complete authentication without it.
UDM / ARPF / SIDFUnified Data Management / Authentication Credential Repository and Processing Function / Subscription Identifier De-concealing FunctionHolds K, generates authentication vectors, and is the only entity that can turn a SUCI back into a SUPI.
SEAFSecurity Anchor FunctionThe role, co-located with the AMF, that holds K_SEAF. Not a separate deployed function in practice.
SUPI / SUCISubscription Permanent / Concealed IdentifierThe permanent subscriber identity and its encrypted form. Only the concealed form is ever sent over the air (§5).
5G-GUTI / 5G-S-TMSIGlobally Unique Temporary Identity / shortened formThe temporary identity assigned in Registration Accept, and the 48-bit shortened form the gNB uses for AMF selection.
GUAMIGlobally Unique AMF IdentifierPLMN + AMF Region ID + Set ID + Pointer. Names the AMF instance that owns a UE.
ngKSINAS Key Set Identifier for 5GThree-bit name for a security context, plus a bit distinguishing native from EPS-mapped. Value 7 means no context.
ABBAAnti-Bidding-down Between ArchitecturesA parameter mixed into K_AMF so a future release can bind keys to a feature set without a new message.
RES / XRES / HXRES*--The UE's authentication response, the expected value at the AUSF, and its truncated hash at the AMF (§7).
AUTN / AUTSAuthentication token / synchronisation tokenThe network's challenge authenticator, and the UE's resynchronisation response when SQN is out of range.
NSSAI / S-NSSAINetwork Slice Selection Assistance InformationThe set of slices, and one slice: SST plus an optional Slice Differentiator.
TAI / TACTracking Area Identity / CodePLMN + 24-bit TAC. The unit of paging and of mobility registration updating.
NGAP / N2NG Application ProtocolThe gNB-to-AMF signalling protocol. Carries NAS as an opaque NAS-PDU IE.
UACUnified Access ControlThe SIB1-driven barring mechanism that gates access per access category and access identity (§3.3).
PEIPermanent Equipment IdentifierIMEI or IMEISV. Requested only after NAS security is active.

21. References

  • 3GPP TS 24.501 -- Non-Access-Stratum (NAS) protocol for 5G System (5GS). Clause 4.5.2 (access categories), 5.1.3 (5GMM states), 5.3.23 (T3247 and forbidden-list handling), 5.4.1 (authentication), 5.4.2 (identification), 5.4.3 (security mode control), 5.5.1 (registration), 5.5.2 (de-registration), 6.4.1 (UE-requested PDU session establishment), 8.2.6 (Registration Request), 8.2.7 (Registration Accept), 8.2.9 (Registration Reject), 9.1 (NAS message headers), 9.11.3.2 (5GMM cause), 9.11.3.4 (5GS mobile identity), Table 10.2.1 (timers), Annex A (cause value summary).
  • 3GPP TS 33.501 -- Security architecture and procedures for 5G System. Clause 6.1.2 (initiation of authentication and method selection), 6.1.3.1 (EAP-AKA'), 6.1.3.2 (5G-AKA), 6.2 (key hierarchy and derivation), 6.4 (NAS security), 6.5 (AS security), 6.7 (security mode command procedures), Annex A (key derivation functions), Annex C (SUCI protection schemes).
  • 3GPP TS 23.502 -- Procedures for the 5G System. Clause 4.2.2.2 (registration procedures), 4.3.2 (PDU session establishment), 4.2.3 (service request).
  • 3GPP TS 23.003 -- Numbering, addressing and identification. Clause 2.2 (IMSI and SUPI), 2.2B (SUCI), 2.10 (5G-GUTI, 5G-S-TMSI, GUAMI), 19.4 (NAI formats).
  • 3GPP TS 38.331 -- RRC protocol specification. Clause 5.2.2 (system information acquisition and the barring-on-SIB1-failure rule), 5.3.3 (RRC connection establishment), 5.3.4 (initial security activation), 5.3.14 (unified access control), RRCSetupRequest, RRCSetupComplete, SecurityModeCommand, UE-TimersAndConstants.
  • 3GPP TS 38.304 -- UE procedures in idle mode and RRC inactive state. Clause 5.2.2 (cell selection), 5.2.3.2 (cell selection criteria S).
  • 3GPP TS 38.413 -- NG Application Protocol (NGAP). Clause 8.2.1 (Initial Context Setup), 8.6.2 (Initial UE Message), 9.2.5.1 (INITIAL UE MESSAGE IEs), 9.3.1 (IE definitions including Security Key, GUAMI, Allowed NSSAI, Mobility Restriction List).
  • 3GPP TS 38.321 -- NR MAC protocol specification. Clause 5.1 (random access), 6.1.3.3 (UE Contention Resolution Identity MAC CE).
  • 3GPP TS 22.261 -- Service requirements for the 5G system, for the access identity and access category definitions that UAC implements.

Companion documents in this set

  • 02 Radio Frame Structure -- SFN, half-frames and SSB positions, the timing the UE recovers in §2.1.
  • 03 Random Access -- MSG1 to MSG4 in full, including the 48-bit CCCH SDU that §5.2 accounts for.
  • 13 RRC Overview / 14 RRC States / 15 RRC Procedures -- the RRC side of §2.3 and §9.2, and the state model registration is independent of.
  • 16 RLM and RLF -- what T310, T311, N310 and N311 in §13.1 actually do.
  • 17 System Information -- how SIB1 and the other SIBs are scheduled and re-acquired, and the SI-window wait that dominates §12.
  • 18 MIB and SIB1 IEs -- field-by-field on the two messages §2.2 depends on, including the worked CORESET#0 lookup and the cell-selection arithmetic of §3.2.
  • 19 Paging -- how the 5G-GUTI assigned in §10 is used to reach an idle UE, and what the negotiated DRX parameters mean.
  • 26 UE Capability -- the capability exchange that usually follows Initial Context Setup, and the RACS alternative noted in §18.
  • 27 AS Security Mode -- the RRC-level procedure of §9.2 in detail, including key refresh and the K_gNB / NH chain.