示例:在 PIM 域中配置仅组播快速重新路由
此示例说明如何配置仅组播快速重新路由 (MoFRR),以便在链路故障时最大程度地减少网络中的数据包丢失。它通过增强组播路由协议(协议无关组播 (PIM))来工作。
MoFRR 将组播加入消息从接收方传输到主路径上的源,同时还将辅助组播加入消息从接收方传输到备用路径上的源。数据包从主路径和备份路径接收。冗余数据包在拓扑合并点根据优先级(分配给主路径和备份路径的权重)被丢弃。在主路径上检测到故障时,将通过更改辅助接口接受数据包的接口来进行修复。由于修复是本地的,所以速度很快,从而在主路径上发生链路故障时大大缩短了收敛时间。
要求
配置此示例之前,不需要除设备初始化之外的特殊配置。
在此示例中,只有出口提供商边缘 (PE) 路由器启用了 MoFRR,可以在任何路由器上启用 PIM 域中的 MoFRR。
具有 MPC 线卡的 MX 系列平台支持 MoFRR。作为先决条件,路由器必须设置为 network-services enhanced-ip
模式,并且平台中的所有线卡都必须是 MPC。
此示例要求出口 PE 路由器上安装 Junos OS 14.1 或更高版本。
概述
在此示例中,设备 R3 是出口边缘路由器。MoFRR 仅在此设备上启用。
OSPF 或 IS-IS 用于连接,但也可以使用任何内部网关协议 (IGP) 或静态路由。
PIM 稀疏模式版本 2 在 PIM 域中的所有设备上启用。设备 R1 用作集合点 (RP)。
除 MoFRR 外,设备 R3 还启用了 PIM 联接负载平衡。
出于测试目的,路由器用于模拟源和接收器。设备 R3 配置为使用 set protocols igmp interface fe-1/2/15.0 static group 225.1.1.1
命令静态加入所需组。它只是加入,而不是倾听。fe-1/2/15.0 接口是面向接收器的设备 R3 接口。如果真正的组播接收器主机不可用(如本例所示),此静态 IGMP 配置非常有用。在接收方上,为了使其侦听组播组地址,此示例使用 set protocols sap listen 225.1.1.1
.要使源发送组播流量,将从源路由器发出组播 ping。ping 命令是 ping 225.1.1.1 bypass-routing interface fe-1/2/10.0 ttl 10 count 1000000000
。fe-1/2/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 快速配置
要快速配置此示例,请复制以下命令,将其粘贴到文本文件中,删除所有换行符,更改与您的网络配置匹配所需的任何详细信息,然后将命令复制并粘贴到层次结构级别的 CLI [edit]
中。
设备 R1
set interfaces fe-1/2/10 unit 0 family inet address 10.0.0.2/30 set interfaces fe-1/2/11 unit 0 family inet address 10.0.0.5/30 set interfaces fe-1/2/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 fe-1/2/10.0 set protocols ospf area 0.0.0.0 interface fe-1/2/11.0 set protocols ospf area 0.0.0.0 interface lo0.0 passive set protocols ospf area 0.0.0.0 interface fe-1/2/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 fe-1/2/11 unit 0 family inet address 10.0.0.6/30 set interfaces fe-1/2/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 fe-1/2/11.0 set protocols ospf area 0.0.0.0 interface fe-1/2/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 chassis network-services enhanced-ip set interfaces fe-1/2/13 unit 0 family inet address 10.0.0.10/30 set interfaces fe-1/2/15 unit 0 family inet address 10.0.0.13/30 set interfaces fe-1/2/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 fe-1/2/15.0 static group 225.1.1.1 set protocols ospf area 0.0.0.0 interface fe-1/2/13.0 set protocols ospf area 0.0.0.0 interface fe-1/2/15.0 set protocols ospf area 0.0.0.0 interface lo0.0 passive set protocols ospf area 0.0.0.0 interface fe-1/2/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 fe-1/2/12 unit 0 family inet address 10.0.0.18/30 set interfaces fe-1/2/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 fe-1/2/12.0 set protocols ospf area 0.0.0.0 interface fe-1/2/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 fe-1/2/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 fe-1/2/10.0 set protocols ospf area 0.0.0.0 interface lo0.0 passive
设备接收器
set interfaces fe-1/2/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 fe-1/2/15.0 set protocols ospf area 0.0.0.0 interface lo0.0 passive
分步配置
程序
分步过程
以下示例要求您在配置层次结构中导航各个级别。有关导航 CLI 的信息,请参阅《Junos OS CLI 用户指南》中的在配置模式下使用 CLI 编辑器。
要配置设备 R3:
启用增强型 IP 模式。
[edit chassis] user@R3# set network-services enhanced-ip
配置设备接口。
[edit interfaces] user@R3# set fe-1/2/13 unit 0 family inet address 10.0.0.10/30 user@R3# set fe-1/2/15 unit 0 family inet address 10.0.0.13/30 user@R3# set fe-1/2/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
仅出于测试目的,在面向设备接收器的接口上,模拟 IGMP 联接。
如果您的测试环境具有接收方主机,则此步骤不是必需的。
[edit protocols igmp interface fe-1/2/15.0] user@R3# set static group 225.1.1.1
配置 IGP 或静态路由。
[edit protocols ospf area 0.0.0.0] user@R3# set interface fe-1/2/13.0 user@R3# set interface fe-1/2/15.0 user@R3# set interface lo0.0 passive user@R3# set interface fe-1/2/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 chassis
、 show interfaces
、 show policy-options
show protocols
和show routing-options
命令来确认您的配置。如果输出未显示预期的配置,请重复此示例中的说明以更正配置。
user@R3# show chassis network-services enhanced-ip;
user@R3# show interfaces fe-1/2/13 { unit 0 { family inet { address 10.0.0.10/30; } } } fe-1/2/14 { unit 0 { family inet { address 10.0.0.22/30; } } } fe-1/2/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 fe-1/2/15.0 { static { group 225.1.1.1; } } } ospf { area 0.0.0.0 { interface fe-1/2/13.0; interface fe-1/2/15.0; interface lo0.0 { passive; } interface fe-1/2/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 fe-1/2/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 的接口为 fe-1/2/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: fe-1/2/13.0 Active upstream neighbor: 10.0.0.9 MoFRR Backup upstream interface: fe-1/2/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: fe-1/2/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: fe-1/2/13.0 (P) fe-1/2/14.0 (B) Downstream interface list: fe-1/2/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 接口列表,其中包含主接口和备用接口。