|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
AMF plays the most crtical(central) roles in 5G core network. Simply put, AMF is a central control box or central hub of the whole 5G core network. The Major role of AMF is to handle NAS message from UE. This NAS message would mostly comes from RAN (gNB) but theoretically it can come from other Non 3GPP components. As shown below, the communication between AMF and RAN is going through N1 interface. I wrote a separate notes for N1 interface / N1 mode itself. In this note, I would focus mostly on handling each NAS message with examples. There are some functionalities done by AMF only and some other functions that AMF need to communicate with other network components. In this note, I would mostly focus on those functions that are done by AMF only.
Followings are the name of each network component. AMF Access and Mobility Management Function ==> Equivalent to MME in 4G DN Data Network NEF Network Exposure Function NRF Network Repository Function NSSF Network Slice Selection Function PCF Policy Control Function ==> Equivalent to PCRF in 5G (R)AN (Radio) Access Network SMF Session Management Function UPF User Plane Function ==> Equivalent to PGW in 4G SMSF SMS Function Followings are the topics to be covered in this note.
AMF Functionality/ServicesThe AMF handles critical control plane functions like registration management, connection management, reachability management, mobility management and access authentication. It interacts with other core network functions and external entities via service-based interfaces like Namf. Since AMF has so many different functionailties and interactions, we can take a look at it with various different perspective. In this section, I will try to describe AMF functionalities in a few different ways/perspective, so that you can get the understanding on AMF with different angles. First let's look into AMF with the perspective of registration management, connection management, reachability management, mobility management and access authentication.
As a view with different angle, the functionality of AMF function can be summarized well by the AMF source code itself if you have access to. As an example, following is the list of major fucntionalities written in the source code from free5gc (I wrote a note on how to get and install free5gc if you are interested). It is completely OK that you don't have the code, just taking a lot at the list of major functions would give you pretty good idea on AMF functionality. This is from file : free5gc\NFs\amf\gmm\handler.go. For the details of what AMF does, I would suggest you to refer to the note NGAP and I will just put high level description in this page.
Now let's describe on AMF functionality in terms of service function(service API). Formal specification of AMF is described in 29.518 and the list of services that AMF provides are summarized in a table shown below. < 29.518 - Table 5.1-1 List of AMF Services >
Highlights of this table can be summarized as below.
Interfaces around AMFAMF is the center of the whole 5G core network with the most diverse interface with other core network components. Followings are the network interfaces connected to AMF and corresponding 3GPP specification.
Before AMF start NAS handlingEven though this is not the main contents of this note, I think I need to put some short comments on this at least. Before AMF start handling NAS message, the interface and protocol between AMF and gNB should be established. Usually this process is printed just in a few lines in the trace log, but this establishement process itself is pretty complicated. I have three separate notes only for this process as listed below. What AMF is doing is described mostly by NGAP page. Signaling (Message flow between gNB and AMF) - N2 InterfaceFollowing is the signaling procedure of NR SA attach. Roughly speaking that NGAP traces are the ones handled by AMF. Just take a look at the overal procedure and for the details refer to the note NGAP. At first, I was thinking of AMF details in this page but I thought it may be confusing or duplicating NGAP note. So I decided to put all the details in NGAP note and put overall / high level description in this note. NOTE : The signaling message reaching to AMF through N2 interfaces will be conveyed to various other core network components via correponding interfaces. The signaling through other interfaces will be explained in other notes. Check out Interfaces around AMF to reach out to the corresponding interfaces. This log is captured from Amari Callbox + Commercial UE. The wireshark log in NGAP note is captured from NIC on Core Network PC. Check out this tutorial on Amarisoft TechAcademy to get the entire log. How to select an AMF ?In 5G network, one gNB can be connected to multiple AMF as illustrated below for an example, how the gNB select which AMF to communicate with for each transaction ? In the example shown below, three gNBs are connected to two AMF and the two AMF are also connected to each and every gNBs. The green connecting lines indicates N2 interface and these interfaces are based on SCTP link. Let's assume that all the SCTPs are alive and hear beat keep going on. In a 5G network, a gNB (gNodeB) can be connected to multiple Access and Mobility Management Functions (AMF). The selection of which AMF to communicate with for each traffic flow is based on several factors.
In this situation how each of gNB can figure out(select) which AMF for a specific transaction ?
When a UE (User Equipment) specifies an AMF (Access and Mobility Management Function) in the RRC Connection Complete message, it typically indicates that the UE has a prior association with this AMF. This scenario usually occurs when the UE is re-registering or reconnecting to the network after a disconnection or mobility event. The gNB usually attempts to connect to the AMF specified by the UE if it is a valid option based on availability, policies, and location. However, if the AMF is not suitable or unavailable, the gNB will select a different AMF based on its internal selection logic, load balancing, and NRF recommendations. This approach ensures optimal network performance and continuity of service for the UE. Here’s what the gNB (gNodeB) typically does in this situation:
[4] RRC Setup Complete { message c1: rrcSetupComplete: { rrc-TransactionIdentifier 0, criticalExtensions rrcSetupComplete: { selectedPLMN-Identity 1, registeredAMF { amf-Identifier '800101'H }, guami-Type native, dedicatedNAS-Message '7E014295C6102E7E004169000BF200F...'H } } } [5] Registration Request (piggybacked in RRC setup complete) Protocol discriminator = 0x7e (5GS Mobility Management) Security header = 0x1 (Integrity protected) Auth code = 0x4295c610 Sequence number = 0x2e Protocol discriminator = 0x7e (5GS Mobility Management) Security header = 0x0 (Plain 5GS NAS message, not security protected) Message type = 0x41 (Registration request) 5GS registration type: Follow-on request bit = 1 Value = 1 (initial registration) ngKSI: TSC = 0 NAS key set identifier = 6 5GS mobile identity: 5G-GUTI MCC = 001 MNC = 01 AMF Region ID = 128 AMF Set ID = 4 AMF Pointer = 1 5G-TMSI = 0x32efe46b UE security capability: 0xf0 (5G-EA0=1, 128-5G-EA1=1, 128-5G-EA2=1, 128-5G-EA3=1, 5G-EA4=0, 5G-EA5=0, 5G-EA6=0, 5G-EA7=0) 0x70 (5G-IA0=0, 128-5G-IA1=1, 128-5G-IA2=1, 128-5G-IA3=1, 5G-IA4=0, 5G-IA5=0, 5G-IA6=0, 5G-IA7=0) 0xf0 (EEA0=1, 128-EEA1=1, 128-EEA2=1, 128-EEA3=1, EEA4=0, EEA5=0, EEA6=0, EEA7=0) 0x70 (EIA0=0, 128-EIA1=1, 128-EIA2=1, 128-EIA3=1, EIA4=0, EIA5=0, EIA6=0, EIA7=0) NAS message container: Protocol discriminator = 0x7e (5GS Mobility Management) Security header = 0x0 (Plain 5GS NAS message, not security protected) Message type = 0x41 (Registration request) 5GS registration type: Follow-on request bit = 1 Value = 1 (initial registration) ngKSI: TSC = 0 NAS key set identifier = 6 5GS mobile identity: 5G-GUTI MCC = 001 MNC = 01 AMF Region ID = 128 AMF Set ID = 4 AMF Pointer = 1 5G-TMSI = 0x32efe46b 5GMM capability: 0x03 (SGC=0, 5G-IPHC-CP CIoT=0, N3 data=0, 5G-CP CIoT=0, RestrictEC=0, LPP=0, HO attach=1, S1 mode=1) UE security capability: 0xf0 (5G-EA0=1, 128-5G-EA1=1, 128-5G-EA2=1, 128-5G-EA3=1, 5G-EA4=0, 5G-EA5=0, 5G-EA6=0, 5G-EA7=0) 0x70 (5G-IA0=0, 128-5G-IA1=1, 128-5G-IA2=1, 128-5G-IA3=1, 5G-IA4=0, 5G-IA5=0, 5G-IA6=0, 5G-IA7=0) 0xf0 (EEA0=1, 128-EEA1=1, 128-EEA2=1, 128-EEA3=1, EEA4=0, EEA5=0, EEA6=0, EEA7=0) 0x70 (EIA0=0, 128-EIA1=1, 128-EIA2=1, 128-EIA3=1, EIA4=0, EIA5=0, EIA6=0, EIA7=0) Requested NSSAI: S-NSSAI Length of S-NSSAI contents = 1 (SST) SST = 0x01 Last visited registered TAI: MCC = 001 MNC = 01 TAC = 0x000064 S1 UE network capability: 0xf0 (EEA0=1, 128-EEA1=1, 128-EEA2=1, 128-EEA3=1, EEA4=0, EEA5=0, EEA6=0, EEA7=0) 0x70 (EIA0=0, 128-EIA1=1, 128-EIA2=1, 128-EIA3=1, EIA4=0, EIA5=0, EIA6=0, EIA7=0) 0xc0 (UEA0=1, UEA1=1, UEA2=0, UEA3=0, UEA4=0, UEA5=0, UEA6=0, UEA7=0) 0x40 (UCS2=0, UIA1=1, UIA2=0, UIA3=0, UIA4=0, UIA5=0, UIA6=0, UIA7=0) 0x19 (ProSe-dd=0, ProSe=0, H.245-ASH=0, ACC-CSFB=1, LPP=1, LCS=0, 1xSRVCC=0, NF=1) 0x80 (ePCO=1, HC-CP CIoT=0, ERw/oPDN=0, S1-U data=0, UP CIoT=0, CP CIoT=0, ProSe-relay=0, ProSe-dc=0) 0xb0 (15 bearers=1, SGC=0, N1mode=1, DCNR=1, CP backoff=0, RestrictEC=0, V2X PC5=0, multipleDRB=0) UE's usage setting = 0x01 (Data centric) LADN indication: Length = 0 Data = Network slicing indication = 0x00 (DCNI=0, NSSCI=0) 5GS update type = 0x01 (EPS-PNB-CIoT=no additional information, 5GS-PNB-CIoT=no additional information, NG-RAN-RCU=0, SMS requested=1) [6] Initial UE message initiatingMessage: { procedureCode id-InitialUEMessage, criticality ignore, value { protocolIEs { { id id-RAN-UE-NGAP-ID, criticality reject, value 1 }, { id id-NAS-PDU, criticality reject, value '7E014295C6102E7E004169000BF200F1....'H }, { id id-UserLocationInformation, criticality reject, value userLocationInformationNR: { nR-CGI { pLMNIdentity '00F110'H, nRCellIdentity '001234501'H }, tAI { pLMNIdentity '00F110'H, tAC '000064'H } } }, { id id-RRCEstablishmentCause, criticality ignore, value mo-Signalling }, { id id-UEContextRequest, criticality ignore, value requested } } } }
[7] DownlinkNASTransport, initiatingMessage: { procedureCode id-DownlinkNASTransport, criticality ignore, value { protocolIEs { { id id-AMF-UE-NGAP-ID, criticality reject, value 100 }, { id id-RAN-UE-NGAP-ID, criticality reject, value 1 }, { id id-NAS-PDU, criticality reject, value '7E005B01'H } } } }
When the UE does not specify an AMF in the RRC Connection Complete message, the gNB takes responsibility for selecting an appropriate AMF using NRF queries, considering location, network slice requirements, AMF capabilities, and network policies. This ensures that the UE is served by the most suitable AMF based on the network’s current conditions and configurations. When a UE (User Equipment) does not specify an AMF (Access and Mobility Management Function) in the RRC Connection Complete message, it indicates that the UE does not have a preference or prior association with a specific AMF. This typically happens when the UE is:
In this scenario, the gNB (gNodeB) performs the following steps to select an appropriate AMF for the UE:
[4] RRC Setup Complete { message c1: rrcSetupComplete: { rrc-TransactionIdentifier 0, criticalExtensions rrcSetupComplete: { selectedPLMN-Identity 1, dedicatedNAS-Message '7E004179000D0100F110F0FF000010325476982E02E0E0'H, nonCriticalExtension { nonCriticalExtension { ul-RRC-Segmentation-r16 true } } } } } [5] Registration Request (piggybacked in RRC setup complete) Protocol discriminator = 0x7e (5GS Mobility Management) Security header = 0x0 (Plain 5GS NAS message, not security protected) Message type = 0x41 (Registration request) 5GS registration type: Follow-on request bit = 1 Value = 1 (initial registration) ngKSI: TSC = 0 NAS key set identifier = 7 5GS mobile identity: SUCI SUPI format = 0 (IMSI) MCC = 001 MNC = 01 Routing indicator = 0 Protection sheme id = 0 (Null scheme) Home network public key identifier = 0 MSIN = 0123456789 UE security capability: 0xe0 (5G-EA0=1, 128-5G-EA1=1, 128-5G-EA2=1, 128-5G-EA3=0, 5G-EA4=0, 5G-EA5=0, 5G-EA6=0, 5G-EA7=0) 0xe0 (5G-IA0=1, 128-5G-IA1=1, 128-5G-IA2=1, 128-5G-IA3=0, 5G-IA4=0, 5G-IA5=0, 5G-IA6=0, 5G-IA7=0) [6] Initial UE message initiatingMessage: { procedureCode id-InitialUEMessage, criticality ignore, value { protocolIEs { { id id-RAN-UE-NGAP-ID, criticality reject, value 1 }, { id id-NAS-PDU, criticality reject, value '7E004179000D0100F110F0FF000010325476982E02E0E0'H }, { id id-UserLocationInformation, criticality reject, value userLocationInformationNR: { nR-CGI { pLMNIdentity '00F110'H, nRCellIdentity '001234501'H }, tAI { pLMNIdentity '00F110'H, tAC '000064'H } } }, { id id-RRCEstablishmentCause, criticality ignore, value mo-Signalling }, { id id-UEContextRequest, criticality ignore, value requested } } } } [7] DownlinkNASTransport, initiatingMessage: { procedureCode id-DownlinkNASTransport, criticality ignore, value { protocolIEs { { id id-AMF-UE-NGAP-ID, criticality reject, value 100 }, { id id-RAN-UE-NGAP-ID, criticality reject, value 1 }, { id id-NAS-PDU, criticality reject, value '7E005600020000213C985803AD3165...'H } } } }
Reference
YouTube
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||