cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1907
Views
10
Helpful
6
Replies

bidir pim

Hi,

   Can someone explain how pim bi-dir is different from regular pim-sm? Cisco documentation is not very useful. Thanks for your help

- Balajee

6 Replies 6

Peter Paluch
Cisco Employee
Cisco Employee

Hello Balajee,

In PIM-SM, the multicast distribution tree is uni-directional: it allows the multicast traffic to flow only in the direction either from the source or from the rendezvous point down the tree to the receivers. A multicast traffic may never flow in the opposite direction. If any of these receivers also contributes a multicast traffic to the same multicast group, a new multicast distribution tree has to be constructed for this sender because it is not allowed to send the multicast traffic up the existing tree.

Clearly, in multicast applications of the "many-to-many" type, this behavior of PIM-SM is not ideal. Think a videoconference where everybody sees everybody else. Every receiver is thus a sender as well. With PIM-SM, a multicast distribution tree would need to constructed from each member of the videoconference either to the RP (with shared tree) or to the remaining members (with source tree). In fact, you would have as many separate distribution trees as many members you have. The shared tree does not really help here.

This is where Bidir-PIM comes in. Multicast distribution trees constructed by Bidir-PIM are bi-directional, meaning it is allowed to send the multicast traffic both up and down the branches of this tree. Regardless of how many senders are in a multicast group, there is only a single bidir tree covering them all. Any member of this bidir group can send data without causing a separate tree to be created. This feature relies on specific rules how the multicast traffic is flooded and which router is eligible of flooding the traffic upstream - the designated forwarder - so that no multicast routing loops are created.

Please feel welcome to ask further!

Best regards,

Peter

Thanks Peter for your explanation. Let me put it this way. Topology: Source-R1-RP-R2-Receiver. You mean to say if another source is added to R2 in the above diagram, it can not send multicast traffic towards RP since it is a shared tree and already receiving traffic. And bidir-pim can solve the problem,right? If yes, can you explain why new source can not send traffic up towards RP and what is stopping it? Also, how it is addressed in bidder pim? Thanks for your help.

Thanks,

Balajee

Hello Balajee,

I apologize for answering lately here. I hope this response still reaches you.

Topology: Source-R1-RP-R2-Receiver. You mean to say if another source is  added to R2 in the above diagram, it can not send multicast traffic  towards RP since it is a shared tree and already receiving traffic.

Yes, this is true. You see, in PIM-SM, there are very strict rules on where a packet may be received and through which interfaces the packet may be replicated. The Reverse Path Forwarding rule in PIM-SM says that a router will process only such those multicast packets that come either through the interface back to RP, or through the interface back to the sender of the packet (depending on which tree this router joined). In addition, these packets will be replicated out only those interface that have received PIM Joins for the particular group from the downstream neighbors. Note the strong directionality: the packet must come over the RPF interface (that has sent PIM Join back to either RP or the source), otherwise it is dropped, and the packet must be sent out the interfaces that have received the PIM Join themselves. In other words, multicast traffic flows in the opposite direction of PIM Joins in PIM-SM. This is what makes the distribution trees constructed by PIM-SM uni-directional - the rules of their construction and their usage.

In your scenario, if another source was added to R2 and started sending multicast traffic, a separate distribution tree would need to be constructed for it. The traffic can not flow through the existing distribution tree that was constructed towards R2 as a receiver.

Does this explain sufficiently why trees in PIM-SM are unidirectional? Please feel welcome to ask further!

Also, how it is addressed in bidder pim?

The Bidir-PIM actually behaves quite similarly to the Spanning Tree Protocol. In Bidir-PIM, each connected segment elects exactly one router called Designated Forwarder (DF). This is very similar to STP where each connected segment has exactly one Designated port, and other ports on this segment are either Root ports or blocked ports.

Imagine now what would happen in STP if a Designated port on a segment received a broadcast. The switch in which this Designated port resides would pick up this broadcast, replicate it through all other Designated ports (i.e. onto other segments - other switches may have their Root ports on them) and its Root port (yet another segment on which there may also be another switches having their Root ports). Sending the broadcast through the Root port can be called as forwarding the broadcast upstream (towards the root bridge) while propagating it through Designated ports can be called as forwarding the broadcast downstream (away from the root bridge). If you visualize this process, you can see that the this process of receiving a broadcast on a Designated port and forwarding it all other Designated ports plus the Root port accomplishes, among others, the task of getting the broadcast upstream to the root bridge. The root bridge will of course receive the broadcast through one of its Designated ports and replicate it out its other Designated ports, sending the broadcast downstream to the rest of the network that has not received it yet. Here, other switches will receive the broadcast on their Root ports and will replicate it out all Designated ports, and so on.

So if we sum this up, a broadcast received on a Designated port will be forwarded upstream via the Root port (and also possibly downstream if the switch has other Designated ports - note the bidirectionality here!). A broadcast received on a Root port will be forwarded downstream via Designated ports. There is just one spanning tree constructed in the network, yet this tree is fully bidirectional and allows any node to receive and send the broadcast any time, and the broadcast will be delivered all over the spanning tree.

The Bidir-PIM is very similar. The Designated Forwarder (DF) is responsible for forwarding a multicast packet onto the segment in the downstream direction, and picking up multicasts from the segment and forwarding them towards the Rendezvous Point in the upstream direction. Other routers on the segment which are not DFs are similar to Root ports - they may pick up the multicast from this segment and forward it out their own interfaces on other segments for which they are DFs.

More precisely, assume that a router receives a multicast packet. The RPF verification is also performed here: the packet must either come in through an RPF interface towards the RP, in which case it is a downstream traveling packet, or it must come in through an interface on which the router is a DF, meaning that this packet is an upstream traveling packet. Packet coming in through any other interface is silently dropped. Now, the router takes the packet and forwards it all other interfaces on which it is a DF (the downstream direction), and in addition, if the packet was an upstream packet, it will be also forwarded through the RPF interface towards the RP. Notice the bidirectionality here - a packet can be replicated both into downstream and upstream direction within the single tree.

The described algorithm is slightly simplified - it does not take PIM or IGMP Joins into account. It would result into all multicast being just flooded all over the network. In reality, the downstream traffic is flooded only through a subset of interfaces on which the router is the DF and which have received a PIM or IGMP Join. This limits the flooding only to a set of interfaces that have subscribed receivers.

I understand that this is not an easy topic to digest. You are more than welcome to ask further!

Best regards,

Peter

Hi Peter,

thanks for the nice explanation above, which has clarified a lot to me. But just to confirm that I have understood it correctly now, could you please tell me if the following is correct?

- While in pim-sim the traffic from the source has to pass through the RP before reaching ANY receiver, in pim-bidir the traffic can reach a receiver directly from the source without going through the RP?

Let's consider the following topology: Source --- R1 --- R2 --- RP --- R3  and let's say we have one receiver connected to R2 and one to R3.

- In either mode, the traffic going to the receiver connected to R3 will take the same path;

- However, in regards to the receiver connected to R2:

  - in pim-sm the flow would be: Source ---> R1 ---> R2 ---> RP ---> R2 ---> Receiver

  - in pim-bidir instead: Source ---> R1 ---> R2 ---> Receiver

- besides, is that correct to say that in pim-sm all traffic from Source to RP is encapsulated and then RP unencapsulates it and forward it to the receivers?

Thanks in advance,

Egidio

Hello Egidio,

You are welcome!

in pim-sim the traffic from the source has to pass through the RP before reaching ANY receiver

No, this is not correct. If the multicast is flowing natively (without tunneling, i.e. registering) from the source towards the RP, if any routers on the path from the multicast source to the RP have directly connected receivers, they will automatically forward the stream to the receivers.

- However, in regards to the receiver connected to R2:

  - in pim-sm the flow would be: Source ---> R1 ---> R2 ---> RP ---> R2 ---> Receiver

  - in pim-bidir instead: Source ---> R1 ---> R2 ---> Receiver

According to the explanation above, the multicast flow in both cases, for PIM-SM and Bidir-PIM would be

Source ---> R1 ---> R2 ---> Receiver

- besides, is that correct to say that in pim-sm all traffic from Source  to RP is encapsulated and then RP unencapsulates it and forward it to  the receivers?

Initially, yes, the multicast traffic is encapsulated into PIM Register messages and sent to the RP where it is decapsulated and sent down the shared distribution tree. This fact may give the impression that in PIM-SM, the flow needs to first reach the RP and only then it can start being delivered to the actual receivers. However, this would be true only during the phase of registering a source at the RP (the tunneling). As soon as the RP receives a tunneled packet from the source, it learns about its source IP and can send PIM Join towards this IP address. This PIM Join message travels along the routers towards the source, creating an (S, G) state in all these routers and allowing the multicast traffic to flow natively from the source to the RP. As soon as this happens and RP starts receiving the multicast traffic natively, the registering process is terminated, and the multicast traffic then flows natively from the source to the RP and down the remaining branches of the distribution tree. Any router on the path between the source and the RP can divert a copy of the stream to its directly connected receivers or other routers that have previous sent a PIM Join towards the RP.

As usual, please feel welcome to ask further!

Best regards,

Peter

Just want to add some clarifications to Peter's statement highlighted in bold color below "The Bidir-PIM is very similar. The Designated Forwarder (DF) is responsible for forwarding a multicast packet onto the segment in the downstream direction, and picking up multicasts from the segment and forwarding them towards the Rendezvous Point in the upstream direction. Other routers on the segment which are not DFs are similar to Root ports - they may pick up the multicast from this segment and forward it out their own interfaces on other segments for which they are DFs."

I think the correct statements should be "other routers on the segment which are not DFs will silently drop the traffic", otherwise a loop will take place in PIM Bidir tree.