Oct 13 2009
Building the shared and shortest path Tree
The Shared tree is rooted at the RP and the shortest path tree is rooted at the Source of the multicast traffic.
The following processes will be discussed.
- Building the shared tree between the receivers and the RP
- Forwarding unicast PIM Register packets from the source to the RP
- Building the shortest Path tree between the RP and the source
- Building the Shortest-Path Tree between the Source and Receiver
Building the shared tree between the receivers and the RP
- A multicast receiver expresses its interest in receiving traffic destined for a multicast group. Typically, it does this using IGMP or MLD.
- One of the receiver’s local routers is elected as the Designated Router (DR) for that subnet.
- On receiving the receiver’s expression of interest, the DR then sends a PIM Join message towards the RP for that multicast group.
- This Join message is known as a (*,G) Join because it joins group G for all sources to that group.
- The (*,G) Join travels hop-by-hop towards the RP for the group, and in each router it passes through, a multicast tree state for group G is instantiated.
- Eventually, the (*,G) Join either reaches the RP or reaches a router that already has (*,G) Join state for that group.
- When many receivers join the group, their Join messages converge on the RP and form a distribution tree for group G that is rooted at the RP.
- This is known as the RP Tree (RPT), and is also known as the shared tree because it is shared by all sources sending to that group.
- Join messages are resent periodically so long as the receiver remains in the group.
- When all receivers on a leaf-network leave the group, the DR will send a PIM (*,G) Prune message towards the RP for that multicast group.
- However, if the Prune message is not sent for any reason, the state will eventually time out.
Forwarding unicast PIM Register packets to the RP
- A multicast data sender just starts sending data destined for a multicast group.
- The sender’s local router (DR) takes those data packets, unicast-encapsulates them, and sends them directly to the RP.
- The RP receives these encapsulated data packets, decapsulates them, and forwards them onto the shared tree.
- The packets then follow the (*,G) multicast tree state in the routers on the RP Tree being replicated wherever the RP Tree branches, and eventually reaching all the receivers for that multicast group.
- The process of encapsulating data packets to the RP is called registering, and the encapsulation packets are known as PIM Register packets.
- At this stage, multicast traffic is flowing encapsulated to the RP, and then natively over the RP tree to the multicast receivers.
Building the shortest Path tree between the RP and the source
-
Register-encapsulation of data packets is inefficient for two reasons:
- Encapsulation and decapsulation may be relatively expensive operations for a router to perform, depending on whether or not the router has appropriate hardware for these tasks.
- Traveling all the way to the RP, and then back down the shared tree may result in the packets traveling a relatively long distance to reach receivers that are close to the sender. For some applications, this increased latency or bandwidth consumption is undesirable
- Therefore when the RP receives a register-encapsulated data packet from source S on group G, it will normally initiate an (S,G) source-specific Join towards S.
- This Join message travels hop-by-hop towards S, instantiating (S,G) multicast tree state in the routers along the path.
- (S,G) multicast tree state is used only to forward packets for group G if those packets come from source S.
- Eventually the Join message reaches S’s subnet or a router that already has (S,G) multicast tree state.
- Packets from S start to flow following the (S,G) tree state towards the RP.
- While the RP is in the process of joining the source-specific tree for S, the data packets will continue being encapsulated to the RP.
- When packets from S also start to arrive natively at the RP, the RP will be receiving two copies of each of these packets.
- At this point, the RP starts to discard the encapsulated copy of these packets.
- The RP then sends a Register-Stop message back to S’s DR to prevent the DR from unnecessarily encapsulating the packets.
- At this stage, traffic will be flowing natively from S along a source-specific tree to the RP, and from there along the shared tree to the receivers.
- Where the two trees intersect, traffic may transfer from the source-specific tree to the RP tree and thus avoid taking a long detour via the RP.
Building the Shortest-Path Tree between the Source and Receiver
- Although having the RP join back towards the source removes the encapsulation overhead, it does not completely optimize the forwarding paths.
- For many receivers, the route via the RP may involve a significant detour when compared with the shortest path from the source to the receiver.
- To obtain lower latencies or more efficient bandwidth utilization, a router on the receiver’s LAN, typically the DR, may initiate a transfer from the shared tree to a source-specific shortest-path tree (SPT).
- To do this, it issues an (S,G) Join towards S.
- This instantiates state in the routers along the path to S.
- Eventually, this join either reaches S’s subnet or reaches a router that already has (S,G) state.
- When this happens, data packets from S start to flow following the (S,G) state until they reach the receiver.
- At this point, the receiver (or a router upstream of the receiver) will be receiving two copies of the data: one from the SPT and one from the RPT.
- When the first traffic starts to arrive from the SPT, the DR or upstream router starts to drop the packets for G from S that arrive via the RP tree.
- In addition, it sends an (S,G) Prune message towards the RP. This is known as an (S,G,rpt) Prune.
- The Prune message travels hop-by-hop, instantiating state along the path towards the RP indicating that traffic from S for G should NOT be forwarded in this direction.
- The prune is propagated until it reaches the RP or a router that still needs the traffic from S for other receivers.
- By now, the receiver will be receiving traffic from S along the shortest-path tree between the receiver and S.
- In addition, the RP is receiving the traffic from S, but this traffic is no longer reaching the receiver along the RP tree.
- As far as the receiver is concerned, this is the final distribution tree.
The above content was taken from RFC 4601