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
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 This is the full configuration of the CGW deployment:
yamlConfigure the CGW deployment based on the example above.
- Configure the VPP Operator that should handle the FPP deployment creation:
yaml- Provide the CNF name:
yamlThe configuration above creates the VPPDeployment object with mode set to
instance, which in turn creates KubernetesStatefulSetobject (as opposed toDaemonSetwhich is used for thenodemode), and adds thecennso.net/cnf: cgwlabel 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:
yamlBased 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:yamlThe
frame-queue-neltsparameter 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:
yamlCaution
Do not run a CGW with NAT on exactly one VPP worker thread, because the built-in
vppctl pingcommand 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. Withcpu: "4", VPP runs one main thread and exactly one worker thread. Set cpu to2, or to6or more. If the CGW already runs with one worker thread, do not runvppctl 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: