intel / afxdp-plugins-for-kubernetes

Apache License 2.0
44 stars 16 forks source link

working of AF_XDP plugin #48

Open chmodshubham opened 1 year ago

chmodshubham commented 1 year ago

Working of AF_XDP Plugin

I am trying to understand how the AF_XDP plugin for K8s works, correct me if I am wrong.

In Primary mode

Packets Flow:

packets -> primary device(physical NIC) -> NIC Driver(applies the XDP program at the hook) -> AF_XDP socket(outside the pod) -> pod

Components Role:

  1. AF_XDP plugin is responsible to create af_xdp sockets for each pod
  2. AF_XDP CNI is responsible for configuring the network interfaces of the pods

In CDQ mode

Packets Flow:

packets -> primary device(physical NIC) -> NIC Driver(applies the XDP program at the hook) -> subfunction(resides outside the pod but in the userspace) -> AF_XDP socket(outside the pod) -> pod

Components Role:

  1. NIC Driver creates the subfunction and assigns it to AF_XDP CNI to manage.
  2. AF_XDP plugin creates the AF_XDP socket at the userspace, outside the pod. it commands the driver to create a new subfunction(outside the pod) based on requirements.
  3. AF_XDP CNI is responsible for assigning subfunctions to the respective pods.

Note: I had seen the image of AF_XDP high-level Arch, but not sure about the implementation of the subfunction and AF_XDP socket inside the pod. Correct me if it is implemented the same as what was there.

Thank you in advance!