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.

You are reading User Plane Gateway 2.8, an older release. The newest release is 3.2. Go to 3.2

UPG deployment guide

UPG Deployment

upg-manager image uses fpp-manager as base image. This includes Golang based controller for VPPInterface, VPPConfig, IPFIXExporter and RoutingTable Custom Resources (CRs). UPG registers to watch for this resources on Kubernetes API. Besides that, UPG does reconciliation for UPGConfig CR.

This mechanism uses Kubernetes Custom Resources to configure interfaces, routing tables, PFCP Server parameters and NWIs (network instances) in VPP instance. Any CLI commands referring to this resources will be revoked and align with k8s API state.

UPG is installed as a regular Helm chart. For more information about configurable parameters, read the User Plane Gateway chart configuration document.

Steps to deploy UPG:

  1. Deploy fpp-crd chart

  2. Deploy upg-crd chart

  3. Deploy upg-support chart

  4. Deploy upg chart

Deploy fpp-crd

fpp-crd chart deployment is needed because UPG uses VPPInterface and other FPP Custom Resources for configuration. This chart does not require any additional configuration and should be deployed once per cluster.

Deploy upg-crd

upg-crd helm chart provides UPG-specific Custom Resources, which must be installed for proper upg-manager functioning. This chart does not require any additional configuration and should be deployed once per cluster.

This mean that UPG CRDs are shared between all UPG deployments in the cluster.

Deploy upg-support

upg-support chart provides Prometheus ServiceMonitor and UPG Overview Grafana dashboard.

A current limitation is that the UPG Overview dashboard should be installed once in the cluster - it gathers metrics from multiple upg instances. Installing it twice may influence the Grafana Operator to flip the ownership and location of the dashboard.

Example of chart configuration:

yaml

To deploy upg-support without the UPG Overview dashboard, include dashboard.enabled: false in chart's values.yaml.

For more details, see UPG Support chart documentation.

Deploy upg

upg chart deploys upg-manager with proper configuration. This chart can be installed multiple times in the same cluster.

Example configuration values:

For more details, see UPG chart documentation.

General UPG configuration

Based on the chart configuration, the below settings are included in the UPG deployment.

UPG manager acts like VPP manager - generates startup.conf and starts vpp as a child process. To start upg-manager, define the following environment variables:

  • FPP_DISABLE_UPLINK - set to any value, instructs the manager not to use DPDK-based physical interfaces, for upg memifs are used

  • FPP_INSTANCE_NAME - sets UPG name, used for watching resources labelled with fpp-manager.cennso.com/plumbing-instance, both values must match

  • FPP_VPP_RUN_PATH - defines VPP runtime directory, by default set to /run/vppswitch, which is used in fpp-manager. Must be set not to use the same directory as fpp-manager

  • FPP_INSTANCE_NAMESPACE - sets namespace where upg-manager watches for CRs

  • FPP_INSTANCE_UID - contains pod UID value, distinguishes between pod generations and is used in label fpp-manager.cennso.com/plumbing-instance-uid

  • FPP_HEAP_SIZE - declares heap size for UPG instance, by default set to 6G by manager

  • FPP_STATS_SIZE - declares stats segment size for metrics, default 512M

UPG handles configuration based on VPP CLI commands with the UPF plugin extension. The UPF plugin consists of the following:

  • definition of 3GPP TS 29.244 standard implementation (CLI: upf specification release 16)

  • Node name, used in control plane communication: (CLI: upf node-id fqdn <node-name>)

  • PFCP server configuration:

    • CLI: upf pfcp endpoint ip <ip-sx-interface> vrf <control-plane-table-id>
    • CLI: upf pfcp server set fifo-size 512
  • Define tunnel endpoint id:

    • CLI: upf gtpu endpoint ip <ip-sx-interface> nwi <cp-nwi-name> teid 0x80000000/2
    • if running in PGW mode, CLI: upf gtpu endpoint ip <ip-grx-interface> nwi epc teid 0x80000000/2

There are also general VPP commands used to configure UPG:

  • Setting up expiration time for ip neighbors per address family:
    • CLI: set ip neighbor-config ip4 age 10
    • CLI: set ip neighbor-config ip6 age 10

Execute the above CLI commands using the afterCommands field in VPPConfig.spec CR:

yaml

Additional config

If specific, non-standard CLI commands must be executed per UPG instance, they can be defined in the additionalConfig field in values.yaml:

yaml

Interface creation

UPG uses VPPInterface CR to handle interface creation. For VPP-based workloads, most suitable interface type is memif - in memory interface, that connects underlying VPP switch with UPG.

VPPInterface can be created manually, by higher level UPG operator or by NetworkAttachmentDefinition (NAD) with fpp-cni as an interface type. NADs are created by helm chart provided with UPG Manager for interfaces:

  • grx - for access network interface
  • sx - for control plane communication
  • sgi - for data network connectivity

As an example of grx interface, Helm chart configuration:

yaml

Resulting NAD:

yaml

Static IP address assignment is used here, and the resulting VPPInterface:

yaml

The interface name in VPP CLI and in UPG metrics is set to grx.

Network Attachment definitions for grx/sx/sgi are added to UPG deployment by chart.

yaml

VPPInterface is targeted against UPG deployment by label: fpp-manager.cennso.com/plumbing-instance-uid.

CNI-less interface creation

You can create memifs directly with VPPInterface (without invoking FPP-CNI) by setting useCNILessMemifs to true and adding networkName with a valid FPPNetwork name in the UPG chart configuration. The rest of the configuration stays the same.

Note

The CNI-less feature requires the deployment of FPP 2.2.0 (both Operator and VPPSwitch on Data Plane nodes) on the cluster.

The benefits of using the direct creation of VPPInterface:

  • The UPG pod starts immediately without waiting for CNI to finish. This is useful when UPG has more than 40 connected interfaces.
  • The user can change the interface parameters (like IP, MAC, MTU, FPP Network) in the runtime. The following table lists the consequences of such action.

Possible aftermath if the VPPInterface parameter is changed:

Caution

See the Known issues before modifying the number of Rx/Tx queues and buffer/queue size.

To use CNI-less memif creation, set useCNILessMemifs to true (by default false). Also, add networkName with a valid FPPNetwork name to all interfaces, for example:

yaml

Additional interfaces

Any additional interfaces than grx/sgi/sx can be connected to UPG by creating NAD and attaching its name in networks annotations. Chart configuration enables to define extra NAD names in additionalNetworks value (per upg deployment) or instances.<instance-name>.networking. (per UPG instance). NADs itself should be provisioned outside of the chart.

yaml

VRF - Routing Table creation

UPG uses RoutingTable CR to handle routing table creation. VPP CLI commands are not supported, as the routing state is synced against CR objects, and additional routes are removed from the VPP.

For UPG deployment, chart configuration will create appropriate RoutingTable objects, for per interface route definition in values.yaml. Chart supports routes for access network (grx), data network (sgi) and NAT pools (default gw). Any additional routes should be defined during deployment, outside of UPG chart.

RoutingTable is targeted against UPG deployment by per instance label fpp-manager.cennso.com/plumbing-instance, or by set of labels defined in VPPConfig spec.routingTableSelectors. UPG charts generate list of label based on chart name, release name and UPG instance name:

yaml

More info on RoutingTable targeting is included in next paragraph.

Example of input of networking configuration:

yaml

This creates the following RoutingTable CRs:

yaml

To check routes applied on the UPG instance, run VPP CLI:

text

Targeting routing tables based on labels

You can define the routingTableSelectors value in the values.yaml chart for a routing table that matches the UPG instance. It allows you to apply one Routing table to multiple UPG instances.

By definition of multiple label sets, one UPG instance can apply multiple routing tables matching different labels, for example configuration in chart values.yaml:

yaml

This is propagated to VPPConfig that matches the UPG instance:

yaml

UPG chart will generate the basic routing tables matching app.kubernetes.io/instance, app.kubernetes.io/name, cennso.net/cnf and instance labels. There can be created additional routing table objects, that match only additional label (crossInstance in example) outside of UPG chart:

yaml

In that case, all UPG instance that have VPPConfig with crossInstance label defined will fetch and apply above routing table.

NWI creation

In PGW mode, 3 NWIs should be created: epc, cp and sgi. For TDF mode, NWIs: access, cp and multiple sgis (one per destination, nat pool) should be created.

UPG chart takes care of proper NWI creation, based on values.yaml type value: pgw or tdf. One sgi per nat pool is added after declaration nat.enabled: true and nat.type set to cgnat.

Instead of using the type value, the name and type of NWI can be configured using the nwis section:

yaml

Do not set type: tdf and per NWI configuration together.

The default configuration provided above serves for the PGW-U use-case.

Example of a configuration for TDF-U:

yaml

Data Networks are configured one per NAT pool, based on instances.nat.pools

Sample configuration for GTP-proxy use case, when Access and Data networks are using only GTP endpoints:

yaml

NWI CR config

UPG uses UPGConfig CR to create NWIs. Old way of CLI NWI creation is not supported, as the only source of truth is Kubernetes API CRs.

For the PGW-U UPG case, the following NWIs will be created by the chart using default values:

yaml

The TDF-U use-case using the following values.yaml:

yaml

And resulting UPGConfig:

yaml

The GTP-Proxy use case NWI configuration:

yaml

It results in the following UPGConfig:

yaml

To check the NWI configuration on running UPG instance, use VPP CLI:

text

Features

Policy-based routing configuration

Policy-based routing, or traffic steering feature, provides possibility to apply routing rules per session and forward traffic to different data networks like Internet or VPN. This feature assumes SMC support in PFCP Session Creation Request using 3GPP TS 29.244 V16.9.1 8.2.23 Forwarding Policy IE.

During session establishment, SMC assigns a policy by adding the Forwarding Policy IE to the FAR(s) with Destination Interface SGi-LAN/N6-LAN. For each session, one of the policies is applied, causing a lookup in one of the respective tables. UPG and SMC configuration should be in sync, SMC should send already configured policy IDs in UPG config. Policy ID is a regular string with max 63 characters. For example defaultInet or defaultVpn.

Example topology overview:

policy based routing topology
policy based routing topology

Steps needed to configure policy based routing:

  1. Regular SGI interface (called inet in above picture) can be used for Internet connectivity, chart will create NAD for inet
  2. Ensure that VXLANs for SGI and VPN interface are created (outside of UPG chart), to enable connectivity to Internet and VPN CGWs - both gateways need to have FPP-CNI tap interfaces deployed
  3. Create NAD for VPN interface (outside of UPG chart)
  4. Define additional interface in UPG deployment for VPN connectivity - additionalNetworks in instances.<name>.networking
  5. Define policy names in UPG config using additionalConfig section in instances.<name>
  6. Define routing tables attached to policy created, outside of UPG chart
  7. For multi UPG instances, define routingTableSelectors so that one routing table object will be used on each UPG.

Please refer to policy based routing values.yamlOpens a file and example of NAD and RoutingTableOpens a file definitions for full configuration needed.

Policy based routing feature should be used in pgw mode of UPG. To define forwarding policy, CLI commands in instances.<name>.additionalConfig should be used, example:

yaml

Current requirement is to create tables first before upf policy add id <name> command is used. Table creation in additionalConfig should be removed after implementing conditional wait for RoutingTable CR to be added before executing additionalConfig commands.

upf policy add id <policy-name> via ip4-lookup-in-table <table-id> via ip6-lookup-in-table <table-id> defines <policy-name> to be used for traffic forwarding, with connected IPv4 and IPv6 routing table look ups. Routing table must exist before referencing them in policy creation command. If routing table is deleted during runtime, policy is working, but no traffic is forwarded outside of UPG. After routing table is available again, traffic is passing normally.

Above example of policy creation shows how to configure policy based routing together with IPFIX activation per session. Two policies needs to be created, for example defaultInet and defaultInetIPFix, and proper configuration at SMC side will send PFCP IEs for routing (FAR - forwarding policy name) and ipfix template (TP IPFIX Policy IE - FlowUsage as prepared for PGW mode).

IPFIX configuration includes exporter config:

yaml

And SGI IPFIX configuration:

yaml

For VPN interface, separate NAD needs to be created outside of UPG chart. Example:

yaml

This NAD vpn21-memif-inst01 can be added in additionalNetworks in per instance network configuration:

yaml

Last step is to configure routing tables connected to policy tables. This needs to be done outside of UPG chart. Policy based routing enables pointing default route to Internet and specific IP network addresses to VPN data network. Also blocking of IP range is allowed. Example:

yaml

Above example shows different routes configuration for tables 201 and 202, where 201 table pass default traffic to Internet, and specific address to VPN data network. Table 202 does opposite routing, by default passing traffic to VPN data network, and only specific routes are forwarded to SGI (Internet) network. IP 9.9.9.9/32 is blocked.

Common label across all RoutingTable CRs is configured in UPG chart by:

yaml

IPFIX configuration

UPG enables IPFIX to be exported. This is built in feature and to properly use it, IPFIX exporter and per NWI IPFIX settings should be configured. IPFIX exporter configures the IPFIX collector, these are current assumptions for IPFIX exporter configuration:

  • UPG supports sending IPFIX data over VPP interface, so current configuration does not support to use Kubernetes default network (like Calico)
  • Collector IP address should use FPP-CNI, and recommended is control network (sx), as it was tested and reported to be working
  • IPFIX collectors are distinguish by IP address, so only one collector per IP is supported currently (this is VPP internal limitation)
  • Collector IP defined in ipfixExportes should match per NWI ipfixCollector settings, otherwise IPFIX feature will not work

Example:

yaml

UPG supports two IPFIX templates:

  • NatEvent - mainly created for TDF use-case, with NAT information
  • FlowUsage - used in PGW mode

Second part of IPFIX configuration is per uplink NWI ipfix config, supported in sgi or per NAT pool configuration in values.yaml. Example for PGW mode:

yaml

ipfixExporters.collectorAddress and instances.<name>.networking.sgi.ipfixCollector needs to match, otherwise IPFIX will not be sent. For PGW mode, ipfixPolicy can be set in NWI configuration, or if policy is omitted, PFCP Session Establishment Request should include PFCP TP IPFIX Policy IE with a valid name of the policy (FlowUsage/NatEvent). PGW mode can use FlowUsage as ipfixPolicy. In case where ipfixPolicy is empty, no ipfix is sent by default and IPFIX is activated per session.

For TDF mode, per NAT pool ipfix configuration is supported, and should be included in NAT config section, example:

yaml

To check IPFIX configuration, VPP CLI on UPG can be executed:

text

TDF with CG-NAT

To configure UPG in TDF mode, the following settings need to be defined in values.yaml.

First of all, we need to define the type to tdf.

As UPG requires an FPP-enabled node to run on, nodeAffinity needs to be defined. For example, if all nodes with fpp enabled are labeled with fpp-manager.cennso.com/vppswitch: "", then the chart config should include:

yaml

If UPG deployment should be pinned to a specific node, then affinity can look like this (assuming the node name is worker-node1.test.cluster.net):

yaml

labels need to be defined because there are used in the upg-support Grafana dashboard:

yaml

If the UPG Manager image is hosted on a private registry, imagePullSecrets should be set in values.yaml, example:

yaml

This will set the service account to use that secret, as well as it will be set in UPG deployment. The secret needs to be created outside UPG deployment.

Based on the load test (250k sessions), a recommendation for resource allocation is:

yaml

The enableHugepagesAllocation parameter specifies if UPG uses hugepages for heap, stats segment, and buffer. If set to true, UPG uses a hugepages memory system instead of the standard memory allocation mechanisms. When hugepages are enabled, the resources.memory parameter must be set to at least 1Gi and resources.hugepages-2Mi must be set to at lease 4Gi. If enableHugepagesAllocation is set to false, hugepages are disabled and the resources.memory must be set to at least the value of heapsize + 1G. Enabling and disabling hugepages allocation for heap, stats, and buffer does not influence the performance or stability of UPG.

Networking configuration for UPG instance includes regular grx and sx interface configuration. sgi configuration is omitted, as a per pool sgi will be added. Example config:

yaml

Above will result in the UPG chart to define NADs with memif interfaces for GRX (named an1) and SX (named sx1). Proper VXLANs should be created (i.e. 4201 and 4101) using the Custom Resource of vxlan.fpp-manager.cennso.com. UPG chart does not create those VXLAN objects. This will enable cross-node communication. Example:

yaml

TDF setup requires NAT. UPG enables 2 types of NAT: basic and carrier-grade NAT (CG-NAT). In the TDF case, cg-nat will be used. To enable cg-nat values.conf should include:

yaml

Where 500000 is the number of connections for all users, and this number was verified by load test to be sufficient (250k sessions run).

The maxNatFlows represent the maximum of NAT flows that can be processed per UPG instance. This influences total memory consumption. 1 NAT flow was measured to take 246 bytes, and 1M of sessions took 246 MB of memory.

It is advised to configure maxNatFlows to a high number, to prepare the system for many connections. The maxNatFlows entries are pre-allocated on UPG startup.

If maxNatFlows will be reached, no new connection will be NATed, and the UE will not be able to reach the Data Network.

NAT flow has its idle timeout to free up the resources, it depends on the protocol, and it can be configurable using UPG chart values:

yaml

NAT flows are not removed after reaching the timeout, they are removed in the Least Recently Used (LRU) style. So the flow table can be filled up, but when a new flow should be created - an invalid flow will be removed and replaced with the new one.

To further estimate UPG CG-NAT capacity, NAT pool configuration is introduced:

  • start - start external IP range, example: 198.19.8.1
  • end - end external IP range, example: 198.19.8.254
  • blocksize - range of port assigned to NAT binding
yaml

The capacity of the NAT pool in terms of total NAT flows is calculated as follows:

  • External_IPs * (MAX_PORT - MIN_PORT)
    where MIN_PORT is by default 1024 and MAX_PORT is by default 65535.

MIN_PORT and MAX_PORT are configurable by:

yaml

Example calculation for 2 external IPs and default port ranges:

  • 2 * (65535 - 1024) = 2 * 64511 = 129022

The maximum number of NAT flows is fragmented into blocksize ranges. In conjunction with external IP, the port block creates NAT binding, for example:

text

After the UPF session is deleted, NAT binding is released and a port block is returned to be used by other sessions. This NAT binding might be used immediately, but the algorithm that assigns NAT bindings to new UPF sessions tries to pick up less used external IP first.

NAT binding is reused immediately after the previous session is deleted.

UPG exposes vpp_nat_pool_capacity metric per NAT Pool, which helps to see what is the total capacity of NAT bindings per NAT pool, calculated as External_IPs * (MAX_PORT - MIN_PORT)/BLOCK_SIZE.

vpp_nat_pool_utilization metric shows how many NAT bindings are allocated to UEs.

When UE uses all ports assigned in NAT Binding, new connections will not be NATed, and traffic will be blocked until some port will be freed up.

NAT pools are configured in instances.<name>.nat section of chart values.yaml. Example NAT pool configuration:

yaml

In per pool configuration, ipfix capabilities are defined, interface details (name, type, mtu, IP address and pool gateway address). vni refers to FPP VXLAN network id. This vxlan needs to be created with with vxlan.fpp-manager.cennso.com CRs outside of UPG chart. Above configuration will generate NADs for NAT pool interfaces, with fpp-cni and memif type.

yaml

Based on NAT pool definitions, NWI per NAT pool will be defined using UPGConfig CR. Also IPFIX configuration per NWI will be included. IPFIX template default should be used for TDF use-case:

yaml

NAT pools configuration will be included in VPPConfig with per UPG target:

yaml

This is example exporters configuration:

yaml

Rate limiter

For TDF case, there is possibility to throttle the session creation rate, which is important to not overwhelm SMF. Rate limiter will be applied to PFCP Session Report Request, sent from UPG to SMF. rateLimiterPPS included in values.yaml will set how many messages per second can be sent.

yaml

PFCP Server Configuration

UPGConfig CR can be used to configure UPG PFCP Server parameters.

PFCP Heartbeat Configuration

PFCP Heartbeat mechanism is used to identify connectivity problems between UPG and CP-Function. The number of retries for unanswered PFCP Heartbeat Request and the timeout between retries in seconds can be configured within pfcp section of UPGConfig.

yaml

UPGConfig CR is populated with dedicated values by setting appropriate parameters in values.yaml. Note, that number of retires should not be greater than 30, and timeout should be positive number in seconds not greater than 120.

yaml

PFCP Heartbeat configuration can be verified from VPP CLI:

text

UPG runtime reconfiguration

The following actions can happen when you change the UPG configuration and apply it on a running instance:

  1. UPG can be restarted - the UPG pod restarts but no lifecycle action, such as deleting the pod and creating a new one, is triggered
  2. UPG can be recreated - the UPG pod is deleted and a new copy is created

UPG restart does not trigger CNI to be executed. This impacts the application of the changed IP address from Network Attachment Definition (NAD) to a running UPG pod. To apply the IP changes, you must recreate the UPG pod.

Changes to the UPG configuration that do not trigger the UPG restart or recreation:

Other changes that affect UPG: