DynagenでCCIEを目指す
20100322 PIM sparse-mode RPをstaticに設定
最終更新:
it_certification
-
view
目的
- マルチキャスト sparse-modeの一番簡単な設定を確認します。
- RPはstaticに設定します。
構成
- 設定概要
- OSPFを有効化
- multicastを有効化
- 全I/Fをsparse modeに
- R1 loopback0をstaticにRPとして設定
- 構成図

- netファイル
ghostios = True sparsemem = True model = 3660 [localhost] [[3660]] image = C:\Program Files\Dynamips\images\C3660-I-Mz_20121-5_20T8.bin ram = 128 [[ROUTER R1]] f0/0 = NIO_gen_eth:\Device\NPF_{EEC4A317-FFD6-4B4A-9787-64BB3651D3B0} f1/0 = R2 f1/0 [[ROUTER R2]] f2/0 = R3 f2/0 [[ROUTER R3]]
- R1
Current configuration : 1006 bytes ! version 12.1 no service single-slot-reload-enable service timestamps debug uptime service timestamps log uptime no service password-encryption ! hostname R1 ! logging rate-limit console 10 except errors ! ip subnet-zero ! ! no ip finger no ip domain-lookup ! ip multicast-routing ! ! ! 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 FastEthernet0/1 ip address 192.168.3.1 255.255.255.0 ip pim sparse-mode no keepalive 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 ! router ospf 1 log-adjacency-changes network 10.0.0.1 0.0.0.0 area 0 network 192.168.0.0 0.0.0.255 area 0 network 192.168.1.0 0.0.0.255 area 0 network 192.168.3.0 0.0.0.255 area 0 ! ip classless no ip http server ip pim rp-address 10.0.0.1 ! ! line con 0 transport input none line aux 0 line vty 0 4 ! end
- R2
Current configuration : 907 bytes ! version 12.1 no service single-slot-reload-enable service timestamps debug uptime service timestamps log uptime no service password-encryption ! hostname R2 ! logging rate-limit console 10 except errors ! ip subnet-zero ! ! no ip finger no ip domain-lookup ! ip multicast-routing ! ! ! interface FastEthernet0/0 no ip address shutdown duplex auto speed auto ! interface FastEthernet0/1 no ip address shutdown duplex auto speed auto ! interface FastEthernet1/0 ip address 192.168.1.2 255.255.255.0 ip pim sparse-mode duplex auto speed auto ! interface FastEthernet2/0 ip address 192.168.2.2 255.255.255.0 ip pim sparse-mode duplex auto speed auto ! router ospf 1 log-adjacency-changes network 192.168.1.0 0.0.0.255 area 0 network 192.168.2.0 0.0.0.255 area 0 ! ip classless no ip http server ip pim rp-address 10.0.0.1 ! ! line con 0 transport input none line aux 0 line vty 0 4 ! end
- R3
Current configuration : 850 bytes ! version 12.1 no service single-slot-reload-enable service timestamps debug uptime service timestamps log uptime no service password-encryption ! hostname R3 ! logging rate-limit console 10 except errors ! ip subnet-zero ! ! no ip finger no ip domain-lookup ! ip multicast-routing ! ! ! interface Loopback0 ip address 10.0.0.3 255.255.255.255 ip pim sparse-mode ! interface FastEthernet0/0 no ip address shutdown duplex auto speed auto ! interface FastEthernet0/1 no ip address shutdown duplex auto speed auto ! interface FastEthernet2/0 ip address 192.168.2.3 255.255.255.0 ip pim sparse-mode duplex auto speed auto ! router ospf 1 log-adjacency-changes network 10.0.0.3 0.0.0.0 area 0 network 192.168.2.0 0.0.0.255 area 0 ! ip classless no ip http server ip pim rp-address 10.0.0.1 ! ! line con 0 transport input none line aux 0 line vty 0 4 ! end
multicastの設定確認
- PIM interfaceの確認
全てのルータの全I/Fがsparse modeとして設定されている事を確認します
R1#show ip pim interface Address Interface Ver/ Nbr Query DR DR Mode Count Intvl Prior 192.168.0.1 FastEthernet0/0 v2/S 0 30 1 192.168.0.1 192.168.3.1 FastEthernet0/1 v2/S 0 30 1 192.168.3.1 192.168.1.1 FastEthernet1/0 v2/S 1 30 1 192.168.1.2
- RPの確認
RPの設定ができているかどうかを確認します。
なお、(?)は名前解決ができなかったという意味です。
ちなみに、no ip domain-lookupを忘れると、IPアドレスに対する名前をいちいち解決しようとするので、show ip pim rp mappingの表示に非常に時間がかかります。
なお、(?)は名前解決ができなかったという意味です。
ちなみに、no ip domain-lookupを忘れると、IPアドレスに対する名前をいちいち解決しようとするので、show ip pim rp mappingの表示に非常に時間がかかります。
R3#show ip pim rp mapping PIM Group-to-RP Mappings Group(s) 224.0.1.39/32 RP 10.0.0.1 (?), v1 Info source: local, via Auto-RP Uptime: 00:11:07, expires: never Group(s) 224.0.1.40/32 RP 10.0.0.1 (?), v1 Info source: local, via Auto-RP Uptime: 00:11:07, expires: never Group(s): 224.0.0.0/4, Static RP: 10.0.0.1 (?)
検証1 PIM joinの確認
- パケットキャプチャの準備
Dynamipsに以下のコマンドを投入し、R1 f1/0のパケットキャプチャを開始します
=> capture R1 f1/0 cap_R1_10.cap
- デバッグの有効化
全てのルータでデバッグを有効にします
debug ip pim
- R3 loopback 0をマルチキャストグループに参加させます。
R3(config)#int loopback 0 R3(config-if)#ip igmp static-group 239.1.1.1
- join メッセージの確認
joinメッセージを送信した旨をデバッグメッセージを確認できます。
ちなみに、以下の引用はR2のデバッグメッセージです。
ちなみに、以下の引用はR2のデバッグメッセージです。
02:12:12: PIM: Received v2 Join/Prune on FastEthernet2/0 from 192.168.2.3, to us 02:12:12: PIM: Join-list: (*, 239.1.1.1) RP 10.0.0.1
パケットキャプチャの結果からは以下のようなjoinメッセージを確認できます。

検証2 共有ツリーの確認
- 検証1の設定削除
マルチキャストグループからの脱退
R3(config)#int loopback 0 R3(config-if)#no ip igmp static-group 239.1.1.1
全てのルータでデバッグを無効にします
no debug ip pim
全ルータのマルチキャストルーティングテーブルを削除します。
clear ip mroute *
- デバッグの有効化
debug ip mroute
- デバッグメッセージの確認
R2では、共有ツリーが作成されたりRPF checkが行われたりする様子が分かります。
02:12:12: MRT: Create (*, 239.1.1.1), RPF Null, PC 0x60775914 02:12:12: PIM: Check RP 10.0.0.1 into the (*, 239.1.1.1) entry, RPT-bit set, WC-bit set, S-bit set
- 共通ツリーの確認
R3の確認
R3#show ip mroute IP Multicast Routing Table Flags: D - Dense, S - Sparse, B - Bidir Group, s - SSM Group, C - Connected, L - Local, P - Pruned, R - RP-bit set, F - Register flag, T - SPT-bit set, J - Join SPT, M - MSDP created entry, X - Proxy Join Timer Running, A - Advertised via MSDP, U - URD, I - Received Source Specific Host Report Outgoing interface flags: H - Hardware switched Timers: Uptime/Expires Interface state: Interface, Next-Hop or VCD, State/Mode (*, 224.0.1.40), 00:09:25/00:00:00, RP 10.0.0.1, flags: SJPCL Incoming interface: FastEthernet2/0, RPF nbr 192.168.2.2 Outgoing interface list: Null (*, 239.1.1.1), 00:08:53/00:00:00, RP 10.0.0.1, flags: SJC Incoming interface: FastEthernet2/0, RPF nbr 192.168.2.2 Outgoing interface list: Loopback0, Forward/Sparse, 00:08:53/00:00:00
R2の確認
R2#show ip mroute IP Multicast Routing Table Flags: D - Dense, S - Sparse, B - Bidir Group, s - SSM Group, C - Connected, L - Local, P - Pruned, R - RP-bit set, F - Register flag, T - SPT-bit set, J - Join SPT, M - MSDP created entry, X - Proxy Join Timer Running, A - Advertised via MSDP, U - URD, I - Received Source Specific Host Report Outgoing interface flags: H - Hardware switched Timers: Uptime/Expires Interface state: Interface, Next-Hop or VCD, State/Mode (*, 224.0.1.40), 00:10:10/00:00:00, RP 10.0.0.1, flags: SJCL Incoming interface: FastEthernet1/0, RPF nbr 192.168.1.1 Outgoing interface list: FastEthernet2/0, Forward/Sparse, 00:10:03/00:03:21 (*, 239.1.1.1), 00:09:31/00:02:56, RP 10.0.0.1, flags: S Incoming interface: FastEthernet1/0, RPF nbr 192.168.1.1 Outgoing interface list: FastEthernet2/0, Forward/Sparse, 00:09:31/00:02:56
R1の確認
R1#show ip mroute IP Multicast Routing Table Flags: D - Dense, S - Sparse, B - Bidir Group, s - SSM Group, C - Connected, L - Local, P - Pruned, R - RP-bit set, F - Register flag, T - SPT-bit set, J - Join SPT, M - MSDP created entry, X - Proxy Join Timer Running, A - Advertised via MSDP, U - URD, I - Received Source Specific Host Report Outgoing interface flags: H - Hardware switched Timers: Uptime/Expires Interface state: Interface, Next-Hop or VCD, State/Mode (*, 239.255.255.250), 00:10:23/00:02:06, RP 10.0.0.1, flags: SJC Incoming interface: Null, RPF nbr 0.0.0.0 Outgoing interface list: FastEthernet0/0, Forward/Sparse, 00:10:23/00:02:06 (*, 224.0.1.40), 00:10:46/00:00:00, RP 10.0.0.1, flags: SJCL Incoming interface: Null, RPF nbr 0.0.0.0 Outgoing interface list: FastEthernet1/0, Forward/Sparse, 00:10:38/00:02:46 FastEthernet0/0, Forward/Sparse, 00:10:46/00:02:05
(*, 239.1.1.1), 00:10:01/00:03:25, RP 10.0.0.1, flags: S Incoming interface: Null, RPF nbr 0.0.0.0 Outgoing interface list: FastEthernet1/0, Forward/Sparse, 00:10:01/00:03:25
- VLC media playerの起動
PCのループバックアドレスを239.1.1.1のマルチキャストグループに参加させます
- R1のマルチキャストルーティングテーブルを再確認
(*, 239.1.1.1)のOILに、PCのループバックアドレス宛てが追加されています。
R1#show ip mroute IP Multicast Routing Table Flags: D - Dense, S - Sparse, B - Bidir Group, s - SSM Group, C - Connected, L - Local, P - Pruned, R - RP-bit set, F - Register flag, T - SPT-bit set, J - Join SPT, M - MSDP created entry, X - Proxy Join Timer Running, A - Advertised via MSDP, U - URD, I - Received Source Specific Host Report Outgoing interface flags: H - Hardware switched Timers: Uptime/Expires Interface state: Interface, Next-Hop or VCD, State/Mode (*, 239.255.255.250), 00:12:52/00:02:37, RP 10.0.0.1, flags: SJC Incoming interface: Null, RPF nbr 0.0.0.0 Outgoing interface list: FastEthernet0/0, Forward/Sparse, 00:12:52/00:02:37 (*, 224.0.1.40), 00:13:15/00:00:00, RP 10.0.0.1, flags: SJCL Incoming interface: Null, RPF nbr 0.0.0.0 Outgoing interface list: FastEthernet1/0, Forward/Sparse, 00:13:07/00:03:15 FastEthernet0/0, Forward/Sparse, 00:13:15/00:02:42 (*, 239.1.1.1), 00:12:30/00:02:56, RP 10.0.0.1, flags: SJC Incoming interface: Null, RPF nbr 0.0.0.0 Outgoing interface list: FastEthernet0/0, Forward/Sparse, 00:00:04/00:02:56 <- PC宛てが追加 FastEthernet1/0, Forward/Sparse, 00:12:30/00:02:56
検証3 Register / Register-stop
- switch overの無効化
このシナリオではRP経由のパケットを観察したいので、全ルータでswitch overを無効化します。
※ 通常はラストホップルータでのみ行えば良い設定ですが、このシナリオではルータのI/Fがマルチキャストレシーバになっているため、念のために全ルータで無効化しておきます。
※ 通常はラストホップルータでのみ行えば良い設定ですが、このシナリオではルータのI/Fがマルチキャストレシーバになっているため、念のために全ルータで無効化しておきます。
R2(config)#ip pim spt-threshold infinity
- パケットキャプチャの準備
Dynamipsに以下のコマンドを投入し、R1 f1/0のパケットキャプチャを開始します
=> capture R1 f1/0 cap_R1_10.cap
- ping送信
R3からマルチキャストアドレス宛てのpingを送信します。
R3#ping 239.1.1.1 Type escape sequence to abort. Sending 1, 100-byte ICMP Echos to 239.1.1.1, timeout is 2 seconds: .
- マルチキャストルーティングテーブルの確認
R1, R2, R3のいずれのルータでも、送信元からRPまでのツリーが作成されている事が確認できます
R1#show ip mroute - 略 - (192.168.2.3, 239.1.1.1), 00:00:13/00:02:46, flags: PXA Incoming interface: FastEthernet1/0, RPF nbr 192.168.1.2 Outgoing interface list: Null R2#show ip mroute - 略 - (192.168.2.3, 239.1.1.1), 00:00:09/00:02:50, flags: T Incoming interface: FastEthernet2/0, RPF nbr 0.0.0.0 Outgoing interface list: FastEthernet1/0, Forward/Sparse, 00:00:09/00:03:29 R3#show ip mroute - 略 - (192.168.2.3, 239.1.1.1), 00:00:06/00:02:53, flags: CFT Incoming interface: FastEthernet2/0, RPF nbr 0.0.0.0, Registering Outgoing interface list: Loopback0, Forward/Sparse, 00:00:06/00:02:53
- デバッグメッセージの確認
R1では、Registerメッセージが確認できます。Registerの一分後にRegister-Stopが確認できます。
00:06:36: PIM: Received v2 Register on FastEthernet1/0 from 192.168.2.3 - 略 - 00:07:36: PIM: Received Register on FastEthernet1/0 from 192.168.2.3 00:07:36: PIM: Send Register-Stop to 192.168.2.3 for 0.0.0.0, group 0.0.0.0
- パケットキャプチャの確認
Registerメッセージを確認できます。Registerは、送信元からRPまでのツリーを作成するパケットです。Register送信前は、マルチキャストで転送する事ができないため、パケットをPIM Registerでカプセル化してユニキャストで送信します。
パケットをよく見ると、宛先がユニキャストになっている事とpingがカプセル化されている事が確認できます。
パケットをよく見ると、宛先がユニキャストになっている事とpingがカプセル化されている事が確認できます。

Registerの一分後には、Register-Stopが確認できます。
