03-PIM Snooping配置
本章节下载: 03-PIM Snooping配置 (216.09 KB)
目 录
1 PIM Snooping································································································································· 1-1
1.1 PIM Snooping简介·················································································································· 1-1
1.2 配置PIM Snooping·················································································································· 1-3
1.3 PIM Snooping显示和维护········································································································ 1-3
1.4 PIM Snooping典型配置举例····································································································· 1-4
1.5 常见配置错误举例···················································································································· 1-7
1.5.1 交换机不能实现PIM Snooping功能················································································ 1-7
1.5.2 部分下游PIM路由器无法收到组播数据············································································ 1-7
· 本文所涉及的路由器和路由器图标,代表了一般意义下的路由器或路由交换机.。
· 设备支持两种运行模式:独立运行模式和IRF模式,缺省情况下为独立运行模式。有关IRF模式的介绍,请参见“IRF配置指导”中的“IRF”。
PIM Snooping是Protocol Independent Multicast Snooping(协议无关组播窥探)的简称,运行PIM Snooping的二层设备通过对收到的PIM协议报文进行分析,将有接收需求的端口添加到相应的组播转发表项中,以实现组播报文的精确转发。
如图1-1所示,组播源Source 1和Source 2分别向组播组G1和G2发送组播数据,而Receiver 1和Receiver 2则分别是G1和G2的接收者,二层设备上连接各PIM路由器的端口都属于同一个VLAN:
· 当二层设备只运行IGMP Snooping时,它通过监听PIM路由器发出的PIM Hello报文来维护路由器端口,并将所有组播数据报文向VLAN内的所有路由器端口转发;而对于其它类型的PIM协议报文,则在VLAN内广播。因此,无论PIM路由器是否有接收需求,都会收到所有的PIM协议报文和组播数据报文。
· 当二层设备同时运行了IGMP Snooping和PIM Snooping时,它通过监听PIM路由器发出的PIM协议报文来了解其接收需求,从而将有接收需求的PIM路由器所在的端口加入到相应的组播转发表项中,使PIM协议报文和组播数据报文能够被精确转发给有接收需求的PIM路由器,从而节约了网络带宽。
· 有关IGMP Snooping和路由器端口的详细介绍,请参见“IP组播配置指导”中的“IGMP Snooping”。
· 有关PIM的详细介绍,请参见“IP组播配置指导”中的“PIM”。
在配置某VLAN内的PIM Snooping时,需要在交换机上先全局使能IGMP Snooping,然后在该VLAN内使能IGMP Snooping和PIM Snooping。
操作 |
命令 |
说明 |
进入系统视图 |
system-view |
- |
全局使能IGMP Snooping,并进入IGMP-Snooping视图 |
igmp-snooping |
必选 缺省情况下,IGMP Snooping处于关闭状态 |
退回系统视图 |
quit |
- |
进入VLAN视图 |
vlan vlan-id |
- |
在VLAN内使能IGMP Snooping |
igmp-snooping enable |
必选 缺省情况下,VLAN内的IGMP Snooping处于关闭状态 |
在VLAN内使能PIM Snooping |
pim-snooping enable |
必选 缺省情况下,VLAN内的PIM Snooping处于关闭状态 |
· 有关igmp-snooping和igmp-snooping enable命令的详细介绍,请参见“IP组播命令参考”中的“IGMP Snooping”。
· 在VLAN内使能了PIM Snooping之后,PIM Snooping功能只在属于该VLAN的端口上生效。
· 在组播VLAN的子VLAN内使能PIM Snooping无效。有关组播VLAN的详细介绍,请参见“IP组播配置指导”中的“组播VLAN”。
在完成上述配置后,在任意视图下执行display命令可以显示配置后PIM Snooping的运行情况,通过查看显示信息验证配置的效果。
在用户视图下执行reset命令可以清除PIM Snooping的统计信息。
表1-2 PIM Snooping显示和维护
命令 |
|
查看PIM Snooping的邻居信息(独立运行模式) |
display pim-snooping neighbor [ vlan vlan-id ] [ slot slot-number ] [ | { begin | exclude | include } regular-expression ] |
查看PIM Snooping的邻居信息(IRF模式) |
display pim-snooping neighbor [ vlan vlan-id ] [ chassis chassis-number slot slot-number ] [ | { begin | exclude | include } regular-expression ] |
查看PIM Snooping的路由信息(独立运行模式) |
display pim-snooping routing-table [ vlan vlan-id ] [ slot slot-number ] [ | { begin | exclude | include } regular-expression ] |
查看PIM Snooping的路由信息(IRF模式) |
display pim-snooping routing-table [ vlan vlan-id ] [ chassis chassis-number slot slot-number ] [ | { begin | exclude | include } regular-expression ] |
查看PIM Snooping监听到的PIM报文的统计信息 |
display pim-snooping statistics [ | { begin | exclude | include } regular-expression ] |
清除PIM Snooping监听到的PIM报文的统计信息 |
reset pim-snooping statistics |
· 如图1-2所示,Router A和Router B各自的GigabitEthernet3/0/1接口分别连接组播源Source 1和Source 2;Router C和Router D各自的GigabitEthernet3/0/1接口分别连接接收者Receiver 1和Receiver 2;Router A、Router B、Router C和Router D各自的GigabitEthernet3/0/2接口都通过Switch A互连。
· Source 1和Source 2分别通过组播组224.1.1.1和225.1.1.1发送组播数据,Receiver 1和Receiver 2则分别接收来自组播组224.1.1.1和225.1.1.1的组播数据;Router C和Router D各自的GigabitEthernet3/0/1接口上都运行IGMP,Router A、Router B、Router C和Router D上都运行PIM-SM,并由Router A的GigabitEthernet3/0/2接口充当C-BSR和C-RP。
· 通过在Switch A上配置IGMP Snooping和PIM Snooping,使Switch A将PIM协议报文和组播数据报文只转发给有接收需求的路由器。
图1-2 PIM Snooping典型配置组网图
配置IP地址
请按照图1-2配置各接口的IP地址和子网掩码,具体配置过程略。
配置Router A
# 使能IP组播路由,在各接口上使能PIM-SM,并将接口GigabitEthernet3/0/2配置为C-BSR和C-RP。
<RouterA> system-view
[RouterA] multicast routing-enable
[RouterA] interface GigabitEthernet 3/0/1
[RouterA-GigabitEthernet3/0/1] pim sm
[RouterA-GigabitEthernet3/0/1] quit
[RouterA] interface GigabitEthernet 3/0/2
[RouterA-GigabitEthernet3/0/2] pim sm
[RouterA-GigabitEthernet3/0/2] quit
[RouterA] pim
[RouterA-pim] c-bsr GigabitEthernet 3/0/2
[RouterA-pim] c-rp GigabitEthernet 3/0/2
配置Router B
# 使能IP组播路由,在各接口上使能PIM-SM。
<RouterB> system-view
[RouterB] multicast routing-enable
[RouterB] interface GigabitEthernet 3/0/1
[RouterB-GigabitEthernet3/0/1] pim sm
[RouterB-GigabitEthernet3/0/1] quit
[RouterB] interface GigabitEthernet 3/0/2
[RouterB-GigabitEthernet3/0/2] pim sm
配置Router C
# 使能IP组播路由,在各接口上使能PIM-SM,并在接口GigabitEthernet3/0/1上使能IGMP。
<RouterC> system-view
[RouterC] multicast routing-enable
[RouterC] interface GigabitEthernet 3/0/1
[RouterC-GigabitEthernet3/0/1] pim sm
[RouterC-GigabitEthernet3/0/1] igmp enable
[RouterC-GigabitEthernet3/0/1] quit
[RouterC] interface GigabitEthernet 3/0/2
[RouterC-GigabitEthernet3/0/2] pim sm
配置Router D
Router D的配置与Router C相似,配置过程略。
配置Switch A
# 全局使能IGMP Snooping。
<SwitchA> system-view
[SwitchA] igmp-snooping
[SwitchA-igmp-snooping] quit
# 创建VLAN 100,把端口GigabitEthernet3/0/1到GigabitEthernet3/0/4添加到该VLAN中;在该VLAN内使能IGMP Snooping和PIM Snooping。
[SwitchA] vlan 100
[SwitchA-vlan100] port GigabitEthernet 3/0/1 to GigabitEthernet 3/0/4
[SwitchA-vlan100] igmp-snooping enable
[SwitchA-vlan100] pim-snooping enable
[SwitchA-vlan100] quit
检验配置效果
# 查看Switch A上VLAN 100内PIM Snooping的邻居信息。
[SwitchA] display pim-snooping neighbor vlan 100
Total number of neighbors: 4
VLAN ID: 100
Total number of neighbors: 4
Neighbor Port Expires Option Flags
10.1.1.1 GE3/0/1 02:02:23 LAN Prune Delay
10.1.1.2 GE3/0/2 03:00:05 LAN Prune Delay
10.1.1.3 GE3/0/3 02:22:13 LAN Prune Delay
10.1.1.4 GE3/0/4 03:07:22 LAN Prune Delay
由此可见,Router A、Router B、Router C和Router D之间都建立起了PIM Snooping邻居关系。
# 查看Switch A上VLAN 100内PIM Snooping的路由信息。
[SwitchA] display pim-snooping routing-table vlan 100
Total 2 entry(ies)
FSM Flag: NI-no info, J-join, PP-prune pending
VLAN ID: 100
Total 2 entry(ies)
(*, 224.1.1.1)
Upstream neighbor: 10.1.1.1
Total number of downstream ports: 1
1: GE3/0/3
(*, 225.1.1.1)
Upstream neighbor: 10.1.1.1
Total number of downstream ports: 1
1: GE3/0/4
由此可见,Switch A将向Router C转发组播组224.1.1.1的组播数据,向Router D转发组播组225.1.1.1的组播数据。
交换机不能实现PIM Snooping功能。
IGMP Snooping或PIM Snooping没有使能。
使用display current-configuration命令查看IGMP Snooping和PIM Snooping的运行状态。
如果没有使能IGMP Snooping,请先在系统视图下使用igmp-snooping命令全局使能IGMP Snooping,然后在VLAN视图下分别使用igmp-snooping enable和pim-snooping enable命令使能VLAN内的IGMP Snooping和PIM Snooping。
如果没有使能PIM Snooping,请在VLAN视图下使用pim-snooping enable命令使能VLAN内的PIM Snooping。
在有分片加入/剪枝报文的网络中,部分下游PIM路由器无法收到组播数据。
PIM Snooping不能对分片报文进行重组,因此无法维护分片加入/剪枝报文中携带的下游状态。为了保证系统功能正常,只能将分片加入/剪枝报文在VLAN内广播,因此需要在VLAN内连接PIM Snooping交换机的所有PIM路由器上都禁止加入报文抑制能力(即使能邻居跟踪功能),以保证加入报文不被广播的分片加入/剪枝报文所抑制。假如存在未禁止该能力的PIM路由器,被广播的分片加入/剪枝报文就会影响其它PIM路由器的加入状态:如果某PIM路由器有组播接收需求,但其发送的加入报文被抑制,那么该路由器将无法收到组播数据。
在PIM路由器连接PIM Snooping交换机的接口上使用pim hello-option neighbor-tracking命令使能邻居跟踪功能。
如果存在不能够使能邻居跟踪功能的PIM路由器,则需关闭PIM Snooping交换机上的PIM Snooping功能。
不同款型规格的资料略有差异, 详细信息请向具体销售和400咨询。H3C保留在没有任何通知或提示的情况下对资料内容进行修改的权利!