行業洞察
2026-10-21 15:33:45

5GC 核心網路 AMF 發起的清除程序

5GC AMF 清除流程負責刪除過期的使用者簽約資料和移動性管理上下文,使用者登出後關鍵處理點包括 Nudm_SDM_Unsubscribe、Nudm_UECM_Deregistration、PurgeFlag、GUAMI 以及 AMF 上下文清理。

貝克電信

5GC 核心網路 AMF 發起的清除程序

UE 可能長時間未連線至網路,直到滿足 AMF 隱式取消註冊計時器的條件。此時,問題已不是 UE 如何完成註冊,而且網路可能已無法向 UE 傳送 NAS 取消註冊訊息。網路必須決定如何處理 AMF 仍為該 UE 保留的簽約資料、行動性管理上下文,以及 UDM 中的訂閱和註冊狀態。

AMF Purge(AMF 清除)負責這個清理階段。3GPP 將此程序定義為 Purge of Subscriber Data in AMF(清除 AMF 中的用戶資料)。UE 完成隱式或顯式取消註冊後,AMF 可移除本機儲存的用戶簽約資料和 MM Context(行動性管理上下文),並終止與 UDM 維持的相關關聯。

因此,分析 Purge 程序時,不應重新從 Registration Request、Authentication 或 Registration Accept 開始。重點是註冊關係結束後,AMF 與 UDM 如何清理已失效的註冊相關狀態。

Purge、註冊與網路發起取消註冊的界線

Purge 有時會與取消註冊混淆,因為它可能發生在符合隱式取消註冊條件之後,但這兩者並非同一程序。

程序主要目的應檢查的典型信令
初始註冊建立 UE 與 5GS 之間的註冊關係Registration Request / Accept
網路發起的取消註冊終止現有的 5GS 註冊關係Deregistration Request 與相關清理信令
AMF Purge 清除從 AMF 移除過期的用戶簽約資料與 MM Context,並清除 UDM 中的相關狀態SDM Unsubscribe 與 UECM Deregistration

在隱式取消註冊的情境下,UE 可能已長時間無法連線,因此 Purge 程序本身不需要 UE 參與。即使信令追蹤中沒有 UE 端的註冊或取消註冊 NAS 訊息,也不表示未執行 Purge。

更精確地說,取消註冊是確定 UE 不再維持目前的 5GS 註冊關係,而 Purge 則移除 AMF 與 UDM 中仍與該關係相關的殘留狀態。

若要了解網路為何終止 UE 註冊,請參閱5GC 核心網路由網路發起的取消註冊程序。Purge 接續取消註冊後的 AMF 端清理作業。

5GC 初始註冊、網路發起取消註冊與 AMF Purge 的區別:Purge 在取消註冊後清理 AMF 上下文及 UDM 關聯
5GC 初始註冊、網路發起取消註冊與 AMF Purge 的區別:Purge 在取消註冊後清理 AMF 上下文及 UDM 關聯

AMF Purge 的觸發條件與清理範圍

典型觸發條件是 AMF 端用於隱式取消註冊的計時器達到設定條件。網路無法繼續將 UE 視為正常註冊狀態,因此必須清理剩餘的上下文。

AMF 主要處理兩類狀態。

第一類是Subscriber Data(用戶簽約資料)。UE 註冊期間,AMF 可能從 UDM 取得並儲存與存取及行動性管理相關的簽約資料,也可能建立 SDM Subscription,以便相關用戶資料異動時由 UDM 通知 AMF。

第二類是MM Context(行動性管理上下文),包含 AMF 用於管理 UE 註冊和行動性狀態的資訊。當 UE 不再維持目前的註冊關係時,這些本機上下文不應無限期占用資源。

因此,Purge 的用途是移除舊狀態,而非建立新狀態。典型清理項目包括:

  • 取消 AMF 在 UDM 中建立的用戶資料訂閱;

  • 在 UDM 中取消 AMF 的 UECM 註冊;

  • 移除 AMF 本機儲存的 UE 簽約資料和 MM Context;

  • 使 AMF 儲存的 UE 註冊狀態與實際已取消註冊的狀態一致。

5GC AMF Purge 清除用戶簽約資料、MM Context、UDM 中的 SDM Subscription 與 UECM Registration,避免繼續保留失效的 UE 上下文
5GC AMF Purge 清除用戶簽約資料、MM Context、UDM 中的 SDM Subscription 與 UECM Registration,避免繼續保留失效的 UE 上下文

SDM 取消訂閱與 UECM 取消註冊信令

從 SBI 信令追蹤來看,AMF Purge 的主要信令序列相對簡短,集中在 AMF 與 UDM 之間。

取消 SDM 訂閱

AMF 首先必須移除先前建立的用戶資料訂閱。在 HTTP/2 追蹤中,可以觀察到類似下列操作:

DELETE /nudm-sdm/v2/{SUPI}/sdm-subscriptions/{subscriptionId}

UDM 使用 Subscription ID 找出並刪除對應的訂閱關係。訂閱移除後,UE 的用戶簽約資料即使後續發生異動,也不會再透過已刪除的訂閱向該 AMF 發送通知。

正常情況下,UDM 可回傳 204 No Content,表示訂閱已成功移除。

在 UECM 中取消 AMF 註冊

接著,AMF 必須更新 UDM UECM 中的註冊狀態。在實際網路的信令追蹤中,這可能呈現為更新 AMF 3GPP Access Registration 資源,請求同時攜帶 GUAMI 與 PurgeFlag=true。

UDM 根據接收到的資訊核對相應的 AMF 註冊紀錄。如果 GUAMI 與儲存的服務 AMF 資訊相符,註冊資料便會反映 Purge 狀態,表示服務 AMF 已完成該 UE 所需的取消註冊及清理。

成功處理後,UDM 也可以回傳 204 No Content。此時,AMF 與 UDM 之間的兩項主要關聯已完成清理:

  1. SDM Subscription 已移除;

  2. UECM 中的 AMF Registration 已完成取消註冊/Purge 處理。

最後,AMF 移除本機保留的 UE 上下文,並將對應的註冊管理狀態轉為 RM-DEREGISTERED。

5GC AMF Purge 流程:AMF 先呼叫 Nudm SDM Unsubscribe 介面 移除 UDM 的用戶資料訂閱,再使用 GUAMI 與 PurgeFlag 執行 Nudm UECM Deregistration
5GC AMF Purge 流程:AMF 先呼叫 Nudm SDM Unsubscribe 介面 移除 UDM 的用戶資料訂閱,再使用 GUAMI 與 PurgeFlag 執行 Nudm UECM Deregistration

AMF Purge 信令追蹤的檢查要點

排查 AMF Purge 問題不應從 Registration Request 開始,通常也無須先從 gNB 或 UPF 著手。核心在於 AMF 和 UDM 的狀態一致性。

實用的檢查點包括:

  • SDM Subscription:確認 AMF 針對正確的 SUPI 與 Subscription ID 發送 Unsubscribe 請求;

  • UDM Response:確認 SDM 刪除操作成功,且 UDM 已移除原有訂閱關係;

  • UECM Registration:確認 AMF 對正確的存取類型與 UE 註冊紀錄執行 Deregistration;

  • GUAMI:確認請求所攜帶的 GUAMI 與 UDM 儲存的服務 AMF 資訊相符;

  • PurgeFlag:確認請求正確標示為 Purge 清除作業;

  • AMF Local Context:確認 UDM 端操作完成後,AMF 確實移除了相關簽約資料與 MM Context。

如果 SDM Subscription 已刪除,但 AMF 仍保留舊的 MM Context,問題較可能出在 AMF 本機清理環節。若 SDM Unsubscribe 本身失敗,下一步應檢查 Subscription ID、SUPI 及 UDM 中儲存的對應訂閱關係。

因此,不應僅依據特定 NAS 訊息是否出現來判斷 Purge 已完成。更可靠的標準是:AMF 本機上下文、UDM 資料訂閱和 UECM 註冊狀態是否都與 UE 已不再註冊的事實一致。

常見問題

AMF Purge 與隱式取消註冊相同嗎?

不完全相同。隱式取消註冊可能引發後續 Purge 處理;Purge 更明確地指 AMF 在取消註冊後清除簽約資料與 MM Context,並移除 UDM 中相關的 SDM 訂閱及 UECM 註冊。

AMF Purge 需要 UE 傳送 NAS 訊息嗎?

不一定。隱式取消註冊時,UE 可能早已無法連線。主要 Purge 信令在 AMF 與 UDM 之間交換,因此追蹤中可以沒有 UE 端的 Registration Request 或 Deregistration Request。

Nudm_SDM_Unsubscribe 的作用是什麼?

它移除 AMF 先前為 UE 建立的用戶資料訂閱。取消訂閱後,UDM 不會再透過已刪除的訂閱向該 AMF 發送後續的用戶簽約資料異動通知。

PurgeFlag 有什麼用途?

Purge 期間的 UECM Deregistration 可攜帶 Purge 相關指示,讓 UDM 知道 AMF 正在清理對應的註冊關係。分析信令時,應將 PurgeFlag 與 GUAMI、相關的 UECM Registration 一併判讀。

為什麼 Purge 程序中不再次執行註冊?

Purge 處理的是已結束的舊註冊關係之清理,並不建立新的註冊關係。若 UE 之後再次接入 5GS,就會依當時的 UE 和網路狀態進入適用的 Registration 程序;那是另一個獨立的信令序列。

推薦產品
目錄
客服 電話
We use cookie to improve your online experience. By continuing to browse this website, you agree to our use of cookie.

Cookies

This Cookie Policy explains how we use cookies and similar technologies when you access or use our website and related services. Please read this Policy together with our Terms and Conditions and Privacy Policy so that you understand how we collect, use, and protect information.

By continuing to access or use our Services, you acknowledge that cookies and similar technologies may be used as described in this Policy, subject to applicable law and your available choices.

Updates to This Cookie Policy

We may revise this Cookie Policy from time to time to reflect changes in legal requirements, technology, or our business practices. When we make updates, the revised version will be posted on this page and will become effective from the date of publication unless otherwise required by law.

Where required, we will provide additional notice or request your consent before applying material changes that affect your rights or choices.

What Are Cookies?

Cookies are small text files placed on your device when you visit a website or interact with certain online content. They help websites recognize your browser or device, remember your preferences, support essential functionality, and improve the overall user experience.

In this Cookie Policy, the term “cookies” also includes similar technologies such as pixels, tags, web beacons, and other tracking tools that perform comparable functions.

Why We Use Cookies

We use cookies to help our website function properly, remember user preferences, enhance website performance, understand how visitors interact with our pages, and support security, analytics, and marketing activities where permitted by law.

We use cookies to keep our website functional, secure, efficient, and more relevant to your browsing experience.

Categories of Cookies We Use

Strictly Necessary Cookies

These cookies are essential for the operation of the website and cannot be disabled in our systems where they are required to provide the service you request. They are typically set in response to actions such as setting privacy preferences, signing in, or submitting forms.

Without these cookies, certain parts of the website may not function correctly.

Functional Cookies

Functional cookies enable enhanced features and personalization, such as remembering your preferences, language settings, or previously selected options. These cookies may be set by us or by third-party providers whose services are integrated into our website.

If you disable these cookies, some services or features may not work as intended.

Performance and Analytics Cookies

These cookies help us understand how visitors use our website by collecting information such as traffic sources, page visits, navigation behavior, and general interaction patterns. In many cases, this information is aggregated and does not directly identify individual users.

We use this information to improve website performance, usability, and content relevance.

Targeting and Advertising Cookies

These cookies may be placed by our advertising or marketing partners to help deliver more relevant ads and measure the effectiveness of campaigns. They may use information about your browsing activity across different websites and services to build a profile of your interests.

These cookies generally do not store directly identifying personal information, but they may identify your browser or device.

First-Party and Third-Party Cookies

Some cookies are set directly by our website and are referred to as first-party cookies. Other cookies are set by third-party services, such as analytics providers, embedded content providers, or advertising partners, and are referred to as third-party cookies.

Third-party providers may use their own cookies in accordance with their own privacy and cookie policies.

Information Collected Through Cookies

Depending on the type of cookie used, the information collected may include browser type, device type, IP address, referring website, pages viewed, time spent on pages, clickstream behavior, and general usage patterns.

This information helps us maintain the website, improve performance, enhance security, and provide a better user experience.

Your Cookie Choices

You can control or disable cookies through your browser settings and, where available, through our cookie consent or preference management tools. Depending on your location, you may also have the right to accept or reject certain categories of cookies, especially those used for analytics, personalization, or advertising purposes.

Please note that blocking or deleting certain cookies may affect the availability, functionality, or performance of some parts of the website.

Restricting cookies may limit certain features and reduce the quality of your experience on the website.

Cookies in Mobile Applications

Where our mobile applications use cookie-like technologies, they are generally limited to those required for core functionality, security, and service delivery. Disabling these essential technologies may affect the normal operation of the application.

We do not use essential mobile application cookies to store unnecessary personal information.

How to Manage Cookies

Most web browsers allow you to manage cookies through browser settings. You can usually choose to block, delete, or receive alerts before cookies are stored. Because browser controls vary, please refer to your browser provider’s support documentation for details on how to manage cookie settings.

Contact Us

If you have any questions about this Cookie Policy or our use of cookies and similar technologies, please contact us at support@becke.cc .