EVPN BUM 流量与 PIM-SM

如果没有 EVPN 和 PIM-SMHER 是将 BUM 流量复制到远程 VTEP 的默认方式,其中入口 VTEP 为每个叠加 BUM 数据包生成与 VTEP 数量相同的副本。在某些部署中,这并非最佳选择。

以下示例显示了 EVPN-PIM 配置,其中底层组播分发 BUM 流量。MDT 优化了底层网络中叠加 BUM 流量的流动。

在以上示例中,host01 发送 ARP 请求以解析 host03。leaf01(除了将数据包洪泛到 host02 之外)还在底层网络上发送封装的数据包,spine 使用 MDT 将其转发到 leaf02 和 leaf03。

对于 PIM-SM,类型 3 路由不会导致任何转发条目。当 VNI 的 BUM 模式为 PIM-SM 时,Cumulus Linux 为第 2 层 VNI 播发类型 3 路由。

如果您使用基于 PIM-SM 的 MDT 进行 EVPN BUM 复制,NVIDIA 建议您使用 EVPN 多宿主

配置组播 VXLAN 隧道

要配置组播 VXLAN 隧道,您需要在底层配置 PIM-SM

  • 在适当的第 3 层接口上启用 PIM-SM
  • 在所有 PIM 路由器上配置静态 RP。
  • RP 上配置 MSDP 以实现 RP 冗余。

有关在底层配置 PIM-SM 的配置步骤,请参阅协议无关组播 - PIM

除了 PIM-SM 配置之外,您还需要在每个 VTEP 上运行以下命令,以提供第 2 层 VNI 到 MDT 的映射。

运行 nv set nve vxlan flooding multicast-group <ip-address> 命令。例如

cumulus@switch:~$ nv set nve vxlan flooding multicast-group 224.0.0.10

编辑 /etc/network/interfaces 文件,并将 vxlan-mcastgrp <ip-address> 添加到接口节中。例如

cumulus@switch:~$ sudo vi /etc/network/interfaces
...
auto vxlan10
iface vxlan10
  vxlan-id 10
  vxlan-mcastgrp 224.0.0.10
  ...

运行 ifreload -a 命令以加载新配置

cumulus@switch:~$ ifreload -a

每个第 2 层 VNI 一个组播组是底层带宽利用率的最佳配置。但是,您可以为多个第 2 层 VNI 指定相同的组播组。

验证 EVPN-PIM

运行 vtysh show ip mroute 命令以查看 FRR 中的组播路由信息。当使用 EVPN-PIM 时,每个 VTEP 都充当 VNI-MDT 组的源和目的地,因此,每个 VTEP 上的 mroute 条目应如下所示

cumulus@switch:~$ sudo vtysh
...
switch# show ip mroute
IP Multicast Routing Table
Flags: S - Sparse, C - Connected, P - Pruned
       R - RP-bit set, F - Register flag, T - SPT-bit set

Source          Group           Flags    Proto  Input            Output           TTL  Uptime
*               224.0.0.10      S        IGMP   swp54            pimreg           1    23:20:54
                                                                 ipmr-lo          1            
10.10.10.1      224.0.0.10      SFT      PIM    lo               swp51            1    23:20:56
*               224.0.0.20      S        IGMP   swp53            pimreg           1    23:20:54
                                                                 ipmr-lo          1            
10.10.10.1      224.0.0.20      SFT      PIM    lo               swp52            1    23:20:56
*               224.0.0.30      S        IGMP   swp51            pimreg           1    23:20:54
                                                                 ipmr-lo          1            
10.10.10.1      224.0.0.30      SFT      PIM    lo               swp53            1    23:20:56

(*,G) 条目应在 OIL(传出接口列表)中显示 ipmr-lo,(S,G) 条目应显示 lo 作为源接口或传入接口,并在 OIL 中显示 ipmr-lo

运行 ip mroute 命令以查看内核中的组播路由信息。内核信息应与 FRR 信息匹配。

cumulus@switch:~$ ip mroute
(10.10.10.1,224.0.0.30)          Iif: lo         Oifs: swp53  State: resolved
(10.10.10.1,224.0.0.20)          Iif: lo         Oifs: swp52  State: resolved
(10.10.10.1,224.0.0.10)          Iif: lo         Oifs: swp51  State: resolved
(0.0.0.0,224.0.0.10)             Iif: swp54      Oifs: pimreg ipmr-lo swp54  State: resolved
(0.0.0.0,224.0.0.20)             Iif: swp53      Oifs: pimreg ipmr-lo swp53  State: resolved
(0.0.0.0,224.0.0.30)             Iif: swp51      Oifs: pimreg ipmr-lo swp51  State: resolved

运行 bridge fdb show | grep 00:00:00:00:00:00 命令以验证每个 VXLAN 设备的所有零 MAC 地址是否都指向正确的组播组目的地。

cumulus@switch:~$ bridge fdb show | grep 00:00:00:00:00:00
00:00:00:00:00:00 dev vxlan10 dst 224.0.0.10 self permanent
00:00:00:00:00:00 dev vxlan20 dst 224.0.0.20 self permanent

show ip mroute count 命令通常用于检查组播数据包计数,但会更新 VTEP 上始发或终止的封装 BUM 流量。

运行 vtysh show evpn vni <vni> 命令以确保您的第 2 层 VNI 具有正确的洪泛信息

cumulus@switch:~$ sudo vtysh
switch# show evpn vni 10
VNI: 10
 Type: L2
 Tenant VRF: default
 VxLAN interface: vni10
 VxLAN ifIndex: 18
 Local VTEP IP: 10.10.10.1
 Mcast group: 224.0.0.10   <<<<<<<
 Remote VTEPs for this VNI:
  10.10.10.3 flood: -
 Number of MACs (local and remote) known for this VNI: 6
 Number of ARPs (IPv4 and IPv6, local and remote) known for this VNI: 14
 Advertise-gw-macip: No

配置示例

以下示例显示了 VTEP 上的 EVPN-PIM 配置,其中

  • PIM 在 swp51 到 swp54 和环回接口上(请参阅下面的 /etc/frr/frr.conf 文件示例)。
  • 组映射 10.10.100.100 用于静态 RP(请参阅下面的 /etc/frr/frr.conf 文件示例的顶部)。
  • 组播组 224.0.0.10 映射到 VNI10,组播组 224.0.0.20 映射到 VNI20,组播组 224.0.0.30 映射到 VNI30(请参阅下面的 /etc/network/interfaces 文件示例)。
cumulus@leaf01:~$ sudo cat /etc/frr/frr.conf
...
ip pim rp 10.10.100.100
ip pim keep-alive-timer 3600
ip pim ecmp
service integrated-vtysh-config
vrf BLUE
 vni 4002
 exit-vrf
vrf RED
 vni 4001
 exit-vrf
vrf mgmt
 ip route 0.0.0.0/0 192.168.200.1
 exit-vrf
interface swp51
 ip pim
interface swp52
 ip pim
interface swp53
 ip pim
interface swp54
 ip pim
interface lo
 ip igmp
 ip pim
 ip pim use-source 10.10.10.1
router bgp 65101
 bgp router-id 10.10.10.1
 neighbor underlay peer-group
 neighbor underlay remote-as external
 neighbor swp51 interface peer-group underlay
 neighbor swp52 interface peer-group underlay
 neighbor swp53 interface peer-group underlay
 neighbor swp54 interface peer-group underlay
 !
 address-family ipv4 unicast
  redistribute connected
 exit-address-family
 !
 address-family l2vpn evpn
  neighbor underlay activate
  advertise-all-vni
 exit-address-family
 !
router bgp 65101 vrf RED
 bgp router-id 10.10.10.1
 !
 address-family ipv4 unicast
  redistribute connected
 exit-address-family
 !
 address-family l2vpn evpn
  advertise ipv4 unicast
 exit-address-family
!
router bgp 65101 vrf BLUE
 bgp router-id 10.10.10.1
 !
 address-family ipv4 unicast
  redistribute connected
 exit-address-family
 !
 address-family l2vpn evpn
  advertise ipv4 unicast
 exit-address-family
cumulus@leaf01:~$ sudo cat /etc/network/interfaces
...
auto lo
iface lo inet loopback
    address 10.10.10.1/32
    vxlan-local-tunnelip 10.10.10.1

auto eth0
iface eth0
    vrf mgmt
    address 192.168.200.11/24

auto mgmt
iface mgmt
  vrf-table auto
  address 127.0.0.1/8
  address ::1/128

auto RED
iface RED
  vrf-table auto

auto BLUE
iface BLUE
  vrf-table auto

auto bridge
iface bridge
    bridge-ports bond1 bond2 bond3
    bridge-ports vni10 vni20 vni30 vniRED vniBLUE 
    bridge-vids 10 20 30
    bridge-vlan-aware yes

auto vni10
iface vni10
    bridge-access 10
    vxlan-id 10
    mstpctl-portbpdufilter yes
    mstpctl-bpduguard yes
    bridge-learning off
    bridge-arp-nd-suppress on
    vxlan-mcastgrp 224.0.0.10

auto vni20
iface vni20
    bridge-access 20
    vxlan-id 20
    mstpctl-portbpdufilter yes
    mstpctl-bpduguard yes
    bridge-learning off
    bridge-arp-nd-suppress on
    vxlan-mcastgrp 224.0.0.20

auto vni30
iface vni30
    bridge-access 30
    vxlan-id 30
    mstpctl-portbpdufilter yes
    mstpctl-bpduguard yes
    bridge-learning off
    bridge-arp-nd-suppress on
    vxlan-mcastgrp 224.0.0.30

auto vniRED
iface vniRED
    bridge-access 4001
    vxlan-id 4001
    mstpctl-portbpdufilter yes
    mstpctl-bpduguard yes
    bridge-learning off
    bridge-arp-nd-suppress on

auto vniBLUE
iface vniBLUE
    bridge-access 4002
    vxlan-id 4002
    mstpctl-portbpdufilter yes
    mstpctl-bpduguard yes
    bridge-learning off
    bridge-arp-nd-suppress on

auto vlan10
iface vlan10
    address 10.1.10.2/24
    address-virtual 00:00:00:00:00:10 10.1.10.1/24
    vrf RED
    vlan-raw-device bridge
    vlan-id 10

auto vlan20
iface vlan20
    address 10.1.20.2/24
    address-virtual 00:00:00:00:00:20 10.1.20.1/24
    vrf RED
    vlan-raw-device bridge
    vlan-id 20

auto vlan30
iface vlan30
    address 10.1.30.2/24
    address-virtual 00:00:00:00:00:30 10.1.30.1/24
    vrf BLUE
    vlan-raw-device bridge
    vlan-id 30

auto vlan4001
iface vlan4001
    hwaddress 44:38:39:BE:EF:AA
    vrf RED
    vlan-raw-device bridge
    vlan-id 4001

auto vlan4002
iface vlan4002
    hwaddress 44:38:39:BE:EF:AA
    vrf BLUE
    vlan-raw-device bridge
    vlan-id 4002

auto swp51
iface swp51
    alias to spine

auto swp52
iface swp52
    alias to spine

auto swp53
iface swp53
    alias to spine

auto swp54
iface swp54
    alias to spine

auto swp1
iface swp1
    alias bond member of bond1

auto bond1
iface bond1
    bond-slaves swp1 
    bridge-access 10
    mtu 9000
    bond-lacp-bypass-allow yes
    mstpctl-bpduguard yes
    mstpctl-portadminedge yes

auto swp2
iface swp2
    alias bond member of bond2

auto bond2
iface bond2
    bond-slaves swp2 
    bridge-access 20
    mtu 9000
    bond-lacp-bypass-allow yes
    mstpctl-bpduguard yes
    mstpctl-portadminedge yes

auto swp3
iface swp3
    alias bond member of bond3

auto bond3
iface bond3
    bond-slaves swp3 
    bridge-access 30
    mtu 9000
    bond-lacp-bypass-allow yes
    mstpctl-bpduguard yes
    mstpctl-portadminedge yes

在 VXLAN 主动-主动模式下配置 EVPN-PIM

要在 VXLAN 主动-主动模式下使用 MLAG 对配置 EVPN-PIM,请在每个 MLAG 对等交换机的对等链路子接口上启用 PIM(除了上面 配置组播 VXLAN 隧道中描述的配置之外)。

运行 nv set interface <peerlink> router pim 命令。例如

cumulus@switch:~$ nv set interface peerlink.4094 router pim
cumulus@switch:~$ nv config apply

在 vtysh shell 中,运行以下命令

cumulus@switch:~$ sudo vtysh

switch# configure terminal
switch(config)# interface peerlink.4094
switch(config-if)# ip pim
switch(config-if)# end
switch# write memory
switch# exit
cumulus@switch:~$