PIM SM using BSR mechanism

PIM SM using BSR mechanism

Homburg router:

ip multicast-routing

!

interface fastethernet 0/0

ip address 10.1.1.1 255.255.255.0

ip pim sparse-mode

ip ospf 1 area 0

!

interface serial 0/0

ip address 10.2.1.1 255.255.255.0

ip ospf 1 area 0

ip pim sparse-mode

!

interface serial 0/1

ip address 10.2.2.1 255.255.255.0

ip ospf 1 area 0

ip pim sparse-mode

!

Fedora router:

ip multicast-routing

!

interface Loopback 0

ip address 10.224.1.2 255.255.255.255

ip ospf 1 area 0

ip pim sparse-mode

!

interface serial 0/0

ip address 10.2.1.2 255.255.255.252

ip ospf 1 area 0

ip pim sparse-mode

!

interface serial 0/1

ip address 10.2.4.1 255.255.255.0

ip ospf 1 area 0

ip pim sparse-mode

!

interface serial 0/2

ip address 10.2.5.1 255.255.255.0

ip ospf 1 area 0

ip pim sparse-mode

!

access-list 1 permit 239.0.0.0 0.255.255.255

!

ip pim bsr-candidate Loopback 0 0

ip pim rp-candidate Loopback 0 group-list 1

!

Porkpie router:

ip multicast-routing

!

interface serial 0/0

ip address 10.2.3.2 255.255.255.0

ip ospf 1 area 0

ip pim sparse-mode

!

interface serial 0/1

ip address 10.2.4.2 255.255.255.0

ip ospf 1 area 0

ip pim sparse-mode

!

interface fastethernet 0/0

ip address 172.16.1.2 255.255.255.0

ip ospf 1 area 0

ip pim sparse-mode

standby 1 ip 172.16.1.1

standby 1 preempt

!

Bowler router:

ip multicast-routing

!

interface serial 0/0

ip address 10.2.5.2 255.255.255.252

ip ospf 1 area 0

ip pim sparse-mode

!

interface fastethernet 0/0

ip address 172.16.1.3 255.255.255.0

ip ospf 1 area 0

ip pim sparse-mode

standby 1 ip 172.16.1.1

standby 1 preempt

standby 1 priority 105

standby 1 track serial 0/0 10

!

Stetson router:

ip multicast-routing

!

interface Loopback 0

ip address 10.224.1.1 255.255.255.255

ip ospf 1 area 0

ip pim sparse-mode

!

interface serial 0/0

ip address 10.2.2.2 255.255.255.0

ip ospf 1 area 0

ip pim sparse-mode

!

interface serial 0/1

ip address 10.2.3.1 255.255.255.0

ip ospf 1 area 0

ip pim sparse-mode

!

access-list 1 permit 239.0.0.0 0.255.255.255

!

ip pim bsr-candidate Loopback 0 0

ip pim rp-candidate Loopback 0 group-list 1

!

Stetson and Fedora routers are configured to be C-BSRs and C-RPs for the PIM SM domain. Both routers start sending BSM messages to 224.0.0.13 (all PIM routers) destination address. The BSM messages contain the BSR IP address and priority.

Stetson# debug ip pim

*Mar 1 00:59:00.079: PIM(0): Received v2 Bootstrap on Serial0/0 from 10.2.2.1

*Mar 1 00:59:00.083: PIM(0): Received v2 Bootstrap on Serial0/1 from 10.2.3.2

*Mar 1 00:59:00.087: PIM(0): Update (239.0.0.0/8, RP:10.224.1.2), PIMv2

*Mar 1 00:59:00.091: PIM(0): Update (239.0.0.0/8, RP:10.224.1.1), PIMv2

Since priorities are equal, the router with highest IP address becomes the BSR. In this case, Fedora router has higher IP address (10.224.1.2) and hence is the BSR.

Fedora# 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) 239.0.0.0/8

RP 10.224.1.2 (?), v2

Info source: 10.224.1.2 (?), via bootstrap, priority 0, holdtime 150

Uptime: 00:42:22, expires: 00:02:10

RP 10.224.1.1 (?), v2

Info source: 10.2.2.2 (?), via bootstrap, priority 0, holdtime 150

Uptime: 00:41:05, expires: 00:01:43

Bowler# show ip pim bsr-router

PIMv2 Bootstrap information

BSR address: 10.224.1.2 (?)

Uptime: 00:49:01, BSR Priority: 0, Hash mask length: 0

Expires: 00:02:01

Each C-RP sends C-RP-Adv messages periodically to show their willingness to serve as an RP. Below Fedora router receives C-RP-Adv message with group-range 239.0.0.0/8 and RP address 10.224.1.1.

Fedora#

*Mar 1 01:20:26.231: PIM(0): Received v2 Candidate-RP-Advertisement on Serial0/1 from 10.2.2.2

*Mar 1 01:20:26.235: PIM(0): Update (239.0.0.0/8, RP:10.224.1.1), PIMv2

The BSR forms the RP-Set and advertises to every PIM router. Every PIM router elects an RP for the group from the RP-Set. Here, since the priorities are same for every C-RP (defined in ip pim rp-candidate command), a hash function is run to determine a hash value for every C-RP. The C-RP which produces higher hash value is selected as the RP for the group. Here, Fedora router produces higher hash value and hence is chosen as the RP.

Bowler# show ip pim rp-hash 239.10.1.1

RP 10.224.1.2 (?), v2

Info source: 10.224.1.1 (?), via bootstrap, priority 0, holdtime 150

Uptime: 00:54:06, expires: 00:02:23

PIMv2 Hash Value (mask 0.0.0.0)

RP 10.224.1.2, via bootstrap, priority 0, hash value 2132222040

RP 10.224.1.1, via bootstrap, priority 0, hash value 969159953

Bowler# show ip mroute 239.10.1.1

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,

Z - Multicast Tunnel, z - MDT-data group sender,

Y - Joined MDT-data group, y - Sending to MDT-data group

Outgoing interface flags: H - Hardware switched, A - Assert winner

Timers: Uptime/Expires

Interface state: Interface, Next-Hop or VCD, State/Mode

(*, 239.10.1.1), 01:36:50/stopped, RP 10.224.1.2, flags: SJC

Incoming interface: Serial0/0, RPF nbr 10.2.5.1

Outgoing interface list:

FastEthernet0/0, Forward/Sparse, 01:30:11/00:02:52

(10.1.1.1, 239.10.1.1), 00:00:02/00:02:57, flags: JT

Incoming interface: Serial0/0, RPF nbr 10.2.5.1

Outgoing interface list:

FastEthernet0/0, Forward/Sparse, 00:00:02/00:02:57

If the priority of C-BSR for Stetson is changed to 100, that makes it a BSR for the group range defined.

Stetson(config)# ip pim bsr-candidate Loopback 0 100

Fedora# show ip pim bsr-router

PIMv2 Bootstrap information

BSR address: 10.224.1.1 (?)

Uptime: 00:01:21, BSR Priority: 100, Hash mask length: 0

Expires: 00:01:48

This system is a candidate BSR

Candidate BSR address: 10.224.1.2, priority: 0, hash mask length: 0

Candidate RP: 10.224.1.2(Loopback0)

Holdtime 150 seconds

Advertisement interval 60 seconds

Next advertisement in 00:00:33

Group acl: 1

Understanding hash-mask:

The hash-mask length is defined in the command-

ip pim bsr-candidate <intf-type> <intf-number> [hash-mask-length] [priority value]

The default hash-mask-length is 0.

The hash-mask is a 32-bit number assigned to a BSR. It is advertised in all BSM messages by the BSR. All the receiving routers run a hash-function that assigns a consecutive number of group addresses to one C-RP, then assigns the next group of addresses to next C-RP and so on.

For example- if the hash-mask is 30 bits, the first 30 bits of all multicast addresses is masked. The last 2 bits describe four group addresses that will be assigned to an RP. So multicast addresses 224.1.1.0-3 all belong to one RP, then 224.1.1.4-7 belong to next RP, and so on. In this way, all the routers in the PIM domain select the same RP for a multicast group address.

If the hash-mask is 0, this means that there is a single bundle of group addresses that span the entire multicast address space.