Using high performance multicast

You can use multicast on your Single Root I/O Virtualization (SR-IOV) hardware network.

Configuring high performance multicast

The OpenShift SDN default Container Network Interface (CNI) network provider supports multicast between pods on the default network. This is best used for low-bandwidth coordination or service discovery, and not high-bandwidth applications. For applications such as streaming media, like Internet Protocol television (IPTV) and multipoint videoconferencing, you can utilize Single Root I/O Virtualization (SR-IOV) hardware to provide near-native performance.

When using additional SR-IOV interfaces for multicast:

  • Multicast packages must be sent or received by a pod through the additional SR-IOV interface.

  • The physical network which connects the SR-IOV interfaces decides the multicast routing and topology, which is not controlled by OKD.

Using an SR-IOV interface for multicast

The follow procedure creates an example SR-IOV interface for multicast.

Prerequisites

  • Install the OpenShift CLI (oc).

  • You must log in to the cluster with a user that has the cluster-admin role.

Procedure

  1. Create a SriovNetworkNodePolicy object:

    1. apiVersion: sriovnetwork.openshift.io/v1
    2. kind: SriovNetworkNodePolicy
    3. metadata:
    4. name: policy-example
    5. namespace: openshift-sriov-network-operator
    6. spec:
    7. resourceName: example
    8. nodeSelector:
    9. feature.node.kubernetes.io/network-sriov.capable: "true"
    10. numVfs: 4
    11. nicSelector:
    12. vendor: "8086"
    13. pfNames: ['ens803f0']
    14. rootDevices: ['0000:86:00.0']
  2. Create a SriovNetwork object:

    1. apiVersion: sriovnetwork.openshift.io/v1
    2. kind: SriovNetwork
    3. metadata:
    4. name: net-example
    5. namespace: openshift-sriov-network-operator
    6. spec:
    7. networkNamespace: default
    8. ipam: | (1)
    9. {
    10. "type": "host-local", (1)
    11. "subnet": "10.56.217.0/24",
    12. "rangeStart": "10.56.217.171",
    13. "rangeEnd": "10.56.217.181",
    14. "routes": [
    15. {"dst": "224.0.0.0/5"},
    16. {"dst": "232.0.0.0/5"}
    17. ],
    18. "gateway": "10.56.217.1"
    19. }
    20. resourceName: example
    1If you choose to configure DHCP as IPAM, ensure that you provision the following default routes through your DHCP server: 224.0.0.0/5 and 232.0.0.0/5. This is to override the static multicast route set by the default network provider.
  3. Create a pod with multicast application:

    1. apiVersion: v1
    2. kind: Pod
    3. metadata:
    4. name: testpmd
    5. namespace: default
    6. annotations:
    7. k8s.v1.cni.cncf.io/networks: nic1
    8. spec:
    9. containers:
    10. - name: example
    11. image: rhel7:latest
    12. securityContext:
    13. capabilities:
    14. add: ["NET_ADMIN"] (1)
    15. command: [ "sleep", "infinity"]
    1The NET_ADMIN capability is required only if your application needs to assign the multicast IP address to the SR-IOV interface. Otherwise, it can be omitted.