19 Temmuz 2018 Perşembe

PIM BSR Multicast

R1(config)#ip pim rp-candidate loopback 0 priority 10
!
R2(config)#ip pim rp-candidate loopback 0 priority 5
R2(config)#ip pim bsr-candidate loopback 0 22

RP-CANDİDATE ben rp'liğini ilan etmek istiyor BSR-candidate ise bu seçimi yapan cihaz. RP-CANDİDATE en düsük değer rp olur, Bsr da ise yüksek bsr değeri ornekteki 22 bsr olur. Defaultta 0 'dır ikiside.


multicast pim bsr topology


First we enable multicast routing on all routers::
R1, R2, R3 & R4
(config)#ip multicast-routing
And enable PIM sparse mode on all interfaces:
R1(config)#interface GigabitEthernet 0/1
R1(config-if)#ip pim sparse-mode
R2(config)#interface GigabitEthernet 0/1
R2(config-if)#ip pim sparse-mode 

R2(config)#interface GigabitEthernet 0/2
R2(config-if)#ip pim sparse-mode 
R3(config)#interface GigabitEthernet 0/1
R3(config-if)#ip pim sparse-mode 

R3(config)#interface GigabitEthernet 0/2
R3(config-if)#ip pim sparse-mode 
R4(config)#interface GigabitEthernet 0/1
R4(config-if)#ip pim sparse-mode
R1 will become the RP and instead of using one of the physical interfaces, we will use a new loopback interface as the RP address. Make sure PIM sparse mode is enabled on the loopback and that it is advertised in OSPF:
R1(config)#interface Loopback 0
R1(config-if)#ip address 1.1.1.1 255.255.255.255
R1(config-if)#ip pim sparse-mode

R1(config)#router ospf 1
R1(config-router)#network 1.1.1.1 0.0.0.0 area 0
Here’s the command to enable the RP:
R1(config)#ip pim rp-candidate loopback 0 ?
group-list group-list
interval RP candidate advertisement interval
priority RP candidate priority
Above you can see a number of options. The group-list allows you to use an access-list to select the multicast groups that you want to be an RP for. The priority command is used to set the priority. Let’s forget about these parameters and keep it simple for now:
R1(config)#ip pim rp-candidate loopback 0
At the moment, nothing will happen. Our RP requires messages from a BSR so it knows where it can register itself. Let’s configure R2 as the BSR.
Like the RP, I will use a new loopback interface as the BSR address:
R2(config)#interface Loopback 0
R1(config-if)#ip address 2.2.2.2 255.255.255.255
R1(config-if)#ip pim sparse-mode

R1(config)#router ospf 1
R1(config-router)#network 2.2.2.2 0.0.0.0 area 0
Now we can use the BSR command:
R1(config)#ip pim bsr-candidate loopback 0 ?
Hash Mask length for RP selection
There are a couple of parameters we can choose from. The first one is the hash mask length and we can set the priority:
R1(config)#ip pim bsr-candidate loopback 0 0 ? 
  <0-255>  Priority value for candidate bootstrap router
  <cr>
It’s also possible to configure a filter so the BSR doesn’t accept all RPs:
R1(config)#ip pim bsr-candidate loopback 0 0 0 ?
  accept-rp-candidate  BSR RP candidate filter
  <cr>
We will keep it simple…I’m not going to use any of the parameters for now:
R1(config)#ip pim bsr-candidate loopback 0
As soon as you configure the BSR, it will send BSR messages. Here’s what these look like:
multicast pim bootstrap capture
Above you can see that these packets are sent to multicast address 224.0.0.13. The BSR priority is 0 and the hash mask is 0.
Want to take a look at this packet yourself?
Once our RP receives the BSR message, it will register itself. Here’s what the packet looks like:
Multicast PIM Bootstrap RP Announcement Capture
Above you can see that this is a unicast packet. In the PIM options we see the default priority (0) and the multicast group: 224.0.0.0/4.
Want to see this packet for yourself?
Let’s verify our work:
R1#show ip pim bsr-router 
PIMv2 Bootstrap information
  BSR address: 2.2.2.2 (?)
  Uptime:      00:01:04, BSR Priority: 0, Hash mask length: 0
  Expires:     00:02:06
  Candidate RP: 1.1.1.1(Loopback0)
    Holdtime 150 seconds
    Advertisement interval 60 seconds
    Next advertisement in 00:00:48
The show ip bim bsr-router command gives us a quick overview of the BSR that our routers have found. Let’s check it on all routers:
R2#show ip pim bsr-router
PIMv2 Bootstrap information
This system is the Bootstrap Router (BSR)
  BSR address: 2.2.2.2 (?)
  Uptime:      00:02:09, BSR Priority: 0, Hash mask length: 0
  Next bootstrap message in 00:00:51
R2 sees itself as the BSR, so far so good. What about R3 and R4?
R3#show ip pim bsr-router
PIMv2 Bootstrap information
  BSR address: 2.2.2.2 (?)
  Uptime:      00:01:11, BSR Priority: 0, Hash mask length: 0
  Expires:     00:01:59
R4#show ip pim bsr-router
PIMv2 Bootstrap information
  BSR address: 2.2.2.2 (?)
  Uptime:      00:01:13, BSR Priority: 0, Hash mask length: 0
  Expires:     00:01:57
R3 and R4 also know where the BSR is. Let’s see if our routers also have learned where the RP is:
R1#show ip pim rp mapping 
PIM Group-to-RP Mappings
This system is a candidate RP (v2)

Group(s) 224.0.0.0/4
  RP 1.1.1.1 (?), v2
    Info source: 2.2.2.2 (?), via bootstrap, priority 0, holdtime 150
         Uptime: 00:04:35, expires: 00:01:54
R1 knows that it’s a candidate RP and that this information comes from BSR. Let’s check R2:
R2#show ip pim rp mapping
PIM Group-to-RP Mappings
This system is the Bootstrap Router (v2)

Group(s) 224.0.0.0/4
  RP 1.1.1.1 (?), v2
    Info source: 1.1.1.1 (?), via bootstrap, priority 0, holdtime 150
         Uptime: 00:04:37, expires: 00:01:46
R2 tells us that it’s the BSR and that it has learned that R1 is the RP. What about R3?
R3#show ip pim rp mapping
PIM Group-to-RP Mappings

Group(s) 224.0.0.0/4
  RP 1.1.1.1 (?), v2
    Info source: 2.2.2.2 (?), via bootstrap, priority 0, holdtime 150
         Uptime: 00:04:40, expires: 00:01:48
R3 has learned about the RP, so does R4:
R4#show ip pim rp mapping
PIM Group-to-RP Mappings

Group(s) 224.0.0.0/4
  RP 1.1.1.1 (?), v2
    Info source: 2.2.2.2 (?), via bootstrap, priority 0, holdtime 150
         Uptime: 00:04:41, expires: 00:01:44
All routers have now learned about the RP through BSR!
There are a couple of things we can try though. Let’s see what happens when we add a second RP. Let’s configure R4 as our second RP:
R4(config)#interface loopback 0
R4(config-if)#ip address 4.4.4.4 255.255.255.255
R4(config-if)#ip pim sparse-mode 
R4(config)#router ospf 1
R4(config-router)#network 4.4.4.4 0.0.0.0 area 0

R4(config)#ip pim rp-candidate loopback 0
Let’s check what our routers think of this:
R1#show ip pim rp mapping
PIM Group-to-RP Mappings
This system is a candidate RP (v2)

Group(s) 224.0.0.0/4
  RP 4.4.4.4 (?), v2
    Info source: 2.2.2.2 (?), via bootstrap, priority 0, holdtime 150
         Uptime: 00:02:23, expires: 00:02:20
  RP 1.1.1.1 (?), v2
    Info source: 2.2.2.2 (?), via bootstrap, priority 0, holdtime 150
         Uptime: 00:18:42, expires: 00:02:04
R2#show ip pim rp mapping
PIM Group-to-RP Mappings
This system is the Bootstrap Router (v2)

Group(s) 224.0.0.0/4
  RP 4.4.4.4 (?), v2
    Info source: 4.4.4.4 (?), via bootstrap, priority 0, holdtime 150
         Uptime: 00:02:21, expires: 00:02:05
  RP 1.1.1.1 (?), v2
    Info source: 1.1.1.1 (?), via bootstrap, priority 0, holdtime 150
         Uptime: 00:18:29, expires: 00:01:43
R3#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: 2.2.2.2 (?), via bootstrap, priority 0, holdtime 150
         Uptime: 00:02:21, expires: 00:02:21
  RP 1.1.1.1 (?), v2
    Info source: 2.2.2.2 (?), via bootstrap, priority 0, holdtime 150
         Uptime: 00:18:31, expires: 00:02:01
R4#show ip pim rp mapping
PIM Group-to-RP Mappings
This system is a candidate RP (v2)

Group(s) 224.0.0.0/4
  RP 4.4.4.4 (?), v2
    Info source: 2.2.2.2 (?), via bootstrap, priority 0, holdtime 150
         Uptime: 00:02:21, expires: 00:02:23
  RP 1.1.1.1 (?), v2
    Info source: 2.2.2.2 (?), via bootstrap, priority 0, holdtime 150
         Uptime: 00:18:29, expires: 00:02:04
As you can see above, all routers know about both RPs. Both RPs advertise the 224.0.0.0/4 multicast group and have a priority of 0.
Let’s check the hash value of these RPs since that’s what decides which router we will use as the RP:
R3#show ip pim rp-hash 239.1.1.1
  RP 4.4.4.4 (?), v2
    Info source: 2.2.2.2 (?), via bootstrap, priority 0, holdtime 150
         Uptime: 00:11:38, expires: 00:02:09
  PIMv2 Hash Value (mask 0.0.0.0)
    RP 4.4.4.4, via bootstrap, priority 0, hash value 1642267698
    RP 1.1.1.1, via bootstrap, priority 0, hash value 332477713
Above you can see that R4 has a higher hash value so that’s the RP we will use for multicast group 239.1.1.1. With a hash mask of 0, we will use R4 as the RP for all multicast groups.
Let’s try playing with the hash mask…we can change its value so that R1 and R4 will both be used as an RP. I will use a hash mask of 31-bit. This means that each RP will get two multicast groups:
R2(config)#ip pim bsr-candidate loopback 0 31
Let’s use the show ip pim rp-hash command again to check different multicast groups:
R3#show ip pim rp-hash 239.1.1.0
  RP 1.1.1.1 (?), v2
    Info source: 1.1.1.1 (?), via bootstrap, priority 0, holdtime 150
         Uptime: 1w0d, expires: 00:01:46
  PIMv2 Hash Value (mask 255.255.255.254)
    RP 4.4.4.4, via bootstrap, priority 0, hash value 192087346
    RP 1.1.1.1, via bootstrap, priority 0, hash value 1415431185
R3#show ip pim rp-hash 239.1.1.1
  RP 1.1.1.1 (?), v2
    Info source: 2.2.2.2 (?), via bootstrap, priority 0, holdtime 150
         Uptime: 00:41:36, expires: 00:01:48
  PIMv2 Hash Value (mask 255.255.255.254)
    RP 4.4.4.4, via bootstrap, priority 0, hash value 192087346
    RP 1.1.1.1, via bootstrap, priority 0, hash value 1415431185
R3#show ip pim rp-hash 239.1.1.2
  RP 4.4.4.4 (?), v2
    Info source: 2.2.2.2 (?), via bootstrap, priority 0, holdtime 150
         Uptime: 00:26:07, expires: 00:01:28
  PIMv2 Hash Value (mask 255.255.255.254)
    RP 4.4.4.4, via bootstrap, priority 0, hash value 724279812
    RP 1.1.1.1, via bootstrap, priority 0, hash value 52024035
R3#show ip pim rp-hash 239.1.1.3
  RP 4.4.4.4 (?), v2
    Info source: 2.2.2.2 (?), via bootstrap, priority 0, holdtime 150
         Uptime: 00:26:35, expires: 00:01:59
  PIMv2 Hash Value (mask 255.255.255.254)
    RP 4.4.4.4, via bootstrap, priority 0, hash value 724279812
    RP 1.1.1.1, via bootstrap, priority 0, hash value 52024035
Above you can see that 239.1.1.0 and 239.1.1.1 are now served by R1 and R4 gets 239.1.1.2 and 239.1.1.3. Each RP gets two multicast groups.
Last but not least, let’s see what happens when we add a second BSR?
I’ll configure R3 as the BSR:
R3(config)#interface loopback 0
R3(config-if)#ip address 3.3.3.3 255.255.255.255
R3(config-if)#ip pim sparse-mode 

R3(config)#router ospf 1
R3(config-router)#network 3.3.3.3 0.0.0.0 area 0

R3(config)#ip pim bsr-candidate Loopback0 31 
I’m using the same configuration as on R2. Let’s find out which router is the active BSR:
R2#show ip pim bsr-router 
PIMv2 Bootstrap information
  BSR address: 3.3.3.3 (?)
  Uptime:      00:03:33, BSR Priority: 0, Hash mask length: 31
  Expires:     00:01:46
This system is a candidate BSR
  Candidate BSR address: 2.2.2.2, priority: 0, hash mask length: 31
Above you can see that R3 is now the active BSR. The priority is the same on both routers so it’s the highest IP address that is used as a tie-breaker. R3 becomes the BSR
R1:

hostname R1
!
ip multicast-routing 
ip cef
!
interface Loopback0
 ip address 1.1.1.1 255.255.255.255
 ip pim sparse-mode
!
interface GigabitEthernet0/1
 ip address 192.168.12.1 255.255.255.0
 ip pim sparse-mode
!
router ospf 1
 network 1.1.1.1 0.0.0.0 area 0
 network 192.168.12.0 0.0.0.255 area 0
!
ip pim rp-candidate Loopback0
R2:
hostname R2
!
ip multicast-routing 
ip cef
!
interface Loopback0
 ip address 2.2.2.2 255.255.255.255
 ip pim sparse-mode
!
interface GigabitEthernet0/1
 ip address 192.168.12.2 255.255.255.0
 ip pim sparse-mode
!
interface GigabitEthernet0/2
 ip address 192.168.23.2 255.255.255.0
 ip pim sparse-mode
!
router ospf 1
 network 2.2.2.2 0.0.0.0 area 0
 network 192.168.12.0 0.0.0.255 area 0
 network 192.168.23.0 0.0.0.255 area 0
!
ip pim bsr-candidate Loopback0 31
R3:
hostname R3
!
ip multicast-routing 
ip cef
!
interface Loopback0
 ip address 3.3.3.3 255.255.255.255
 ip pim sparse-mode
!
interface GigabitEthernet0/1
 ip address 192.168.34.3 255.255.255.0
 ip pim sparse-mode
!
interface GigabitEthernet0/2
 ip address 192.168.23.3 255.255.255.0
 ip pim sparse-mode
!
router ospf 1
 network 3.3.3.3 0.0.0.0 area 0
 network 192.168.23.0 0.0.0.255 area 0
 network 192.168.34.0 0.0.0.255 area 0
!
ip pim bsr-candidate Loopback0 31
R4:
hostname R4
!
ip multicast-routing 
ip cef
!
interface Loopback0
 ip address 4.4.4.4 255.255.255.255
 ip pim sparse-mode
!
interface GigabitEthernet0/1
 ip address 192.168.34.4 255.255.255.0
 ip pim sparse-mode
!
router ospf 1
 network 4.4.4.4 0.0.0.0 area 0
 network 192.168.34.0 0.0.0.255 area 0
!
ip pim rp-candidate Loopback0

Hiç yorum yok:

Yorum Gönder