Multicast Pim Sparse Mode
Multicast Pim Sparse Mode
Multicast Pim Sparse Mode
PNETLAB Store
PNETLab.com
Lab Objective:
The objective of this lab exercise is for you to learn and understand Multicast PIM Sparse Mode.
Task:
R1, R2 and R3 are our multicast routers that we will configure for PIM sparse mode. S4 will be the
source that sends multicast traffic. H5 is the receiver.
Solution
Basic Configuration:
Router R1 R2
Configuration interface Ethernet0/0 interface Loopback0
no shutdown no shutdown
ip address 10.1.12.1 255.255.255.0 ip address 2.2.2.2 255.255.255.255
ip ospf 1 area 0 ip ospf 1 area 0
! !
interface Ethernet0/1 interface Ethernet0/0
no shutdown no shutdown
ip address 10.1.13.1 255.255.255.0 ip address 10.1.12.2 255.255.255.0
1
Download PNETLab Platform
PNETLAB Store
PNETLab.com
Router R3 S4
Configuration interface Ethernet0/0 interface Ethernet0/0
no shutdown no shutdown
ip address 10.1.13.3 255.255.255.0 ip address 10.1.14.4 255.255.255.0
ip ospf 1 area 0 no ip route-cache
! !
interface Ethernet0/1 ip default-gateway 10.1.14.1
no shutdown no ip routing
ip address 10.1.23.3 255.255.255.0
ip ospf 1 area 0
!
interface Ethernet0/2
no shutdown
ip address 10.1.35.3 255.255.255.0
ip ospf 1 area 0
Router H5
Configuration interface Ethernet0/0
no shutdown
ip address 10.1.35.5 255.255.255.0
no ip route-cache
!
ip default-gateway 10.1.35.3
no ip routing
Multicast routing is disabled by default on Cisco IOS routers so we have to enable it:
R1(config)#ip multicast-routing
R2(config)#ip multicast-routing
2
Download PNETLab Platform
PNETLAB Store
PNETLab.com
R3(config)#ip multicast-routing
Now we can configure PIM. Let’s start with R1 and R2:
R1(config)#interface e0/0
R1(config-if)# ip pim sparse-mode
R2(config)#interface e0/0
R2(config-if)# ip pim sparse-mode
As soon as I enable PIM Sparse mode on the interface our router will start sending PIM hello
packets. The default is 105 seconds. R1 and R2 will become neighbors since they receive each
others PIM hello packets. If they keep receiving them before the holddown timer is expired then
they will keep seeing each other as PIM neighbors:
R1(config-if)#
*Sep 13 06:07:36.751: %PIM-5-DRCHG: DR change from neighbor 0.0.0.0 to 10.1.12.1 on
interface Ethernet0/0
*Sep 13 06:07:39.341: %PIM-5-NBRCHG: neighbor 10.1.12.2 UP on interface Ethernet0/0
*Sep 13 06:07:39.344: %PIM-5-DRCHG: DR change from neighbor 10.1.12.1 to 10.1.12.2 on
interface Ethernet0/0
Let’s enable all the other interfaces.:
R1(config-if)#interface e0/1
R1(config-if)# ip pim sparse-mode
R1(config-if)#interface e0/2
R1(config-if)# ip pim sparse-mode
R2(config-if)#interface e0/1
R2(config-if)# ip pim sparse-mode
R3(config-if)#interface e0/0
R3(config-if)# ip pim sparse-mode
R3(config-if)#interface e0/1
R3(config-if)# ip pim sparse-mode
R3(config-if)#interface e0/2
R3(config-if)# ip pim sparse-mode
3
Download PNETLab Platform
PNETLAB Store
PNETLab.com
R1#show ip mroute
R2#show ip mroute
R3#show ip mroute
4
Download PNETLab Platform
PNETLAB Store
PNETLab.com
R1(config)#
*Sep 13 06:35:55.989: %LINEPROTO-5-UPDOWN: Line protocol on Interface Tunnel0, changed
state to up
R2(config)#
*Sep 13 06:35:57.713: %LINEPROTO-5-UPDOWN: Line protocol on Interface Tunnel0, changed
state to up
*Sep 13 06:35:57.714: %LINEPROTO-5-UPDOWN: Line protocol on Interface Tunnel1, changed
state to up
R3(config)#
*Sep 13 06:35:59.242: %LINEPROTO-5-UPDOWN: Line protocol on Interface Tunnel0, changed
state to up
5
Download PNETLab Platform
PNETLAB Store
PNETLab.com
R1, R2 and R3 each create a tunnel0 interface. R2 also creates a tunnel1 interface.
The first tunnel interface is used to encapsulate the first multicast packet in a PIM register message
and forward it to the RP. The RP has one additional tunnel interface which is used for
decapsulation of the PIM register packet.
These tunnel interfaces won’t show up in your configuration but we can take a look at them with
the following command:
R1#debug ip pim
R2#debug ip pim
R3#debug ip pim
R1#
*Sep 13 06:48:20.022: PIM(0): Check RP 2.2.2.2 into the (*, 239.1.1.1) entry
6
Download PNETLab Platform
PNETLAB Store
PNETLab.com
*Sep 13 06:48:20.022: PIM(0): Building Triggered (*,G) Join / (S,G,RP-bit) Prune message for
239.1.1.1
*Sep 13 06:48:20.022: PIM(0): Adding register encap tunnel (Tunnel0) as forwarding interface
of (10.1.14.4, 239.1.1.1).
*Sep 13 06:48:20.023: PIM(0): Received v2 Register-Stop on Ethernet0/0 from 2.2.2.2
*Sep 13 06:48:20.023: PIM(0): for source 10.1.14.4, group 239.1.1.1
*Sep 13 06:48:20.023: PIM(0): Removing register encap tunnel (Tunnel0) as forwarding
interface of (10.1.14.4, 239.1.1.1).
*Sep 13 06:48:20.023: PIM(0): Clear Registering flag to 2.2.2.2 for (10.1.14.4/32, 239.1.1.1)
R1 encapsulates the first multicast packet that it receives from our source and forwards it with a
PIM register message towards the RP. A bit later, it receives a PIM register stop from the RP who
asks R1 to stop forwarding anything.
R2#
*Sep 13 06:48:20.022: PIM(0): Received v2 Register on Ethernet0/0 from 10.1.12.1
*Sep 13 06:48:20.022: for 10.1.14.4, group 239.1.1.1
*Sep 13 06:48:20.022: PIM(0): Check RP 2.2.2.2 into the (*, 239.1.1.1) entry
*Sep 13 06:48:20.023: PIM(0): Adding register decap tunnel (Tunnel1) as accepting interface of
(*, 239.1.1.1).
*Sep 13 06:48:20.023: PIM(0): Adding register decap tunnel (Tunnel1) as accepting interface of
(10.1.14.4, 239.1.1.1).
*Sep 13 06:48:20.023: PIM(0): Send v2 Register-Stop to 10.1.12.1 for 10.1.14.4, group
239.1.1.1
Above you can see that R2 receives the PIM register and replies with the PIM register stop.
When R1’s suppression timer is almost expired, it will send a PIM register null packet to check if
the RP is still not interested:
R1#
*Sep 13 06:52:26.952: PIM(0): Send v2 Data-header Register to 2.2.2.2 for 10.1.14.4, group
239.1.1.1
*Sep 13 06:52:26.954: PIM(0): Received v2 Register-Stop on Ethernet0/0 from 2.2.2.2
*Sep 13 06:52:26.954: PIM(0): for source 10.1.14.4, group 239.1.1.1
*Sep 13 06:52:26.954: PIM(0): Clear Registering flag to 2.2.2.2 for (10.1.14.4/32, 239.1.1.1)
R2 quickly replies, telling R1 to shut up. Here’s the debug from R2:
R2#
*Sep 13 06:52:26.953: PIM(0): Received v2 Register on Ethernet0/0 from 10.1.12.1
*Sep 13 06:52:26.953: (Data-header) for 10.1.14.4, group 239.1.1.1
7
Download PNETLab Platform
PNETLAB Store
PNETLab.com
R1#
*Sep 12 14:08:53.719: PIM(0): Join-list: (10.1.14.4/32, 239.1.1.1)
*Sep 12 14:08:53.719: PIM(0): Add Ethernet0/1/0.0.0.0 to (10.1.14.4, 239.1.1.1), Forward
state, by PIM Graft
*Sep 12 14:08:53.719: PIM(0): Send v2 Graft-Ack on Ethernet0/1 to 10.1.13.3
H5(config)#interface e0/0
H5(config-if)#ip igmp join-group 239.5.5.5
R3 will now join the RPT for 239.5.5.5 since it receives the IGMP membership report from H5.
Here’s what it looks like:
R3#
*Sep 13 06:59:24.205: PIM(0): Check RP 2.2.2.2 into the (*, 239.5.5.5) entry
*Sep 13 06:59:24.205: PIM(0): Building Triggered (*,G) Join / (S,G,RP-bit) Prune message for
239.5.5.5
*Sep 13 06:59:24.205: PIM(0): Building Triggered (*,G) Join / (S,G,RP-bit) Prune message for
239.5.5.5
*Sep 13 06:59:24.205: PIM(0): Upstream mode for (*, 239.5.5.5) changed from 0 to 1
*Sep 13 06:59:24.205: PIM(0): Insert (*,239.5.5.5) join in nbr 10.1.23.2's queue
*Sep 13 06:59:24.205: PIM(0): Building Join/Prune packet for nbr 10.1.23.2
*Sep 13 06:59:24.205: PIM(0): Adding v2 (2.2.2.2/32, 239.5.5.5), WC-bit, RPT-bit, S-bit Join
*Sep 13 06:59:24.205: PIM(0): Send v2 join/prune to 10.1.23.2 (Ethernet0/1)
Above you can see the (*,G) entry which tells us we are joining the SPT. The * is a wildcard that
indicates “any source”. The G is the group, in our case 239.5.5.5.
R2#
*Sep 13 06:59:24.205: PIM(0): Received v2 Join/Prune on Ethernet0/1 from 10.1.23.3, to us
*Sep 13 06:59:24.205: PIM(0): Join-list: (*, 239.5.5.5), RPT-bit set, WC-bit set, S-bit set
*Sep 13 06:59:24.205: PIM(0): Check RP 2.2.2.2 into the (*, 239.5.5.5) entry
*Sep 13 06:59:24.205: PIM(0): Adding register decap tunnel (Tunnel1) as accepting interface of
(*, 239.5.5.5).
8
Download PNETLab Platform
PNETLAB Store
PNETLab.com
Let’s see what the multicast routing tables look like now:
• J: this is the SPT-bit. When possible, R3 will try to join the SPT for this multicast group.
We’ll see this in a minute…
• C: this means we have a member of this multicast group that is directly connected to us.
R1(config)#interface e0/1
R1(config-if)#shutdown
Let’s see what happens when we send traffic to this multicast group
9
Download PNETLab Platform
PNETLAB Store
PNETLab.com
R1#
*Sep 13 07:32:50.288: PIM(0): Adding register encap tunnel (Tunnel0) as forwarding interface
of (10.1.14.4, 239.5.5.5).
*Sep 13 07:32:50.289: PIM(0): Received v2 Join/Prune on Ethernet0/0 from 10.1.12.2, to us
*Sep 13 07:32:50.289: PIM(0): Join-list: (10.1.14.4/32, 239.5.5.5), S-bit set
*Sep 13 07:32:50.289: PIM(0): Add Ethernet0/0/10.1.12.2 to (10.1.14.4, 239.5.5.5), Forward
state, by PIM SG Join
R1 receives a PIM join from the RP and decides to put its Ethernet0/0 interface into forwarding
mode. Here’s what we see on the RP:
R2#
*Sep 13 07:32:50.289: PIM(0): Received v2 Register on Ethernet0/0 from 10.1.12.1
*Sep 13 07:32:50.289: for 10.1.14.4, group 239.5.5.5
*Sep 13 07:32:50.289: PIM(0): Adding register decap tunnel (Tunnel1) as accepting interface of
(10.1.14.4, 239.5.5.5).
*Sep 13 07:32:50.289: PIM(0): Insert (10.1.14.4,239.5.5.5) join in nbr 10.1.12.1's queue
*Sep 13 07:32:50.289: PIM(0): Building Join/Prune packet for nbr 10.1.12.1
*Sep 13 07:32:50.289: PIM(0): Adding v2 (10.1.14.4/32, 239.5.5.5), S-bit Join
*Sep 13 07:32:50.289: PIM(0): Send v2 join/prune to 10.1.12.1 (Ethernet0/0)
*Sep 13 07:32:50.309: PIM(0): Received v2 Join/Prune on Ethernet0/1 from 10.1.23.3, to us
R2>
*Sep 13 07:32:50.309: PIM(0): Join-list: (10.1.14.4/32, 239.5.5.5), S-bit set
*Sep 13 07:32:50.309: PIM(0): Update Ethernet0/1/10.1.23.3 to (10.1.14.4, 239.5.5.5), Forward
state, by PIM SG Join
R2>
*Sep 13 07:32:56.874: PIM(0): Received v2 Join/Prune on Ethernet0/1 from 10.1.23.3, to us
*Sep 13 07:32:56.874: PIM(0): Join-list: (*, 239.5.5.5), RPT-bit set, WC-bit set, S-bit set
*Sep 13 07:32:56.874: PIM(0): Update Ethernet0/1/10.1.23.3 to (*, 239.5.5.5), Forward state,
by PIM *G Join
*Sep 13 07:32:56.874: PIM(0): Update Ethernet0/1/10.1.23.3 to (10.1.14.4, 239.5.5.5), Forward
state, by PIM *G Join
*Sep 13 07:33:01.280: PIM(0): Received v2 Register on Ethernet0/0 from 10.1.12.1
*Sep 13 07:33:01.280: for 10.1.14.4, group 239.5.5.5
*Sep 13 07:33:01.280: PIM(0): Removing register decap tunnel (Tunnel1) as accepting interface
of (10.1.14.4, 239.5.5.5).
*Sep 13 07:33:01.280: PIM(0): Installing Ethernet0/0 as accepting interface for (10.1.14.4,
239.5.5.5).
*Sep 13 07:33:01.343: PIM(0): Insert (10.1.14.4,239.5.5.5) join in nbr 10.1.12.1's queue
*Sep 13 07:33:01.343: PIM(0): Building Join/Prune packet for nbr 10.1.12.1
*Sep 13 07:33:01.343: PIM(0): Adding v2 (10.1.14.4/32, 239.5.5.5), S-bit Join
*Sep 13 07:33:01.343: PIM(0): Send v2 join/prune to 10.1.12.1 (Ethernet0/0)
10
Download PNETLab Platform
PNETLAB Store
PNETLab.com
R2>
*Sep 13 07:33:21.306: PIM(0): Received v2 Register on Ethernet0/0 from 10.1.12.1
*Sep 13 07:33:21.306: for 10.1.14.4, group 239.5.5.5
*Sep 13 07:33:21.306: PIM(0): Send v2 Register-Stop to 10.1.12.1 for 10.1.14.4, group
239.5.5.5
*Sep 13 07:33:44.842: PIM(0): Building Periodic (*,G) Join / (S,G,RP-bit) Prune message for
239.5.5.5
*Sep 13 07:33:49.864: PIM(0): Received v2 Join/Prune on Ethernet0/1 from 10.1.23.3, to us
*Sep 13 07:33:49.864: PIM(0): Join-list: (10.1.14.4/32, 239.5.5.5), S-bit set
*Sep 13 07:33:49.864: PIM(0): Update Ethernet0/1/10.1.23.3 to (10.1.14.4, 239.5.5.5), Forward
state, by PIM SG Join
*Sep 13 07:33:54.148: PIM(0): Send RP-reachability for 239.5.5.5 on Ethernet0/1
*Sep 13 07:33:55.969: PIM(0): Received v2 Join/Prune on Ethernet0/1 from 10.1.23.3, to us
*Sep 13 07:33:55.969: PIM(0): Join-list: (*, 239.5.5.5), RPT-bit set, WC-bit set, S-bit set
*Sep 13 07:33:55.969: PIM(0): Update Ethernet0/1/10.1.23.3 to (*, 239.5.5.5), Forward state,
by PIM *G Join
*Sep 13 07:33:55.969: PIM(0): Update Ethernet0/1/10.1.23.3 to (10.1.14.4, 239.5.5.5), Forward
state, by PIM *G Join
*Sep 13 07:34:01.248: PIM(0): Insert (10.1.14.4,239.5.5.5) join in nbr 10.1.12.1's queue
*Sep 13 07:34:01.248: PIM(0): Building Join/Prune packet for nbr 10.1.12.1
*Sep 13 07:34:01.248: PIM(0): Adding v2 (10.1.14.4/32, 239.5.5.5), S-bit Join
*Sep 13 07:34:01.248: PIM(0): Send v2 join/prune to 10.1.12.1 (Ethernet0/0)
R2>
*Sep 13 07:34:44.746: PIM(0): Building Periodic (*,G) Join / (S,G,RP-bit) Prune message for
239.5.5.5
*Sep 13 07:34:49.673: PIM(0): Received v2 Join/Prune on Ethernet0/1 from 10.1.23.3, to us
*Sep 13 07:34:49.673: PIM(0): Join-list: (10.1.14.4/32, 239.5.5.5), S-bit set
*Sep 13 07:34:49.673: PIM(0): Update Ethernet0/1/10.1.23.3 to (10.1.14.4, 239.5.5.5), Forward
state, by PIM SG Join
We can see that R2 receives a PIM register with an encapsulated multicast packet that it accepts.
It now learns the source (10.1.14.4) of the multicast group so the router will join the SPT.
We can also see that it has received a PIM join from R3 and that its Ethernet0/1 interface goes
into forwarding mode.
R3#
*Sep 13 07:32:50.308: PIM(0): Insert (10.1.14.4,239.5.5.5) join in nbr 10.1.23.2's queue
*Sep 13 07:32:50.308: PIM(0): Building Join/Prune packet for nbr 10.1.23.2
*Sep 13 07:32:50.308: PIM(0): Adding v2 (10.1.14.4/32, 239.5.5.5), S-bit Join
*Sep 13 07:32:50.308: PIM(0): Send v2 join/prune to 10.1.23.2 (Ethernet0/1)
11
Download PNETLab Platform
PNETLAB Store
PNETLab.com
R3 already joined the RPT for 239.5.5.5 but since it now has learned the source, it will join the SPT
(note the S-bit Join).
Now let’s turn on interface e0/1 of R1 in order to see difference between the SPT and RPT
R1(config)#interface e0/1
R1(config-if)#no shutdown
Now take a look at its multicast routing table:
Notice that R2 has pruned traffic from 10.1.14.4 to 239.5.5.5. This traffic is no longer required
since R3 has switched to SPT and is no longer using the RP.
When R3 made the switch from RPT to SPT, it has sent a PIM prune message to the RP.
14