Skip to content

Xn — gNB ⇔ gNB (inter-base-station RAN interface)

Difficulty: Intermediate / Estimated study time: 20 min / Connection points: gNB ⇔ gNB (between RAN nodes) / Protocol: control plane XnAP over SCTP / user plane GTP-U (Xn-U) / Related interfaces: N2, N3, N14

Learning objectives

After reading this page, you will be able to:

  • Explain that Xn is a RAN inter-node interface directly connecting base stations (gNBs), and that its positioning differs from 5GC reference points (N2/N3, etc.).
  • Explain that Xn consists of two planes: the control plane Xn-C (XnAP over SCTP) and the user plane Xn-U (GTP-U).
  • Explain that the main use of Xn is Xn-based Handover (direct handover between gNBs) and, for it, the UE-context transfer and data forwarding it requires.
  • Explain the role of the Path Switch (N2/NGAP) that connects to the core after Xn HO completes, in terms of its division of labor with Xn.
  • Explain the correspondence with 4G (EPC) X2 (eNB⇔eNB, X2AP).

Prerequisites

Understanding the following first will make this smoother:

  • The overall picture of the procedure in which Xn plays the leading role → Handover
  • The positioning of the lower SCTP under XnAP and the user-plane GTP-U → Protocol dictionary
  • The connection point to the core (the control path that carries Path Switch) → N2
  • The user-data path between gNBs (contrasted with N3) → N3
  • The concept of interfaces / reference points → Interface dictionary

Why — Why it is needed

The UE moves. When it moves from the area of one base station (Source gNB) to the area of the neighboring base station (Target gNB), the communication must be taken over without interruption (handover).

At this time, if the base stations could not communicate directly, all the coordination of the handover would have to be done via the core (AMF), making the procedure heavy. If there is a path over which neighboring base stations can directly exchange messages such as "I am handing this UE over to you; here is the context; the remaining downlink data will be temporarily forwarded to you," the handover becomes fast and smooth.

This path directly connecting gNBs is Xn. With Xn, base stations can coordinate handover directly (Xn-based Handover), and the core only needs the follow-up procedure after execution (Path Switch). Without Xn, handover must be done via the core-mediated N2-based Handover. It is specified in 3GPP TS 38.420 / TS 38.423, etc. (detailed clause numbers are to be confirmed).

Analogy: Xn is the inter-branch hotline connecting two neighboring branches (gNBs). When a customer (UE) moves to the neighboring branch, the branches can hand over directly — "this person is coming to you; here is the record" — without having the head office (AMF) relay each step.

Overview

Xn is the interface connecting gNB ⇔ gNB, that is, RAN nodes to each other. Whereas many 5GC reference points (N2/N3/N4 …) connect RAN⇔core or NF-to-NF within the core, Xn is characterized by connecting base station to base station. For this reason, Xn is positioned as a separate-category RAN interface, distinct from the so-called 5GC reference points (Nx numbers).

Xn consists of two planes with different roles.

Plane Name Protocol Role
Control plane Xn-C XnAP over SCTP Coordination of Xn-based Handover, UE-context transfer, inter-gNB configuration interworking
User plane Xn-U GTP-U over UDP data forwarding during handover (temporary transfer of downlink data), etc.

The main use of Xn is Xn-based Handover. The Source gNB and Target gNB directly coordinate the handover over Xn-C (XnAP), take over the UE context, and as needed forward the pending downlink data to the Target gNB over Xn-U (GTP-U). After the handover completes over the radio interface, the Target gNB sends an N2/NGAP Path Switch to the core (AMF) and switches the downlink path (N3) from the UPF to the new gNB.

Xn is not a 'reference point (Nx)' but a RAN interface

N2 (gNB⇔AMF) and N3 (gNB⇔UPF) are 5GC reference points connecting RAN and core, but Xn connects gNBs to each other as a RAN inter-node interface. Therefore Xn is not assigned an "N-number" reference-point number. Its role and governing specifications (the TS 38 family = NG-RAN) also belong to a different lineage from the core-side reference points (the TS 23/29 families). This difference is the reason Xn is treated as a separate category in the Interface dictionary.

Basic Concept — Beginner-friendly explanation

Let us liken Xn to a direct hotline connecting two neighboring branches (gNBs).

  • When a customer (UE) is about to move from Branch A to Branch B, Branch A, without going through the head office (AMF), directly contacts Branch B over the direct hotline (Xn-C): "I am handing this person over to you; here is the record so far (UE context)."
  • During the handover, packages (downlink data) still arriving for Branch A are temporarily forwarded to Branch B over the dedicated package delivery (Xn-U) to prevent loss.
  • Once the customer has finished moving to Branch B's counter (radio), Branch B notifies the head office (AMF): "from now on this person is at our branch" (Path Switch). The head office then switches the delivery destination of packages (the N3 path of downlink data) to Branch B.

In other words, Xn handles the direct contact between branches (control Xn-C + package forwarding Xn-U), and only the final notification to the head office is done over a separate line (the N2/NGAP Path Switch) — that is the division of labor.

Protocol / Transport

Item Content
Control-plane Protocol XnAP (Xn Application Protocol) — TS 38.423
Control-plane Transport SCTP over IP (reliability, ordering guarantee, multi-stream/multi-homing)
User-plane Protocol GTP-U — TS 29.281 (data forwarding during handover, etc.)
User-plane Transport UDP over IP (GTP-U is UDP 2152)
Governing specifications TS 38.420 (Xn general principles) / TS 38.423 (XnAP) / TS 38.424 (Xn-U) family (clause numbers to be confirmed)
Characteristics Direct IF between RAN nodes. Two planes: control (Xn-C) and user (Xn-U). HO coordination, UE-context transfer, data forwarding

Control is SCTP, user is GTP-U (the same design philosophy as 4G X2)

The control plane of Xn (Xn-C/XnAP) is carried over SCTP, just like N2 (NGAP) and 4G S1AP/X2AP (because control signaling is vulnerable to loss and reordering). The user plane (Xn-U), meanwhile, uses GTP-U (UDP 2152) because it handles downlink data forwarding during handover. GTP-U = UDP 2152 can be asserted, but the Xn-specific port assignment, procedureCode, and other details are to be confirmed.

Architecture

flowchart LR
  UE(("UE"))
  sgNB["Source gNB"]
  tgNB["Target gNB"]
  AMF["AMF (5GC)"]
  UPF["UPF (5GC)"]

  UE -- "radio (movement)" --> tgNB
  sgNB == "Xn-C (XnAP / SCTP): HO coordination, context transfer" ==> tgNB
  sgNB -. "Xn-U (GTP-U): data forwarding" .-> tgNB
  tgNB -- "N2 (NGAP): Path Switch" --> AMF
  UPF -- "N3 (GTP-U): downlink path (switch target)" --> tgNB

  classDef ran fill:#efe,stroke:#3a3,stroke-width:2px;
  class sgNB,tgNB ran;

How to read the diagram: The thick line (==>) is Xn-C (XnAP/SCTP), over which the Source gNB and Target gNB coordinate the handover directly and transfer the UE context. The dotted line is Xn-U (GTP-U), over which the downlink data during the takeover is temporarily forwarded (data forwarding). Once the handover completes over the radio, the Target gNB notifies the AMF via the N2 (NGAP) Path Switch and switches the N3 downlink path from the UPF to the new gNB. Note the division of labor: Xn is between gNBs, while Path Switch and N3 are the connection to the core. The detailed flow of the procedure is consolidated in the Handover chapter (not repeated on this page).

Usage Procedure

Xn is used mainly in Xn-based Handover.

  • Xn Setup: The handshake establishing Xn between neighboring gNBs (exchange of capabilities, cell information, etc.). A foundational procedure not tied to a UE.
  • Handover Preparation (Xn-C): The Source gNB sends a Handover Request to the Target gNB, and the Target returns acceptance/rejection and necessary information in a Handover Request Acknowledge. Here the UE context is transferred.
  • Data forwarding (Xn-U): During the takeover, downlink data remaining at the Source gNB is temporarily forwarded to the Target gNB over GTP-U to prevent loss.
  • Path Switch (after Xn completes / N2/NGAP): The Target gNB sends a Path Switch Request to the AMF and switches the UPF's downlink path (N3) to the new gNB. This is an N2 procedure, not Xn.

For the differences in the applicability conditions of Xn-based and N2-based, the positioning of Path Switch, the state machine, and so on, see the Handover chapter (the procedure details, procedureCode, and clause-number sub-branches are to be confirmed).

Main Messages

These are representative messages flowing over Xn-C (XnAP) (illustrative, to be confirmed).

Message (example) Plane Purpose
Xn Setup Request / Response Xn-C Handshake to establish Xn (exchange of inter-gNB capabilities and cell information)
Handover Request / Request Acknowledge Xn-C Preparation of Xn-based HO and UE-context transfer
SN Status Transfer (to be confirmed) Xn-C Transfer of state such as sequence numbers at takeover
UE Context Release (to be confirmed) Xn-C Release of the Source-side UE context after HO completes

Message names and procedureCode are to be confirmed: The XnAP message names and assignments in the table above differ by Release. For exact definitions, refer to the relevant Release of TS 38.423. For details of each message, see the Message dictionary.

Packet Analysis (Wireshark)

Xn is observed as XnAP over SCTP on the control plane and GTP-U on the user plane.

Purpose Display Filter
Extract XnAP (control plane) xnap
View the lower SCTP sctp
View Xn-U (user-plane GTP-U) gtp

Points to watch when decoding:

  • The control plane is XnAP, and you identify Xn Setup / Handover Preparation, etc. by the procedureCode (the lower layer is SCTP).
  • The user plane Xn-U is GTP-U (UDP 2152), over which the data forwarding tunnel during handover can be observed.
  • Xn is an interface between gNBs. Because the Path Switch to the core appears on the N2 (NGAP) side, distinguish it so as not to confuse it with ngap (N2).
  • SBI (HTTP/2) and PFCP (N4) are irrelevant to Xn; the http2 / pfcp filters are not used.

Comparison with EPC

  • In 4G: There was the X2 interface directly connecting neighboring base stations (eNBs), which performed the direct coordination of X2-based Handover and data forwarding over the control plane X2AP (TS 36.423) over SCTP and the user plane X2-U (GTP-U). When there was no X2 or a core relocation was required, it was S1-based Handover (MME-mediated).
  • In 5G: The counterpart is Xn (control plane XnAP / TS 38.423, user plane Xn-U / GTP-U), which directly coordinates Xn-based Handover. When there is no Xn or an AMF/UPF relocation is required, it becomes N2-based Handover (AMF-mediated).
4G (EPC) 5G (5GC / NG-RAN)
X2 (eNB ⇔ eNB) Xn (gNB ⇔ gNB)
X2AP (TS 36.423) XnAP (TS 38.423)
X2-U (GTP-U) Xn-U (GTP-U)
X2-based / S1-based Handover Xn-based / N2-based Handover
Path Switch (after X2 HO, eNB→MME) Path Switch (after Xn HO, gNB→AMF, NGAP)

4G X2 (between eNBs) corresponds to 5G Xn (between gNBs). The concept of Path Switch — "after HO, notify the core and switch the downlink path" — is inherited directly from 4G (X2 HO) (see the Handover chapter).

3GPP Specification

  • 3GPP TS 38.420 — Xn general principles (interface between NG-RAN nodes). Specific clause numbers are to be confirmed
  • 3GPP TS 38.423 — XnAP (Xn Application Protocol). Control plane (Xn-C). Specific clause numbers are to be confirmed
  • 3GPP TS 38.424 — Xn data transfer (Xn-U) related. Specific clause numbers are to be confirmed
  • 3GPP TS 29.281 — GTP-U (user-plane encapsulation of Xn-U. UDP 2152)
  • 3GPP TS 38.300 — Overall NG-RAN architecture (positioning of Xn)
  • IETF RFC 4960 — SCTP (the lower transport of XnAP)

The scope of assertion of this dictionary-style page

What is asserted is limited to: that Xn is an inter-gNB IF; the two-plane composition of Xn-C (XnAP/SCTP) and Xn-U (GTP-U); that the main use is Xn-based Handover; GTP-U = UDP 2152; and the correspondence with X2. The individual XnAP message names/procedureCode, clause-number sub-branches, and Xn-specific port assignments differ by Release; they are not fabricated but marked to be confirmed.

Summary

  • Xn is a RAN inter-node interface connecting gNB ⇔ gNB, in a separate category from 5GC reference points (Nx numbers).
  • It consists of two planes: Xn-C (XnAP over SCTP) and Xn-U (GTP-U over UDP 2152).
  • Its main use is Xn-based Handover: gNBs coordinate directly over Xn-C and transfer the UE context, and perform data forwarding over Xn-U.
  • The Path Switch after HO completes is an N2 (NGAP) procedure, not Xn, and switches the UPF's downlink path (N3) to the new gNB.
  • It corresponds to 4G X2 (between eNBs, X2AP TS 36.423, X2-U). The concept of Path Switch continues from 4G (details in the Handover chapter).

Next Step

  • Handover — The overall picture of the procedure in which Xn plays the leading role (Xn-based / N2-based)
  • N2 — The core-side control path that carries the Path Switch after HO completes
  • N3 — The downlink user-plane path that is switched by Path Switch
  • N14 — Inter-AMF UE-context transfer (interworks when the AMF changes in an N2-based HO)
  • Interface dictionary — The list of reference points and RAN interfaces