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

5GC 中由 AMF 发起的清除流程:UDM 信令与上下文清理

AMF 清除在去注册后移除本地用户数据和移动性上下文。SDM Unsubscribe、UECM PATCH、purgeFlag、GUAMI 校验以及各接入的状态决定清理是否一致。

贝克电信

5GC 中由 AMF 发起的清除流程:UDM 信令与上下文清理

AMF 清除是指在 UE 被隐式或显式去注册后,可选地移除本地存储的用户数据和移动性管理(MM)上下文。相关 UDM 信令取消订阅数据通知,并将相应接入的注册标记为已清除。该操作不会删除已配置的用户账户。

典型排查从无法联系的 UE 和旧 AMF 上下文开始。工程上需要确定能否丢弃该上下文、哪些 UDM 关联需要变更,以及较新或仍然有效的注册状态是否受到保护。主要交互为 Nudm_SDM_Unsubscribe 和 Nudm_UECM_Deregistration。

AMF 清除何时在去注册之后执行

3GPP 将该流程称为清除 AMF 中的用户数据。在 TS 23.502,Release 18,第 4.5.3 节中,去注册后清除本地用户数据和 MM 上下文属于实现可选项。如果 AMF 选择该选项,就必须向 UDM 执行相应的取消订阅和去注册操作。

定时器到期时,这一区别很重要。定时器条件属于可达性和隐式去注册处理,并不构成通用的清除定时器,也不要求立即删除每条 UE 记录。应先确定相关注册为何结束,再判断 AMF 是否选择清除保留的上下文。

流程目的需要检查的证据
初始注册建立接入和移动性注册Registration Request、订阅获取和 Registration Accept
去注册结束适用接入的注册触发原因、接入范围、适用时的 NAS 交互以及注册状态
AMF 清除丢弃保留的本地数据并同步 UDM本地清理、SDM Unsubscribe 和 UECM 清除指示

关于网络发起的去注册流程,其内容涵盖前置决策和任何面向 UE 的通知。清除本身不需要 UE 发送新的 Registration Request 或 NAS Deregistration Accept。在隐式去注册场景下,UE 可能已不可用。

注册、去注册及后续 AMF 清除的概念对比
注册建立关联,去注册结束适用的注册,可选的 AMF 清除处理保留的本地数据。丢弃符号并不表示删除 UDM 中的用户账户。

哪些内容被移除,哪些可以保留

应区分三类状态。AMF 的用户数据副本包含为接入和移动性处理而获取的信息。其 MM 上下文支持 UE 的移动性和注册管理。SDM 订阅则是独立的通知关联,UDM 通过它报告所订阅数据的变化。

UDM 还通过 UE 上下文管理(UECM)维护 AMF 注册信息。清除期间,这些信息会针对相关接入更新为带有已清除指示的状态。将操作简单描述为“删除 UDM 注册”,会掩盖移除 SDM 订阅资源与修改 AMF 注册资源之间的区别。

清除也不等于撤销服务权限。已配置的用户订阅仍是另一项独立事项。UE 稍后返回时会执行适当的注册流程,是否允许接入取决于当时生效的订阅和网络条件。初始注册信令流程涵盖身份、鉴权以及必要服务上下文的重建。

当 3GPP 和非 3GPP 接入并存时,接入范围至关重要。结束一个接入上的注册,不能证明 UE 在另一接入上没有有效关联。在将剩余上下文视为泄漏之前,应确定哪个接入已结束,以及哪些剩余状态仍需要该上下文。同样,应使用PDU 会话释放流程调查 SMF 和 UPF 会话资源;AMF 清除确认并不能证明这些资源已删除。

SDM Unsubscribe 移除通知订阅

参考流程在本地用户数据和 MM 上下文已清除后开始与 UDM 交互。它先显示 SDM Unsubscribe 请求和响应,随后是 UECM Deregistration 请求和响应。因此,不应将本地删除描述为只能在收到两个 UDM 响应后才执行的强制最后一步。

对于单个 SDM 订阅,AMF 向创建该订阅时由 Location 标头标识的订阅资源发送 HTTP DELETE。示例路径如下:

SDM 订阅资源

DELETE {apiRoot}/nudm-sdm/v2/{supi}/sdm-subscriptions/{subscriptionId}

关联数据包时,应使用实际存储的订阅 URI 和已部署的 API 版本。示例仅表示资源模式,不能替代 UDM 返回的 URI。应匹配 SUPI、订阅 ID 和来源 AMF,以免将其他上下文的订阅误认为已过时的订阅。

成功移除返回 204 No Content。TS 29.503 第 5.2.2.4.2 节还描述了 404 Not Found,用于没有有效订阅的情况,例如订阅 ID 未知。遇到 404 应检查先前的删除尝试和最初创建时的响应。仅凭 404 不能判定整个清除流程成功。

移除后,该订阅不再向 AMF 提供后续数据变更通知。同一用户的其他订阅必须分别评估。相应的 UDM 到 UDR 处理属于流程的 UDM 一侧,不应假设只在 AMF 处抓取的数据包中可以看到这些处理。

UECM Deregistration 设置特定接入的清除标志

对于 AMF 去注册,服务操作名称并不意味着 HTTP DELETE。TS 29.503,Release 18,第 5.3.2.4.2 和 5.3.2.4.3 节将其映射为对相应 AMF 注册资源执行 PATCH:

特定接入的 UECM 资源

PATCH {apiRoot}/nudm-uecm/v1/{ueId}/registrations/amf-3gpp-access
PATCH {apiRoot}/nudm-uecm/v1/{ueId}/registrations/amf-non-3gpp-access

这里,{ueId}是此操作使用的 SUPI。修改数据包括 guami 和 purgeFlag: true。这些是 JSON 属性的准确拼写;“PurgeFlag”也用作规范中的类型名称。不要自行增加清除端点,也不要把这两个接入资源当作可互换资源。

在设置标志前,UDM 会将收到的 GUAMI 与存储的注册信息进行校验。成功请求收到 204 No Content;GUAMI 不匹配则返回 403 Forbidden。第 6.2.6.2.7 和 6.2.6.2.8 节的修改表明确要求,在 MCC、MNC、AMF Region ID 或 AMF Set ID 不同时拒绝请求。

该校验与来自旧服务上下文的延迟清理有关。作为排障推断,不匹配可能表示服务注册已改变,而不是应强制执行清理。在将每个 403 都归因于授权配置问题之前,应比较注册历史和请求归属。

展示 SDM Unsubscribe、UECM Deregistration、GUAMI 和 PurgeFlag 的 AMF 与 UDM 示意图
SDM Unsubscribe 移除通知订阅;UECM Deregistration 更新接入注册的 purgeFlag。划掉的用户符号仅为概念表达,并不表示删除 UDM 用户账户或整个 AMF 注册资源。

如何诊断未完成的 AMF 清除

将本地 AMF 日志与 SBI 事务关联。HTTP 成功响应确认的是单个 UDM 操作,而本地上下文移除需要独立证据。在此清除流程开始前,注册管理已经进入相应的去注册状态;不应将最后一个 UECM 响应视为首次使 UE 进入 RM-DEREGISTERED 的事件。

观察结果下一步检查
SDM DELETE 返回 404找回原始订阅 URI,并检查先前的移除或重试历史。
UECM PATCH 返回 403将请求中的 GUAMI 与当前存储的注册及近期 AMF 变更进行比较。
SDM 移除成功,但 UECM 更新失败分别跟踪两项结果;通知清理不能证明已记录清除指示。
UDM 操作成功,但本地上下文仍存在检查是否选择了清除、本地删除日志,以及任何仍有效的接入状态。
仅清除一个接入在将另一接入保留的状态判定为错误前,先核实其实际注册情况。

每次尝试均应记录 SUPI、服务 AMF、接入资源、订阅 URI、响应状态和时间戳。应区分旧请求重试与同一用户的新注册。在与服务器端处理相关联之前,超时意味着事务结果未知,不能证明 UDM 未做任何更改。

列出 SUPI、订阅 ID、GUAMI、PurgeFlag、MM 上下文和 RM-DEREGISTERED 的 AMF 清除跟踪分析示意图
跟踪检查必须关联受影响的接入与服务上下文。该图不是数据包时序图,RM-DEREGISTERED 是清除场景的前提,而不是最终响应新建的状态。

常见问题

为什么日志时间戳看起来可能与流程顺序矛盾?

首先检查时钟同步、日志缓冲,以及日志条目记录的是请求创建、传输、处理还是完成。在判断实现改变了流程顺序之前,应比较事务标识符和交互双方。日志的显示顺序不一定等于处理顺序。

如何准备交给外部支持的清除跟踪记录?

移除凭证、令牌和不必要的用户数据。以一致方式替换用户标识符,使事务仍可关联,并保留相关接入类型、响应原因、时间戳和版本信息。通过运营商批准的支持流程共享跟踪记录。

调查部署问题应使用哪个规范版本?

从网络声明的版本、支持的 API 版本以及实现文档入手。这里的参考资料标明了本说明使用的 Release 18 修订版。在将其细节应用于其他版本或软件构建之前,应比较相关变化。

推荐产品
目录
客服 电话
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 .