DynagenでCCIEを目指す
20100403 PIM auto-RP sparse-dense-modeを使用
最終更新:
it_certification
-
view
目的
- マルチキャストにおける、auto-rpの設定方法を確認します。
- RPの選出および発見は、I/Fをsparse-dense-modeに設定する事で実現します。
構成
- 設定概要
- Dynagen上のルータR1とWindows上のloopback adapterを接続します。
- loopback adapterの設定方法は「トップページ/手順書 ネットワーク系/Loopbackインターフェースとの接続」を確認してください。
- VLC media playerを用いて、loopback adapterをマルチキャストグループに参加させます。
- staticでルーティングします。
- 全ルータでマルチキャストを有効にします。
- 全I/Fをspase-modeにします。(検証2で、spase-dense-modeに変更します)
- R2 loopback0をRP候補にします。
- R3をMapping Agentにします。
- 構成図

- netファイル
ghostios = True
sparsemem = True
model = 3620
[localhost]
[[3620]]
image = C:\Program Files\Dynamips\images\c3620-j1s3-mz.123-18.bin
ram = 256
[[ROUTER R1]]
f0/0 = NIO_gen_eth:\Device\NPF_{EEC4A317-FFD6-4B4A-9787-64BB3651D3B0}
f1/0 = R2 f0/0
[[ROUTER R2]]
f1/0 = R3 f0/0
[[ROUTER R3]]
- R1
! version 12.3 service timestamps debug datetime msec service timestamps log datetime msec no service password-encryption ! hostname R1 ! boot-start-marker boot-end-marker ! ! no aaa new-model ip subnet-zero ! ! no ip domain lookup ! ip multicast-routing ip cef ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! interface Loopback0 ip address 10.0.0.1 255.255.255.255 ip pim sparse-mode ! interface FastEthernet0/0 ip address 192.168.0.1 255.255.255.0 ip pim sparse-mode duplex auto speed auto ! interface FastEthernet1/0 ip address 192.168.1.1 255.255.255.0 ip pim sparse-mode duplex auto speed auto ! ip http server ip classless ip route 0.0.0.0 0.0.0.0 192.168.1.2 ! ! ! ! ! ! ! ! line con 0 line aux 0 line vty 0 4 ! ! end
- R2
! version 12.3 service timestamps debug datetime msec service timestamps log datetime msec no service password-encryption ! hostname R2 ! boot-start-marker boot-end-marker ! ! no aaa new-model ip subnet-zero ! ! no ip domain lookup ! ip multicast-routing ip cef ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! interface Loopback0 ip address 10.0.0.2 255.255.255.255 ip pim sparse-mode ! interface FastEthernet0/0 ip address 192.168.1.2 255.255.255.0 ip pim sparse-mode duplex auto speed auto ! interface FastEthernet1/0 ip address 192.168.2.2 255.255.255.0 ip pim sparse-mode duplex auto speed auto ! ip http server ip classless ip route 0.0.0.0 0.0.0.0 192.168.1.1 ! ip pim send-rp-announce Loopback0 scope 16 group-list 1 interval 15 ! access-list 1 permit 239.1.1.1 ! ! ! ! ! ! line con 0 line aux 0 line vty 0 4 ! ! end
- R2
! version 12.3 service timestamps debug datetime msec service timestamps log datetime msec no service password-encryption ! hostname R2 ! boot-start-marker boot-end-marker ! ! no aaa new-model ip subnet-zero ! ! no ip domain lookup ! ip multicast-routing ip cef ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! interface Loopback0 ip address 10.0.0.2 255.255.255.255 ip pim sparse-mode ! interface FastEthernet0/0 ip address 192.168.1.2 255.255.255.0 ip pim sparse-mode duplex auto speed auto ! interface FastEthernet1/0 ip address 192.168.2.2 255.255.255.0 ip pim sparse-mode duplex auto speed auto ! ip http server ip classless ip route 0.0.0.0 0.0.0.0 192.168.1.1 ! ip pim send-rp-announce Loopback0 scope 16 group-list 1 interval 15 ! access-list 1 permit 239.1.1.1 ! ! ! ! ! ! line con 0 line aux 0 line vty 0 4 ! ! end
- R3
! version 12.3 service timestamps debug datetime msec service timestamps log datetime msec no service password-encryption ! hostname R3 ! boot-start-marker boot-end-marker ! ! no aaa new-model ip subnet-zero ! ! no ip domain lookup ! ip multicast-routing ip cef ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! interface Loopback0 ip address 10.0.0.3 255.255.255.255 ip pim sparse-mode ! interface FastEthernet0/0 ip address 192.168.2.3 255.255.255.0 ip pim sparse-mode duplex auto speed auto ! ip http server ip classless ip route 0.0.0.0 0.0.0.0 192.168.2.2 ! ip pim send-rp-discovery scope 16 interval 20 ! ! ! ! ! ! ! line con 0 line aux 0 line vty 0 4 ! ! end
検証1 RP候補, MAの設定
- RP候補の設定
R2 loopback 0をRP候補として設定します。
R2(config)#ip pim send-rp-announce loopback 0 scope 16 group-list 1 interval 15
- MAの設定
R3をMapping Agentとして設定します。
R3(config)#ip pim send-rp-discovery scope 16 interval 20
- パケットキャプチャの設定
R2 0/1でパケットキャプチャを行います。
=> capture R2 f0/1 cap_R2_01.cap
- パケットキャプチャの確認
宛先が224.0.1.39の自信がRP候補である事をMAに通知するパケット(RP announcement)と、宛先が224.0.1.40のMAがRPを通知するパケット(RP mapping)が確認できます。


- RPの確認
RPを選出および発見するためには239.0.1.39と239.0.1.40宛てのマルチキャスト通信を行います。RP選出前は、sparse-modeでマルチキャストパケットを転送できないため、ルータはRPを認識する事ができません。
show ip pim rp mappingコマンドを入力すると、RPは表示されない事が確認できます。
show ip pim rp mappingコマンドを入力すると、RPは表示されない事が確認できます。
R1#show ip pim rp mapping PIM Group-to-RP Mappings R2#show ip pim rp mapping PIM Group-to-RP Mappings This system is an RP (Auto-RP) R3#show ip pim rp mapping PIM Group-to-RP Mappings This system is an RP-mapping agent
- マルチキャストルーティングテーブルの確認
RPを認識していないため、239.1.1.1の共有ツリーはまだ作成されていません。
R1#show ip mroute
- 略 -
(*, 239.1.1.1), 00:39:07/00:02:18, RP 0.0.0.0, flags: DC
Incoming interface: Null, RPF nbr 0.0.0.0 <- 共有ツリーがまだ作成されていないため
Outgoing interface list: IncomingがNullになっています。
FastEthernet0/0, Forward/Sparse, 00:39:07/00:02:18
(*, 224.0.1.39), 00:24:35/stopped, RP 0.0.0.0, flags: DP
Incoming interface: Null, RPF nbr 0.0.0.0
Outgoing interface list: Null
(10.0.0.2, 224.0.1.39), 00:02:44/00:00:15, flags: PT
Incoming interface: FastEthernet1/0, RPF nbr 192.168.1.2
Outgoing interface list: Null
(*, 224.0.1.40), 00:41:02/00:02:08, RP 0.0.0.0, flags: DPL
Incoming interface: Null, RPF nbr 0.0.0.0
Outgoing interface list: Null
(*, 239.255.255.250), 00:40:53/00:02:16, RP 0.0.0.0, flags: DC
Incoming interface: Null, RPF nbr 0.0.0.0
Outgoing interface list:
FastEthernet0/0, Forward/Sparse, 00:40:54/00:02:15
R2#show ip mroute
- 略 -
(*, 224.0.1.39), 00:25:20/stopped, RP 0.0.0.0, flags: DP
Incoming interface: Null, RPF nbr 0.0.0.0
Outgoing interface list: Null
(10.0.0.2, 224.0.1.39), 00:25:20/00:02:55, flags: PT
Incoming interface: Loopback0, RPF nbr 0.0.0.0
Outgoing interface list: Null
(*, 224.0.1.40), 00:35:34/00:02:23, RP 0.0.0.0, flags: DCL
Incoming interface: Null, RPF nbr 0.0.0.0
Outgoing interface list:
FastEthernet0/0, Forward/Sparse, 00:35:34/00:02:23
R3#show ip mroute
- 略 -
(*, 224.0.1.39), 00:03:17/stopped, RP 0.0.0.0, flags: DCL
Incoming interface: Null, RPF nbr 0.0.0.0
Outgoing interface list:
Loopback0, Forward/Sparse, 00:03:17/00:02:37
FastEthernet0/0, Forward/Sparse, 00:03:17/00:02:57
(10.0.0.2, 224.0.1.39), 00:00:01/00:02:58, flags: L
Incoming interface: Null, RPF nbr 0.0.0.0
Outgoing interface list:
FastEthernet0/0, Forward/Sparse, 00:00:01/00:02:58
Loopback0, Forward/Sparse, 00:00:01/00:02:58
(*, 224.0.1.40), 00:03:17/00:02:53, RP 0.0.0.0, flags: DCL
Incoming interface: Null, RPF nbr 0.0.0.0
Outgoing interface list:
FastEthernet0/0, Forward/Sparse, 00:03:17/00:02:53
検証2 sparse-dense-modeに変更
- sparse-dense-modeに変更
全ルータの全I/Fをsparse-dense-modeに変更します。
R1(config)#interface FastEthernet 0/0
R1(config-if)#ip pim sparse-dense-mode
R1(config-if)#exit
R1(config)#interface FastEthernet 1/0
R1(config-if)#ip pim sparse-dense-mode
R1(config-if)#exit
R1(config)#interface Loopback 0
R1(config-if)#ip pim sparse-dense-mode
R1(config-if)#do show ip pim interface
Address Interface Ver/ Nbr Query DR DR
Mode Count Intvl Prior
192.168.0.1 FastEthernet0/0 v2/SD 0 30 1 192.168.0.1 <- SDになっている事を確認
192.168.1.1 FastEthernet1/0 v2/SD 1 30 1 192.168.1.2 <- SDになっている事を確認
10.0.0.1 Loopback0 v2/SD 0 30 1 10.0.0.1 <- SDになっている事を確認
- RPの確認
検証1の時と異なり、RPを認識している事が確認できます。
R1#show ip pim rp mapping
PIM Group-to-RP Mappings
Group(s) 239.1.1.1/32
RP 10.0.0.2 (?), v2v1
Info source: 192.168.2.3 (?), elected via Auto-RP
Uptime: 00:13:07, expires: 00:02:46
R2#show ip pim rp mapping
PIM Group-to-RP Mappings
This system is an RP (Auto-RP)
Group(s) 239.1.1.1/32
RP 10.0.0.2 (?), v2v1
Info source: 192.168.2.3 (?), elected via Auto-RP
Uptime: 00:13:29, expires: 00:02:22
R3#show ip pim rp mapping
PIM Group-to-RP Mappings
This system is an RP-mapping agent
Group(s) 239.1.1.1/32
RP 10.0.0.2 (?), v2v1
Info source: 10.0.0.2 (?), elected via Auto-RP
Uptime: 00:18:38, expires: 00:00:40
- マルチキャストルーティングテーブルの確認
検証1の時と異なり、239.1.1.1の共有ツリーが作成されています。
R1#show ip mroute
- 略 -
(*, 239.1.1.1), 00:10:39/00:02:19, RP 10.0.0.2, flags: SJC
Incoming interface: FastEthernet1/0, RPF nbr 192.168.1.2 <- IncomingがNullからf1/0に変わります
Outgoing interface list:
FastEthernet0/0, Forward/Sparse-Dense, 00:10:39/00:02:19
(*, 224.0.1.39), 00:10:44/stopped, RP 0.0.0.0, flags: D
Incoming interface: Null, RPF nbr 0.0.0.0
Outgoing interface list:
FastEthernet1/0, Forward/Sparse-Dense, 00:10:44/00:00:00
(10.0.0.2, 224.0.1.39), 00:01:20/00:01:39, flags: PT
Incoming interface: FastEthernet1/0, RPF nbr 192.168.1.2
Outgoing interface list: Null
(*, 224.0.1.40), 00:10:47/stopped, RP 0.0.0.0, flags: DCL
Incoming interface: Null, RPF nbr 0.0.0.0
Outgoing interface list:
FastEthernet1/0, Forward/Sparse-Dense, 00:10:47/00:00:00
(192.168.2.3, 224.0.1.40), 00:10:25/00:02:30, flags: PLT
Incoming interface: FastEthernet1/0, RPF nbr 192.168.1.2
Outgoing interface list: Null
(*, 239.255.255.250), 00:09:48/00:02:20, RP 0.0.0.0, flags: DC
Incoming interface: Null, RPF nbr 0.0.0.0
Outgoing interface list:
FastEthernet1/0, Forward/Sparse-Dense, 00:09:48/00:00:00
FastEthernet0/0, Forward/Sparse-Dense, 00:09:48/00:00:00
R2#show ip mroute
- 略 -
(*, 239.1.1.1), 00:10:54/00:02:33, RP 10.0.0.2, flags: S <- (*, 239.1.1.1)のエントリが加わります
Incoming interface: Null, RPF nbr 0.0.0.0
Outgoing interface list:
FastEthernet0/0, Forward/Sparse-Dense, 00:10:54/00:02:33
(*, 224.0.1.39), 00:10:58/stopped, RP 0.0.0.0, flags: DC
Incoming interface: Null, RPF nbr 0.0.0.0
Outgoing interface list:
FastEthernet1/0, Forward/Sparse-Dense, 00:10:58/00:00:00
FastEthernet0/0, Forward/Sparse-Dense, 00:10:58/00:00:00
(10.0.0.2, 224.0.1.39), 00:10:58/00:02:44, flags: T
Incoming interface: Loopback0, RPF nbr 0.0.0.0
Outgoing interface list:
FastEthernet0/0, Prune/Sparse-Dense, 00:01:34/00:01:55
FastEthernet1/0, Forward/Sparse-Dense, 00:10:58/00:00:00
(*, 224.0.1.40), 00:11:10/stopped, RP 0.0.0.0, flags: DCL
Incoming interface: Null, RPF nbr 0.0.0.0
Outgoing interface list:
FastEthernet1/0, Forward/Sparse-Dense, 00:11:11/00:00:00
FastEthernet0/0, Forward/Sparse-Dense, 00:11:11/00:00:00
(192.168.2.3, 224.0.1.40), 00:10:39/00:02:16, flags: LT
Incoming interface: FastEthernet1/0, RPF nbr 0.0.0.0
Outgoing interface list:
FastEthernet0/0, Forward/Sparse-Dense, 00:10:39/00:00:00
R3#show ip mroute
- 略 -
(*, 224.0.1.39), 00:21:56/stopped, RP 0.0.0.0, flags: DCL
Incoming interface: Null, RPF nbr 0.0.0.0
Outgoing interface list:
FastEthernet0/0, Forward/Sparse, 00:21:56/00:02:38
Loopback0, Forward/Sparse, 00:21:56/00:02:07
(10.0.0.2, 224.0.1.39), 00:21:50/00:02:55, flags: LT
Incoming interface: FastEthernet0/0, RPF nbr 192.168.2.2
Outgoing interface list:
Loopback0, Forward/Sparse, 00:21:50/00:02:07
(*, 224.0.1.40), 00:21:56/00:02:08, RP 0.0.0.0, flags: DCL
Incoming interface: Null, RPF nbr 0.0.0.0
Outgoing interface list:
Loopback0, Forward/Sparse, 00:21:56/00:02:08
- デバッグの有効化
全てのルータで以下のデバッグを有効にします。
R1#debug ip pim auto-rp PIM Auto-RP debugging is on
- デバッグメッセージの確認
R1では、RP-discoverryの受信が確認できます。
*Mar 1 00:09:23.275: Auto-RP(0): Update (239.1.1.1/32, RP:10.0.0.2), PIMv2 v1 *Mar 1 00:09:53.239: Auto-RP(0): Received RP-discovery, from 192.168.2.3, RP_cnt 1, ht 61 *Mar 1 00:09:53.243: Auto-RP(0): Update (239.1.1.1/32, RP:10.0.0.2), PIMv2 v1 *Mar 1 00:10:00.291: Auto-RP(0): Received RP-discovery, from 192.168.2.3, RP_cnt 1, ht 61 *Mar 1 00:10:00.295: Auto-RP(0): Update (239.1.1.1/32, RP:10.0.0.2), PIMv2 v1 *Mar 1 00:10:10.419: Auto-RP(0): Received RP-discovery, from 192.168.2.3, RP_cnt 1, ht 61 *Mar 1 00:10:10.423: Auto-RP(0): Update (239.1.1.1/32, RP:10.0.0.2), PIMv2 v1
R2では、RP-discoverryの受信とRP-Announceの送信が確認できます。
*Mar 1 00:15:04.815: Auto-RP(0): Build RP-Announce for 10.0.0.2, PIMv2/v1, ttl 16, ht 46 *Mar 1 00:15:04.815: Auto-RP(0): Build announce entry for (239.1.1.1/32) *Mar 1 00:15:04.819: Auto-RP(0): Send RP-Announce packet on FastEthernet0/0 *Mar 1 00:15:04.819: Auto-RP(0): Send RP-Announce packet on FastEthernet1/0 *Mar 1 00:15:04.823: Auto-RP: Send RP-Announce packet on Loopback0 *Mar 1 00:15:18.491: Auto-RP(0): Received RP-discovery, from 192.168.2.3, RP_cnt 1, ht 181 *Mar 1 00:15:18.495: Auto-RP(0): Added with (239.1.1.1/32, RP:10.0.0.2), PIMv2 v1
R3では、RP-discoverryの送信とRP-Announceの受信が確認できます。
*Mar 1 00:20:40.503: Auto-RP(0): Received RP-announce, from 10.0.0.2, RP_cnt 1, ht 46 *Mar 1 00:20:40.507: Auto-RP(0): Update (239.1.1.1/32, RP:10.0.0.2), PIMv2 v1 *Mar 1 00:20:56.575: Auto-RP(0): Received RP-announce, from 10.0.0.2, RP_cnt 1, ht 46 *Mar 1 00:20:56.579: Auto-RP(0): Update (239.1.1.1/32, RP:10.0.0.2), PIMv2 v1 *Mar 1 00:20:56.583: Auto-RP(0): Received RP-announce, from 10.0.0.2, RP_cnt 1, ht 46 *Mar 1 00:20:56.583: Auto-RP(0): Update (239.1.1.1/32, RP:10.0.0.2), PIMv2 v1 *Mar 1 00:20:58.515: Auto-RP(0): Build RP-Discovery packet *Mar 1 00:20:58.515: Auto-RP: Build mapping (239.1.1.1/32, RP:10.0.0.2), PIMv2 v1, *Mar 1 00:20:58.515: Auto-RP(0): Send RP-discovery packet on FastEthernet0/0 (1 RP entries) *Mar 1 00:21:11.551: Auto-RP(0): Received RP-announce, from 10.0.0.2, RP_cnt 1, ht 46 *Mar 1 00:21:11.555: Auto-RP(0): Update (239.1.1.1/32, RP:10.0.0.2), PIMv2 v1
補足
稀にRPを認識しない事があります。
私の場合は、以下のようにRPとマルチキャストルーティングテーブルをクリアすると、RPを認識してくれました。原因は不明です。
私の場合は、以下のようにRPとマルチキャストルーティングテーブルをクリアすると、RPを認識してくれました。原因は不明です。
R1#clear ip pim rp-mapping R1#clear ip mroute *