In this lab I’ve setup a basic multicast environment using PIM ( Protocol Independent Multicast ) in a Sparse-Mode Style configuration. What does this mean? Basically, Sparse mode is an on-demand type of multicast routing, as opposed to Dense mode, which is a Push/Prune based mechanism. Most implementations of multicast routing will use Sparse-Mode because it reduces the burst[s] of traffic which occur in PIM Dense mode ( State Refresh helps remedy this behavior in Dense Mode, but that is another topic ).
I’m a big fan of digging deep into the internal operations of network protocols. So Wireshark will be used to uncover the intimate details of PIM, IGMP, and BSR, as a go along. I encourage others to do the same!
1. IGP & Unicast Routing
Before we get started we need to make sure our IGP is configured properly. Hopefully this doesn’t come as a surprise, but in order for Multicast routing to work properly, Unicast routing must be in order. In my configuration all links ( including loopbacks) are advertised into my IGP. I decided to uses OSPF with all links in area 0.RP Discovery & Configuration
So we have this thing called an RP (Rendezvous Point). The RP facilitates multicast flows between listeners and senders. Simply put, if a multicast source sends traffic, the RP is notified, and if a client is interested in a particular groups traffic, the RP is notified. The RP can then build a tree between a source and listener for multicast traffic to flow through, alleviating the flood and prune behavior of PIM Dense Mode. So how do we setup an RP? There are two ways to configure an RP: Dynamically or Statically. A static RP configuration is very straight forward. Simply pick a router in your network that you wish to be the RP, and configure all of your routers with that information ( In Cisco IOS: ip pim ). Dynamic RP election is a bit more complicated. We have two choices for dynamically learning an RP, Auto-RP & BSR. As the title says, this lab will be discussing BSR, so I wont get into the details of Auto-RP.BSR Protocol
BSR is a protocol for discovering candidate RPs, and then advertising that information to all other routers in the network. There are two mechanisms in the BSR protocol. You have BootStrap routers which listens for candidate RP advertisements, and you have Candidate RPs which advertise themselves as suitable RPs for any number of multicast addresses ( default 224.0.0.0/4 ). This is a much more scalable solution than static configuration, especially when you have a lot of devices in your network. It is also better than Auto-RP, because you do not need to run the cisco-rp-announce (224.0.1.39) and cisco-rp-discovery (224.0.1.40) groups in dense mode.Lets go over BSR operation step by step. But first, I will configure R6 (BSR Candidate), and R4 (RP Candidate). Note: BSR/RP Candidate can be the same router, but to demonstrate the full operation I have the roles split between two devices).
BSR Candidate (R6)
R6(config)#ip multicast-routing R6(config)#interface loopback 0 R6(config-if)#ip address 6.6.6.6 255.255.255.255 R6(config-if)#ip ospf 1 area 0 R6(config-if)#ip pim sparse-mode R6(config-if)#exit R6(config)#interface FastEthernet 0/0 R6(config-if)#ip address 10.4.4.6 255.255.255.240 R6(config-if)#ip ospf 1 area 0 R6(config-if)#ip pim sparse-mode R6(config-if)#exit R6(config)#interface FastEthernet 0/1 R6(config-if)#ip address 10.6.6.6 255.255.255.240 R6(config-if)#ip ospf 1 area 0 R6(config-if)#ip pim sparse-mode R6(config-if)#exit |
R6(config)#ip pim bsr-candidate Loopback0 0 0 R6(config)# |
interface: Interface to source BSR advertisements from
hash-mask-length:This allows you to specify how multicast groups are distributed between RPs, when multiple Candidate RPs have the same Priority. I highly suggest reading TCP/IP Routing Volume II by Jeff Doyle, for more details on this process. (default 0).
priority: BSR Candidate priority. Higher is better (default 0).
RP Candidate (R6)
R4(config)#ip multicast-routing R4(config)#interface loopback 0 R4(config-if)#ip address 4.4.4.4 255.255.255.255 R4(config-if)#ip ospf 1 area 0 R4(config-if)#ip pim sparse-mode R4(config-if)#exit R4(config)#interface FastEthernet 0/0 R4(config-if)#ip address 10.4.4.4 255.255.255.240 R4(config-if)#ip ospf 1 area 0 R4(config-if)#ip pim sparse-mode R4(config-if)#exit R4(config)#interface FastEthernet 0/1 R4(config-if)#ip address 10.1.1.4 255.255.255.240 R4(config-if)#ip ospf 1 area 0 R4(config-if)#ip pim sparse-mode R4(config-if)#exit |
R4(config)#ip pim rp-candidate Loopback0 priority 0 R4(config)# |
interface: Interface to source RP advertisements from
group-list: (optional): Specify an ACL which includes the Multicast groups. Default is 224.0.0.0/24
priority (optional): specify RP priority. Lower is better (default 0).
BSR Election
Candidate Bootstrap routers send BSM (Bootstrap Messages) to multicast address 224.0.0.13 ( ALL-PIM-ROUTERS). These messages are forwarded hop-by-hop as long as they’re received on an interface which passes an RPF check for the BSR Candidate IP. Because we only have 1 Bootstrap router there is no BSR election. However if there were multiple Candidate BSRs, the BSR with the highest Priority wins. If there is a tie in priority, highest IP address wins. BSR priority is specified during configuration of the BSR Candidate, see above.
Bootstrap (BSR Election) Message: Sent by R6, multicast to 224.0.0.13 & forwarded by each router.
Ethernet II, Src: c2:02:74:55:00:00 (c2:02:74:55:00:00), Dst: IPv4mcast_00:00:0d (01:00:5e:00:00:0d) Internet Protocol, Src: 10.4.4.6 (10.4.4.6), Dst: 224.0.0.13 (224.0.0.13) Protocol Independent Multicast Version: 2 Type: Bootstrap (4) Checksum: 0xa8ce [correct] PIM parameters Fragment tag: 0x2625 Hash mask len: 0 BSR priority: 0 BSR: 6.6.6.6 |
Each Candidate RP unicasts their RP Groups & Priority directly to the Bootstrap router.
RP Advertisement to BSR: Sent by R4, unicast to R6.
Ethernet II, Src: c2:00:74:55:00:00 (c2:00:74:55:00:00), Dst: c2:02:74:55:00:00 (c2:02:74:55:00:00) Internet Protocol, Src: 10.4.4.4 (10.4.4.4), Dst: 6.6.6.6 (6.6.6.6) Protocol Independent Multicast Version: 2 Type: Candidate-RP-Advertisement (8) Checksum: 0xec5c [correct] PIM parameters Prefix-count: 1 Priority: 0 Holdtime: 150 RP: 4.4.4.4 Group 0: 224.0.0.0/4 |
The Bootstrap router forwards RP information it receives to the rest of the network via multicast ( 224.0.0.13 ). Each individual router in the network picks the best RP to group mappings. For RP election, lowest priority wins ( contrary to BSR election in which highest priority wins). RP priority is specified during Candidate RP configuration, see above.
Bootstrap Message with RP mappings: Sent by R6, multicast to 224.0.0.13 & forwarded by each router.
Ethernet II, Src: c2:02:74:55:00:00 (c2:02:74:55:00:00), Dst: IPv4mcast_00:00:0d (01:00:5e:00:00:0d) Internet Protocol, Src: 10.4.4.6 (10.4.4.6), Dst: 224.0.0.13 (224.0.0.13) Protocol Independent Multicast Version: 2 Type: Bootstrap (4) Checksum: 0xcf99 [correct] PIM parameters Fragment tag: 0x13b6 Hash mask len: 0 BSR priority: 0 BSR: 6.6.6.6 Group 0: 224.0.0.0/4 RP count: 1 FRP count: 1 RP 0: 4.4.4.4 Holdtime: 150 Priority: 0 |
R1#show ip pim rp mapping
PIM Group-to-RP Mappings
Group(s) 224.0.0.0/4
RP 4.4.4.4 (?), v2
Info source: 6.6.6.6 (?), via bootstrap, priority 0, holdtime 150
Uptime: 04:03:30, expires: 00:01:31
R1#