> For the complete documentation index, see [llms.txt](https://docs.cennso.com/components/smc/3.10/llms.txt) (all documentation: [llms.txt](https://docs.cennso.com/llms.txt)). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cennso.com/components/smc/3.10/config/ue-ip-allocation.md).

# UE IP allocation

## IP assignment over RADIUS interface

## IP pool configuration

The `.Values.apn.ue_ip_pools` entry contains the pools allowed in the SMC.
For each pool defined, only one range per IP version can be provisioned,
so only one IPv4 range and one IPv6 range are allowed.

A pool is needed for GTP requests to any APN. However, the assigned IP
may be overwritten in the case the `Framed-IP-Address` AVP is received
in a RADIUS authorization response.

> **CAUTION:** The pool size may severely impact the rate of session creation.
> The following table presents an estimation of the maximum rate achievable
> by the SMC as a function of the pool size:
> 
> | Prefix Length | Request Duration in µs | Request per Second |
> | ---: | ---: | ---: |
> | 24 | 11 | 90909 |
> | 23 | 20 | 50000 |
> | 22 | 41 | 24390 |
> | 21 | 75 | 13333 |
> | 20 | 144 | 6944 |
> | 19 | 327 | 3058 |
> | 18 | 675 | 1481 |
> | 17 | 1481 | 675 |
> | 16 | 3293 | 304 |
> | 15 | 6419 | 156 |
> | 14 | 13765 | 73 |
> | 13 | 26947 | 37 |
> | 12 | 53613 | 19 |
> | 11 | 112101 | 9 |
> | 10 | 223171 | 4 |
> | 9 | 447767 | 2 |
> | 8 | 912774 | 1 |

The `Framed-Pool`/`Framed-IPv6-Pool` AVPs in the RADIUS Auth-Response
message can indicate the IP pool that SMC should use. However,
the session establishment will fail if no UPG is supporting
the returned pool, or if the pool name is not configured.

## GTPv2 PDN type configuration

The `.Values.apn.bearerType` and `.Values.apn.preferredBearerType` reflect
the behaviour of the SMC as a response to the `PDN Type` value included in the
GTPv2 Create Session Request message. As explained in 3GPP TS 23.401,
clause 5.3.1.1 "IP address allocation / General", if the PDN GW receives a
request for PDN type IPv4v6 but the provisioned `.Values.apn.bearerType`
is `IPv4` or `IPv6`, the PDN type shall be changed to a single address PDN
type (IPv4 or IPv6) in the Accept response and the Cause "New PDN type due
to network preference" (value 18, see 3GPP TS 29.274, table 8.4-1 "Cause values")
will be set.

If the PDN GW receives a request for PDN type IPv4v6, but the Dual Address Bearer
Flag is not set within the `Indication` IE, the PDN type shall be changed to the
IP version set in the `.Values.apn.preferredBearerType` parameter in the Accept
response and the Cause "New PDN type due to single address bearer only" (value 19,
see 3GPP TS 29.274, table 8.4-1 "Cause values") will be set.

If a PDN Type of IPv4 or IPv6 is set in the Create Session Request, but the
`.Values.apn.bearerType` is set to IPv6 or IPv4 respectively, a Reject message
will be sent with the Cause "Preferred PDN type not supported" (value 83,
see 3GPP TS 29.274, table 8.4-1 "Cause values")

| CSRequest `PDN Type` | CSRequest `DAF` (`Indication` IE) | SMC `bearerType` | SMC `preferredBearerType` | CSResponse / Cause / PDN Type |
| --- | --- | --- | --- | --- |
| IPv4 | - | IPv4 | - | Accept / 16 / IPv4 |
| IPv6 | - | IPv6 | - | Accept / 16 / IPv6 |
| IPv4 | - | IPv6 | - | Reject / 83 |
| IPv6 | - | IPv4 | - | Reject / 83 |
| IPv4v6 | 0 / Absent | IPv4v6 | IPv4 | Accept / 19 / IPv4 |
| IPv4v6 | 0 / Absent | IPv4v6 | IPv6 | Accept / 19 / IPv6 |
| IPv4v6 | 1 | IPv4v6 | IPv4v6 | Accept / 16 / IPv4v6 |
| IPv4v6 | - | IPv4 | - | Accept / 18 / IPv4 |
| IPv4v6 | - | IPv6 | - | Accept / 18 / IPv4 |
