Bidirectional PIM
Notes on Standard PIM-SM behavior:
From Source to RP: Unidirectional Source Tree.
In initial spanning tree establishment traffic is encapsulated into unicast register messages by the first hop router to the RP. Consequently a partial Source tree is created joining the RP to the Source. Traffic between sources and the RP does not flow upstream in the shared tree, but only downstream along the SPT of the source until it reaches the RP.
From RP to Receivers: Unidirectional Shared Tree.
PIM-SM accepts traffic from only one Reverse Path Forwarding (RPF) interface, which the interface pointing the RP. Such behavior allows only downstream traffic flow. Each (*,G) entry in fact is marked with the nbr of the RP router. Once the tree is established, routers revert it to the Source tree. Per Source a (S,G) entry is available on all routers in the path (no entry on routers not in the path).
=> PIM-SM needs then the mechanism of registration to the RP in order to localize a Source and form a dedicated source tree from the RP up to the Source. Extra Mroute (S,G) entries are needed between the Sources and the RP (the source tree from Sources to RPs). Is there a way to simplify the tables to (*,G) only also on the Source to RP side? => use only shared tree and impose a different rule to first hop / upstream of RP routers.
Bidir-PIM modifies the unidirectional behavior of PIM-SM by changing some of its mechanisms:
1) For packets that need to be forwarded from the Source to the RP, Bidir-PIM performs no unicast registration mechanism. Packets are instead passed down to the RP using another mechanism based on a new ROLE: the Designated Forwarder (DF). On every network (segment or point-to-point link) all PIM routers participate in a procedure called designated forwarder (DF) election. The procedure selects one router for each segment. This router is the router that has the best unicast path to the RP(*). When packets arrive from a Source on an interface, the router elected as DF for that segment FLOODS the stream in the direction of the RP (that is a shared tree, “upstream” side of the RP). Recursively a the next hop, which is not yet the RP, which receives the stream, verifies that it is performing the DF role for the segment and sends further downstream the stream to the RP. (*) the DF role is related to the segment (INTERFACE). If Mcast is heard on a segment ONLY the DF floods it in direction of the RP.
2) For packets that are forwarded downstream from the RP toward receivers, there are no fundamental differences between bidir-PIM and PIM-SM. In fact the path will still be the shared tree from the RP to the receivers. Anyway a group that is in bidirectional mode has only shared tree forwarding capabilities.
Note: Summarizing, a Multicast Bidir-PIM router floods packets if:
– It receives an explicit Join (PIM or IGMP) on a interface (and the RFP rule is satisfied);
– It is on the “upstream part of the shared tree” AND is performing the DF role (and the RFP rule is satisfied).
=====> DRAWBACKS of Bidir-PIM:
Shared tree and Source SPT forwarding cannot be mixed as in Bidir PIM SM. Therefore there is no reversion (or optimization) to the source tree anymore. Traffic in a bidirectional group will ALWAYS be forwarded via the RP of that group, even if no receivers are present downstream the RP (it arrives anyway to the RP), and the tree is always a Shared Tree. If no receivers are present, the traffic will only be DROPPED off at the RP. The RP acts logically as “statically present joiner” for the DF routers.
Designated Forwarder Election
The DF election is based on unicast routing metrics and uses the same tie-breaking rules employed by PIM assert processes. The router with the most preferred unicast routing metric to the RP becomes the DF. Use of this method ensures that only one copy of every packet will be sent to the RP, even if there are parallel equal-cost paths to the RP. A DF is selected for every RP of bidirectional groups. As a result, multiple routers may be elected as DF on any network segment, one for each RP. Any particular router may be elected as DF on more than one interface.
RP Placement
Similar to PIM SM, the configuration of the RP placement or election can be done via Auto-RP, static RP configurations, or the PIM Version 2 Bootstrap (PIMv2 BSR) mechanism. IMPORTNAT: the RP mapping or candidate mechanism MUST be flagged with the Bidir-PIM capability (normally a “bidir” keyword).
A single router can act as a Bidir-PIM RP for some groups and as PIM-SM RP for other groups, BUT NO overlapping of Groups must be present (otherwise the overlapping prefers the Bidir mode). In this case the real RP should offer two logical (loopback) interfaces so that the PIM routers will have logically two separated RPs where they can direct their signaling to. ANYWAY ALL routers MUST be Bidir-PIM capable in order to avoid loops (they all need at least the “ip pim bidir-enable” command).
RP mapping or candidate specification MUST flagged with the Bidir-PIM capability
As usual, but with “bidir” keyword:
RT6(config)ip pim rp-address ip-address [group-list <ACL>] [override] bidir
RT6(config)ip pim rp-candidate <IF> [group-list <ACL>] bidir
RT6(config)ip pim send-rp-announce <IF> scope <ttl> [group-list <ACL>] [interval <sec>] bidir
Example: All network performing in Bidir-PIM mode
1) Enable Bidir Mode globally
RTx(config)ip multicast-routing
RTx(config)ip pim bidir-enable <<<<< Enable Bidir-PIM globally
2) Configure SM per interface
RTx(config)interface XXX
RTx(config-if)ip pim sparse-mode <<<<< Bidir-PIM builds on PIM-SM
3) Limit the Groups to be specified as Bidir Mode (optional)
access-list 10 permit 224.0.0.0 7.255.255.255
4) Specify RP mechanism with Bidir keyword
RT1(config)ip pim rp-candidate Serial0 group-list 10 bidir
RT6(config)ip pim rp-candidate Ethernet0/0.2 group-list 10 priority 10 bidir
Apr 16 14:47:59: PIM(0): Received v2 DF on Ethernet1 from 10.1.23.8
Apr 16 14:47:59: PIM(0): Received v2 Bootstrap on Ethernet1 from 10.1.23.8
Apr 16 14:47:59: PIM(0): Update (224.0.0.0/4, RP:10.1.12.1), PIMv2 , bidir
Apr 16 14:47:59: PIM(0): Update (224.0.0.0/4, RP:10.1.35.6), PIMv2 , bidir
Apr 16 14:47:59: PIM(0): Received v2 DF on Ethernet1 from 10.1.23.3
Apr 16 14:47:59: PIM(0): Received v2 DF on Ethernet1 from 10.1.23.3
Apr 16 14:47:59: PIM(0): Received v2 DF on Ethernet1 from 10.1.23.8
Apr 16 14:47:59: PIM(0): Received v2 DF on Ethernet1 from 10.1.23.3
Apr 16 14:47:59: PIM(0): Received v2 DF on Ethernet1 from 10.1.23.3
Apr 16 14:47:59: PIM(0): Received v2 DF on Ethernet1 from 10.1.23.8
Apr 16 14:47:59: PIM(0): Received v2 DF on Ethernet1 from 10.1.23.3
Apr 16 14:47:59: PIM(0): Received v2 DF on Ethernet1 from 10.1.23.3
Apr 16 14:47:59: PIM(0): Received v2 DF on Ethernet1 from 10.1.23.8
Apr 16 14:47:59: PIM(0): Received v2 DF on Ethernet1 from 10.1.23.3
Apr 16 14:47:59: PIM(0): Received v2 DF on Ethernet1 from 10.1.23.3
Apr 16 14:48:00: PIM(0): Check RP 10.1.12.1 into the (*, 239.255.1.1) entry
Apr 16 14:48:04: PIM(0): Received v2 DF on Ethernet1 from 10.1.23.8
Apr 16 14:48:04: PIM(0): Received v2 DF on Ethernet1 from 10.1.23.8
Apr 16 14:48:04: PIM(0): Received v2 DF on Ethernet1 from 10.1.23.8
Apr 16 14:48:04: PIM(0): Received v2 DF on Ethernet1 from 10.1.23.8
Apr 16 14:48:04: PIM(0): Received v2 DF on Ethernet1 from 10.1.23.8
Apr 16 14:48:04: PIM(0): Received v2 DF on Ethernet1 from 10.1.23.8
Apr 16 14:48:05: PIM(0): Received v2 DF on Ethernet1 from 10.1.23.8
Apr 16 14:48:05: PIM(0): Received v2 DF on Ethernet1 from 10.1.23.8
Apr 16 14:48:05: PIM(0): Received v2 DF on Ethernet1 from 10.1.23.8
Apr 16 14:48:12: PIM(0): Received v2 Bootstrap on Ethernet1 from 10.1.23.8
Apr 16 14:48:12: PIM(0): Update (224.0.0.0/4, RP:10.1.12.1), PIMv2 , bidir
Apr 16 14:48:12: PIM(0): Update (224.0.0.0/4, RP:10.1.35.6), PIMv2 , bidir
Apr 16 14:47:59: PIM(0): Received v2 Candidate-RP-Advertisement on Ethernet0/0.2 from 10.1.23.1
Apr 16 14:47:59: PIM(0): Update (224.0.0.0/4, RP:10.1.12.1), PIMv2 , bidir
Apr 16 14:47:59: PIM(0): Received v2 DF on Ethernet0/0.2 from 10.1.35.8
Apr 16 14:47:59: PIM(0): Received v2 DF on Ethernet0/0.104 from 138.1.56.5
Apr 16 14:47:59: PIM(0): Received v2 Bootstrap on Ethernet0/0.104 from 138.1.56.5
Apr 16 14:47:59: PIM(0): Received v2 DF on Ethernet0/0.2 from 10.1.35.8
Apr 16 14:47:59: PIM(0): Received v2 DF on Serial0/0.1 from 138.1.11.155
Apr 16 14:47:59: PIM(0): Received v2 DF on Ethernet0/0.2 from 10.1.35.8
Apr 16 14:47:59: PIM(0): Received v2 DF on Serial0/0.1 from 138.1.11.155
Apr 16 14:47:59: PIM(0): Received v2 DF on Ethernet0/0.2 from 10.1.35.8
Apr 16 14:47:59: PIM(0): Received v2 DF on Ethernet0/0.2 from 10.1.35.8
Apr 16 14:48:00: PIM(0): Check RP 10.1.12.1 into the (*, 239.255.1.1) entry
Apr 16 14:48:04: PIM(0): Received v2 DF on Ethernet0/0.2 from 10.1.35.8
Apr 16 14:48:04: PIM(0): Received v2 DF on Ethernet0/0.104 from 138.1.56.5
Apr 16 14:48:04: PIM(0): Received v2 DF on Serial0/0.1 from 138.1.11.130
Apr 16 14:48:04: PIM(0): Received v2 DF on Serial0/0.1 from 138.1.11.130
Apr 16 14:48:04: PIM(0): Received v2 DF on Serial0/0.1 from 138.1.11.155
Apr 16 14:48:04: PIM(0): Received v2 DF on Serial0/0.1 from 138.1.11.130
Apr 16 14:48:05: PIM(0): Received v2 DF on Ethernet0/0.2 from 10.1.35.8
Apr 16 14:48:10: PIM(0): Received v2 Join/Prune on Serial0/0.1 from 138.1.11.155, to us
Apr 16 14:48:10: PIM(0): Join-list: (*, 239.255.255.250), RPT-bit set, WC-bit set, S-bit set
Apr 16 14:48:10: PIM(0): Check RP 10.1.12.1 into the (*, 239.255.255.250) entry
Apr 16 14:48:10: PIM(0): Add Serial0/0.1/138.1.11.155 to (*, 239.255.255.250), Forward state, by PIM *G Join
Apr 16 14:48:10: PIM(0): Building Triggered Join/Prune message for 239.255.255.250
Apr 16 14:48:10: PIM(0): Insert (*,239.255.255.250) join in nbr 10.1.35.8’s queue
Apr 16 14:48:10: PIM(0): Building Join/Prune packet for nbr 10.1.35.8
Apr 16 14:48:10: PIM(0): Adding v2 (10.1.12.1/32, 239.255.255.250), WC-bit, RPT-bit, S-bit Join
Apr 16 14:48:10: PIM(0): Send v2 join/prune to 10.1.35.8 (Ethernet0/0.2)
Apr 16 14:48:10: PIM(0): Received v2 DF on Ethernet0/0.2 from 10.1.35.8
Apr 16 14:48:12: PIM(0): Received v2 Bootstrap on Ethernet0/0.104 from 138.1.56.5
Apr 16 14:48:15: PIM(0): Received v2 DF on Ethernet0/0.2 from 10.1.35.8
Apr 16 14:48:20: PIM(0): Received v2 DF on Ethernet0/0.2 from 10.1.35.8
Apr 16 14:48:25: PIM(0): Received v2 DF on Ethernet0/0.2 from 10.1.35.8
Apr 16 14:48:30: PIM(0): Received v2 DF on Ethernet0/0.2 from 10.1.35.8
Apr 16 14:48:35: PIM(0): Received v2 DF on Ethernet0/0.2 from 10.1.35.8
Apr 16 14:48:40: PIM(0): Received v2 DF on Ethernet0/0.2 from 10.1.35.8
Apr 16 14:48:45: PIM(0): Received v2 DF on Ethernet0/0.2 from 10.1.35.8
Apr 16 14:48:50: PIM(0): Received v2 DF on Ethernet0/0.2 from 10.1.35.8
Apr 16 14:48:55: PIM(0): Received v2 DF on Ethernet0/0.2 from 10.1.35.8
Apr 16 14:48:58: PIM(0): Received v2 Candidate-RP-Advertisement on Ethernet0/0.2 from 10.1.35.6
Apr 16 14:48:58: PIM(0): Update (224.0.0.0/4, RP:10.1.35.6), PIMv2 , bidir
Apr 16 14:48:59: PIM(0): Received v2 Candidate-RP-Advertisement on Ethernet0/0.2 from 10.1.23.1
Apr 16 14:48:59: PIM(0): Update (224.0.0.0/4, RP:10.1.12.1), PIMv2 , bidir
Apr 16 14:48:59: PIM(0): Building Periodic Join/Prune message for 239.255.1.1
Apr 16 14:49:00: PIM(0): Received v2 DF on Ethernet0/0.2 from 10.1.35.8
RT1sh ip mroute
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
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.255.1.1), 00:04:29/00:02:04, RP 10.1.12.1, flags: BP
Bidir-Upstream: Null, RPF nbr 0.0.0.0 <<<< ONLY the (*,G)
Outgoing interface list: Null entry is used
(*, 224.0.1.40), 00:12:22/00:02:05, RP 0.0.0.0, flags: DPL
Incoming interface: Null, RPF nbr 0.0.0.0
Outgoing interface list: Null
(*, 239.255.255.250), 00:03:55/00:01:58, RP 10.1.12.1, flags: BP
Bidir-Upstream: Null, RPF nbr 0.0.0.0
Outgoing interface list: Null
RT5sh ip pim interface df
Interface RP DF Winner Metric Uptime
Ethernet0/0.33 10.1.12.1 150.1.1.1 2733056 00:06:23
10.1.35.6 150.1.1.1 2195456 00:06:18
Ethernet0/0 10.1.12.1 192.168.1.120 2733056 00:06:23
10.1.35.6 192.168.1.120 2195456 00:06:18
Ethernet0/0.104 10.1.12.1 138.1.56.6 2221056 00:06:23
10.1.35.6 138.1.56.6 0 00:06:18
Serial0/0 10.1.12.1 138.1.11.156 2221056 00:06:22
10.1.35.6 138.1.11.156 0 00:06:18
RT5sh ip pim rp mapping
PIM Group-to-RP Mappings
Group(s) 224.0.0.0/4
RP 10.1.12.1 (?), v2, bidir <<<<< Bidir enabled
Info source: 10.1.35.6 (?), via bootstrap, priority 0
Uptime: 00:16:34, expires: 00:02:19
RP 10.1.35.6 (?), v2, bidir
Info source: 10.1.35.6 (?), via bootstrap, priority 10
Uptime: 00:16:55, expires: 00:02:16
Example network performing in Bidir-PIM mode on some groups and Sparse Mode on others
By default a bidirectional RP advertises all groups as bidirectional. An access list on the RP can be used to specify a list of groups to be advertised as bidirectional.
– A Loopback “A” address having Groups with the PERMIT keyword will operate in Bidir-PIM mode;
– A Loopback “A” address having Groups with the DENY keyword will operate in dense mode;
– A different, non-bidirectional RP address (Loopback “B”) is required for groups that operate in sparse mode;
ip pim send-rp-announce Loopback0 scope 10 group-list 45 bidir
ip pim send-rp-announce Loopback1 scope 10 group-list 46
ip pim send-rp-discovery scope 10
access-list 45 permit 224.0.0.0 0.255.255.255 <<<< Bidir keyword, Permit => Bidir-PIM mode
access-list 45 permit 227.0.0.0 0.255.255.255 <<<< Bidir keyword, Permit => Bidir-PIM mode
access-list 45 deny 225.0.0.0 0.255.255.255 <<<< Bidir keyword, Deny => Dense mode
access-list 46 permit 226.0.0.0 0.255.255.255 <<<< No Bidir keyword, Permit => Sparse mode
Example: Bidir + Bootstrap
hostname RT1
!
ip multicast-routing
!
interface Loopback100
ip address 10.100.100.100 255.255.255.255
!
interface Loopback101
ip address 10.100.100.101 255.255.255.255
!
interface Ethernet1
ip address 10.1.23.1 255.255.255.0
ip pim sparse-mode
!
interface Serial1
encapsulation frame-relay
!
interface Serial1.1 point-to-point
ip address 138.1.15.11 255.255.255.248
ip pim sparse-mode
frame-relay interface-dlci 302
!
router eigrp 1
passive-interface Ethernet0
network 10.1.23.0 0.0.0.255
network 10.100.100.100 0.0.0.0
network 10.100.100.101 0.0.0.0
network 138.1.15.8 0.0.0.7
network 140.1.2.0 0.0.0.255
no auto-summary
!
ip classless
!
ip pim bidir-enable
ip pim bsr-candidate Serial0 0
ip pim rp-candidate Loopback101 group-list 2 bidir <<<< Bidir + Permit = Bidir Mode
ip pim rp-candidate Loopback100 group-list 1 <<<< No-Bidir + Permit = Sparse Mode
!
access-list 1 permit 239.255.1.1 <<<< Important: No overlap
access-list 2 permit 239.254.0.0 0.0.255.255 <<<< Important: No overlap
!
end
RT1sh ip mroute
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
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.254.1.1), 00:01:12/00:02:54, RP 10.100.100.101, flags: B
Bidir-Upstream: Null, RPF nbr 0.0.0.0
Outgoing interface list: Null
(*, 239.255.1.1), 00:01:24/stopped, RP 10.100.100.100, flags: S
Incoming interface: Null, RPF nbr 0.0.0.0
Outgoing interface list: Null
(192.168.1.1, 239.255.1.1), 00:00:37/00:02:52, flags: T
Incoming interface: Ethernet1, RPF nbr 10.1.23.8
Outgoing interface list: Null
RT1sh 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.254.0.0/16
RP 10.100.100.101 (?), v2, bidir
Info source: 10.1.12.1 (?), via bootstrap, priority 0
Uptime: 00:02:36, expires: 00:02:49
Group(s) 239.255.1.1/32
RP 10.100.100.100 (?), v2
Info source: 10.1.12.1 (?), via bootstrap, priority 0
Uptime: 00:02:35, expires: 00:02:53
RT6sh ip mroute active
Active IP Multicast Sources – sending >= 4 kbps
Group: 239.255.1.1, (?)
RP-tree:
Rate: 17 pps/191 kbps(1sec), 122 kbps(last 20 secs), 199 kbps(life avg)
Group: 239.254.1.1, (?)
RP-tree:
Rate: 17 pps/191 kbps(1sec), 191 kbps(last 40 secs), 179 kbps(life avg)