Dynamic RP election and Auto RP in PIM Sparse-Dense Mode
Auto RP works by having some routers proposing themselves as “Candidate RP” for a specific group (or multiple groups) and by having “RP Discovery” routers which collect candidate announcements, perform evaluation and election and inform all PIM neighbors of the chosen RP for a given group (Group-to-RP mapping).
Notes:
– An RP Candidate can announce itself for a set of Groups, with a specific TTL scope (which PIMv2 Bootstrap does not have).
– Discovery router collects and evaluates all announcements for all groups anyway. It Multicasts information on 224.0.1.40.
– AutoRP incoming announcements can be limited for some group using boundary lists with “filter-autorp” keyword;
AutoRP uses itself a multicast mechanism, based on Candidate RP as sources of announcements to the special group 224.0.1.39, which all Discovery routers join and listen to. Discovery routers also work as sources for RP-to-GROUP mapping announcements, multicasting on 224.0.1.40 to all PIM routers (therefore all PIM routers in SM-DM mode join this Group). THEREFORE, in order to make AutoRP work, the mode Sparse-Dense is needed (224.0.1.40 and 224.0.1.39 are used for electing the RP, while Sparse mode cannot forward them….. they need Sparse-Dense Mode).
Example AutoRP election
-> Remove on all routers, remove static configuration:
conf t
no ip pim rp-address 140.1.2.1
no ip pim spt-threshold infinity
end
clear ip igmp group
clear ip mroute *
clear ip pim rp-mapping
-> change all router to PIM SM-DM:
RT2(config-if) ip pim sparse-dense-mode
-> choose RP Candidate(s)
RT1(config)ip pim send-rp-announce s1.1 scope 15
-> choose the RP Discovery router(s):
RT2(config)ip pim send-rp-discovery scope 15
-> Clear and reset all trees (224.0.1.40, 224.0.1.39, etc.) and IGMP joins:
clear ip igmp group
clear ip mroute *
clear ip pim rp-mapping
Note:
If you do not change the mode from Sparse to Sparse-Dense, Mapping will be not announced!!!!
RT5sh ip mroute count
Group: 224.0.1.40, Source count: 0, Packets forwarded: 0, Packets received: 0
RT5sh ip mroute count
Group: 224.0.1.40, Source count: 0, Packets forwarded: 0, Packets received: 0
When changed (and cleared) now PIM announcements flood correctly:
RT5sh ip mroute count
Group: 239.255.1.1, Source count: 1, Packets forwarded: 440, Packets received: 445
RP-tree: Forwarding: 0/0/0/0, Other: 0/0/0
Source: 192.168.1.1/32, Forwarding: 440/21/1344/232, Other: 445/0/5
Group: 224.0.1.39, Source count: 1, Packets forwarded: 1, Packets received: 2
Source: 138.1.15.11/32, Forwarding: 1/0/48/0, Other: 2/1/0
Group: 224.0.1.40, Source count: 1, Packets forwarded: 1, Packets received: 2
Source: 10.1.23.2/32, Forwarding: 1/0/48/0, Other: 2/1/0
RT5sh ip pim rp
Group: 239.255.1.1, RP: 138.1.15.11, v2, uptime 00:03:10, expires 00:02:42
Group: 239.255.255.250, RP: 138.1.15.11, v2, uptime 00:03:10, expires 00:02:42
RT2sh ip pim rp mapping <<<<<<< Mapping Router
PIM Group-to-RP Mappings
This system is an RP-mapping agent
Group(s) 224.0.0.0/4
RP 138.1.15.11 (?), v2v1
Info source: 138.1.15.11 (?), elected via Auto-RP
Uptime: 00:00:08, expires: 00:02:47
NOTE(*): When you apply a change in Multicasting, often/always do on all routers:
clear ip igmp group
clear ip mroute *
clear ip pim rp-mapping
—> Sometimes do even a reload……..
Avoiding Dense Mode Failover
Using Sparse-Dense mode with Auto-RP requires dense mode support only for the election of the RP and its mapping to all leafs. Actually, anyway, dense mode is still available as a Fallback mode in case the RP is completely unavailable. In some cases, while still needing SM-DM for AutoRP election, we want to avoid the possibility of a reversion to DM mode in case of lack of an RP in the network. Use in this case “no ip pim dm-fallback” on all routers.
(Command is available on 12.3(4)T)
Router(config-if) no ip pim dm-fallback
====> Sparse-Dense Mode does not reverse to Dense Mode (apart of AutoRP mechanisms);
Sparse Mode and AutoRP listener only (no Dense Mode)
Alternatively to imposing no fall-back on Sparse-Dense Mode, since IOS 12.4, an enhancement is available which allows to use Sparse Mode “only” plus a restricted dense mode communication pattern exclusively for 224.0.1.40 and 224.0.1.39 groups needed by AutoRP. This avoids the possibility of a global fall back in case of lost of the RP.
hostname RT6
!
ip multicast-routing
!
interface Ethernet0/0
!
interface Ethernet0/0.2
ip pim sparse-mode <<<<<< only Sparse Mode, not Sparse-Dense Mode
!
interface Ethernet0/0.60
ip pim sparse-mode
!
interface Ethernet0/0.104
ip pim sparse-mode
!
interface Serial0/0.1 multipoint
ip pim sparse-mode
!
interface Serial0/0.2 point-to-point
ip pim sparse-mode
!
ip pim autorp listener <<<<<< but Auto RP dense-mode
ip pim send-rp-discovery scope 15 listener configured
!
end
hostname RT1
!
ip multicast-routing
!
interface Serial0
ip pim sparse-mode
ip multicast boundary 2 filter-autorp
!
interface Serial1
!
interface Serial1.1 point-to-point
ip pim sparse-mode
!
ip pim autorp listener
ip pim send-rp-announce Serial1.1 scope 15
!
access-list 2 deny 224.0.1.0 0.0.0.255
access-list 2 permit any
!
end
hostname RT8
!
ip multicast-routing
!
interface Ethernet0
ip pim sparse-mode
!
interface Ethernet1
ip pim sparse-mode
ip multicast boundary 1 filter-autorp
!
ip pim autorp listener
ip pim send-rp-announce Ethernet0 scope 15
!
end
RT6sh ip pim rp mapping
PIM Group-to-RP Mappings
This system is an RP-mapping agent
Group(s) 224.0.0.0/4
RP 138.1.15.11 (?), v2v1
Info source: 138.1.15.11 (?), elected via Auto-RP <<<< It chooses RT1
Uptime: 00:03:42, expires: 00:02:14
RP 10.1.35.8 (?), v2v1
Info source: 10.1.35.8 (?), via Auto-RP <<<< It sees RT8, but
Uptime: 00:03:44, expires: 00:02:16 does not choose it
Filtering some RP announcements on the RP Discover router(s)
To be able to filter a subset of INCOMING Auto-RP announcement messages coming from the RP candidates ON the discovery routers, use: ip pim [vrf vrf-name] rp-announce-filter rp-list <access-list> group-list <access-list>
IMPORTANT: the rp-access-list must permit all the candidate RPs to be taken by the filter and finally be ignored!!!
Suppose in the previous example we do want to remove announcements of RT8 on RT6.
RT6(config)access-list 99 permit any
RT6(config)access-list 98 permit host 10.1.35.8
RT6(config)ip pim rp-announce-filter rp-list 98 group-list 99
OR equivalently if all groups must be treated the same way:
RT6(config)ip pim rp-announce-filter rp-list 98
RT6sh ip mroute count
IP Multicast Statistics
8 routes using 8506 bytes of memory
3 groups, 1.66 average sources per group
Forwarding Counts: Pkt Count/Pkts per second/Avg Pkt Size/Kilobits per second
Other counts: Total/RPF failed/Other drops(OIF-null, rate-limit etc)
Group: 239.255.1.1, Source count: 0, Packets forwarded: 0, Packets received: 63
RP-tree: Forwarding: 0/0/0/0, Other: 63/63/0
Group: 224.0.1.39, Source count: 2, Packets forwarded: 10, Packets received: 20 <– Candidate
Source: 10.1.35.8/32, Forwarding: 5/1/48/0, Other: 9/4/0 announcements Rx
Source: 138.1.15.11/32, Forwarding: 5/0/48/0, Other: 11/6/0
Group: 224.0.1.40, Source count: 3, Packets forwarded: 0, Packets received: 5 <— Mapping
Source: 138.1.11.156/32, Forwarding: 0/0/0/0, Other: 2/2/0 announcements Tx
Source: 138.1.15.10/32, Forwarding: 0/0/0/0, Other: 1/1/0
Source: 138.1.56.6/32, Forwarding: 0/0/0/0, Other: 2/2/0
RT6sh ip pim rp mapping
PIM Group-to-RP Mappings
This system is an RP-mapping agent
Group(s) 224.0.0.0/4
RP 138.1.15.11 (?), v2v1 <—— only this is considered.
Info source: 138.1.15.11 (?), elected via Auto-RP
Uptime: 00:00:04, expires: 00:02:51