9.5 PIM-SM

  1. 实验目的
  1. 熟悉PIM-SM的应用场景
  2. 掌握PIM-SM的配置方法
  1. 实验拓扑

实验拓扑如图9-40所示:

                                                      图9-40:PIM-SM

  1. 实验步骤

(1)配置IP地址

MCS1的配置

MCS1的配置如图9-41所示:

                                                      图9-41:配置MCS1的IP地址

R1的配置

<Huawei>system-view

Enter system view, return user view with Ctrl+Z.

[Huawei]undo info-center enable

Info: Information center is disabled.

[Huawei]sysname R1

[R1]interface g0/0/0

[R1-GigabitEthernet0/0/0]ip address 10.1.1.1 24

[R1-GigabitEthernet0/0/0]quit

[R1]interface g0/0/1

[R1-GigabitEthernet0/0/1]ip address 10.1.2.1 24

[R1-GigabitEthernet0/0/1]quit

[R1]interface g0/0/2

[R1-GigabitEthernet0/0/2]ip address 13.1.1.1 24

[R1-GigabitEthernet0/0/2]quit

R2的配置

<Huawei>system-view

Enter system view, return user view with Ctrl+Z.

[Huawei]undo info-center enable

Info: Information center is disabled.

[Huawei]sysname R2

[R2]interface g0/0/0

[R2-GigabitEthernet0/0/0]ip address 10.1.1.2 24

[R2-GigabitEthernet0/0/0]quit

[R2]interface g0/0/1

[R2-GigabitEthernet0/0/1]ip address 10.1.2.2 24

[R2-GigabitEthernet0/0/1]quit

R3的配置

<Huawei>system-view

[Huawei]undo info-center enable

Info: Information center is disabled.

[Huawei]sysname R3

[R3]interface g0/0/0

[R3-GigabitEthernet0/0/0]ip address 13.1.1.3 24

[R3-GigabitEthernet0/0/0]quit

[R3]interface g0/0/1

[R3-GigabitEthernet0/0/1]ip address 34.1.1.3 24

[R3-GigabitEthernet0/0/1]quit

[R3]interface g0/0/2

[R3-GigabitEthernet0/0/2]ip address 192.168.1.3 24

[R3-GigabitEthernet0/0/2]quit

R4的配置

<Huawei>system-view

Enter system view, return user view with Ctrl+Z.

[Huawei]undo info-center enable

[Huawei]sysname R4

[R4]interface g0/0/0

[R4-GigabitEthernet0/0/0]ip address 10.1.2.4 24

[R4-GigabitEthernet0/0/0]quit

[R4]interface g0/0/1

[R4-GigabitEthernet0/0/1]ip address 34.1.1.4 24

[R4-GigabitEthernet0/0/1]quit

[R4]interface g0/0/2

[R4-GigabitEthernet0/0/2]ip address 45.1.1.4 24

[R4-GigabitEthernet0/0/2]quit

[R4]interface g0/0/3

[R4-GigabitEthernet0/0/3]ip address 46.1.1.4 24

[R4-GigabitEthernet0/0/3]quit

R5的配置

<Huawei>system-view

Enter system view, return user view with Ctrl+Z.

[Huawei]undo info-center enable

Info: Information center is disabled.

[Huawei]sysname R5

[R5]interface g0/0/0

[R5-GigabitEthernet0/0/0]ip address 192.168.2.5 24

[R5-GigabitEthernet0/0/0]quit

[R5]interface g0/0/2

[R5-GigabitEthernet0/0/2]ip address 45.1.1.5 24

[R5-GigabitEthernet0/0/2]quit

R6的配置

<Huawei>system-view

Enter system view, return user view with Ctrl+Z.

[Huawei]undo info-center enable

Info: Information center is disabled.

[Huawei]sysname R5

[R5]sysname R6

[R6]interface g0/0/0

[R6-GigabitEthernet0/0/0]ip address 46.1.1.6 24

[R6-GigabitEthernet0/0/0]quit

[R6]interface g0/0/1

[R6-GigabitEthernet0/0/1]ip address 192.168.2.6 24

[R6-GigabitEthernet0/0/1]quit

PC1的配置

PC1的配置如图9-42所示:

                                                  图9-42:配置PC1的IP地址

PC2的配置

PC2的配置如图9-43所示:

                                                 图9-43:配置PC2的IP地址

(2)配置IGP

R1的配置

[R1]ospf router-id 1.1.1.1

[R1-ospf-1]area 0

[R1-ospf-1-area-0.0.0.0]network 10.1.1.0 0.0.0.255

[R1-ospf-1-area-0.0.0.0]network 13.1.1.0 0.0.0.255

[R1-ospf-1-area-0.0.0.0]network 10.1.2.0 0.0.0.255

[R1-ospf-1-area-0.0.0.0]quit

R2的配置

[R2]ospf router-id 2.2.2.2

[R2-ospf-1]area 0

[R2-ospf-1-area-0.0.0.0]network 10.1.1.0 0.0.0.255

[R2-ospf-1-area-0.0.0.0]network 10.1.2.0 0.0.0.255

[R2-ospf-1-area-0.0.0.0]quit

R3的配置

[R3]ospf router-id 3.3.3.3

[R3-ospf-1]area 0

[R3-ospf-1-area-0.0.0.0]network 13.1.1.0 0.0.0.255

[R3-ospf-1-area-0.0.0.0]network 34.1.1.0 0.0.0.255

[R3-ospf-1-area-0.0.0.0]network 192.168.1.0 0.0.0.255

[R3-ospf-1-area-0.0.0.0]quit

R4的配置

[R4]ospf router-id 4.4.4.4

[R4-ospf-1]area 0

[R4-ospf-1-area-0.0.0.0]network 10.1.2.0 0.0.0.255

[R4-ospf-1-area-0.0.0.0]network 34.1.1.0 0.0.0.255

[R4-ospf-1-area-0.0.0.0]network 46.1.1.0 0.0.0.255

[R4-ospf-1-area-0.0.0.0]network 45.1.1.0 0.0.0.255

[R4-ospf-1-area-0.0.0.0]quit

R5的配置

[R5]ospf router-id 5.5.5.5

[R5-ospf-1]area 0

[R5-ospf-1-area-0.0.0.0]network 45.1.1.0 0.0.0.255

[R5-ospf-1-area-0.0.0.0]network 192.168.2.0 0.0.0.255

[R5-ospf-1-area-0.0.0.0]quit

R6的配置

[R6]ospf router-id 6.6.6.6

[R6-ospf-1]area 0

[R6-ospf-1-area-0.0.0.0]network 46.1.1.0 0.0.0.255

[R6-ospf-1-area-0.0.0.0]network 192.168.2.0 0.0.0.255

[R6-ospf-1-area-0.0.0.0]quit

(3)运行PIM SM

R1的配置

[R1]multicast routing-enable

[R1]interface g0/0/0

[R1-GigabitEthernet0/0/0]pim sm

[R1-GigabitEthernet0/0/0]quit

[R1]interface g0/0/1

[R1-GigabitEthernet0/0/1]pim sm

[R1-GigabitEthernet0/0/1]quit

[R1]interface g0/0/2

[R1-GigabitEthernet0/0/2]pim sm

[R1-GigabitEthernet0/0/2]quit

R2的配置

[R2]multicast routing-enable

[R2]interface g0/0/0

[R2-GigabitEthernet0/0/0]pim sm  

[R2-GigabitEthernet0/0/0]quit

[R2]interface g0/0/1

[R2-GigabitEthernet0/0/1]pim sm

[R2-GigabitEthernet0/0/1]quit

R3的配置

[R3]multicast routing-enable

[R3]interface g0/0/0

[R3-GigabitEthernet0/0/0]pim sm

[R3-GigabitEthernet0/0/0]quit   

[R3]interface g0/0/1

[R3-GigabitEthernet0/0/1]pim sm

[R3-GigabitEthernet0/0/1]quit

[R3]interface g0/0/21

[R3]interface g0/0/2

[R3-GigabitEthernet0/0/2]pim sm

[R3-GigabitEthernet0/0/2]quit

R4的配置

[R4]multicast routing-enable

[R4]interface g0/0/0

[R4-GigabitEthernet0/0/0]pim sm

[R4-GigabitEthernet0/0/0]quit

[R4]interface g0/0/1

[R4-GigabitEthernet0/0/1]pim sm

[R4-GigabitEthernet0/0/1]quit

[R4]interface g0/0/2

[R4-GigabitEthernet0/0/2]pim sm

[R4-GigabitEthernet0/0/2]quit

[R4]interface g0/0/3

[R4-GigabitEthernet0/0/3]pim sm

[R4-GigabitEthernet0/0/3]quit

R5的配置

[R5]multicast routing-enable

[R5]interface g0/0/0

[R5-GigabitEthernet0/0/0]pim sm

[R5-GigabitEthernet0/0/0]quit

[R5]interface g0/0/2

[R5-GigabitEthernet0/0/2]pim sm

[R5-GigabitEthernet0/0/2]quit

R6的配置

[R6]multicast routing-enable

[R6]interface g0/0/0

[R6-GigabitEthernet0/0/0]pim sm

[R6-GigabitEthernet0/0/0]quit

[R6]interface g0/0/1

[R6-GigabitEthernet0/0/1]pim sm

[R6-GigabitEthernet0/0/1]quit

(4)静态RP的设置

在R4上创建一个环回口0,IP地址为4.4.4.4,作为静态RP地址

R4的配置

[R4]interface LoopBack 0

[R4-LoopBack0]ip address 4.4.4.4 32  //环回口比较稳定

[R4-LoopBack0]ospf enable area 0   //一定要宣告进OSPF

[R4-LoopBack0]quit

[R4]pim

[R4-pim]static-rp 4.4.4.4

[R4-pim]quit

R1的配置

[R1]pim

[R1-pim]static-rp 4.4.4.4

[R1-pim]quit

R2的配置

[R2]pim

[R2-pim]static-rp 4.4.4.4

[R2-pim]quit

R3的配置

[R3]pim

[R3-pim]static-rp 4.4.4.4

[R3-pim]quit

R5的配置

[R5]pim

[R5-pim]static-rp 4.4.4.4

[R5-pim]quit

R6的配置

[R6]pim

[R6-pim]static-rp 4.4.4.4

[R6-pim]quit

(5)设置组播服务器

MCS1的配置如图9-44所示:

                                                                图9-44:组播源的配置

(6)运行IGMP

R3的配置

[R3]interface g0/0/2

[R3-GigabitEthernet0/0/2]igmp enable

[R3-GigabitEthernet0/0/2]igmp version 2

[R3-GigabitEthernet0/0/2]quit

R5的配置

[R5]interface g0/0/0

[R5-GigabitEthernet0/0/0]igmp  enable

[R5-GigabitEthernet0/0/0]igmp version 2

[R5-GigabitEthernet0/0/0]quit

R6的配置

[R6]interface g0/0/1

[R6-GigabitEthernet0/0/1]igmp enable

[R6-GigabitEthernet0/0/1]igmp version 2

[R6-GigabitEthernet0/0/1]quit

(7)让PC1加入组224.1.1.1

PC1的配置如图9-45所示:

                                                  图9-45:配置PC1让其加入组224.1.1.1

  1. 实验调试

(1)观察RPT的形成

  • 当R3收到IGMP加入组224.1.1.1的请求后,R3生成(* 224.1.1.1)条目,确认上游和下游接口,然后向开始向RP建RPT

[R3]display pim routing-table

 VPN-Instance: public net

 Total 1 (*, G) entry; 0 (S, G) entry

 (*, 224.1.1.1)   //生成(* G)

     RP: 4.4.4.4

     Protocol: pim-sm, Flag: WC

     UpTime: 00:00:45

     Upstream interface: GigabitEthernet0/0/1  //上游接口

         Upstream neighbor: 34.1.1.4

         RPF prime neighbor: 34.1.1.4

     Downstream interface(s) information:

     Total number of downstreams: 1

         1: GigabitEthernet0/0/2   //下游接口

             Protocol: igmp, UpTime: 00:00:45, Expires: -

  • R4收到(* 224.1.1.1)join报文后,创建(* 224.1.1.1)条目

<R4>display pim routing-table

 VPN-Instance: public net

 Total 1 (*, G) entry; 0 (S, G) entry

 (*, 224.1.1.1)  //形成(* G )

     RP: 4.4.4.4 (local)

     Protocol: pim-sm, Flag: WC

     UpTime: 00:12:56

     Upstream interface: Register  //上游接口

         Upstream neighbor: NULL

         RPF prime neighbor: NULL

     Downstream interface(s) information:

     Total number of downstreams: 1  //下游接口

         1: GigabitEthernet0/0/1

             Protocol: pim-sm, UpTime: 00:12:56, Expires: 00:02:34

【技术要点】

Join转发的路径及在每台路由器上生成的组播转发表构成RPT树,只要接收者存在,R3会每隔60s向上游发送join,收到join的接口重置接口计时器,超时时间为210s。超时后些接口会从下游接口列表中移除。其流程图如图9-46所示:

                                                 图9-46:Join转发的路径

(2)把R1的g0/0/0的优选级改成100,让组播流量去访问RP走MCS1-R1-R4

华为Datacom网络工程师HCIP全套学习课程(全套理论+实验)-学习视频教程-腾讯课堂

  • 查看R1的PIM接口信息

<R1>display pim interface g0/0/0

 VPN-Instance: public net

 Interface           State NbrCnt HelloInt   DR-Pri     DR-Address

 GE0/0/0             up    1      30         1          10.1.1.2      

通过以上输出可以看到DR-address是10.1.1.2

  • 把R1的g0/0/0的接口DR的优选级改成100

[R1]interface g0/0/0

[R1-GigabitEthernet0/0/0]pim hello-option dr-priority 100

  • 再次查看R1的PIM接口信息

[R1]display pim interface g0/0/0

 VPN-Instance: public net

 Interface           State NbrCnt HelloInt   DR-Pri     DR-Address

 GE0/0/0             up    1      30         100        10.1.1.1        (local)

通过以上输出可以看到变成了10.1.1.1

【技术要点】

PIM DR的选举原则

  • 优选级越大越优,默认为1
  • 优选级相同,接口IP地址越大越优

(3)观察SPT的形成

  • 打开MCS1的组播流量,在R1的g0/0/0口抓包

在MCS1运行组播,其配置如图9-47所示:

                                               图9-47:在MCS1上运行组播

  • 组播第一跳路由R1收到组播报文后,把它封装成单播报文向RP注册,单播报文如图9-48所示:

                                      图9-48:单播注册报文的格式

  • RP收到单播注册报文后,将其解封装,建立(S,G)表项,并将组播数据沿RPT发送到达组成员。

<R4>display pim routing-table

 VPN-Instance: public net

 Total 1 (*, G) entry; 1 (S, G) entry

 (*, 224.1.1.1)

     RP: 4.4.4.4 (local)

     Protocol: pim-sm, Flag: WC

     UpTime: 00:26:34

     Upstream interface: Register

         Upstream neighbor: NULL

         RPF prime neighbor: NULL

     Downstream interface(s) information:

     Total number of downstreams: 1

         1: GigabitEthernet0/0/1

             Protocol: pim-sm, UpTime: 00:26:34, Expires: 00:02:56

 (10.1.1.100, 224.1.1.1)  //形成(S  G )

     RP: 4.4.4.4 (local)

     Protocol: pim-sm, Flag: 2MSDP SWT ACT

     UpTime: 00:07:00

     Upstream interface: Register

         Upstream neighbor: NULL

         RPF prime neighbor: NULL

     Downstream interface(s) information:

     Total number of downstreams: 1

         1: GigabitEthernet0/0/1

             Protocol: pim-sm, UpTime: 00:02:10, Expires: -

  • RP向组播源发送(S  G)join报文,报文到达R1,R1添加下游接口,它向RP同时发送组播报文和单播注册报文。

<R1>display pim routing-table

 VPN-Instance: public net

 Total 0 (*, G) entry; 1 (S, G) entry

 (10.1.1.100, 224.1.1.1)

     RP: 4.4.4.4

     Protocol: pim-sm, Flag: SPT LOC ACT

     UpTime: 00:05:30

     Upstream interface: GigabitEthernet0/0/0

         Upstream neighbor: NULL

         RPF prime neighbor: NULL

     Downstream interface(s) information:

     Total number of downstreams: 1

         1: GigabitEthernet0/0/2

             Protocol: pim-sm, UpTime: 00:05:28, Expires: 00:02:54

  • RP收到单播注册报文和组播报文后,就发送register-stop,其报文格式如图9-49所示:

                                                     图9-49:register-stop包文格式

  • 单播注册和单播注册停止如图9-50所示:

                                                 图9-50:单播注册和单播注册停

华为Datacom网络工程师HCIP全套学习课程(全套理论+实验)-学习视频教程-腾讯课堂

(4)由RPT切换到STP,其流程图如图9-51所示:

                                               图9-51:由RPT切换到STP

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值