Network Functions - ianchen0119/Introduce-to-5GC GitHub Wiki
ref: TS 123 501 V15.3.0
上圖為 5G 核心網路的架構圖,參考該架構圖我們可以發現一些細節:
1. 除了 N1、N2、N3、N4、N6 與 N9,每一個 Network Function 都使用 SBI 溝通。
2. 這些不經由 SBI 的 Reference Points,分別使用了以下協定進行資料的傳輸:
- N1 使用 NAS Protocol,NAS(Non-access stratum)的訊息並非像是圖片中直接連上核心網路,而是會送往 RAN 後由 RAN 進行轉發(NAS 也就是非直接接入的意思)。
- N2 使用 NGAP Protocol。
- N3 與 N9 使用 GTP-I Protocol。
- N4 使用 PFCP Protocol。
4G 核心網路(EPC)與 5G 核心網路都有 Network Function 的概念,如果對 EPC 有一定的認識就會發現 MME(EPC 的 Network Function 之一)要負責的工作實在繁重了!
3GPP 在訂定 R15 規格書時將 5G 核心網路的 Network Function 重新劃分,明顯的差異在:
- Session 與 Mobility 的管理工作從原本由一個 NF 負責改交由 AMF 與 SMF 負責。
- 將 HSS 根據不同的資料類型拆成兩個 data producer(UDR & AUSF)。
- 新增 NRF、NEF 與 NSSF
補充: NEF 提供 Network Exposure 的功能,它讓外部的 AF(Application Function)可以透過它存取核心網路的資源以及提供 traffic influence 的支援。
本文會簡單的帶大家認識一些常見的 Network Function(以 free5GC 有實作的為主)。
AMF 負責的工作在 EPC 中原本是由 MME 負責,但是在 EPS 的設計中,MME 需要負責更多 Control Plane 的處理。 在 5GS 中,AMF 僅需要注重在訪問與移動性管理,具體功能包含:
- Encryption and Integrity Protection on NAS
- Connection & Registration Management
- 參與 Authentication 流程
- 當與 4G 核心網路互動時,負責分配 EPS Bearer ID
- 處理與 UE、RAN 之間的 Control Plane message
- 處理 4G-5G or 5G-5G 的 Handover
- UE reachability
- SMF selection(可以基於 TAC、切片或是 DNN)
- 支援網路切片(與 NSSF 互動選擇出最佳的 Slice)
- C-IoT 最佳化
TS 29.518 的 章節 5.1 有定義 AMF 作為哪些 API 的 Producer,這些 API 又會由誰來使用:
- Session 管理,包含:建立、釋放與修改 session。
- 維護 UPF 與基地台之間的通道,該通道用來傳輸 user plane data。
- 負責分配與管理 UE 的 IP 位址(也可以由外部網路或是 UPF 負責)。
- 存取 subscription-related info
- 套用 PCF 提供的 policy rules 至 UPF,UPF 會根據這些規則執行 QoS。
類似於 EPC 中的 P-GW,負責以下內容:
- DL/UP Data transmission 負責 Packet 的路由以及轉發,讓 UE 能夠通到外部網路。
- 為 UE 分配 IP 位址
- 連結 UE 與 PDN
- 執行 Policy Rule
- Usage Report 搜集用戶的使用資訊並交給 SMF 以達到計費需求。
- QoS 控制每一個 QoS Flow 的傳輸速率
- Downlink Data Buffering 根據 BAR 來決定是否需要暫存封包。
Supports authentication for 3GPP access and untrusted non-3GPP access as specified in TS 33.501 [29].
- implements the EAP authentication server for security procedures with AMF
- stores keys that are retrieved by AMF for security and integrity protection
6.2.6 in 3GPP 501 R15
NRF 支援以下功能:
- Supports service discovery function 其他 NF 可以向 NRF 發送 Receive NF Discovery Request,NRF 會提供它被找到的 NF 的資料。
- Maintains the NF profile of available NF instances and their supported services.
NF Profile 會包含這些資料:
- NF instance ID.
- NF type.
- PLMN ID.
- Network Slice related Identifier(s) e.g. S-NSSAI, NSI ID.
- FQDN or IP address of NF.
- NF capacity information.
- NF Specific Service authorization information.
- if applicable, Names of supported services.
- Endpoint Address(es) of instance(s) of each supported service.
- Identification of stored data/information.
- Other service parameter, e.g., DNN, notification endpoint for each type of notification that the NF service is interested in receiving.
- Location information for the NF instance.
- TAI(s).
- Routing ID, for UDM and AUSF.
- One or more GUAMI(s), in case of AMF.
- SMF area identity(ies) in case of UPF.
- UDM Group ID, range(s) of SUPIs, range(s) of GPSIs, range(s) of external group identifiers for UDM.
- UDR Group ID, range(s) of SUPIs, range(s) of GPSIs, range(s) of external group identifiers for UDR.
- AUSF Group ID, range(s) of SUPIs for AUSF.
在 Network Slicing 的背景下,基於 network implementation,多個 NRF 可以被部屬到不同層級之中:
- PLMN level
- shared-slice level the NRF is configured with information belonging to a set of Network Slices.
- slice-specific level the NRF is configured with information belonging to an S-NSSAI.
在 roaming 的背景下,多個 NRF 可以被部屬到不同網路:
- the NRF(s) in the Visited PLMN (known as the vNRF) configured with information for the visited PLMN.
- the NRF(s) in the Home PLMN (known as the hNRF) configured with information for the home PLMN, referenced by the vNRF via the N27 interface.
NSSF 幫助 AMF 針對不同的使用場景選擇一個合適的網路切片(NSSelection),網路切片的概念會在後面的章節提到。 NSSF 的主要職責為:
- 選擇一個切片集合用於服務 UE
- 決定 allowed NSSAI & configured NSSAI
- 依據訂閱用戶的資料與地點為 UE 選擇 AMF set
PCF 就像是 EPC 中的 PCRF,會向 UDR 索取訂閱用戶的資料以制定 QoS & Charging rules。 舉例來說:當 PDU Session 在建立或是修改階段,SMF 收到相關請求時會向 PCF 詢問 policy decision 以套用適當的 QoS 策略。
類似於 EPC 中 HSS 的邏輯功能,UDM 負責用戶標識、簽約數據、鑒權數據的管理、用戶的服務網元註冊管理:
- 因為 O&M intervention 或是 Implicit Deregistration timer 到期,UDM 會觸發 Network-initiated Deregistration:

5G 架構運許 UDM, PCF, NEF 儲存資料到 UDR 之中,這些資料包含 UDM 與 PCF 存放的訂閱戶資料與策略資料、NEF 存放的 structured data for exposure 和 application data (including Packet Flow Descriptions (PFDs) for application detection, AF request information for multiple UEs)。 UDR 可以部屬在每一個 PLMN 且他可以服務同一個 PLMN 下的 UDM, PCF 以及 NEF。
N3IWF 提供 Non-Trusted 3GPP Access 服務接入(例如:透過 wifi 接入核心網路),一般的 UE 無法與 N3IWF 連線,只有 N3UE 可以使用該功能,通常這個網元會被用在智慧工廠上。
- 建立 IPsec tunne
- 處理 NAS/NGAP 訊息
- IPsec/N3 封包的封裝與解封裝