5G NR - SecurityModeFailure Message Explained

The SecurityModeFailure message is the UE’s explicit negative response to SecurityModeCommand in 5G NR. It tells the gNB that the requested AS security activation could not be completed successfully.

In simple terms, this is the UE saying: the requested RRC security setup did not work, so the normal protected RRC procedure cannot continue.

This page covers the NR RRC SecurityModeFailure message from 3GPP TS 38.331. It is part of the NR RRC security activation procedure, not NAS security signaling.

Why SecurityModeFailure matters

SecurityModeFailure is one of the most important bad-case checkpoints in the NR RRC security procedure.

It matters because it tells you:

  • the UE did not complete AS security activation successfully
  • the failure happened before normal protected follow-up signaling could continue
  • later missing messages such as RRCReconfiguration may be missing because security activation already failed
  • the troubleshooting focus should shift to the security step, not only to later connected-mode procedures

If this message appears, the success path toward SecurityModeComplete has already failed.

Where SecurityModeFailure appears in the call flow

A common failure path is:

  1. RRC Setup from gNB to UE
  2. RRCSetupComplete from UE to gNB
  3. SecurityModeCommand from gNB to UE
  4. SecurityModeFailure from UE to gNB
  5. release, abort, or recovery handling instead of normal protected follow-up signaling

This means SecurityModeFailure is the explicit negative branch of the same security activation procedure that would otherwise produce SecurityModeComplete.

Call flow position

A compact NR signaling view is:

UE                              gNB
|                               |
|----- RRCSetupComplete ------->|
|                               |
|<---- SecurityModeCommand -----|
|                               |
|---- SecurityModeFailure ----->|
|                               |
|--- release or recovery -----> |
|                               |

This sequence shows the bad-case path:

  • SecurityModeCommand requests AS security activation
  • SecurityModeFailure reports that the UE could not complete it
  • normal protected follow-up signaling such as RRC Reconfiguration is usually blocked or replaced by failure handling

For the broader procedure context, see:

Transport characteristics

For trace analysis, the transport profile is:

  • Direction: UE to gNB
  • Bearer: SRB1
  • Logical channel: UL-DCCH
  • RLC mode: AM
  • Protocol layer: NR RRC

This is part of the connected-mode control path during the security activation stage.

What engineers should inspect first

When SecurityModeFailure appears, inspect in this order:

  1. Did it follow the expected SecurityModeCommand?
  2. Does the transaction identifier match?
  3. Did the UE fail explicitly with SecurityModeFailure or was there also a silent timeout pattern?
  4. What happened immediately after the failure: release, retry, or recovery?
  5. Does the surrounding trace point to integrity, algorithm, or context-consistency problems?

Practical troubleshooting guidance

This message is most useful when read together with:

If the failure path is hit, the main engineering questions are:

  • did the UE reject the commanded security activation or fail during verification?
  • is the selected security configuration consistent with the UE and scenario?
  • did the network abort immediately after the failure?
  • is the root issue really AS security activation rather than a later RRC procedure?

Summary

SecurityModeFailure is the UE-side indication that NR RRC AS security activation failed.

The key engineering points are:

  • it is the explicit negative branch of the SecurityModeCommand procedure
  • it is a small procedural failure message, not a detailed root-cause container
  • it is sent on SRB1 / UL-DCCH
  • it usually blocks the normal path toward protected follow-up signaling
  • troubleshooting depends on pairing it with the preceding command and the immediate recovery behavior

FAQ

What does SecurityModeFailure mean in 5G NR?

It means the UE could not successfully complete the AS security activation requested by SecurityModeCommand.

Who sends SecurityModeFailure?

The UE sends SecurityModeFailure to the gNB.

What comes before SecurityModeFailure?

SecurityModeCommand comes immediately before it in the failure branch.

What happens after SecurityModeFailure?

The network usually cannot continue normal protected RRC signaling and may release the connection or trigger recovery handling.

Does SecurityModeFailure explain the full reason in detail?

Usually no. Engineers often need surrounding trace context to understand the real root cause.

How is SecurityModeFailure different from SecurityModeComplete?

SecurityModeComplete confirms success, while SecurityModeFailure is the explicit UE-side failure path.

Summary

Uplink NR RRC message used by the UE to indicate that the commanded AS security activation could not be completed successfully.