Custom Resources
The communication between FPP Manager, FPP CNI Plugin and VPP-based
workload instances happens using VPPInterface custom resources.
FPP Manager applies the VPPInterface state to the VPP instance
it's running 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 FPPManager instance (a
VPP-based workload). The latter is used for VPP-based workload
instances. There are also VPPConfig objects which can be used to
configure VPP instances, both VPPSwitch daemon pods and VPP-based
workloads.
Both VPPConfig and VPPInterface objects, as well as IPFIXExporter objects,
are targeted using labels.
It's possible to target a VPP workload where FPPManager is passed the specific
value of the FPP_INSTANCE_NAME environment variable:
Another version of instance targeting uses FPP_INSTANCE_UID
environment variable value, which usually contains pod UID value in VPP-based workloads.
This method is used by FPP-CNI for VPP-based workload pods:
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:
or all VPPSwitch nodes:
RoutingTable objects are also subject to this label-matching mechanism
unless alternative selectors are specified using the routingTableSelectors
field in the VPPConfig spec.
VPPConfig objects
VPPConfig objects can be used to configure VPP instances, be that
VPPSwitch daemon pods or FPP-based workload pods. VPPConfig lists
VPP CLI commands that must be run by FPP Manager, which can utilize 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.
This Ifs structure that can be used in the afterCommands has the following fields for each interface:
Namecontains the VPP interface name for the interfaceIPcontains the IPv4 address for this interface, if any, or an empty string if there's no IPv4 address assigned for this interfaceIPNetcontains CIDR (IPv4 / subnet) for this interface, if any, or an empty string if there's no IPv4 address assigned for this interfaceIP6contains the IPv6 address for this interface, if any, or an empty string if there's no IPv6 address assigned for this interfaceIPNet6contains CIDR (IPv6 / subnet) for this interface, if any, or an empty string if there's no IPv6 address assigned for this interfaceTablecontains 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:
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:
For this to work, we need to define the MAPPING_ environment variables for
the FPP Manager pod like this:
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:
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-physiftypewhich can be eitheruplinkorextnetfpp-manager.cennso.com/plumbing-physifrolewhich can bestandalonefor a non-bonded interface,member-Nfor a bond member, orbondfor a bond
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, except that ifName must
match the name of the interface that is created upon VPP startup based
on MAPPING_... environment variable value (see
Deploying FPP document for details). When automatic uplink
creation is enabled, the uplinks should not be created manually to avoid
conflicts.
It's also possible to bond the uplink interfaces. If, for example, there are several uplinks configured like this:
they can be bonded together in a single uplink like this
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.
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.
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.
VPPInterface: memif
Memifs are used to attach VPP-based workload instances 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:
Slave (client) memif. ifName is set to the name of
NetworkAttachmentDefinition below. It is used as the VPP interface
name in the VPP app:
Sample NetworkAttachmentDefinition with the CNI config from which FPP-CNI has derived the above VPPInterface:
The following additional tunable settings are available for memifs in the CNI config:
numRxQueues(goes intospec.memif.numRxQueueson the slave memif interfaces): number of rx queues, defaults to 1numTxQueues(goes intospec.memif.numTxQueueson the slave memif interfaces): number of tx queues, defaults to 1memifRingSize(goes intospec.memif.ringSize) - the number of entries of RX/TX rings, defaults to 4096memifBufferSize(goes intospec.memif.bufferSize) - size of the buffer allocated for each ring entry, defaults to 2048txPlacementcontrols 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 tonumRxQueueswhich describes the number of RX queues on the client side and thus also the number of TX queues on the VPPSwitch sideclientTxPlacementcontrols core-to-tx-queue assignment on the client side. The number of entries must be equal to thenumTxQueues, each entry corresponding to a tx queue on the client side.
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.
Below is the sample NetworkAttachmentDefinition with the CNI config from which FPP-CNI has derived the above VPPInterface.
It is also possible to specify multiple IP addresses for an interface:
The following additional tunable settings are available for taps in the CNI config:
numRxQueues(goes intospec.tap.numRxQueues): number of rx queues, defaults to 1tapRxRingSize(goes intospec.tap.txRingSize) - the number of entries of TX ring, defaults to 4096tapTxRingSize(goes intospec.tap.txRingSize) - the number of entries of RX ring, defaults to 4096
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 two ways:
- By specifying the name of a particular VPPInterface
- By specifying a set of labels that match a single VPPInterface
Both ways can be used manually on the VPPInterface definition or automatically through the FPP-CNI config in NetworkAttachmentDefinition.
Sample definition of a tap interface with a SPAN source from another interface specified using name:
Sample definition of a tap interface with the SPAN source specified using labels:
Example FPP-CNI NAD with SPAN configuration:
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.
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.
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
af (Address Family). af can be either IPv4 or IPv6. Multiple
routing tables with the same id are allowed; in this case, they're
merged together.
The idea of reconciliation is mostly the same as with the VPPInterfaces:
- Load RoutingTable objects and extract Route records from them
- Load the current VPP FIB table state and convert it to the set of Route records
- Diff two sets
- Add missing Tables to VPP (the tables are never removed afterward b/c it may be a bit too hard to tell if it's empty)
- Delete routes that are in VPP but not in RoutingTables
- 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.
IPFIXExporter objects
IPFIXExporter objects are used to configure IPFIX Exporters in VPP.
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:

CNI Setup diagram for memif interfaces:
