> For the complete documentation index, see [llms.txt](https://docs.cennso.com/components/fpp/3.2/llms.txt) (all documentation: [llms.txt](https://docs.cennso.com/llms.txt)). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cennso.com/components/fpp/3.2/deployment-guides/multinode-xdp.md).

# Deploy Fast Path Provider on multiple nodes using AF_XDP

This document describes the prerequisites and steps for a multi-node deployment of Fast Path Provider (FPP) using AF_XDP driver. This guide uses the **fpp-af-xdp** composition, which automatically creates a macvlan NetworkAttachmentDefinition for uplink connectivity.

For deployments using SRIOV, see [SRIOV Networks as uplinks](https://docs.cennso.com/components/fpp/3.2/deployment-guides/multinode-sriov.md). For direct NIC assignment, see [direct NIC assignment](https://docs.cennso.com/components/fpp/3.2/deployment-guides/multinode-direct-nic.md).

## Prerequisites

- [Requirements](https://docs.cennso.com/components/fpp/3.2/requirements.md)
- [VPP Operator deployed](https://docs.cennso.com/components/fpp/3.2/deployment-guides/vppoperator-deployment.md)
- Ensure you [use linux kernel 6.X](https://docs.cennso.com/components/fpp/3.2/requirements.md#af_xdp-requirements) to successfully create AF_XDP interfaces for your uplinks.

Terminology used in the installation document:

- FPP node - FPP pod in the `node` mode, which acts as a virtual switch on each Data Plane node
- Uplink - network interface, virtual or physical, which is used by FPP node to communicate inside the cluster and create a VXLAN mesh to interconnect workload CNFs between nodes

## How it works

The **fpp-af-xdp** composition uses the AF_XDP (Address Family - eXpress Data Path) driver for uplink connectivity. Unlike DPDK or SRIOV, AF_XDP works with standard Linux network interfaces without requiring specialized hardware or drivers.

The composition automatically:
1. Creates a macvlan NetworkAttachmentDefinition on the target cluster
2. Configures the FPP pods to use AF_XDP NIC mappings with the macvlan interface
3. Uses [Whereabouts](https://github.com/k8snetworkplumbingwg/whereabouts) for IP address management within the uplink network

## Steps

1. **Identify the network interface on the Core Cluster nodes** that you intend to use for FPP uplinks. Any Linux interface with cross-node connectivity is suitable.
1. **Create an `FPPDeployment` object** on the Management Cluster using the **fpp-af-xdp** composition, and [configure its basic options](#basic-configuration).
1. **Configure the AF_XDP uplinks** by properly defining the [**spec.afXDPComposition** field](#af_xdp-uplink-configuration).
1. **Adjust the VPP configuration** as needed. Refer to the [available configuration options](#vpp-configuration) for more details.
1. **Verify the FPPDeployment status** to ensure it is [working correctly](#verification).

### Configuration example

```yaml
# Apply this on the Management Cluster
apiVersion: fpp.cennso.com/v1alpha1
kind: FPPDeployment
metadata:
  name: multi-node-xdp-fpp-node
  namespace: cennso-infra
spec:
  version: <version>
  compositionRef:
    name: fpp-af-xdp
  connectionSecretRef:
    name: example-core-cluster
    namespace: cennso-infra
  operatorRef:
    name: node-operator
    namespace: cennso-infra
  targetNamespace: fpp

  afXDPComposition:
    masterInterface: bond0
    uplinkCIDR: "10.10.0.0/24"

  buffersPerNuma: 256000
  heapSize: "3G"
  useHugepages: true
  resources:
    cpu: "10"
    memory: 2Gi
    hugepages-2Mi: 5Gi
  nodeSelector:
    node-role.cennso.net/worker: dataplane
```

### Configuration options

#### Basic configuration

For basic FPPDeployment options, see [Single Node deployment guide](https://docs.cennso.com/components/fpp/3.2/deployment-guides/single-node.md#basic-configuration-options).

For purpose of this guide, we will use linux kernel interface `bond0`.

#### Enable FPP Overlay Network monitoring

FPP 3.0.5 introduces node-to-node monitoring using an `FPPNetwork` with VXLAN VNI 1 over the Uplink interface. You can enable this feature (disabled by default) by setting **spec.enableUplinkMonitoring** to `true` within the `FPPDeployment`, and then monitor the network state on the `FPP Overview` Grafana dashboard. For more details, [see the docs](https://docs.cennso.com/components/fpp/3.2/observability/network-monitoring.md).

#### AF_XDP uplink configuration

The **spec.afXDPComposition** section configures the uplink network:

- **masterInterface** - Name of the host network interface to use as the master for the macvlan network attachment (e.g., `bond0`, `eth0`). This interface must exist on all Data Plane nodes.
- **uplinkCIDR** - CIDR for the FPP overlay network (e.g., `10.10.0.0/24`). Each FPP pod receives an IP address from this range via Whereabouts.

```yaml
afXDPComposition:
  masterInterface: bond0
  uplinkCIDR: "10.10.0.0/24"
```

> **NOTE**: AF_XDP uses a single uplink interface, so bonding configuration is not applicable. For bonded uplinks, use the [SRIOV deployment](https://docs.cennso.com/components/fpp/3.2/deployment-guides/multinode-sriov.md) instead.

#### VPP configuration

You can customize VPP behavior through the **spec.vppConfigs** field. A typical configuration for multi-node deployments:

```yaml
vppConfigs:
- nodeName: ""
  spec:
    afterCommands:
      - set ip neighbor-config ip4 age 5
    uplinkConfig:
      prefixLen4: 24
      prefixLen6: 64
```

## Verification

First, check if FPPDeployment was [setup correctly](https://docs.cennso.com/components/fpp/3.2/deployment-guides/single-node.md#verification).

Next, verify that the `fpp-node-macvlan` NetworkAttachmentDefinition was created on the Core Cluster:

```bash
kubectl get net-attach-def fpp-node-macvlan -n fpp -oyaml
```

Sample output:

```yaml
apiVersion: k8s.cni.cncf.io/v1
kind: NetworkAttachmentDefinition
metadata:
  name: fpp-node-macvlan
  namespace: fpp
spec:
  config: |
    {
      "cniVersion": "0.3.1",
      "type": "macvlan",
      "master": "bond0",
      "mode": "bridge",
      "ipam": {
        "type": "whereabouts",
        "range": "10.10.0.0/24"
      }
    }
```

The uplink interfaces are created for each worker node, you can verify its existence using `kubectl` on the Core Cluster:

```bash
kubectl get vppinterfaces.fpp-manager.cennso.com -n fpp -owide
```

Sample output:
```
NAME                                     IFNAME        READY
nic-node-{worker-node-name-1}-uplink-0   uplink-xdp0   true
nic-node-{worker-node-name-2}-uplink-0   uplink-xdp0   true
```

You can also verify the VPP interfaces by running the following command in the FPP node pods:

```bash
vppctl show interfaces
```

Sample output:

```
              Name               Idx    State  MTU (L3/IP4/IP6/MPLS)     Counter          Count
local0                            0     down          0/0/0/0
uplink-xdp0                       17     up          9000/0/0/0     rx packets                    22
                                                                    rx bytes                    2569
                                                                    drops                         22
                                                                    ip6                            1
```

Once enabled in the `FPPDeployment`, you can verify node-to-node connectivity by viewing the [FPP Overlay Network status on the FPP Overview Grafana dashboard](https://docs.cennso.com/components/fpp/3.2/observability/dashboard-fpp.md#fpp-overlay-network-status).

Otherwise, you can initiate a manual ping using the `uplink-xdp0` interface. First, determine the IP addresses of the FPP nodes by executing the following `kubectl` command on the Core Cluster:

```bash
kubectl get vppinterface -o jsonpath='{range .items[*]}{.metadata.name}{"\t"}{.spec.ips[*]}{"\n"}{end}' -n fpp
```

Sample output:

```
nic-node-{worker-node-name-1}-uplink-0  10.10.0.1/24
nic-node-{worker-node-name-2}-uplink-0  10.10.0.2/24
```

This IP address is allocated from the IPAM range defined in the FPPDeployment's **spec.afXDPComposition.uplinkCIDR** field (e.g., `10.10.0.0/24`).

Next, execute the `vppctl ping` command within the FPP node pod located on the `{worker-node-name-1}` node:

```bash
vppctl ping 10.10.0.2 source uplink-xdp0
```

Proper output:

```
116 bytes from 10.10.0.2: icmp_seq=1 ttl=64 time=.1339 ms
116 bytes from 10.10.0.2: icmp_seq=2 ttl=64 time=.1366 ms
116 bytes from 10.10.0.2: icmp_seq=3 ttl=64 time=.1177 ms
116 bytes from 10.10.0.2: icmp_seq=4 ttl=64 time=.1184 ms
116 bytes from 10.10.0.2: icmp_seq=5 ttl=64 time=.1187 ms

Statistics: 5 sent, 5 received, 0% packet loss
```
