PIM Operation and Daemons
Both Linux and FreeBSD support PIM-SMv2 and PIM-DM natively, with the requirement of additional user-space PIM daemons (either USC pimd or XORP). PIM-SM is a sparse-mode shared-tree multicast routing protocol, whereas PIM-DM is a dense-mode distance-vector protocol. PIM is a complex protocol, and its discussion goes far beyond this quick introductory chapter. For more information, consult RFC 2362.
Lab 14-2: Native Linux and FreeBSD Multicast (PIM-SMv2) in Combination with Cisco PIM-SM-DM
For this lab, you must enable PIM-SMv2 in the Linux and FreeBSD kernel (see the configurations in Appendix A, "UNIX Kernel Configuration Files") and install the USC pimd. The pimd configuration file is /etc/pimd.conf. Just start pimd with the sequence pimd-c /etc/pimd.conf or use pimd -c /etc/pimd.conf -d all for extensive debugging output.
For this lab, pimd is running on callisto and castor; the Cisco configuration of scar is shown in Example 14-14. Note that ganymed still runs mrouted and remains connected to scar via the DVMRP tunnel. Therefore, scar acts as a DVMRP-PIM gateway, which is quite common when connecting legacy DVMRP domains to PIM domains. In this lab, you will learn about essential PIM operation, rendezvous points (RPs), and the PIM bootstrap mechanism router (BSR) for propagating RP sets.
CAUTION
An empty pimd.conf results in pimd not being available as a candidate RP (rendezvous point) and candidate BSR (bootstrap router).
NOTE
pimd can define scope zones that are similar to mrouted. This enables you to prevent certain multicast prefixes to be forwarded beyond a certain network boundary. (For example, add phyint eth0 scoped 239.0.0.0 masklen 8 to your pimd.conf file.)
Example 14-14. Scar IOS Multicast Configuration Featuring PIM and DVMRP
scar# show running-config
...
!
ip multicast-routing
ip multicast route-limit 100
!
interface Loopback0
ip address 10.0.0.1 255.255.255.255
!
interface Tunnel0
ip unnumbered Loopback0
ip pim sparse-dense-mode
ip igmp join-group 224.2.2.2
tunnel source 192.168.14.254
tunnel destination 192.168.1.254
tunnel mode dvmrp
!
interface Ethernet0
bandwidth 10000
ip address 192.168.7.254 255.255.255.0
no ip proxy-arp
ip pim sparse-dense-mode
ip load-sharing per-packet
no ip route-cache
ip igmp join-group 224.2.2.2
ip cgmp
no ip mroute-cache
media-type 10BaseT
random-detect
!
interface Ethernet1
bandwidth 10000
ip address 192.168.14.254 255.255.255.0
no ip proxy-arp
ip pim sparse-dense-mode
ip load-sharing per-packet
no ip route-cache
ip ospf network broadcast
ip igmp join-group 224.2.2.2
ip cgmp
no ip mroute-cache
media-type 10BaseT
random-detect
!
ip pim bsr-candidate Ethernet1 30 4
ip pim rp-candidate Ethernet1 group-list 11
!
access-list 11 permit 224.0.0.0 15.255.255.255
...
Examples 14-15, 14-16, and 14-17 demonstrate PIM output, debugging, and operation on Linux, Cisco IOS, and FreeBSD. It is worth mentioning that pimd operation creates its own interface (pimreg) on Linux systems (as shown in Example 14-15).
Example 14-15. pimd Results and Operation on Callisto
[root@callisto:~#] ifconfig
eth0 Link encap:Ethernet HWaddr 00:10:5A:D7:93:60
inet addr:192.168.14.1 Bcast:192.168.14.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:2211 errors:0 dropped:0 overruns:0 frame:0
TX packets:2826 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:252609 (246.6 Kb) TX bytes:314945 (307.5 Kb)
Interrupt:5 Base address:0xd800
eth1 Link encap:Ethernet HWaddr 52:54:05:E3:51:87
inet addr:192.168.1.1 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:27746 errors:0 dropped:0 overruns:0 frame:0
TX packets:32340 errors:0 dropped:0 overruns:0 carrier:0
collisions:490 txqueuelen:100
RX bytes:14612252 (13.9 Mb) TX bytes:4162570 (3.9 Mb)
Interrupt:9 Base address:0xd400
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:717 errors:0 dropped:0 overruns:0 frame:0
TX packets:717 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:337307 (329.4 Kb) TX bytes:337307 (329.4 Kb)
pimreg Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
UP RUNNING NOARP MTU:1472 Metric:1
RX packets:3 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:356 (356.0 b) TX bytes:0 (0.0 b)
[root@callisto:~#] netstat -g
IPv6/IPv4 Group Memberships
Interface RefCnt Group
--------------- ------ ---------------------
lo 1 ALL-SYSTEMS.MCAST.NET
eth0 1 ALL-ROUTERS.MCAST.NET
eth0 1 PIM-ROUTERS.MCAST.NET
eth0 1 ALL-SYSTEMS.MCAST.NET
eth1 1 ALL-ROUTERS.MCAST.NET
eth1 1 PIM-ROUTERS.MCAST.NET
eth1 1 NTP.MCAST.NET
eth1 1 ALL-SYSTEMS.MCAST.NET
eth1 1 224.2.2.2
pimreg 1 ALL-SYSTEMS.MCAST.NET
[root@callisto:~#] mtrace 192.168.7.7 192.168.14.1 224.2.2.2
Mtrace from 192.168.7.7 to 192.168.14.1 via group 224.2.2.2
Querying full reverse path...
0 ? (192.168.14.1)
-1 scar (192.168.14.254) PIM thresh^ 0 Reached RP/Core
Round trip time 2 ms; total ttl of 1 required.
Waiting to accumulate statistics...Results after 10 seconds:
Source Response Dest Overall Packet Statistics For Traffic From
* * * 224.0.1.32 Packet 192.168.7.7 To 224.2.2.2
v __/ rtt 1 ms Rate Lost/Sent = Pct Rate
192.168.14.254 scar Reached RP/Core
v \__ ttl 2 0 pps ?/0 0 pps
192.168.14.1 192.168.14.1
Receiver Query Source
[root@callisto:~#] pimd -c /etc/pimd.conf -d all
debug level 0xffffffff (dvmrp_detail,dvmrp_prunes,dvmrp_mrt,dvmrp_neighbors,dvmrp_timers
,igmp_proto,
igmp_timers,igmp_members,trace,timeout,pkt,interfaces,kernel,cache,rsrr,pim_detail
,pim_hello,pim_register,pim_join_prune,pim_bootstrap,pim_asserts,pim_cand_rp,
pim_routes,pim_timers,pim_rpf)
16:17:17.768 pimd version 2.1.0-alpha29.18 starting
16:17:17.768 Got 262144 byte send buffer size in 0 iterations
16:17:17.768 Got 262144 byte recv buffer size in 0 iterations
16:17:17.768 Got 262144 byte send buffer size in 0 iterations
16:17:17.768 Got 262144 byte recv buffer size in 0 iterations
16:17:17.769 Getting vifs from kernel
16:17:17.769 installing eth0 (192.168.14.1 on subnet 192.168.14) as vif #0-2 - rate=0
16:17:17.769 installing eth1 (192.168.1.1 on subnet 192.168.1) as vif #1-3 - rate=0
16:17:17.769 installing gre1 (10.10.10.1 -> 10.10.10.2) as vif #2-12 - rate=0
16:17:17.769 Getting vifs from /etc/pimd.conf
16:17:17.769 Local Cand-RP address is 192.168.14.1
16:17:17.769 Local Cand-RP priority is 30
16:17:17.769 Local Cand-RP advertisement period is 30 sec.
16:17:17.769 Local Cand-BSR address is 192.168.14.1
16:17:17.769 Local Cand-BSR priority is 3
16:17:17.770 Adding prefix 224.0.0.0/4
16:17:17.770 data_rate_limit is 50000 (bits/s)
16:17:17.770 data_rate_interval is 20 (seconds)
16:17:17.770 reg_rate_limit is 50000 (bits/s)
16:17:17.770 reg_rate_interval is 20 (seconds)
16:17:17.770 eth0 comes up; vif #0 now in service
16:17:17.770 SENT IGMP Membership Query from 192.168.14.1 to 224.0.0.1
16:17:17.770 SENT PIM v2 Hello from 192.168.14.1 to 224.0.0.13
16:17:17.770 eth1 comes up; vif #1 now in service
16:17:17.770 warning - sendto to 224.0.0.1 on 192.168.1.1: Invalid argument
16:17:17.771 warning - sendto from 192.168.1.1 to 224.0.0.13: Invalid argument
16:17:17.771 gre1 is DOWN; vif #2 out of service
16:17:17.771 register_vif0 comes up; vif #3 now in service
Virtual Interface Table
Vif Local-Address Subnet Thresh Flags Neighbors
0 192.168.14.1 192.168.14 1 DR NO-NBR
1 192.168.1.1 192.168.1 1 DR NO-NBR
2 10.10.10.1 10.10.10/30 1 DOWN
3 192.168.14.1 register_vif0 1
Multicast Routing Table
Source Group RP-addr Flags
--------------------------(*,*,RP)--------------------------
Number of Groups: 0
Number of Cache MIRRORs: 0
16:17:17.772 PIM HELLO holdtime from 192.168.14.254 is 105
16:17:17.772 SENT PIM v2 Hello from 192.168.14.1 to 224.0.0.13
16:17:17.773 sending PIM v2 Bootstrap from 192.168.14.1 to 192.168.14.254
Virtual Interface Table
Vif Local-Address Subnet Thresh Flags Neighbors
0 192.168.14.1 192.168.14 1 PIM 192.168.14.254
1 192.168.1.1 192.168.1 1 DR NO-NBR
2 10.10.10.1 10.10.10/30 1 DOWN
3 192.168.14.1 register_vif0 1
Virtual Interface Table
Vif Local-Address Subnet Thresh Flags Neighbors
0 192.168.14.1 192.168.14 1 PIM 192.168.14.254
1 192.168.1.1 192.168.1 1 DR NO-NBR
2 10.10.10.1 10.10.10/30 1 DOWN
3 192.168.14.1 register_vif0 1
Example 14-16. Cisco IOS PIM Statistics, Output and Debug
scar# show ip pim neighbor
PIM Neighbor Table
Neighbor Interface Uptime/Expires Ver DR
Address Prio/Mode
192.168.7.7 Ethernet0 00:03:53/00:01:22 v2 N /
192.168.14.1 Ethernet1 00:03:22/00:01:22 v2 N /
scar# show ip pim interface
Address Interface Ver/ Nbr Query DR DR
Mode Count Intvl Prior
192.168.7.254 Ethernet0 v2/SD 1 30 1 192.168.7.254
192.168.14.254 Ethernet1 v2/SD 1 30 1 192.168.14.254
10.0.0.1 Tunnel0 v2/DV 1 30 1 0.0.0.0
scar# 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 - Candidate for MSDP Advertisement,
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.111), 05:05:18/00:00:00, RP 192.168.14.254, flags: SJCL
Incoming interface: Null, RPF nbr 0.0.0.0
Outgoing interface list:
Tunnel0, Forward/Dvmrp, 04:49:28/00:00:00
Ethernet1, Forward/Sparse-Dense, 05:05:18/00:01:31
Ethernet0, Forward/Sparse-Dense, 05:05:18/00:02:11
(*, 224.0.1.40), 05:05:17/00:00:00, RP 0.0.0.0, flags: DCL
Incoming interface: Null, RPF nbr 0.0.0.0
Outgoing interface list:
Tunnel0, Forward/Dvmrp, 04:49:28/00:00:00
Ethernet0, Forward/Sparse-Dense, 05:05:17/00:00:00
Ethernet1, Forward/Sparse-Dense, 05:05:17/00:00:00
(*, 224.2.2.2), 05:05:18/00:00:00, RP 192.168.14.254, flags: SJCL
Incoming interface: Null, RPF nbr 0.0.0.0
Outgoing interface list:
Tunnel0, Forward/Dvmrp, 04:53:28/now
Ethernet1, Forward/Sparse-Dense, 05:05:18/00:01:33
Ethernet0, Forward/Sparse-Dense, 05:05:18/00:02:17
(192.168.2.7, 224.2.2.2), 00:00:06/00:02:53, flags: CLJ
Incoming interface: Tunnel0, RPF nbr 192.168.1.254, Dvmrp
Outgoing interface list:
Ethernet1, Forward/Sparse-Dense, 00:00:06/00:02:53
Ethernet0, Forward/Sparse-Dense, 00:00:06/00:02:53
scar# show ip pim bsr-router
PIMv2 Bootstrap information
This system is the Bootstrap Router (BSR)
BSR address: 192.168.14.254 (?)
Uptime: 04:49:04, BSR Priority: 4, Hash mask length: 30
Next bootstrap message in 00:00:59
Candidate RP: 192.168.14.254(Ethernet1)
Advertisement interval 60 seconds
Next advertisement in 00:00:55
Group acl: 11
scar# show ip pim rp
Group: 224.0.1.111, RP: 192.168.14.254, v2, next RP-reachable in 00:00:32
Group: 224.2.2.2, RP: 192.168.14.254, v2, next RP-reachable in 00:00:32
scar# show ip pim rp mapping
PIM Group-to-RP Mappings
This system is a candidate RP (v2)
This system is the Bootstrap Router (v2)
Group(s) 224.0.0.0/4
RP 192.168.14.254 (?), v2
Info source: 192.168.14.254 (?), via bootstrap
Uptime: 04:50:32, expires: 00:02:56
scar# show ip pim interface detail
Ethernet0 is up, line protocol is up
Internet address is 192.168.7.254/24
Multicast switching: process
Multicast packets in/out: 6474/0
Multicast boundary: not set
Multicast TTL threshold: 0
PIM: enabled
PIM version: 2, mode: sparse-dense
PIM DR: 192.168.7.254 (this system)
PIM neighbor count: 1
PIM Hello/Query interval: 30 seconds
PIM State-Refresh processing: enabled
PIM State-Refresh origination: disabled
PIM State-Refresh: 1 non-capable neighbor
PIM NBMA mode: disabled
PIM ATM multipoint signaling: disabled
PIM domain border: disabled
Multicast Tagswitching: disabled
Ethernet1 is up, line protocol is up
Internet address is 192.168.14.254/24
Multicast switching: process
Multicast packets in/out: 0/0
Multicast boundary: not set
Multicast TTL threshold: 0
PIM: enabled
PIM version: 2, mode: sparse-dense
PIM DR: 192.168.14.254 (this system)
PIM neighbor count: 1
PIM Hello/Query interval: 30 seconds
PIM State-Refresh processing: enabled
PIM State-Refresh origination: disabled
PIM State-Refresh: 1 non-capable neighbor
PIM NBMA mode: disabled
PIM ATM multipoint signaling: disabled
PIM domain border: disabled
Multicast Tagswitching: disabled
Tunnel0 is up, line protocol is up
Interface is unnumbered. Using address of Loopback0 (10.0.0.1)
Multicast switching: fast
Multicast packets in/out: 0/0
Multicast boundary: not set
Multicast TTL threshold: 0
PIM: enabled
PIM version: 2, mode: sparse-dense
PIM DR: 0.0.0.0 (this system)
PIM neighbor count: 0
PIM Hello/Query interval: 30 seconds
PIM State-Refresh processing: enabled
PIM State-Refresh origination: disabled
PIM NBMA mode: disabled
PIM ATM multipoint signaling: disabled
PIM domain border: disabled
Multicast Tagswitching: disabled
scar# debug ip pim
PIM debugging is on
scar# terminal monitor
05:01:34: PIM: Building Join/Prune message for 224.0.1.32
05:01:36: PIM: Received v2 Hello on Ethernet1 from 192.168.14.1
05:01:41: PIM: Received v2 Bootstrap on Ethernet1 from 192.168.14.1
05:01:42: PIM: Send periodic v2 Hello on Ethernet1
05:01:42: PIM: Send RP-reachability for 224.0.1.111 on Ethernet1
05:01:42: PIM: Send RP-reachability for 224.0.1.111 on Ethernet0
05:01:42: PIM: Send RP-reachability for 224.2.2.2 on Ethernet1
05:01:42: PIM: Send RP-reachability for 224.2.2.2 on Ethernet0
05:01:48: PIM: Send periodic v2 Hello on Ethernet0
05:01:48: PIM: Received v2 Hello on Ethernet0 from 192.168.7.7
05:01:53: PIM: Received v2 Bootstrap on Ethernet0 from 192.168.7.7
05:02:06: PIM: Received v2 Hello on Ethernet1 from 192.168.14.1
05:02:08: PIM: Received v2 Candidate-RP-Advertisement on Ethernet1 from 192.168.14.254
05:02:08: PIM: Update (224.0.0.0/4, RP:192.168.14.254), PIMv2
05:02:11: PIM: Received v2 Bootstrap on Ethernet1 from 192.168.14.1
05:02:12: PIM: Send periodic v2 Hello on Ethernet1
05:02:14: PIM: Building Join/Prune message for 224.2.2.2
05:02:16: PIM: Building Join/Prune message for 224.0.1.111
05:02:18: PIM: Received v2 Hello on Ethernet0 from 192.168.7.7
05:02:18: PIM: Send periodic v2 Hello on Ethernet0
05:02:23: PIM: Received v2 Bootstrap on Ethernet0 from 192.168.7.7
05:02:34: PIM: Building Join/Prune message for 224.0.1.32
05:02:36: PIM: Received v2 Hello on Ethernet1 from 192.168.14.1
05:02:41: PIM: Received v2 Bootstrap on Ethernet1 from 192.168.14.1
05:02:42: PIM: Send periodic v2 Hello on Ethernet1
05:02:48: PIM: Received v2 Hello on Ethernet0 from 192.168.7.7
05:02:48: PIM: Send periodic v2 Hello on Ethernet0
05:02:53: PIM: Received v2 Bootstrap on Ethernet0 from 192.168.7.7
05:03:06: PIM: Received v2 Hello on Ethernet1 from 192.168.14.1
05:03:08: PIM: Received v2 Candidate-RP-Advertisement on Ethernet1 from 192.168.14.254
05:03:08: PIM: Update (224.0.0.0/4, RP:192.168.14.254), PIMv2
05:03:11: PIM: Received v2 Bootstrap on Ethernet1 from 192.168.14.1
05:03:12: PIM: Send periodic v2 Hello on Ethernet1
05:03:12: PIM: Send RP-reachability for 224.0.1.111 on Ethernet1
05:03:12: PIM: Send RP-reachability for 224.0.1.111 on Ethernet0
05:03:13: PIM: Send RP-reachability for 224.2.2.2 on Ethernet1
05:03:13: PIM: Send RP-reachability for 224.2.2.2 on Ethernet0
05:03:14: PIM: Building Join/Prune message for 224.2.2.2
05:03:16: PIM: Building Join/Prune message for 224.0.1.111
Example 14-17. Castor pimd Operation and Debug Output
[root@castor:~#] netstat -g -f inet
Virtual Interface Table
Vif Thresh Rate Local-Address Remote-Address Pkts-In Pkts-Out
0 1 0 192.168.2.7 0 1040
1 1 0 192.168.7.7 0 990
2 1 0 192.168.80.1 0 0
4 1 0 192.168.2.7 0 0
IPv4 Multicast Forwarding Cache
Origin Group Packets In-Vif Out-Vifs:Ttls
192.168.2.7 224.2.2.2 48 0 1:1
[root@castor:~#] netstat -gs -f inet
IPv4 multicast forwarding:
3875 multicast forwarding cache lookups
1462 multicast forwarding cache misses
961 upcalls to mrouted
50 upcall queue overflows
0 upcalls dropped due to full socket buffer
952 cache cleanups
1462 datagrams with no route for origin
0 datagrams arrived with bad tunneling
0 datagrams could not be tunneled
18 datagrams arrived on wrong interface
0 datagrams selectively dropped
0 datagrams dropped due to queue overflow
0 datagrams dropped for being too large
[root@castor:~#] pimd -c /etc/pimd.conf -d all
debug level 0xffffffff (dvmrp_detail,dvmrp_prunes,dvmrp_mrt,dvmrp_neighbors,dvmrp_timers
,igmp_proto,
igmp_timers,igmp_members,trace,timeout,pkt,interfaces,kernel,cache,rsrr,pim_detail
,pim_hello,pim_register,pim_join_prune,pim_bootstrap,pim_asserts,pim_cand_rp,
pim_routes,pim_timers,pim_rpf)
16:25:02.309 pimd version 2.1.0-alpha29.18 starting
16:25:02.325 Got 232448 byte send buffer size in 8 iterations
16:25:02.325 Got 232448 byte recv buffer size in 8 iterations
16:25:02.325 Got 232448 byte send buffer size in 8 iterations
16:25:02.326 Got 232448 byte recv buffer size in 8 iterations
16:25:02.326 Getting vifs from kernel
16:25:02.327 installing xl0 (192.168.2.7 on subnet 192.168.2) as vif #0 - rate=0
16:25:02.327 installing ed0 (192.168.7.7 on subnet 192.168.7) as vif #1 - rate=0
16:25:02.327 installing vlan8 (192.168.80.1 on subnet 192.168.80) as vif #2 - rate=0
16:25:02.328 installing tun0 (10.10.10.2 -> 10.10.10.1) as vif #3 - rate=0
16:25:02.328 Getting vifs from /etc/pimd.conf
16:25:02.328 Local Cand-RP address is 192.168.80.1
16:25:02.328 Local Cand-RP priority is 20
16:25:02.329 Local Cand-RP advertisement period is 30 sec.
16:25:02.329 Local Cand-BSR address is 192.168.80.1
16:25:02.329 Local Cand-BSR priority is 5
16:25:02.329 Adding prefix 224.0.0.0/4
16:25:02.329 data_rate_limit is 50000 (bits/s)
16:25:02.329 data_rate_interval is 20 (seconds)
16:25:02.329 reg_rate_limit is 50000 (bits/s)
16:25:02.329 reg_rate_interval is 20 (seconds)
16:25:02.344 xl0 comes up; vif #0 now in service
16:25:02.344 SENT IGMP Membership Query from 192.168.2.7 to 224.0.0.1
16:25:02.345 SENT PIM v2 Hello from 192.168.2.7 to 224.0.0.13
16:25:02.345 ed0 comes up; vif #1 now in service
16:25:02.346 SENT IGMP Membership Query from 192.168.7.7 to 224.0.0.1
16:25:02.347 SENT PIM v2 Hello from 192.168.7.7 to 224.0.0.13
16:25:02.347 vlan8 comes up; vif #2 now in service
16:25:02.348 SENT IGMP Membership Query from 192.168.80.1 to 224.0.0.1
16:25:02.348 SENT PIM v2 Hello from 192.168.80.1 to 224.0.0.13
16:25:02.349 tun0 is DOWN; vif #3 out of service
16:25:02.349 register_vif0 comes up; vif #4 now in service
Virtual Interface Table
Vif Local-Address Subnet Thresh Flags Neighbors
0 192.168.2.7 192.168.2 1 DR NO-NBR
1 192.168.7.7 192.168.7 1 DR NO-NBR
2 192.168.80.1 192.168.80 1 DR NO-NBR
3 10.10.10.2 10.10.10/29 1 DOWN
4 192.168.2.7 register_vif0 1
Multicast Routing Table
Source Group RP-addr Flags
--------------------------(*,*,RP)--------------------------
Number of Groups: 0
Number of Cache MIRRORs: 0
16:25:02.354 PIM HELLO holdtime from 192.168.7.254 is 105
16:25:02.355 SENT PIM v2 Hello from 192.168.7.7 to 224.0.0.13
16:25:02.355 sending PIM v2 Bootstrap from 192.168.7.7 to 192.168.7.254
Virtual Interface Table
Vif Local-Address Subnet Thresh Flags Neighbors
0 192.168.2.7 192.168.2 1 DR NO-NBR
1 192.168.7.7 192.168.7 1 PIM 192.168.7.254
2 192.168.80.1 192.168.80 1 DR NO-NBR
3 10.10.10.2 10.10.10/29 1 DOWN
4 192.168.2.7 register_vif0 1
16:25:02.953 Cache miss, src 192.168.1.1, dst 224.2.2.2, iif 0
16:25:02.964 Cache miss, src 192.168.2.7, dst 224.2.2.2, iif 0
16:25:02.964 create group entry, group 224.2.2.2
16:25:04.823 Cache miss, src 192.168.1.1, dst 224.2.2.2, iif 0
16:25:05.094 Cache miss, src 192.168.2.7, dst 224.2.2.2, iif 0
16:25:05.095 create group entry, group 224.2.2.2
16:25:06.433 Cache miss, src 192.168.1.1, dst 224.2.2.2, iif 0
16:25:06.703 Cache miss, src 192.168.2.7, dst 224.2.2.2, iif 0
16:25:06.704 create group entry, group 224.2.2.2
16:25:06.991 create group entry, group 224.0.1.1
Example 14-18 demonstrates bidirectional operation of the mtest utility package, which is available at the same place as mrouted. It consists of two tools: a sender part (msend) and a receiver part (mrcv). mtest is useful to test multicast operation between two distinguished hosts and interfaces. Often it is not quite clear to what interface multicast applications bind, which often results in problems. Finally, if all other diagnosis fails and all friends abandon you, a sniffer is always your last (or first) best hope.
Example 14-18. mtest Utilities (msend/mrcv)
[root@castor:~#] msend
multicast sending test program; enter ? for list of commands
?
i i.i.i.i - set the multicast interface
t ttl_value - set the ttl_value for multicast
z min-max - set packet size range in byte
v min-max - set inter-packet interval range in second
ex. v 0.5-2 or v 1-1 for fixed interval
a rate - set packet sending rate
d type #pkts_or_#sec - set communication duration
type=1 set #pkt ex. d 1 20
type=2 set #sec ex. d 0 25
s g.g.g.g port# - send to IP multicast group
q - quit
i 192.168.7.7
interface set
t 5
ttl set to 5
s 224.2.2.2 34000
Sending... for 10 packets
Sent pkt # 0, for mgroup 224.2.2.2 port -31536, length=1006, interval=982421 microseconds
Sent pkt # 1, for mgroup 224.2.2.2 port -31536, length=1006, interval=982421 microseconds
Sent pkt # 2, for mgroup 224.2.2.2 port -31536, length=1006, interval=982421 microseconds
Sent pkt # 3, for mgroup 224.2.2.2 port -31536, length=1006, interval=982421 microseconds
[root@callisto:~#] mrcv
multicast receiving test program; enter ? for list of commands
?
j g.g.g.g i.i.i.i - join IP multicast group
l g.g.g.g i.i.i.i - leave IP multicast group
r g.g.g.g port# - receive from multicast interface
q - quit
j 224.2.2.2 192.168.14.1
group joined
r 224.2.2.2 34000
Bind socket
Receive pkt # 0, for mgroup 224.2.2.2 port 34000, length=1006, t_sec=134744073,
t_usec=133744072
Receive pkt # 1, for mgroup 224.2.2.2 port 34000, length=1006, t_sec=134744073,
t_usec=133744072
Receive pkt # 2, for mgroup 224.2.2.2 port 34000, length=1006, t_sec=134744073,
t_usec=133744072
Receive pkt # 3, for mgroup 224.2.2.2 port 34000, length=1006, t_sec=134744073,
t_usec=133744072
Example 14-19 offers a configuration scenario for enabling multicast on a Linux GRE tunnel interface in case this is required for some topological reason.
Example 14-19. Callisto GRE Multicast Tunnel Configuration
[root@callisto:~#] modprobe ip_gre
[root@callisto:~#] ip tunnel add gre1 mode gre remote 192.168.2.7 local 192.168.1.1 ttl
127 dev eth0
[root@callisto:~#] ip addr add 10.10.10.1/30 peer 10.10.10.2/30 dev gre1
[root@callisto:~#] ip link set gre1 up multicast on
Lab 14-3: XORP PIM Operation
The XORP multicast architecture currently consists of the MLD6/IGMP and the PIM-SM elements. They are not yet integrated in the router manager (rtrmgr), but you can use them in a standalone way as demonstrated in this lab. At the time of this writing, the milestone release 1.0 was not yet available. That should simplify and consolidate things. This lab features the same lab as shown previously with the exception of callisto running XORP PIM-SM instead of the USC pimd. XORP PIM-SM works with Linux 2.4.x and FreeBSD > 4.8 because of the availability of PIM hooks in the kernel.
To start PIM-SM (standalone mode), follow these steps:
- cd to the pim subdirectory of your XORP source distribution.
- Edit ./configure_pim
- Execute ./test_pim &
- Execute ./configure_pim
- Access the PIM-SM CLI by typing telnet localhost 12000
Example 14-20 introduces the XORP PIM-SM command-line interface and IGMP and PIM-SM relevant output.
Example 14-20. XORP PIM-SM Command-Line Interface
[root@callisto:~#] telnet localhost 12000
Trying 127.0.0.1...
Connected to localhost (127.0.0.1).
Escape character is '^]'.
Welcome, and may the Xorp be with you!
Xorp> show ?
Possible completions:
igmp Display information about IGMP
log Display information about log files and users
mfea Display information about MFEA
pim Display information about PIM
Xorp> show igmp ?
Possible completions:
group Display information about IGMP group membership
interface Display information about IGMP configured interfaces
Xorp> show igmp group
Interface Group Source Last Reported Timeout
eth0 224.0.0.2 0.0.0.0 192.168.14.1 244
eth0 224.0.0.13 0.0.0.0 192.168.14.1 242
eth0 224.0.1.111 0.0.0.0 192.168.14.254 247
eth0 224.2.2.2 0.0.0.0 192.168.14.254 244
eth1 224.0.0.2 0.0.0.0 192.168.1.1 244
eth1 224.0.0.13 0.0.0.0 192.168.1.1 241
Xorp> show igmp interface
Interface State Querier Timeout Version Groups
eth0 UP 192.168.14.1 None 2 4
eth1 UP 192.168.1.1 None 2 2
ipsec0 DISABLED 0.0.0.0 None 2 0
ipsec1 DISABLED 0.0.0.0 None 2 0
ipsec2 DISABLED 0.0.0.0 None 2 0
ipsec3 DISABLED 0.0.0.0 None 2 0
lo DISABLED 0.0.0.0 None 2 0
register_vif DISABLED 0.0.0.0 None 2 0
pimreg DISABLED 0.0.0.0 None 2 0
Xorp> show mfea ?
Possible completions:
dataflow Display information about MFEA dataflow filters
interface Display information about MFEA interfaces
mrib Display MRIB information inside MFEA
Xorp> show mfea interface
Interface State Vif/PifIndex Addr Flags
eth0 UP 0/2 192.168.14.1 MULTICAST BROADCAST KERN_UP
eth1 UP 1/3 192.168.1.1 MULTICAST BROADCAST KERN_UP
ipsec0 DISABLED 2/4 192.168.1.1
ipsec1 DISABLED 3/5
ipsec2 DISABLED 4/6
ipsec3 DISABLED 5/7
lo DISABLED 6/1 127.0.0.1 LOOPBACK KERN_UP
register_vif UP 7/2 192.168.14.1 PIM_REGISTER KERN_UP
pimreg DISABLED 8/9 KERN_UP
Xorp> show mfea mrib
DestPrefix NextHopRouter VifName VifIndex MetricPreference Metric
0.0.0.0/0 192.168.1.254 eth1 1 100 100
10.0.0.1/32 192.168.1.254 eth1 1 100 100
127.0.0.0/8 0.0.0.0 lo 6 100 100
192.168.1.0/24 0.0.0.0 eth1 1 100 100
192.168.2.0/24 192.168.1.254 eth1 1 100 100
192.168.7.0/24 192.168.1.254 eth1 1 100 100
192.168.14.0/24 0.0.0.0 eth0 0 100 100
192.168.45.0/24 0.0.0.0 eth1 1 100 100
192.168.80.0/24 192.168.1.254 eth1 1 100 100
211.11.117.0/24 192.168.1.254 eth1 1 100 100
Xorp> show pim mrib
DestPrefix NextHopRouter VifName VifIndex MetricPreference Metric
0.0.0.0/0 192.168.1.254 eth1 1 100 100
10.0.0.1/32 192.168.1.254 eth1 1 100 100
127.0.0.0/8 0.0.0.0 lo 6 100 100
192.168.1.0/24 0.0.0.0 eth1 1 100 100
192.168.2.0/24 192.168.1.254 eth1 1 100 100
192.168.7.0/24 192.168.1.254 eth1 1 100 100
192.168.14.0/24 0.0.0.0 eth0 0 100 100
192.168.45.0/24 0.0.0.0 eth1 1 100 100
192.168.80.0/24 192.168.1.254 eth1 1 100 100
211.11.117.0/24 192.168.1.254 eth1 1 100 100
Xorp> show pim neighbors
Interface DRpriority NeighborAddr V Mode Holdtime Timeout
eth0 1 192.168.14.254 2 Sparse 105 102
Xorp> show pim rps
RP Type Pri Holdtime Timeout ActiveGroups GroupPrefix
192.168.14.254 bootstrap 0 208 182 2 224.0.0.0/4
Xorp> show pim ?
Possible completions:
bootstrap Display information about PIM bootstrap routers
interface Display information about PIM configured interfaces
join Display information about PIM groups
mfc Display information about PIM Multicast Forwarding Cache
mrib Display MRIB information inside PIM
neighbors Display information about PIM neighbors
rps Display information about PIM RPs
scope Display information about PIM scope zones
Xorp> show pim bootstrap
Active zones:
BSR Pri LocalAddress Pri State Timeout SZTimeout
192.168.14.254 4 192.168.1.1 1 Candidate 105 -1
Expiring zones:
BSR Pri LocalAddress Pri State Timeout SZTimeout
Configured zones:
BSR Pri LocalAddress Pri State Timeout SZTimeout
192.168.1.1 1 192.168.1.1 1 Init -1 -1
Xorp> show pim interface
Interface State Mode V PIMstate Priority DRaddr Neighbors
eth0 UP Sparse 2 NotDR 1 192.168.14.254 1
eth1 UP Sparse 2 DR 1 192.168.1.1 0
ipsec0 DISABLED Sparse 2 NotDR 1 0.0.0.0 0
ipsec1 DISABLED Sparse 2 NotDR 1 0.0.0.0 0
ipsec2 DISABLED Sparse 2 NotDR 1 0.0.0.0 0
ipsec3 DISABLED Sparse 2 NotDR 1 0.0.0.0 0
lo DISABLED Sparse 2 NotDR 1 0.0.0.0 0
register_vif UP Sparse 2 NotDR 1 0.0.0.0 0
pimreg DISABLED Sparse 2 NotDR 1 0.0.0.0 0
Xorp> show pim join
Group Source RP Flags
224.0.1.111 0.0.0.0 192.168.14.254 WC
Upstream interface (RP): eth0
Upstream MRIB next hop (RP): 192.168.14.254
Upstream RPF'(*,G): 192.168.14.254
Upstream state: NotJoined
Join timer: -1
Local receiver include WC: O........
Joins RP: .........
Joins WC: .........
Join state: .........
Prune state: .........
Prune pending state: .........
I am assert winner state: .........
I am assert loser state: .........
Assert winner WC: .........
Assert lost WC: .........
Assert tracking WC: .........
Could assert WC: .........
I am DR: .O.......
Immediate olist RP: .........
Immediate olist WC: .........
Inherited olist SG: .........
Inherited olist SG_RPT: .........
PIM include WC: .........
224.2.2.2 0.0.0.0 192.168.14.254 WC
Upstream interface (RP): eth0
Upstream MRIB next hop (RP): 192.168.14.254
Upstream RPF'(*,G): 192.168.14.254
Upstream state: NotJoined
Join timer: -1
Local receiver include WC: O........
Joins RP: .........
Joins WC: .........
Join state: .........
Prune state: .........
Prune pending state: .........
I am assert winner state: .........
I am assert loser state: .........
Assert winner WC: .........
Assert lost WC: .........
Assert tracking WC: .........
Could assert WC: .........
I am DR: .O.......
Immediate olist RP: .........
Immediate olist WC: .........
Inherited olist SG: .........
Inherited olist SG_RPT: .........
PIM include WC: .........
0 comments:
Post a Comment