5GMM cause codes: what each one means and how to trigger it in a test
A field guide to 5GMM cause values in TS 24.501: who sends each one, in which message, what it means, and how to provoke it against a 5G core in a lab.
When a 5G registration fails, the most useful single fact is usually one octet: the 5GMM cause. It tells you which side gave up and, roughly, why. This guide covers the cause values you will meet most often when testing a 5G SA core, where each is defined in 3GPP TS 24.501, who sends it, and how to provoke it on purpose so you can test that your core handles it correctly.
All clause numbers below refer to TS 24.501, the NAS protocol for the 5G System.
What a 5GMM cause is
The 5GMM cause information element is defined in clause 9.11.3.2. Its purpose, in the spec's words, is "to indicate the reason why a 5GMM request is rejected." The value is one octet, coded as listed in table 9.11.3.2.1, and Annex A explains what each value means.
Two things make causes easier to read:
- Direction matters. Some causes are sent by the network to the UE, in messages such as REGISTRATION REJECT, SERVICE REJECT or a network-initiated DEREGISTRATION REQUEST. Others are sent by the UE to the network, in AUTHENTICATION FAILURE or SECURITY MODE REJECT. Cause #23, for example, is a UE-to-network cause.
- Annex A groups them. A.1 covers UE identification, A.2 subscription options, A.3 PLMN or SNPN specific network failures, congestion and authentication failures, and A.4 invalid messages. The group tells you where to look first.
Network to UE: registration and service rejects
Clause 5.5.1.2.5 describes what the UE does when initial registration is not accepted and the AMF sends REGISTRATION REJECT. These are the values a core tester sees most:
| Cause | Name | What it usually means in a lab |
|---|---|---|
| #3 | Illegal UE | The network refuses service to this UE, for example after it fails to authenticate it |
| #6 | Illegal ME | The device, not the subscription, is not acceptable |
| #7 | 5GS services not allowed | The subscriber is not allowed 5GS services |
| #11 | PLMN not allowed | The UE asked for service in a PLMN where it is not allowed |
| #12 | Tracking area not allowed | The UE asked for service in a tracking area where it is not allowed |
| #13 | Roaming not allowed in this tracking area | The tracking area does not allow roaming for this UE |
| #15 | No suitable cells in tracking area | The UE should look for another tracking area in the same PLMN |
| #22 | Congestion | The network is congested; the AMF can assign back-off timer T3346 |
| #27 | N1 mode not allowed | The UE is not allowed to use N1 mode |
| #62 | No network slices available | None of the requested slices can be provided |
Annex A.2 notes the practical difference between #12 and #15: #15 makes the UE search for another tracking area in the same PLMN, while #12 does not.
Two identity causes from Annex A.1 are worth knowing for service and mobility procedures. #9, UE identity cannot be derived by the network, is sent when the network cannot derive the UE's identity, for example from a 5G-GUTI it does not recognise. #10, implicitly de-registered, is sent when the network has already de-registered the UE, for example after a timer expired. Clause 5.6.1.5 covers SERVICE REJECT, which also carries a 5GMM cause.
UE to network: authentication and security mode
Clause 5.4.1.3.6 covers authentication not accepted by the UE. The UE answers with AUTHENTICATION FAILURE and one of:
- #20, MAC failure: the authentication challenge failed the MAC check.
- #21, synch failure: the sequence number was out of range. The UE includes a re-synchronisation token, AUTS, so the network can resynchronise.
- #26, non-5G authentication unacceptable: the challenge was not acceptable for 5G (see clause 6.1.3 of TS 33.501).
Clause 5.4.2.5 covers a security mode command the UE will not accept. The UE answers with SECURITY MODE REJECT, typically with:
- #23, UE security capabilities mismatch: the replayed UE security capabilities in SECURITY MODE COMMAND differ from what the UE sent. This one has its own article: cause #23 explained.
- #24, security mode rejected, unspecified: any other reason.
When the AMF receives SECURITY MODE REJECT it stops timer T3560 and aborts the procedure that triggered security mode control, usually the registration.
Protocol errors
Annex A.4 lists the causes for invalid messages: #95 semantically incorrect message, #96 invalid mandatory information, #97 message type non-existent or not implemented, #98 message type not compatible with the protocol state, #99 information element non-existent or not implemented, #100 conditional IE error, #101 message not compatible with the protocol state, and #111 protocol error, unspecified. You will see these in 5GMM STATUS and in rejects when a peer sends something malformed or out of sequence.
How to trigger causes against your core
To test that a core handles a cause correctly, you need to provoke the condition, then check two things: that the expected message and cause arrive, and that the core does what the spec says next. With Runik playing the gNB and the UE, the provoking side is under your control.
Network-sent causes come from configuration and from what the UE asks for:
- Register in a tracking area your AMF does not serve to look for #12 or #15. Runik's NGAP builders include an initial UE message at a chosen TAC.
- Request a slice your core is not configured for, by setting the S-NSSAI in the flow, to look for #62.
- Register a subscriber that is provisioned without 5GS service to look for #7.
- Present a 5G-GUTI or TMSI the core does not know. Depending on the procedure, the core may ask for identity or reject; a service request with an unknown TMSI is a common way to see #9.
Which cause a given core returns for a given condition is partly an implementation choice. The spec defines the meaning of each value; your core decides which condition maps to which value. A test should assert what your core is meant to do, and the flow should say why.
UE-sent causes are about what the tester answers:
- Answer an AUTHENTICATION REQUEST with AUTHENTICATION FAILURE, MAC failure or synch failure, and check that the core re-authenticates or rejects as it should.
- Answer a SECURITY MODE COMMAND with SECURITY MODE REJECT and check that the registration is aborted.
These are well-formed messages, so they run in Runik Community. A missing security capability IE or a corrupted NAS container is a different input from those well-formed cases.
Asserting the cause, not just the failure
A negative test that only checks "registration failed" can pass for the wrong reason. Assert the specific reject and the specific end state:
final_checks:
- name: the core sent REGISTRATION REJECT
metric: rx_events.NASDownlinkTransport.RegistrationReject
op: equals
value: 1
- name: the UE never reached registered
metric: final_state_counts.registered
op: equals
value: 0
Add a check on the cause value in the reject, so a change from #12 to #15 in a new build fails the run. rk vocab lists the fields and operators a check can use. Runik reports every failed check by name in the JSON verdict and exits 1, so a changed cause shows up in CI as a regression. A metric key that is absent fails instead of reading as zero.
Keep the negative set running
Cause handling changes quietly between builds. A small set of negative flows (wrong tracking area, unknown slice, authentication failure, security mode reject) runs quickly and catches changes in error handling that happy-path tests never see. Put them next to your registration and PDU session flows in CI, and run them again before every core upgrade.
The public flow catalog includes negative flows you can start from. Install Community with curl -fsSL https://get.dflux.io/runik/install.sh | sh to run them against your core.