百科全書
2026-08-27 17:35:14
NGAP如何在N2上串聯註冊、PDU工作階段與切換?
說明5G N2介面如何在gNB與AMF之間透過SCTP承載NGAP,以及NG Setup、NAS傳輸、UE脈絡、PDU工作階段資源、尋呼與切換如何串聯成一條完整的信令鏈路。

貝克電信

NGAP如何在N2上串聯註冊、PDU工作階段與切換?

擷取5G註冊信令時,在同一條N2連線上常會看到這樣的順序:先出現Initial UE Message,接著是Uplink NAS Transport與Downlink NAS Transport,再來是Initial Context Setup;當UE真正開始建立資料連線時,則會出現PDU Session Resource Setup。理解每一則訊息本身並不特別困難,更難的是弄清楚它們為什麼依照這個順序出現,以及NGAP在整個5G控制平面中究竟扮演什麼角色。可以把N2視為gNB與AMF之間持續存在的控制通道:網路節點先建立關係,接著建立UE脈絡,之後才為PDU工作階段準備RAN資源。當UE移動、進入閒置狀態,或服務參數發生變化時,還會觸發其他NGAP程序。

N2介面實際上負責什麼?

N2是gNB與AMF之間的控制平面介面,使用NGAP(NG Application Protocol,NG應用協定)。從功能來看,它與4G所使用的S1-MME介面有一些相似之處,但運作於5G系統架構中。

SCTP作為N2的傳輸層。NGAP運行於SCTP之上,而UE與5G核心網路之間交換的NAS訊息可透過NGAP在gNB與AMF之間傳送。因此,典型的N2協定堆疊可以這樣理解:IP提供gNB與AMF之間的網路可達性,SCTP建立N2傳輸關聯,NGAP承載N2控制程序與參數,需要時5G NAS則以NAS-PDU形式傳送。

NGAP本身不承載UE的一般使用者平面流量。實際使用者資料通常透過N3使用者平面傳輸。N2負責資源建立、UE脈絡管理、NAS信令傳輸與移動性協調等控制功能。從功能上說,N2支援與PDU工作階段相關的NG-RAN資源建立、維護與釋放,同時也參與UE脈絡管理、移動性管理、NAS信令傳輸與使用者平面資源控制。

5G N2介面透過SCTP與NGAP連接gNB和AMF,並承載NAS信令與UE控制平面程序
5G N2介面透過SCTP與NGAP連接gNB和AMF,並承載NAS信令與UE控制平面程序

為什麼NGAP程序要分成UE關聯程序與非UE關聯程序?

初學NGAP時,若直接鑽進數十種程序與訊息名稱,很快就會變成單純背誦。更實用的方法是先判斷該程序是否與特定UE有關。

UE關聯程序圍繞特定使用者的脈絡、工作階段或移動狀態運作,例如PDU工作階段資源管理、UE脈絡管理、切換、尋呼、NAS傳輸、位置回報與UE無線能力等程序。相對地,非UE關聯程序主要維護gNB與AMF之間的節點層級關係,常見例子包括NG Setup、RAN Configuration Update、AMF Configuration Update、NG Reset、AMF Status Indication以及Overload Start/Stop。

這種區分在排查封包擷取時非常有用。如果整個gNB下的使用者都受影響,應先檢查SCTP、NG Setup、Reset、AMF狀態或過載處理等節點層級程序。如果只有單一UE受影響,則應沿著該UE的NGAP ID、NAS傳輸訊息、脈絡程序及PDU工作階段資源信令繼續追查。

NGAP程序也可依是否需要回應分為Class 1與Class 2。Class 1程序通常包含Request與Response,也可能包含Failure結果;Class 2程序不要求對端提供程序層級的回應。實際故障排查時,與其背誦每個NGAP訊息的類別,不如先確認該程序是否應產生成功或失敗結果。

N2如何從gNB啟動到UE註冊逐步建立狀態?

在任何UE出現之前,gNB首先要解決的不是用戶註冊,而是確認自己能否與AMF正常通訊。

第一步通常是NG Setup。gNB與AMF之間的SCTP關聯建立後,gNB送出NG Setup Request;若AMF接受連線,則回傳NG Setup Response。在AMF池部署中,gNB可能需要與多個AMF建立N2關係,並取得後續AMF選擇所需的資訊。此時只建立了節點層級關係,尚未存在任何特定UE脈絡。

當UE開始註冊時,信令進入下一層級。gNB收到UE最初的NAS訊息後,可透過Initial UE Message轉送給AMF。之後UE與AMF之間的NAS信令通常透過N2上的Uplink NAS Transport與Downlink NAS Transport傳送。需要注意的是,gNB不必解讀全部NAS服務邏輯。對多數NAS信令而言,它的主要責任是辨識正確的UE脈絡,並將NAS-PDU送往適當的AMF。

隨著註冊進行,AMF也需要gNB建立RAN側的UE脈絡,這時會出現Initial Context Setup Request與Initial Context Setup Response。Initial Context Setup Request可包含Allowed NSSAI、GUAMI、UE Security Capabilities、Mobility Restriction List及NAS-PDU等重要UE相關資訊。到了這個階段,gNB已不只是轉送NAS信令,而是開始建立持續服務該UE所需的狀態。

從NG Setup、Initial UE Message、NAS Transport到Initial Context Setup的典型5G N2信令順序
從NG Setup、Initial UE Message、NAS Transport到Initial Context Setup的典型5G N2信令順序

UE開始使用資料時,NGAP如何建立PDU工作階段資源?

註冊成功並不代表UE所需的所有使用者平面資源都已就緒。當UE需要存取資料網路並建立PDU工作階段時,N2也會參與準備相應的RAN資源。

關鍵程序之一是PDU Session Resource Setup。AMF向gNB傳送PDU Session Resource Setup Request。該訊息會把與PDU工作階段及其QoS Flow相關的資訊送往NG-RAN,例如PDU Session ID、S-NSSAI、使用者平面隧道資訊與QoS Flow List。接著gNB依本地條件配置所需的無線側資源,例如為QoS Flow設定必要的DRB,並準備N3使用者平面連線。

資源配置完成後,gNB向AMF傳送PDU Session Resource Setup Response,指出哪些資源已成功建立。回應中可包含gNB使用者平面資訊以及成功接納的QoS Flow。

這裡很容易混淆N1、N2與N3的角色。N1向UE承載NAS層的PDU工作階段資訊;N2協調gNB必須建立的RAN與使用者平面資源;N3則在這些資源就緒後承載實際的使用者平面流量。

因此,排查PDU工作階段失敗時,不能在NAS層回傳Accept訊息後就停止。如果N2的PDU Session Resource Setup程序未成功完成,UE可能已收到工作階段參數,但使用者平面仍無法運作。

PDU工作階段建立後,N2仍會持續運作

PDU工作階段啟用後,NGAP並不會停止。只要UE仍在網路中,狀態或服務條件的變化都可能觸發額外的N2程序。

當UE移動到另一個gNB時,可能觸發以N2或Xn為基礎的切換。N2切換可能包含Handover Required、Handover Request、Handover Request Acknowledge、Handover Command及Handover Notify。新路徑建立後,還可能出現Path Switch Request及其回應,同時釋放來源gNB上的舊UE脈絡。

如果UE處於閒置狀態且下行流量到達,AMF可透過NGAP向NG-RAN傳送Paging訊息,之後RAN執行無線側尋呼程序。Paging是典型的單向NGAP程序。若網路需要調整QoS或其他RAN資源,可觸發PDU Session Resource Modify;當工作階段不再需要時,則使用PDU Session Resource Release。因此,PDU工作階段的N2生命週期不只有Setup,也包含Modify、Release、Notify以及相關Indication程序。

除了UE相關服務程序外,工程人員也可能看到NG Reset、Error Indication、Overload Start、Overload Stop、AMF Status Indication及組態更新等介面管理訊息。這些訊息特別有助於判斷問題僅影響單一UE,還是反映N2節點關係的更大範圍變化。

UE連線後,NGAP處理切換、Path Switch、Paging、PDU工作階段資源修改與釋放,以及介面管理
UE連線後,NGAP處理切換、Path Switch、Paging、PDU工作階段資源修改與釋放,以及介面管理

排查NGAP封包擷取時,最佳順序是什麼?

NGAP包含大量訊息,但實務故障排查不需要從頭到尾逐項檢查3GPP訊息清單。更好的方法是依照網路狀態建立的順序來分析。

第一步是驗證SCTP。如果gNB與AMF之間的Transport Network Layer Association沒有正確建立,繼續分析後續應出現的NGAP服務程序幾乎沒有意義。

第二步是檢查NG Setup,確認節點層級的N2關係正常。如果NG Setup失敗,通常就不應直接跳到UE註冊故障排查。

第三步是辨識特定UE。UE關聯的NGAP訊息通常包含相應的UE-NGAP-ID值。封包分析應隨時間追蹤相同的UE識別碼,而不是只依訊息類型篩選。

第四步是確認NAS信令是否正確傳輸。檢查Initial UE Message、Uplink NAS Transport和Downlink NAS Transport是否形成連續序列。如果NAS-PDU已到達AMF但後續沒有回應,排查方向會與gNB一開始就未送出NAS訊息的情況完全不同。

第五步是檢查UE脈絡建立。如果註冊已進入Initial Context Setup,應檢查Request中的參數,並確認Response是否順利完成。

第六步是檢查PDU工作階段資源。如果UE已註冊但無法存取資料網路,應聚焦PDU Session Resource Setup Request/Response,以及回傳的PDU工作階段和QoS Flow資源結果。

如果問題發生在移動期間,應將排查重點轉向Handover、Path Switch與舊UE脈絡釋放;如果閒置UE無法被下行流量喚醒,則聚焦Paging。

依照SCTP → NG Setup → UE辨識 → NAS → UE脈絡 → PDU工作階段 → 移動性這條鏈路排查,通常比在實際工程中死背數十個NGAP訊息名稱有效得多。

常見問題

NGAP與5G NAS之間是什麼關係?

NGAP是gNB與AMF之間N2介面使用的應用層協定,而NAS承載UE與5G核心網路之間的控制信令。許多NAS訊息會以NAS-PDU形式封裝在NGAP訊息中,由gNB在UE與AMF之間轉送,因此兩種協定運作於不同層級。

N2介面會承載UE的網際網路流量嗎?

不會。N2不是UE資料的一般使用者平面路徑,它承載控制平面信令。使用者流量通常透過N3在gNB與UPF之間傳輸,而NGAP則告知RAN需要建立、修改或釋放哪些相關資源。

NG Setup成功是否代表UE一定能正常註冊?

不代表。NG Setup只建立gNB與AMF之間的節點層級N2關係。當特定UE接入後,Initial UE Message、NAS傳輸、UE脈絡建立,以及後續PDU工作階段資源程序仍需成功完成。

為什麼排查NGAP時不能只依賴訊息類型篩選?

單一gNB可同時處理多個UE,同一種NGAP訊息類型可能針對不同使用者反覆出現。只依訊息名稱篩選很容易把互不相關的程序混在一起。針對特定UE的排查應結合UE-NGAP-ID值、訊息時間以及相關NAS或PDU工作階段脈絡。

推薦產品
目錄
客服 電話
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 .