Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v1.15] Multicast Datapath Backport #31668

Merged

Commits on Mar 29, 2024

  1. bpf,multicast: add map infrastructure

    [ upstream commit b7822a3 ]
    
    This commit adds the eBPF map used to implement the synthetic multicast
    feature.
    
    A `BPF_MAP_TYPE_HASH_OF_MAPS`, which employees a `BPF_MAP_TYPE_HASH`
    inner map, is added to the datapath.
    
    The outer eBPF map is keyed by IPv4 multicast group addresses in big
    endian format and the values are `BPF_MAP_TYPE_HASH` maps.
    
    The inner hash map associates IPv4 source addresses with their
    subscriber multicast metadata.
    
    Each key/value in the inner hash map is a subscriber of the owning
    multicast group.
    
    Signed-off-by: Louis DeLosSantos <louis.delos@isovalent.com>
    ldelossa committed Mar 29, 2024
    Configuration menu
    Copy the full SHA
    1c04091 View commit details
    Browse the repository at this point in the history
  2. bpf,mcast: initial IGMPv3 parsing in bpf_lxc

    [ upstream commit d7e580f ]
    
    This commit introduces IGMPv3 detection and parsing.
    
    When bpf_lxc recognizes IGMP messages egressing the Pod we attempt to
    parse them.
    
    The parsing logic is as follows:
    1. Determine if traffic is IGMP
    2. Determine the IGMP message type
    3. If the type is not a membership report simply drop it (for now)
    4. Parse each group record in the membership report
    5. For any group records which indicate a join add a subscriber to the
       multicast subscriber map, if it exists.
    
    Signed-off-by: Louis DeLosSantos <louis.delos@isovalent.com>
    ldelossa committed Mar 29, 2024
    Configuration menu
    Copy the full SHA
    2edf21c View commit details
    Browse the repository at this point in the history
  3. bpf,igmp: igmpv2 join and leave parsing

    [ upstream commit 8c488dd ]
    
    This commit adds parsing of IGMPv2 messages in a similar fashion as
    IGMPv3 messages.
    
    Signed-off-by: Louis DeLosSantos <louis.delos@isovalent.com>
    ldelossa committed Mar 29, 2024
    Configuration menu
    Copy the full SHA
    4a0de05 View commit details
    Browse the repository at this point in the history
  4. bpf: implement multicast delivery

    [ upstream commit 2afcb61 ]
    
    This commit implements replication and delivery of multicast packets.
    
    This commit also enables the Cilium datapath to access both `bpf_clone_redirect`
    and `bpf_map_for_each_elem` helpers.
    
    The datapath flow is illustrated below:
    
    ┌──────────────────────────────────────────┐
    │                                          │
    │  Sender                                  │
    │  ┌──────┐     ┌─────────┐                │
    │  │ pod  ├─────► bpf_lxc │                │
    │  └──────┘     └────┬────┘                │
    │  Local Receivers   │  eBPF Replication   │
    │  ┌──────┐ ┌──────┐ │  and Redirection    │
    │  │ pod  ◄─┤ veth ◄─┤(cil_from_container) │
    │  └──────┘ └──────┘ │ ┌───────┐           │
    │                    ├─► vxlan │           │
    │  ┌──────┐ ┌──────┐ │ └───┬───┘           │
    │  │ pod  ◄─┤ veth ◄─┘     │               │
    │  └──────┘ └──────┘  ┌────┘               │
    │                     │                    │
    └─────────────────────┼────────────────────┘
                          │
    ┌─────────────────────┼────────────────────┐
    │                     │                    │
    │                 ┌───▼───┐                │
    │                 │ vxlan │                │
    │                 └───┬───┘                │
    │   Remote Receivers  │  eBPF Replication  │
    │   ┌──────┐ ┌──────┐ │  and Redirection   │
    │   │ pod  ◄─┤ veth ◄─┤  (from_overlay)    │
    │   └──────┘ └──────┘ │                    │
    │                     │                    │
    │   ┌──────┐ ┌──────┐ │                    │
    │   │ pod  ◄─┤ veth ◄─┘                    │
    │   └──────┘ └──────┘                      │
    │                                          │
    └──────────────────────────────────────────┘
    
    A multicast sender sends a multicast packet.
    
    The sender's bpf_lxc program does a lookup in the multicast group map to
    discover who has subscribed to the group.
    
    The program then clones and redirects the packets to the subscriber's
    ingress device on the host namespace.
    
    If the subscriber is remote the packet is cloned and redirected to a
    vxlan device for encapsulation.
    
    Once the host stack forwards the vxlan encap'd packet to the receiving
    vxlan device on the remote host a similar "clone and redirect" process
    is performed once the vxlan driver decaps the packet.
    
    Signed-off-by: Louis DeLosSantos <louis.delos@isovalent.com>
    ldelossa committed Mar 29, 2024
    Configuration menu
    Copy the full SHA
    7255b3b View commit details
    Browse the repository at this point in the history
  5. bpf: sync test data

    Signed-off-by: Louis DeLosSantos <louis.delos@isovalent.com>
    ldelossa committed Mar 29, 2024
    Configuration menu
    Copy the full SHA
    a07fd93 View commit details
    Browse the repository at this point in the history