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.

Deploy Fast Path Provider for CGW 2 with basic NAT

This document describes the prerequisites and steps to deploy the Fast Path Provider (FPP) for the Connectivity Gateway (CGW) 2 with NAT use case.

Prerequisites

Steps

  1. Deploy FPP for CGW 2 with basic NAT using the following configuration:

    Connectivity Gateway (CGW) using VPP as a packet processing engine has better performance than a Linux kernel-based solution. For cluster-internal usage, CGW can handle routing and apply basic NAT.

    Caution

    FPP-based CGWs must be only scheduled on the nodes with FPP version 2.0.0 or later serving as VPP Switch to have VPP interfaces configured properly.

    Below is a diagram with the CGW with NAT example deployment described further in this section:

    CGW2 with NAT
    CGW2 with NAT

    This is the full configuration of the CGW deployment:

    yaml
  2. Configure the CGW deployment based on the example above.

    • Configure the VPP Operator that should handle the FPP deployment creation:
    yaml
    • Provide the CNF name:
    yaml

    The configuration above creates the VPPDeployment object with mode set to instance, which in turn creates Kubernetes StatefulSet object (as opposed to DaemonSet which is used for the node mode), and adds the cennso.net/cnf: cgw label to all created resources.

    • Define imagePullSecrets to download the VPP Worker image from a private registry:
    yaml
    • Configure the networking.

    This example uses memifs for in-cluster networking. Starting from the left side, sgi interface is created. This connects the IP network receiving traffic from UPG. Next, on the right side, you have two network interfaces. One is inet, which has connectivity to the Internet. Second is vpn, which connects to the backend services:

    yaml
    • The routing tables are configured as follows:
    yaml

    Based on the routing applied in table rt-sgi, the incoming traffic is forwarded either to the inet interface, where the NAT is applied, or routed to the vpn interface, which connects user traffic with the corporate backend (no NAT applied). rt-inet has the backroute information on where to forward the returning traffic.

    • Configure the NAT using VPP CLI

    FPP enables configuring the basic NAT using CLI commands in vppConfigs:

    yaml

    The frame-queue-nelts parameter is recommended to be set if we use more than 1 worker thread. The calculation uses the following formula:

    text
    • queue size for memif is 512
    • DPDK queue size is configurable (using numRxDesc and numTxDesc), by default set to 2048 each
    • When using 2 memifs for NAT input and NAT output interface - this gives (512+512)*4 = 4096
    • When using memif and DPDK interface - (512+2048)*4 = 10240

    For more configuration options, visit the official VPP NAT documentationOpens in a new tab.

    • Configure the resources

    The minimal resource configuration to achieve 500k NAT translations in a production environment is as follows:

    yaml

    Caution

    Do not run a CGW with NAT on exactly one VPP worker thread, because the built-in vppctl ping command then crashes VPP. The examples on this page assume a node with Hyper-Threading (HT), where each physical core has two logical CPUs. FPP uses one logical CPU of each physical core. VPP runs the main thread on the first of these CPUs and a worker thread on each of the others. With cpu: "4", VPP runs one main thread and exactly one worker thread. Set cpu to 2, or to 6 or more. If the CGW already runs with one worker thread, do not run vppctl ping. Check connectivity with ping from a host outside the CGW.

    For a use case that requires higher performance, assign 6 CPU cores.

    Measured memory consumption for different settings: