VPLS 的 PIM 侦听
了解 VPLS 的 PIM 侦听
引导 PIM 控制数据包有两种方法:
通过使用 PIM 侦听
通过使用 PIM 代理
PIM 侦听将设备配置为仅对 PIM hello 进行检查和操作,并加入/删除数据包。PIM 侦听设备侦听在每个接口上侦听 PIM hello 和加入/删除数据包,以查找感兴趣的组播接收器,并在组播转发树中填充此信息。PIM 侦听与 PIM 代理不同,因为 PIM hello 和加入/删除数据包在 VPLS 中都透明泛洪,而不是在 PIM 代理的情况下只会泛洪发送 hello 数据包。PIM 侦听配置在通过伪线连接的 PE 路由器上。PIM 侦听可确保 VPLS 中不会生成新的 PIM 数据包,但通过伪线 LDP 发送的 PIM 消息除外。
在 VPLS 文档中,PE 路由器等术语用于指提供路由功能的任何设备。
支持 PIM 侦听的设备会通过附加电路接收的 hello 数据包。转发 PIM 加入/删除数据包时,不会在 VPLS 核心中引入延迟。
要配置 PE 路由器上的 PIM 侦听,请在 pim-snooping
层级使用语句 [edit routing-instances instance-name protocols]
:
routing-instances { customer { instance-type vpls; ... protocols { pim-snooping{ traceoptions { file pim.log size 10m; flag all; flag timer disable; } } } } }
示例:为 VPLS 配置 PIM 侦听解释了 PIM 侦听方法。此处不讨论 PIM 代理方法的使用,不在本文的讨论范围内。有关 PIM 代理的更多信息,请参阅 基于 VPLS 的 PIM 侦听。
示例:为 VPLS 配置 PIM 侦听
此示例说明如何在虚拟专用 LAN 服务 (VPLS) 中配置 PIM 侦听,以将组播流量限制到相关设备。
要求
此示例使用以下硬件和软件组件:
M 系列多服务边缘路由器(M7i 和 M10i 以及增强型 CFEB、M120 和 M320 以及 E3 FPC)或 MX 系列 5G 通用路由平台(MX80、MX240、MX480 和 MX960)
Junos OS 13.2 或更高版本
概述
以下示例说明如何配置 PIM 侦听,以将组播流量限制到 VPLS 中感兴趣的设备。
此示例演示了通过使用 PIM 侦听设备限制组播流量的 PIM 侦听。使用 PIM 代理方法实现 PIM 侦听不在此文档的范围,尚未在 Junos OS 中实施。
拓扑
在此示例中,两个 PE 路由器通过伪线连接相互连接。路由器 PE1 连接到路由器 CE1 和 CE2。组播接收器连接到路由器 CE2。路由器 PE2 连接到路由器 CE3 和 CE4。组播源连接到路由器 CE3,第二个组播接收器连接到路由器 CE4。
路由器 PE1 和 PE2 上配置了 PIM 侦听。因此,从组播源发送的数据仅由组播组的成员接收。
图 1 显示了此示例中使用的拓扑。
![PIM Snooping for VPLS](/documentation/us/en/software/junos/multicast/vpn-l2/images/g040935.gif)
配置
CLI 快速配置
要快速配置此示例,请复制以下命令,将其粘贴到文本文件中,删除所有换行符,更改详细信息,以便与网络配置匹配,然后将命令复制并粘贴到层级的 [edit]
CLI 中。
路由器 PE1
set multicast-snooping-options traceoptions file snoop.log size 10m set interfaces ge-2/0/0 encapsulation ethernet-vpls set interfaces ge-2/0/0 unit 0 description toCE1 set interfaces ge-2/0/1 encapsulation ethernet-vpls set interfaces ge-2/0/1 unit 0 description toCE2 set interfaces ge-2/0/2 unit 0 description toPE2 set interfaces ge-2/0/2 unit 0 family inet address 10.0.0.1/30 set interfaces ge-2/0/2 unit 0 family mpls set interfaces lo0 unit 0 family inet address 10.255.1.1/32 set routing-options router-id 10.255.1.1 set protocols mpls interface ge-2/0/1.0 set protocols bgp group toPE2 type internal set protocols bgp group toPE2 local-address 10.255.1.1 set protocols bgp group toPE2 family l2vpn signaling set protocols bgp group toPE2 neighbor 10.255.7.7 set protocols ospf area 0.0.0.0 interface ge-2/0/2.0 set protocols ospf area 0.0.0.0 interface lo0.0 passive set protocols ldp interface ge-2/0/2.0 set protocols ldp interface lo0.0 set routing-instances titanium instance-type vpls set routing-instances titanium vlan-id none set routing-instances titanium interface ge-2/0/0.0 set routing-instances titanium interface ge-2/0/1.0 set routing-instances titanium route-distinguisher 101:101 set routing-instances titanium vrf-target target:201:201 set routing-instances titanium protocols vpls vpls-id 15 set routing-instances titanium protocols vpls site pe1 site-identifier 1 set routing-instances titanium protocols pim-snooping
路由器 CE1
set interfaces ge-2/0/0 unit 0 description toPE1 set interfaces ge-2/0/0 unit 0 family inet address 10.0.0.10/30 set interfaces lo0 unit 0 family inet address 10.255.2.2./32 set routing-options router-id 10.255.2.2 set protocols ospf area 0.0.0.0 interface all set protocols ospf area 0.0.0.0 interface lo0.0 passive set protocols pim rp static address 10.255.3.3 set protocols pim interface all
路由器 CE2
set interfaces ge-2/0/0 unit 0 description toPE1 set interfaces ge-2/0/0 unit 0 family inet address 10.0.0.6/30 set interfaces ge-2/0/1 unit 0 description toReceiver1 set interfaces ge-2/0/1 unit 0 family inet address 10.0.0.13/30 set interfaces lo0 unit 0 family inet address 10.255.2.2 set routing-options router-id 10.255.2.2 set protocols ospf area 0.0.0.0 interface all set protocols ospf area 0.0.0.0 interface lo0.0 passive set protocols pim rp static address 10.255.3.3 set protocols pim interface all
路由器 PE2
set multicast-snooping-options traceoptions file snoop.log size 10m set interfaces ge-2/0/0 encapsulation ethernet-vpls set interfaces ge-2/0/0 unit 0 description toCE3 set interfaces ge-2/0/1 encapsulation ethernet-vpls set interfaces ge-2/0/1 unit 0 description toCE4 set interfaces ge-2/0/2 unit 0 description toPE1 set interfaces ge-2/0/2 unit 0 family inet address 10.0.0.2/30 set interfaces ge-2/0/2 unit 0 family mpls set interfaces lo0 unit 0 family inet address 10.255.7.7/32 set routing-options router-id 10.255.7.7 set protocols mpls interface ge-2/0/2.0 set protocols bgp group toPE1 type internal set protocols bgp group toPE1 local-address 10.255.7.7 set protocols bgp group toPE1 family l2vpn signaling set protocols bgp group toPE1 neighbor 10.255.1.1 set protocols ospf area 0.0.0.0 interface ge-2/0/2.0 set protocols ospf area 0.0.0.0 interface lo0.0 set protocols ldp interface ge-2/0/2.0 set protocols ldp interface lo0.0 set routing-instances titanium instance-type vpls set routing-instances titanium vlan-id none set routing-instances titanium interface ge-2/0/0.0 set routing-instances titanium interface ge-2/0/1.0 set routing-instances titanium route-distinguisher 101:101 set routing-instances titanium vrf-target target:201:201 set routing-instances titanium protocols vpls vpls-id 15 set routing-instances titanium protocols vpls site pe2 site-identifier 2 set routing-instances titanium protocols pim-snooping
路由器 CE3 (RP)
set interfaces ge-2/0/0 unit 0 description toPE2 set interfaces ge-2/0/0 unit 0 family inet address 10.0.0.18/30 set interfaces ge-2/0/1 unit 0 description toSource set interfaces ge-2/0/1 unit 0 family inet address 10.0.0.29/30 set interfaces lo0 unit 0 family inet address 10.255.3.3/32 set routing-options router-id 10.255.3.3 set protocols ospf area 0.0.0.0 interface all set protocols ospf area 0.0.0.0 interface lo0.0 passive set protocols pim rp local address 10.255.3.3 set protocols pim interface all
路由器 CE4
set interfaces ge-2/0/0 unit 0 description toPE2 set interfaces ge-2/0/0 unit 0 family inet address 10.0.0.22/30 set interfaces ge-2/0/1 unit 0 description toReceiver2 set interfaces ge-2/0/1 unit 0 family inet address 10.0.0.25/30 set interfaces lo0 unit 0 family inet address 10.255.4.4/32 set routing-options router-id 10.255.4.4 set protocols ospf area 0.0.0.0 interface all set protocols ospf area 0.0.0.0 interface lo0.0 passive set protocols pim rp static address 10.255.3.3 set protocols pim interface all
为 VPLS 配置 PIM 侦听
逐步过程
以下示例要求您在配置层次结构中的各个级别上导航。有关导航 CLI 的信息,请参阅 CLI 用户指南中的在配置模式下使用 CLI 编辑器。
本节包含拓扑中一个或多个路由器的分步配置过程。有关所有路由器的全面配置,请参阅 CLI 快速配置。
要为 VPLS 配置 PIM 侦听:
配置在路由器之间形成链路的路由器接口。
Router PE2 [edit interfaces] user@PE2# set ge-2/0/0 encapsulation ethernet-vpls user@PE2# set ge-2/0/0 unit 0 description toCE3 user@PE2# set ge-2/0/1 encapsulation ethernet-vpls user@PE2# set ge-2/0/1 unit 0 description toCE4 user@PE2# set ge-2/0/2 unit 0 description toPE1 user@PE2# set ge-2/0/2 unit 0 family mpls user@PE2# set ge-2/0/2 unit 0 family inet address 10.0.0.2/30 user@PE2# set lo0 unit 0 family inet address 10.255.7.7/32
注意:ge-2/0/0.0
并ge-2/0/1.0
配置为 VPLS 接口并连接到路由器 CE3 和 CE4有关详细信息 ,请参阅虚拟专用 LAN 服务用户指南 。Router CE3 [edit interfaces] user@CE3# set ge-2/0/0 unit 0 description toPE2 user@CE3# set ge-2/0/0 unit 0 family inet address 10.0.0.18/30 user@CE3# set ge-2/0/1 unit 0 description toSource user@CE3# set ge-2/0/1 unit 0 family inet address 10.0.0.29/30 user@CE3# set lo0 unit 0 family inet address 10.255.3.3/32
注意:ge-2/0/1.0
路由器 CE3 上的接口连接到组播源。Router CE4 [edit interfaces] user@CE4# set ge-2/0/0 unit 0 description toPE2 user@CE4# set ge-2/0/0 unit 0 family inet address 10.0.0.22/30 user@CE4# set ge-2/0/1 unit 0 description toReceiver2 user@CE4# set ge-2/0/1 unit 0 family inet address 10.0.0.25/30 user@CE4# set lo0 unit 0 family inet address 10.255.4.4/32
注意:ge-2/0/1.0
路由器 CE4 上的接口连接到组播接收器。同样,配置路由器 PE1、CE1 和 CE2。
配置所有路由器的路由器 ID。
Router PE2 [edit routing-options] user@PE2# set router-id 10.255.7.7
同样,配置其他路由器。
在所有路由器的接口上配置 IGP。
Router PE2 [edit protocols ospf area 0.0.0.0] user@PE2# set interface ge-2/0/2.0 user@PE2# set interface lo0.0
同样,配置其他路由器。
配置 PE 路由器上的 LDP、MPLS 和 BGP 协议。
Router PE2 [edit protocols] user@PE2# set ldp interface lo0.0 user@PE2# set mpls interface ge-2/0/2.0 user@PE2# set bgp group toPE1 type internal user@PE2# set bgp group toPE1 local-address 10.255.7.7 user@PE2# set bgp group toPE1 family l2vpn signaling user@PE2# set bgp group toPE1 neighbor 10.255.1.1 user@PE2# set ldp interface ge-2/0/2.0
与其他 PE 路由器接口需要使用 BGP 组。同样,配置路由器 PE1。
在所有 CE 路由器上配置 PIM。
请确保路由器 CE3 配置为集合点 (RP),并且其他 CE 路由器上配置了 RP 地址。
Router CE3 [edit protocols pim] user@CE3# set rp local address 10.255.3.3 user@CE3# set interface all
Router CE4 [edit protocols pim] user@CE4# set rp static address 10.255.3.3 user@CE4# set interface all
同样,配置路由器 CE1 和 CE2。
在 PE 路由器上配置组播侦听选项。
Router PE2 [edit multicast-snooping-options traceoptions] user@PE2# set file snoop.log size 10m
同样,配置路由器 PE1。
创建路由实例 (
titanium
),并在 PE 路由器上配置 VPLS。Router PE2 [edit routing-instances titanium] user@PE2# set instance-type vpls user@PE2# set vlan-id none user@PE2# set interface ge-2/0/0.0 user@PE2# set interface ge-2/0/1.0 user@PE2# set route-distinguisher 101:101 user@PE2# set vrf-target target:201:201 user@PE2# set protocols vpls vpls-id 15 user@PE2# set protocols vpls site pe2 site-identifier 2
同样,配置路由器 PE1。
在 PE 路由器上配置 PIM 侦听。
Router PE2 [edit routing-instances titanium] user@PE2# set protocols pim-snooping
同样,配置路由器 PE1。
结果
在配置模式下,输入 、 show interfacesshow routing-options、 show protocols、 show multicast-snooping-options和show routing-instances命令,以确认您的配置。
如果输出未显示预期的配置,请重复此示例中的说明,以更正配置。
user@PE2# show interfaces ge-2/0/2 { unit 0 { description toPE1 family inet { address 10.0.0.2/30; } family mpls; } } ge-2/0/0 { encapsulation ethernet-vpls; unit 0 { description toCE3; } } ge-2/0/1 { encapsulation ethernet-vpls; unit 0 { description toCE4; } } lo0 { unit 0 { family inet { address 10.255.7.7/32; } } }
user@PE2# show routing-options router-id 10.255.7.7;
user@PE2# show protocols mpls { interface ge-2/0/2.0; } ospf { area 0.0.0.0 { interface ge-2/0/2.0; interface lo0.0; } } ldp { interface ge-2/0/2.0; interface lo0.0; } bgp { group toPE1 { type internal; local-address 10.255.7.7; family l2vpn { signaling; } neighbor 10.255.1.1; }
user@PE2# show multicast-snooping-options traceoptions { file snoop.log size 10m; }
user@PE2# show routing-instances titanium { instance-type vpls; vlan-id none; interface ge-2/0/0.0; interface ge-2/0/1.0; route-distinguisher 101:101; vrf-target target:201:201; protocols { vpls { site pe2 { site-identifier 2; } vpls-id 15; } pim-snooping; } }
同样,确认所有其他路由器上的配置。完成路由器配置后,请从配置模式进入 commit
。
show protocols使用 CE 路由器上的命令验证 PIM RP 的配置。
验证
确认配置工作正常。
验证 VPLS 的 PIM 侦听
目的
验证 PIM 侦听在网络中是否正常运行。
行动
要验证 PIM 侦听是否能够根据需要工作,请使用以下命令:
show pim snooping interfaces
show pim snooping neighbors detail
show pim snooping statistics
show pim snooping join
show pim snooping join extensive
show multicast snooping route extensive instance <instance-name> group <group-name>
在路由器 PE2 的操作模式下,运行 show pim snooping interfaces 命令。
user@PE2> show pim snooping interfaces Instance: titanium Learning-Domain: default Name State IP NbrCnt ge-2/0/0.0 Up 4 1 ge-2/0/1.0 Up 4 1 DR address: 10.0.0.22 DR flooding is ON
输出将验证是否在将路由器 PE2 连接到路由器 CE3 和 CE4 的两个接口上配置了 PIM 侦听。
同样,检查路由器 PE1 上的 PIM 侦听接口。
在路由器 PE2 的操作模式下,运行 show pim snooping neighbors detail 命令。
user@PE2> show pim snooping neighbors detail Instance: titanium Learning-Domain: default Interface: ge-2/0/0.0 Address: 10.0.0.18 Uptime: 00:17:06 Hello Option Holdtime: 105 seconds 99 remaining Hello Option DR Priority: 1 Hello Option Generation ID: 552495559 Hello Option LAN Prune Delay: delay 500 ms override 2000 ms Tracking is supported Interface: ge-2/0/1.0 Address: 10.0.0.22 Uptime: 00:15:16 Hello Option Holdtime: 105 seconds 103 remaining Hello Option DR Priority: 1 Hello Option Generation ID: 1131703485 Hello Option LAN Prune Delay: delay 500 ms override 2000 ms Tracking is supported
输出将验证路由器 PE2 是否可以检测其 PIM 侦听邻接方(CE3 上的 10.0.0.18 和 CE4 上的 10.0.0.22)的 IP 地址。
同样,检查路由器 PE1 上的 PIM 侦听邻接方。
在路由器 PE2 的操作模式下,运行 show pim snooping statistics 命令。
user@PE2> show pim snooping statistics Instance: titanium Learning-Domain: default Tx J/P messages 0 RX J/P messages 246 Rx J/P messages -- seen 0 Rx J/P messages -- received 246 Rx Hello messages 1036 Rx Version Unknown 0 Rx Neighbor Unknown 0 Rx Upstream Neighbor Unknown 0 Rx J/P Busy Drop 0 Rx J/P Group Aggregate 0 Rx Malformed Packet 0 Rx No PIM Interface 0 Rx Bad Length 0 Rx Unknown Hello Option 0 Rx Unknown Packet Type 0 Rx Bad TTL 0 Rx Bad Destination Address 0 Rx Bad Checksum 0 Rx Unknown Version 0
输出显示路由器 PE2 接收的 hello 和加入/删除消息数。这将验证 PIM 稀疏模式在网络中是否正常运行。
为组播组 203.0.113.1 从连接到路由器 CE3 的源终端发送组播流量。
在路由器 PE2 的操作模式下,运行 show pim snooping join、 show pim snooping join extensive和 show multicast snooping route extensive instance <instance-name> group <group-name> 命令以验证 PIM 侦听。
user@PE2> show pim snooping join Instance: titanium Learning-Domain: default Group: 203.0.113.1 Source: * Flags: sparse,rptree,wildcard Upstream neighbor: 10.0.0.18, Port: ge-2/0/0.0 Group: 203.0.113.1 Source: 10.0.0.30 Flags: sparse Upstream neighbor: 10.0.0.18, Port: ge-2/0/0.0
user@PE2> show pim snooping join extensive Instance: titanium Learning-Domain: default Group: 203.0.113.1 Source: * Flags: sparse,rptree,wildcard Upstream neighbor: 10.0.0.18, Port: ge-2/0/0.0 Downstream port: ge-2/0/1.0 Downstream neighbors: 10.0.0.22 State: Join Flags: SRW Timeout: 180 Group: 203.0.113.1 Source: 10.0.0.30 Flags: sparse Upstream neighbor: 10.0.0.18, Port: ge-2/0/0.0 Downstream port: ge-2/0/1.0 Downstream neighbors: 10.0.0.22 State: Join Flags: S Timeout: 180
输出显示,为组 203.0.113.1 发送的组播流量将通过路由器 CE4 发送至接收方 2,并且还显示上游和下游邻接方的详细信息。
user@PE2> show multicast snooping route extensive instance titanium group 203.0.113.1 Nexthop Bulking: OFF Family: INET Group: 203.0.113.1/24 Bridge-domain: titanium Mesh-group: __all_ces__ Downstream interface list: ge-2/0/1.0 -(1072) Statistics: 0 kBps, 0 pps, 0 packets Next-hop ID: 1048577 Route state: Active Forwarding state: Forwarding Group: 203.0.113.1/24 Source: 10.0.0.8 Bridge-domain: titanium Mesh-group: __all_ces__ Downstream interface list: ge-2/0/1.0 -(1072) Statistics: 0 kBps, 0 pps, 0 packets Next-hop ID: 1048577 Route state: Active Forwarding state: Forwarding
意义
PIM 侦听在网络中可操作。