Home / Call Flows / 5g-security-context-update

5G Security Context Update Procedure Explained

call-flow 5G NR | Security | Context | AMF

Introduction

In 5G networks, the Security Context Update procedure ensures that the security keys and protection mechanisms between the User Equipment (UE) and the network remain valid and secure.

Over time, security keys may need to be refreshed due to:

  • mobility events
  • handovers
  • security policy updates

The security context update mechanism helps maintain secure communication across different network functions and radio nodes.

The procedure is defined by the 3rd Generation Partnership Project in:

  • 3GPP TS 33.501 - 5G Security Architecture
  • 3GPP TS 23.502 - 5G System Procedures
  • 3GPP TS 38.331 - NR RRC Protocol
5G Security Context Update diagram

Why Security Context Update Is Needed

The security context contains important information used for protecting signaling and data traffic.

These include:

  • security keys
  • encryption algorithms
  • integrity protection parameters

Updating the security context ensures that:

  • keys remain secure
  • communication remains protected
  • mobility events do not compromise security

Network Functions Involved

UE (User Equipment)

Applies updated security parameters and keys.

gNB (Next Generation NodeB)

Maintains the access stratum security context for the UE.

AMF (Access and Mobility Management Function)

Manages NAS security context and coordinates updates.

Interfaces Used

Interface Description
NR-UuRadio interface between UE and gNB
N1NAS signaling between UE and AMF
N2Interface between gNB and AMF

Security Context Update Call Flow

Below is the simplified signaling sequence.

UE            gNB            AMF
 |             |              |
 |<--Security Context Update--|
 |             |              |
 |--Update Complete---------->|

After this step, new security parameters become active.

Step-by-Step Explanation

Step 1: Trigger for Security Context Update

A security context update may be triggered by several events such as:

  • handover between gNBs
  • mobility between network areas
  • security policy updates
  • key lifetime expiration

Important parameters to check

Engineers should verify:

  • key lifetime timers
  • security policy configuration
  • mobility event triggers

Step 2: New Key Derivation

The network derives new security keys from the existing security anchor key.

These keys may include:

Key Purpose
K_AMFNAS security key
K_gNBAccess stratum key
K_RRCencRRC encryption
K_UPencUser plane encryption

Important parameters to check

Check:

  • key derivation parameters
  • serving cell identity
  • security anchor key validity

Step 3: Security Context Update Message

The network sends updated security configuration to the UE.

This may include:

  • new encryption keys
  • updated integrity protection parameters
  • refreshed security context identifiers

Important parameters to check

Verify:

  • algorithm compatibility
  • correct key identifiers
  • security context version

Step 4: UE Applies Updated Security Context

The UE applies the new security configuration and updates its security context.

This ensures that future signaling and data messages are protected using the updated keys.

Important parameters to check

Check:

  • correct key activation
  • synchronization with network
  • integrity verification

Security Context Components

Component Description
NAS Security ContextProtects NAS signaling
AS Security ContextProtects radio communication
Encryption KeysProtect signaling and user data
Integrity KeysEnsure message authenticity

When Security Context Updates Occur

Event Reason
HandoverNew base station requires new AS keys
AMF relocationNew NAS security context
Key lifetime expirationSecurity refresh
Security policy changesAlgorithm update

Troubleshooting Security Context Issues

Security Context Mismatch

Possible causes:

  • incorrect key derivation
  • synchronization errors
  • handover configuration issues

Encryption Failure

Possible reasons:

  • unsupported algorithms
  • incorrect key activation
  • UE capability limitations

Integrity Protection Failure

Possible causes:

  • incorrect integrity keys
  • message corruption
  • signaling errors

Relevant 3GPP Specifications

The Security Context Update procedure is defined by the 3rd Generation Partnership Project in:

  • 3GPP TS 33.501 - Security Architecture
  • 3GPP TS 23.502 - System Procedures
  • 3GPP TS 38.331 - NR RRC Protocol

Summary

The Security Context Update procedure ensures that security keys and protection parameters remain valid during mobility and network changes.

The process includes:

  1. detecting a trigger for security update
  2. deriving new security keys
  3. sending updated security parameters
  4. UE applying the updated security context

This mechanism ensures continuous secure communication in dynamic 5G networks.