示例:在交换机上的 PIM 域中配置仅组播快速重新路由
此示例说明如何配置仅组播快速重新路由 (MoFRR),以便在发生链路故障时将网络中的数据包丢失降至最低。它通过增强组播路由协议,即协议无关组播 (PIM) 来工作。
MoFRR 从接收器向主路径上的源传输组播加入消息,同时还从接收器向备用路径上的源传输辅助组播加入消息。从主路径和备份路径接收数据包。冗余数据包将根据优先级(分配给主路径和备份路径的权重)在拓扑合并点被丢弃。当在主路径上检测到故障时,可以通过更改接受数据包的接口到辅助接口来进行修复。由于修复在本地进行,因此速度很快,在主路径上发生链路故障时,可以大大缩短收敛时间。
要求
配置此示例之前,不需要除设备初始化之外的特殊配置。
此示例使用 QFX 系列交换机,并且只有出口提供商边缘 (PE) 设备启用了 MoFRR。此外,此拓扑可能包括用于未启用 MoFRR 的其他设备的 MX 系列路由器;在这种情况下,请用相应的接口替换用于主或备用组播流量流的 MX 系列设备端口。
此示例要求运行 MoFRR 的设备上安装 Junos OS 17.4R1 或更高版本。
概述
在此示例中,设备 R3 是出口边缘设备。仅在此设备上启用 MoFRR。
OSPF 或 IS-IS 用于连接,但也可使用任何内部网关协议 (IGP) 或静态路由。
PIM 稀疏模式版本 2 已在 PIM 域中的所有设备上启用。设备 R1 用作集合点 (RP)。
除 MoFRR 外,设备 R3 还启用了 PIM 加入负载平衡。
出于测试目的,路由或交换设备用于模拟组播源和接收器。设备 R3 配置为使用 set protocols igmp interface xe-0/0/15.0 static group 225.1.1.1
命令以静态方式加入所需组。它只是加入,而不是倾听。xe-0/0/15.0 接口是面向接收器的设备 R3 接口。当真正的组播接收器主机不可用时(如本例所示),此静态 IGMP 配置非常有用。在接收器上,要侦听组播组地址,此示例使用 set protocols sap listen 225.1.1.1
。对于要发送组播流量的源,将从源设备发出组播 ping。ping 命令为 ping 225.1.1.1 bypass-routing interface xe-0/0/10.0 ttl 10 count 1000000000
。xe-0/0/10.0 接口是面向设备 R1 的源接口。
MoFRR 配置包括多个选项,这些选项在此示例中未显示,但将单独说明。选项如下:
stream-protection { mofrr-asm-starg; mofrr-disjoint-upstream-only; mofrr-no-backup-join; mofrr-primary-path-selection-by-routing; policy policy-name; }
CLI 快速配置
CLI 快速配置
要快速配置此示例,请复制以下命令,将其粘贴到文本文件中,删除所有换行符,更改详细信息,以便与网络配置匹配,然后将命令复制并粘贴到层 [edit]
级的 CLI 中。
设备 R1
set interfaces xe-0/0/10 unit 0 family inet address 10.0.0.2/30 set interfaces xe-0/0/11 unit 0 family inet address 10.0.0.5/30 set interfaces xe-0/0/12 unit 0 family inet address 10.0.0.17/30 set interfaces lo0 unit 0 family inet address 192.168.0.1/32 set protocols ospf area 0.0.0.0 interface xe-0/0/10.0 set protocols ospf area 0.0.0.0 interface xe-0/0/11.0 set protocols ospf area 0.0.0.0 interface lo0.0 passive set protocols ospf area 0.0.0.0 interface xe-0/0/12.0 set protocols pim rp local family inet address 192.168.0.1 set protocols pim interface all mode sparse set protocols pim interface all version 2
设备 R2
set interfaces xe-0/0/11 unit 0 family inet address 10.0.0.6/30 set interfaces xe-0/0/13 unit 0 family inet address 10.0.0.9/30 set interfaces lo0 unit 0 family inet address 192.168.0.2/32 set protocols ospf area 0.0.0.0 interface xe-0/0/11.0 set protocols ospf area 0.0.0.0 interface xe-0/0/13.0 set protocols ospf area 0.0.0.0 interface lo0.0 passive set protocols pim rp static address 192.168.0.1 set protocols pim interface all mode sparse set protocols pim interface all version 2
设备 R3
set interfaces xe-0/0/13 unit 0 family inet address 10.0.0.10/30 set interfaces xe-0/0/15 unit 0 family inet address 10.0.0.13/30 set interfaces xe-0/0/14 unit 0 family inet address 10.0.0.22/30 set interfaces lo0 unit 0 family inet address 192.168.0.3/32 set protocols igmp interface xe-0/0/15.0 static group 225.1.1.1 set protocols ospf area 0.0.0.0 interface xe-0/0/13.0 set protocols ospf area 0.0.0.0 interface xe-0/0/15.0 set protocols ospf area 0.0.0.0 interface lo0.0 passive set protocols ospf area 0.0.0.0 interface xe-0/0/14.0 set protocols pim rp static address 192.168.0.1 set protocols pim interface all mode sparse set protocols pim interface all version 2 set protocols pim join-load-balance automatic set policy-options policy-statement load-balancing-policy then load-balance per-packet set routing-options forwarding-table export load-balancing-policy set routing-options multicast stream-protection
设备 R6
set interfaces xe-0/0/12 unit 0 family inet address 10.0.0.18/30 set interfaces xe-0/0/14 unit 0 family inet address 10.0.0.21/30 set interfaces lo0 unit 0 family inet address 192.168.0.6/32 set protocols ospf area 0.0.0.0 interface xe-0/0/12.0 set protocols ospf area 0.0.0.0 interface xe-0/0/14.0 set protocols ospf area 0.0.0.0 interface lo0.0 passive set protocols pim rp static address 192.168.0.1 set protocols pim interface all mode sparse set protocols pim interface all version 2
设备源
set interfaces xe-0/0/10 unit 0 family inet address 10.0.0.1/30 set interfaces lo0 unit 0 family inet address 192.168.0.4/32 set protocols ospf area 0.0.0.0 interface xe-0/0/10.0 set protocols ospf area 0.0.0.0 interface lo0.0 passive
设备接收器
set interfaces xe-0/0/15 unit 0 family inet address 10.0.0.14/30 set interfaces lo0 unit 0 family inet address 192.168.0.5/32 set protocols sap listen 225.1.1.1 set protocols ospf area 0.0.0.0 interface xe-0/0/15.0 set protocols ospf area 0.0.0.0 interface lo0.0 passive
分步配置
程序
分步过程
下面的示例要求您在各个配置层级中进行导航。有关 CLI 导航的信息,请参阅《Junos OS CLI 用户指南》中的在配置模式下使用 CLI 编辑器。
要配置设备 R3,请执行以下操作:
配置设备接口。
[edit interfaces] user@R3# set xe-0/0/13 unit 0 family inet address 10.0.0.10/30 user@R3# set xe-0/0/15 unit 0 family inet address 10.0.0.13/30 user@R3# set xe-0/0/14 unit 0 family inet address 10.0.0.22/30 user@R3# set lo0 unit 0 family inet address 192.168.0.3/32
仅出于测试目的,在面向标记为 Receiver 的设备的接口上,模拟 IGMP 加入。
如果测试环境具有接收器主机,则不需要执行此步骤。
[edit protocols igmp interface xe-0/0/15.0] user@R3# set static group 225.1.1.1
配置 IGP 或静态路由。
[edit protocols ospf area 0.0.0.0] user@R3# set interface xe-0/0/13.0 user@R3# set interface xe-0/0/15.0 user@R3# set interface lo0.0 passive user@R3# set interface xe-0/0/14.0
配置 PIM。
[edit protocols pim] user@R3# set rp static address 192.168.0.1 user@R3# set interface all mode sparse user@R3# set interface all version 2
(选答)配置 PIM 加入负载平衡。
[edit protocols pim] user@R3# set join-load-balance automatic
(选答)配置按数据包的负载平衡。
[edit policy-options policy-statement load-balancing-policy] user@R3# set then load-balance per-packet [edit routing-options forwarding-table] user@R3# set export load-balancing-policy
启用 MoFRR。
[edit routing-options multicast] user@R3# set stream-protection
结果
在配置模式下,输入show interfaces
、show protocols
show policy-options
、和show routing-options
命令,以确认您的配置。如果输出未显示预期的配置,请重复此示例中的说明以更正配置。
user@R3# show interfaces xe-0/0/13 { unit 0 { family inet { address 10.0.0.10/30; } } } xe-0/0/14 { unit 0 { family inet { address 10.0.0.22/30; } } } xe-0/0/15 { unit 0 { family inet { address 10.0.0.13/30; } } } lo0 { unit 0 { family inet { address 192.168.0.3/32; } } }
user@R3# show protocols igmp { interface xe-0/0/15.0 { static { group 225.1.1.1; } } } ospf { area 0.0.0.0 { interface xe-0/0/13.0; interface xe-0/0/15.0; interface lo0.0 { passive; } interface xe-0/0/14.0; } } pim { rp { static { address 192.168.0.1; } } interface all { mode sparse; version 2; } join-load-balance { automatic; } }
user@R3# show policy-options policy-statement load-balancing-policy { then { load-balance per-packet; } }
user@R3# show routing-options forwarding-table { export load-balancing-policy; } multicast { stream-protection; }
如果完成设备配置,请从配置模式输入 commit
。
验证
确认配置工作正常。
将组播流量发送到 PIM 域
目的
使用组播 ping 命令模拟组播流量。
行动
user@Source> ping 225.1.1.1 bypass-routing interface xe-0/0/10.0 ttl 10 count 1000000000 PING 225.1.1.1 (225.1.1.1): 56 data bytes 64 bytes from 10.0.0.14: icmp_seq=1 ttl=61 time=0.845 ms 64 bytes from 10.0.0.14: icmp_seq=2 ttl=61 time=0.661 ms 64 bytes from 10.0.0.14: icmp_seq=3 ttl=61 time=0.615 ms 64 bytes from 10.0.0.14: icmp_seq=4 ttl=61 time=0.640 ms
意义
设备源上面向设备 R1 的接口为 xe-0/0/10.0。请记住,默认情况下,组播 ping 的 TTL 为 1,因此您必须使用选项 ttl
。
验证上游接口
目的
确保出口设备有两个用于组播组联接的上游接口。
行动
user@R3> show pim join 225.1.1.1 extensive sg Instance: PIM.master Family: INET R = Rendezvous Point Tree, S = Sparse, W = Wildcard Group: 225.1.1.1 Source: 10.0.0.1 Flags: sparse,spt Active upstream interface: xe-0/0/13.0 Active upstream neighbor: 10.0.0.9 MoFRR Backup upstream interface: xe-0/0/14.0 MoFRR Backup upstream neighbor: 10.0.0.21 Upstream state: Join to Source, No Prune to RP Keepalive timeout: 354 Uptime: 00:00:06 Downstream neighbors: Interface: xe-0/0/15.0 10.0.0.13 State: Join Flags: S Timeout: Infinity Uptime: 00:00:06 Time since last Join: 00:00:06 Number of downstream interfaces: 1
意义
输出显示了一个活动的上游接口和邻居,以及一个 MoFRR 备份上游接口和邻居。
检查组播路由
目的
检查 IP 组播转发表,确保存在上游 RPF 接口列表,其中包含主接口和备份接口。
行动
user@R3> show multicast route extensive Instance: master Family: INET Group: 225.1.1.1 Source: 10.0.0.1/32 Upstream rpf interface list: xe-0/0/13.0 (P) xe-0/0/14.0 (B) Downstream interface list: xe-0/0/15.0 Session description: Unknown Forwarding statistics are not available RPF Next-hop ID: 836 Next-hop ID: 1048585 Upstream protocol: PIM Route state: Active Forwarding state: Forwarding Cache lifetime/timeout: 171 seconds Wrong incoming interface notifications: 0 Uptime: 00:03:09
意义
输出显示了上游 RPF 接口列表,其中包含主接口和备份接口。