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 Fast Path Provider 2.11, an older release. The newest release is 3.2. Read this page in 3.2

Custom Resources

Note

For explanation of the Amberd concept used below, please refer to the architecture document.

FPP controls the lifecycle of FPP Amberd pods by synchronizing the set of VPPDeployment objects with the set of Amberd DaemonSets and StatefulSets. VPPDeployment objects define either a set of node-mode Amberds or a single instance-mode Amberds.

The VPP interfaces are configured through the VPPInterface CRs (custom resources). The FPP Operator applies the VPPInterface state to the Amberd it targets and reports back the status in the status field of the resource. Each VPPInterface can be targeted at a node (the VPPSwitch on the node) or to a particular instance-mode Amberd (a VPP-based workload). There are also VPPConfig objects which can be used to configure Amberds, both node-mode ("VPPSwitch") daemon pods and instance-mode pods derived from StatefulSets.

Both VPPConfig and VPPInterface objects, as well as IPFIXExporter objects, are targeted using labels. It's possible to target an Amberd where FPPManager receives the specific value of the FPP_INSTANCE_NAME environment variable:

yaml

Another version of instance targeting uses FPP_INSTANCE_UID environment variable value, which usually contains pod UID value in Amberds. This method is used by FPP-CNI for instance-mode Amberds:

yaml

VPPInterface is targeted via instance UID instead of instance name because otherwise, it wouldn't work with CNI. With CNI, the netns is created before the pod is started, and it may be torn down at an arbitrary moment later, even sometime after the pod is re-created. Targeting via instance name can run into a situation where VPPInterface CRs remaining for a while from dead UPG pods interfered with new UPG pods with the same instance name.

It's also possible to target specific VPPSwitch node:

yaml

or all VPPSwitch nodes:

yaml

RoutingTable objects are also subject to this label-matching mechanism unless alternative selectors are specified using the routingTableSelectors field in the VPPConfig spec.

VPPDeployment objects

VPPDeployment objects are used to manage the lifecycle of VPPs running on the cluster.

yaml

To disable VPPDeployment from CLI, run:

bash

To enable it back, run:

bash

VPPTool objects

VPPTool objects describe templates for additional containers to be added to the Amberd pods.

Caution

VPPTool is an immutable cluster-wide resource. If you want to provide any modification to custom resource objects, you must delete VPPTool and create it again. This restarts all Amberd pods that use this tool, which causes network downtime.

yaml

VPPConfig objects

VPPConfig objects can be used to configure VPP instances, be that VPPSwitch daemon pods (node-mode Amberds) or instance mode Amberds. VPPConfig lists VPP CLI commands that must be run by FPP Manager, which can use many interfaces that are configured using VPPInterface CRs.

When multiple VPPConfig objects match this particular FPPManager instance, they're merged together according to their priority value. The resulting config is called "effective config". When effective config changes for an active FPPManager instance, the FPPManager instance restarts. There's an exception from that rule, namely, spec.routingTableSelectors field. When the effective value of spec.routingTableSelectors changes (it being all of the routingTableSelectors lists specified in all of the applicable configs appended together, with duplicates removed), the FPP Manager instance is not restarted but rather just continues with the new routingTableSelectors being used.

Caution

If VPPConfig targeting Amberd pods has afterCommands defined, Amberd pods are restarted after FPP Operator restart.

yaml

This Ifs structure that can be used in the afterCommands has the following fields for each interface:

  • Name contains the VPP interface name for the interface
  • IP contains the IPv4 address for this interface, if any, or an empty string if there's no IPv4 address assigned for this interface
  • IPNet contains CIDR (IPv4 / subnet) for this interface, if any, or an empty string if there's no IPv4 address assigned for this interface
  • IP6 contains the IPv6 address for this interface, if any, or an empty string if there's no IPv6 address assigned for this interface
  • IPNet6 contains CIDR (IPv6 / subnet) for this interface, if any, or an empty string if there's no IPv6 address assigned for this interface
  • Table contains table (VRF) id for this interface (defaults to 0)

The IP address templating mechanism will not work correctly if there are multiple IPv4 addresses or multiple IPv6 addresses specified for the interface.

For VPPSwitch daemon pods, the config may also contain a uplinkConfig section that specifies the uplink configuration:

yaml

The external network configuration code matches the name prefix specified in VPPConfig against physical interface names included in a startup.conf based on MAPPING_ environment variables. Below is an example of a VPPConfig that matches all of the nodes and also enables bonding for the external network:

yaml

For this to work, we need to define the MAPPING_ environment variables for the FPP Manager pod like this:

text

In the example above, 2 interfaces will be used for the ext-net external network defined in VPPConfig. The following VPPInterface objects will be created: <node-name>-ext-net-0, <node-name>-ext-net-1, and also a VPPInterface object for the bond named <node-name>-ext-net-bond.

VPPConfigs that contain external interfaces with IP assignment must match a single FPP node (via fpp-manager.cennso.com/plumbing-node label) or a single FPP instance (via fpp-manager.cennso.com/plumbing-instance label) to avoid IP conflicts:

yaml

VPPInterfaces that are generated for uplinks and extnet interfaces are continuously synced against the VPPConfigs applicable to the current node/instance. The generated VPPInterface objects have a couple of special labels:

  • fpp-manager.cennso.com/plumbing-physiftype: indicates uplink or extnet
  • fpp-manager.cennso.com/plumbing-physifrole: specifies standalone (for a non-bonded interface), member-N (for a bond member), bond (for a bond), or vlan (for a subinterface).

VPPInterface objects

VPPInterface CRs can be created manually, by the FPP-CNI or by the VPPSwitch, the latter being used for VXLAN meshing.

The name of the VPP interface is generated by VPP itself by default, e.g. memif1/100. If spec.ifName is set, that value is used instead of the name of the interface. The special case is the spec.ifName beginning with a dash (-). In this case, spec.ifName is updated using its value as a suffix for the VPP device name, so that -mydev as spec.ifName becomes memif1/100-mydev, and this name is also used as the VPP interface name. This suffix mechanism is used by FPP-CNI on the VPPSwitch side to provide meaningful names for the network interfaces corresponding to pods. There are several types of VPPInterface resources supported.

VPPInterface: uplink/bond

This corresponds to VFs or NICs that VPPSwitch owns, e.g. DPDK interfaces. DPDK interfaces are available upon startup in VPP, so no extra NIC details are specified there. The ifName must match the name of the interface that is created upon VPP startup. The name itseft is based on MAPPING_... environment variable value (see the Installation document for details).

Caution

Uplinks are generated automatically by FPP Operator. Manual modification are overriden.

yaml

It's also possible to bond the uplink interfaces. If, for example, there are several uplinks configured like this:

yaml

they can be bonded together in a single uplink like this:

yaml

VPPInterface: loopback

The loopback interface is useful when a VPP instance must create a local interface. One of the possible use cases is to expose a network gateway on the FPP node. This incorporates a CGW use case on FPP daemonset. You must specify on which node to create the gateway. Regular properties of a VPP interface can be defined as well: VPP interface name (ifName), IPs, MTU, routing table to use, FPPNetwork, or bridge domain to connect to.

yaml

If the MAC address is not specified, it is generated to be unique. The loopback interface is set as a Bridge Virtual Interface (BVI) to be able to respond to the ping.

VPPInterface: external network

When VPPConfig has the externalNetworkConfig section specified, each physical interface that matches the interface name prefix will be configured as an external network by the FPP Manager start sequence. External interfaces are marked with VPPInterface.Spec attribute Type set to extnet. The name of the VPPInterface object is constructed using the node name, externalNetworkConfig.Name and a number: <node-name>-<ext-net-name>-<id>.

When the type is not set, the VPPInterface object is considered to be an uplink interface.

yaml

It's also possible to create a bond interface consisting of external interfaces. Prefix name defined in the externalNetworkConfig.name needs to match multiple physical interfaces mappings in FPP Manager MAPPING_... environment variable value.

VPPInterface: VXLAN endpoint

This corresponds to a VXLAN tunnel endpoint. The endpoints are created internally by the VPPSwitch instances based on VPPInterface objects corresponding to uplinks, and VXLAN objects, so, most of the time, you don't need to create any vxlanTunnel type objects by hand, and they're reserved for possible special cases.

yaml

VPPInterface: GRE tunnel

This corresponds to a GRE tunnel endpoint. FPP supports only L3 GRE tunnels at the moment. Another GRE tunnel endpoint is expected to be present at the destIP, not necessarily provided by FPP. The sourceIP must correspond to an address of an interface belonging to this VPP instance. The traffic destined for the GRE interface will be encapsulated and sent from sourceIP towards the destIP using GRE datagrams. Conversely, the traffic arriving at sourceIP from the destIP will be decapsulated. It's possible to use another table ID for the encapsulated traffic by specifying encapVRFID inside the greTunnel section of the spec. GRE tunnel may have a key configured like it's defined in RFC 2890. If present, should match similar configuration parameters on another GRE tunnel endpoint.

Note

You cannot set spec.ifName for the GRE interface to values like gre0 or gre1 because of possible collision with the internal VPP interface name.

yaml

VPPInterface: memif

Memifs are used to attach Amberds or other tools that use memifs, such as Cisco TRexOpens in a new tab to VPPSwitch. A pair of memif VPPInterface objects is created by FPP-CNI for each such network attachment.

Note that many of the fpp-manager.cennso.com/... labels below are used internally by FPP CNI which has generated the VPPInterface objects below.

Master memif:

yaml

Slave (client) memif. ifName is set to the name of NetworkAttachmentDefinition below. It is used as the VPP interface name in the VPP app:

yaml

Sample NetworkAttachmentDefinition with the CNI config from which FPP-CNI has derived the above VPPInterface:

yaml

The following additional tunable settings are available for memifs in the CNI config:

  • numRxQueues (goes into spec.memif.numRxQueues on the slave memif interfaces): number of rx queues, defaults to 1
  • numTxQueues (goes into spec.memif.numTxQueues on the slave memif interfaces): number of tx queues, defaults to 1
  • memifRingSize (goes into spec.memif.ringSize) - the number of entries of RX/TX rings, defaults to 4096
  • memifBufferSize (goes into spec.memif.bufferSize) - size of the buffer allocated for each ring entry, defaults to 2048
  • txPlacement controls the core-to-tx-queue assignment on the VPPSwitch side, each entry corresponding to a tx queue on that side, so the number of items in the list must be equal to numRxQueues which describes the number of RX queues on the client side and thus also the number of TX queues on the VPPSwitch side
  • clientTxPlacement controls core-to-tx-queue assignment on the client side. The number of entries must be equal to the numTxQueues, each entry corresponding to a tx queue on the client side.

VPPInterface: memif without CNI

A newer way to connect a memif-based workload to VPP L2 switch was developed to omit the use of CNI. The user creates just the client (slave) interface, and FPP Operator creates a matching ephemeral master memif. Ephemeral means that the VPPInterface CR is not actually stored in the Kubernetes API Server.

The VPPInterface has to have:

  • plumbing-instance label
  • attachToNetwork parameter which must be a valid FPPNetwork
  • Role slave
  • IP address/mask

To define TX Placement for a master side of memif interface, serverTxPlacement needs to be defined in slave memif VPPInterface object.

If the targeted instance of UPG is v2.x, an additional fpp-manager.cennso.com/legacy-instance=true label is required.

yaml

VPPInterface: tap

VPPInterface of type tap is used to connect pods that use Linux networking to the VPPSwitch. Note that in the example below, the IP address information is not included as it's handled by the CNI plugin itself in this case.

yaml

Below is the sample NetworkAttachmentDefinition with the CNI config from which FPP-CNI has derived the above VPPInterface.

yaml

It is also possible to specify multiple IP addresses for an interface:

yaml

The following additional tunable settings are available for taps in the CNI config:

  • numRxQueues (goes into spec.tap.numRxQueues): number of rx queues, defaults to 1
  • tapRxRingSize (goes into spec.tap.txRingSize) - the number of entries of TX ring, defaults to 4096
  • tapTxRingSize (goes into spec.tap.txRingSize) - the number of entries of RX ring, defaults to 4096

VPPInterface: VLAN

VPPInterface of the VLAN type is used to create a sub-interface that processes packets with the 802.1q VLAN ID tag attached. Creating this sub-interface requires another interface on the same VPP that serves as a parent. Every VPPInterface of the VLAN type corresponds with one sub-interface. Due to limitations in VPP, the ifName parameter always changes to <parentIfName>.<VLAN ID>.

See the example of the VPPInterface of the VLAN type:

yaml

SPAN configuration

SPAN mapping can be configured on any VPPInterface by adding spanSource field to its spec. SPAN mappings work by applying SPAN settings that tell VPPSwitch to copy all of the traffic targeted towards the interface mentioned in spanSource towards the interface for which that spanSource is set in its spec.

spanSource can be defined in one of three ways:

  1. By specifying the name of a particular VPPInterface
  2. By specifying a set of labels that match a single VPPInterface
  3. By specifying the name and namespace of a CNI-less slave memif

You can use all the above methods manually on the VPPInterface definition or automatically through the FPP-CNI configuration in NetworkAttachmentDefinition.

VPPInterface object name

Sample definition of a tap interface with a SPAN source from another interface specified using name:

yaml

Matching label of source VPPInterface

Sample definition of a tap interface with the SPAN source specified using labels:

yaml

Example FPP-CNI NAD with SPAN configuration:

yaml

VPPInterfaceRef for CNI-less SPANs

When the CNI-less feature is used, the SPAN source interface is not visible as a Kubernetes API object.

In this case, you must define vppInterfaceRef in the spanSource section when defining a Network Attachment Definition:

yaml

The vppInterfaceRef section must include the name and the namespace of the slave memif VPPInterface CR.

FPPNetwork Objects

FPPNetwork is cluster-scope (non-namespaced) object denote separate L2 networks that are handled by this VPP installation. Presently only a single FPPNetwork type is supported: vxlan. FPP automatically creates a full VXLAN mesh across the nodes based on FPPNetwork and VXLAN objects.

yaml

FPPNetwork objects can be referred to via networkName field in a VPPInterface spec or a NetworkAttachmentDefinition instead of specifying bridgeDomain and vni values, respectively. In that case, the value is taken from the id field of the FPPNetwork specified in networkName.

VXLAN Objects

VXLAN objects are handled by the VPPSwitch to automatically create the full mesh between the nodes for each VNI for which VXLAN object exists. VXLAN objects are to be eventually replaced with FPPNetwork.

yaml

RoutingTable objects

RoutingTable makes it possible to specify routes to be installed in VPP. RoutingTable objects are targeted to a node or a VPP-based app instance in the same way as VPPConfigs. Each table has an id and addressFamily. addressFamily can be either IPv4 or IPv6. Multiple routing tables with the same id are allowed; in this case, they're merged together.

yaml

The idea of reconciliation is mostly the same as with the VPPInterfaces:

  1. Load RoutingTable objects and extract Route records from them
  2. Load the current VPP FIB table state and convert it to the set of Route records
  3. Create FIB tables based on RoutingTable IDs - if a routing table exists in VPP, skip creating.
  4. The VPP tables that are not in RoutingTable objects are not deleted.
  5. Delete routes that are in VPP but not in RoutingTables
  6. Add routes that aren't in VPP but are in RoutingTables.

There are multipath routes, for which only some of the paths change, the whole route is re-created. This limitation can be fixed later, as VPP can add/remove individual paths, too.

Firewall VPPACL objects

The VPPACL Custom Resource lets you configure a firewall in VPP using the Access Control List (ACL) rules. The object consists of two arrays: rules and bindings. Use fpp-manager.cennso.com/plumbing-instance to target the configuration towards an Amberd instance.

yaml

VPPABF objects

The VPPABF Custom Resource lets you configure Access Control List (ACL)-based forwarding (ABF). The object consists of three arrays:

  • rules
  • bindings
  • forwarding.

Use the fpp-manager.cennso.com/plumbing-instance label to target the configuration towards an FPP instance pod. See the configuration example of the VPPABF CR:

yaml

For more information, read the ACL-based forwarding document.

IPFIXExporter objects

IPFIXExporter objects are used to configure IPFIX Exporters in VPP.

yaml

If a non-zero tableID is specified for an IPFIXExporter, the table with that ID must be present. For now, this is only guaranteed to work for IPv4.

FPP-CNI Setup diagrams

CNI Setup diagram for tap interfaces:

Sequence diagram
Sequence diagram

CNI Setup diagram for memif interfaces:

Sequence diagram
Sequence diagram

Bonding parameters

You can configure bonding for externalNetworkConfig, uplinkConfig in VPPConfig, and VPPInterface.

There are several bond modes you can use to control how data is transmitted:

  • ActiveBackup - Only one of the bonded interfaces is active. The active interface is changed on a link failure event.
  • Broadcast - Broadcast every packet on all bonded interfaces.
  • LACP - 802.3ad Dynamic link aggregation. The LACP protocol controls bonding.
  • RoundRobin - Interfaces to transmit packets are selected sequentially.
  • XOR - The interface to transmit packets is selected based on the packet hash.

The LACP and XOR modes respect the selection of the load-balancing algorithm. This algorithm selects how the packet's hash responsible for choosing the output interface is calculated. Values for LACP and XOR modes:

  • L2 - hash based on the MAC layer only
  • L23 - hash based on the MAC and IP layers
  • L34 - hash based on the IP and Transport layers

The order of active interfaces under a single-bonded interface changes on link failure and recover events.

Active Backup bond mode

ActiveBackup bond mode follows these rules:

  • Traffic is always transferred through a primary interface, which is the first active interface of the bonded ones.
  • To prevent the delivery of duplicated frames, traffic is dropped on secondary interfaces.
    • This behaviour is specific to the ActiveBackup bond mode.

One of the consequences of those rules is that when two nodes are interconnected using bonded interfaces through other network devices, such as switches, and interfaces on the one side correspond with the interfaces on the other side in a way that traffic can take only one path between each pair of the corresponding interfaces, link failures are handled properly only if they can be detected on both corresponding interfaces. If a link failure is detected only on one side, a connectivity issue occurs. The reason is that the other side drops all the traffic that is received on a secondary interface.

Example of such setup:

Sequence diagram
Sequence diagram

In this setup, if uplink0n0 is the primary interface on both nodes and the link between sm-02 node and port 3 of the sw-14 switch fails, a connectivity failure occurs even if traffic could be transferred through uplink1n0 interfaces.

The ActiveBackup mode is vulnerable to the change of active interface order. For example, if the order of active bonded interfaces changes due to a link failure event with a following recover event, and traffic is delivered only to the same interface, which is now a secondary interface, all received traffic is dropped.