For AI agents: this documentation is indexed for you in llms.txt, and all of it in /llms.txt. Every page is also available as markdown: append .md to its address.

UE IP allocation

This document describes the process of assigning IP addresses for User Equipment (UE). It explains how Session Management Controller (SMC) allocates IP addresses, how to configure IP pools, how IP addresses are assigned over RADIUS or Diameter, the format requirements for IPv6 addresses, and how IPv4, IPv6, or dual-stack addresses are assigned based on the UE's request and network configuration.

IP assignment from an external AAA server

When UE requests a data session, SMC must allocate an IP address to the UE. SMC can assign the IP address locally or get it externally by communicating with an external RADIUS or Diameter server, such as a AAA server, over the Gi/Sgi interface.

Initially, SMC selects a User Plane Gateway (UPG) to manage the data session for the UE. Each UPG has one or more associated IP address pools. SMC assigns suitable IP pools from the selected UPG and communicates these pool names to the AAA server using specific attributes (AVPs):

  • Framed-Pool for IPv4 addresses
  • Framed-IPv6-Pool for IPv6 addresses

If the UE requests a specific IP address or IPv6 prefix, SMC includes them in the following attributes sent to the AAA server:

  • Framed-IP-Address (IPv4)
  • Framed-IPv6-Prefix (IPv6)

The AAA server responds with a RADIUS Access-Accept response that includes:

  • A specific IPv4 address in the Framed-IP-Address attribute
  • A specific IPv6 prefix in the Framed-IPv6-Prefix attribute
  • Alternative pool names in the Framed-Pool and Framed-IPv6-Pool attributes, which override the pools originally selected by SMC

If the AAA server provides specific IP addresses or prefixes, SMC assigns them to the UE instead of allocating addresses from the local pool. If the selected UPG does not support the new pools, SMC selects a different suitable UPG. Moreover, the provided IP address must belong to the selected pool; otherwise, SMC rejects the session request. For more information about RADIUS-based IP assignment, refer to 3GPP TS 29.061, clauses 16 and 16a.

The SMC behaviour also depends on the special values returned in the Framed-IP-Address attribute, as specified in RFC 2865, section 5.8Opens in a new tab:

  • 255.255.255.255 (0xFFFFFFFF) - SMC allocates the IP requested by the UE. If the UE requests 0.0.0.0 (which means any available IPv4), an IP is assigned from the selected pool. If the UE requests a specific IP, SMC tries to allocate that IP. If the requested IP is not in the pool, the session is rejected.
  • 255.255.255.254 (0xFFFFFFFE) - SMC ignores any specific UE request and assigns an IP address directly from the selected pool.
  • If another value is provided, SMC assigns that exact IP address from the AAA server.

If the AAA server response does not include the Framed-IP-Address attribute, SMC attempts to allocate the IP requested by the UE. However, if the UE has not requested a specific IP or the AAA server does not provide an IP in the response, SMC allocates an IP from its locally configured pools.

IP pool configuration

You can configure SMC with one or more UE IP pools from which to allocate addresses. The available IP pools are defined with the apn.ue_ip_pools configuration parameter. Each pool entry allows only one IPv4 range and one IPv6 range. See the example:

yaml

An IP pool must be configured for every APN that UE connects to. When a GTP Create Session Request for an APN is received, SMC requires an available pool from which to assign an IP address. Even if you intend to use only external AAA server addresses, a pool must exist for that APN and AAA-assigned addresses must be selected from that pool's address range.

SMC allocates an IP after receiving an Access-Accept request from a AAA server. If the response contains a Framed-IP-Address (or Framed-IPv6-Prefix) for the UE, the externally provided IP overrides the one selected from the local pool. For example, if the RADIUS server returns 10.9.0.100 in Framed-IP-Address, SMC assigns 10.9.0.100 to the UE. If the RADIUS server doesn't provide an IP address in the response, SMC allocates an IP from the locally configured pools.

If the AAA server returns a Framed-Pool or Framed-IPv6-Pool attribute (containing a pool name), SMC allocates the address from the matching local pool. The pool name must correspond with a pool configured in SMC and be supported on the User Plane Gateway (UPG). If there is no such pool or UPG with that pool, the session establishment fails.

The size of an IP pool impacts startup time and memory consumption. For example, an IP pool /8 contains 16,777,216 addresses, may take up to 40 seconds of startup time, and consume about 3.4 GB of memory.

IPv6 address format requirements

There are a few key rules to follow when defining IPv6 addresses for SMC:

  • Omit the leading zeros. Within each 16-bit group, the leading zeros must be dropped. For example, 085a becomes 85a and 0001 becomes 1.
  • Consecutive zero compression. A series of all-zero groups can be collapsed to :: (double colon) to further compress the address. For example, 2001:0db8:85a3:0000:0000:8a2e:0370:7334 becomes 2001:db8:85a3::8a2e:370:7334.
  • The :: abbreviation can only be used once in a single address notation. If an address has more than one run of zeros, only the longest run is typically compressed (or the leftmost run if there are two equal-length runs). For example, 2001:0db8:0000:0000:0000:0000:0000:0001 can be compressed to 2001:db8::1. However, an address like 2001:db8:0000:0000:0001:0000:0000:0000 (which is 2001:db8:0:0:1:: in the compressed form) already uses :: for the latter long run, so it cannot use :: again even if other groups were zero.
  • IPv6 must be written in lowercase. For example, 2001:db8::1 not 2001:DB8::1.
  • Do not use the mixed IPv4 IPv6 notation.

IP version selection (IPv4, IPv6, dual-stack)

SMC is responsible for handling the PDP/PDN Type (IP version) requested by the UE based on the PDP/PDN Type value included in the Create PDP Context Request/Create Session Request message. Based on the UE's request and network configuration, SMC allocates either an IPv4, IPv6, or dual-stack (IPv4v6) address.

SMC's behaviour in response to PDP/PDN Type requests is controlled by the apn.bearerType and apn.preferredBearerType configuration options. These options define the allowed IP address type for the APN and the preferred fallback option. See the configuration example:

yaml

Based on the PDN Type requested in the Create PDP Context Request/Create Session Request, SMC behaviour is as follows:

  • Dual-stack requested, single-stack APN. If the UE requests dual-stack (IPv4v6), but the APN is configured for a single IP version (IPv4 or IPv6), SMC downgrades the request to the available IP version with the Cause New PDP/PDN type due to network preference.
  • Dual-stack requested, but UE doesn’t support it (Dual Address Flag set to zero). If the PDP/PDN Type in the request is IPv4v6, but the Dual Address Bearer Flag is not set (meaning the UE only allows a single IP address), then SMC allocates a single IP version as specified in the apn.preferredBearerType configuration parameter. The request is accepted with a single PDP/PDN type and the cause New PDP/PDN type due to single address bearer only. For example, if apn.preferredBearerType is IPv6, the UE is assigned with an IPv6 address only even though it asked for IPv4v6 because it cannot support dual-stack addresses.
  • Single-stack requested, opposite stack configured. If the UE specifically requests IPv4 but the APN is configured as IPv6-only in apn.bearerType (or vice versa: UE asks for IPv6 but APN is IPv4-only), then SMC rejects the request with the cause Preferred PDP/PDN type not supported.

The table below summarises various scenarios of PDN type selection and the resulting SMC behaviour (Accept/Reject, cause code, and PDN type in the response). In the table, CSRequest refers to the Create Session Request, CSResponse to the Create Session Response, and DAF is the Dual Address Flag: