
Protocol Independent Multicast
describes the concepts, operation, and features of PIM. PIM is the protocol used to route multicast traffic across network segments from a multicast source to a group of receivers.
- A multicast routing protocol is necessary to route the multicast traffic throughout the network so that routers can locate and request multicast streams from other routers. Multiple multicast routing protocols exist, but Cisco fully supports only PIM.
- PIM is a multicast routing protocol that routes multicast traffic between network segments.
- PIM can use any of the unicast routing protocols to identify the path between the source and receivers.
- Multicast routers create distribution trees that define the path that IP multicast traffic follows through the network to reach the receivers. The two basic types of multicast distribution trees are:
- source trees, (shortest path trees – SPTs)
- shared trees, also known as rendezvous point trees (RPTs)
Source Tree
- Multicast distribution tree where the source is the root of the tree, and branches form a distribution tree through the network all the way down to the receivers.
- When this tree is built, it uses the shortest path through the network from the source to the leaves of the tree.
- Also referred to as a shortest path tree (SPT). The forwarding state of the SPT is known by the notation (S,G).
- Ex: the SG (10.1.1.2, 239.1.1.1)
Shared Tree
- A multicast distribution tree where the root of the shared tree is not the source but a router designated as the rendezvous point (RP).
- Shared trees also referred to as RP trees (RPTs).
- Multicast traffic is forwarded down the shared tree according to the group address G that the packets are addressed to, regardless of the source address.
- Notation (*,G).
Terminology 
Operating Modes
Five PIM operating modes:
- PIM Dense Mode (PIM-DM)
- PIM Sparse Mode (PIM-SM)
- PIM Sparse Dense Mode
- PIM Source Specific Multicast (PIM-SSM)
- PIM Bidirectional Mode (Bidir-PIM)
Control Messages
- All PIM control messages use the IP protocol number 103; Either unicast (that is, register and register stop messages) or multicast, with a TTL of 1 to the all PIM routers address 224.0.0.13.
- PIM hello messages are sent by default every 30s out each PIM-enabled interface to learn about the neighboring PIM routers on each interface to the all PIM routers address.
- Hello messages are also the mechanism used to elect a DR and to negotiate additional capabilities.
- All PIM routers must record the hello information received from each PIM neighbor. PIM Dense Mode (PIM-DM)
PIM Dense Mode
- The multicast traffic from the source is flooding throughout the entire network. As each router receives the multicast traffic from its upstream neighbor via its RPF interface, it forwards the multicast traffic to all its PIM-DM neighbors.
- This results in some traffic arriving via a non-RPF interface, as in the case of R3 receiving traffic from R2 on its non-RPF interface.
- Packets arriving via the nonRPF interface are discarded.
- Even though the flow of multicast traffic is no longer reaching most of the routers in the network, the (S,G) state still remains in all routers until the source stops transmitting.
- PIM-DM is applicable to small networks where there are active receivers on every subnet of the network.
- Because this is rarely the case, and the flood and prune behavior, PIMDM is not generally recommended for production environments
PIM Sparse Mode
- PIM-SM was designed for receivers scattered throughout the network but works well in densely populated networks.
- It also assumes that no receivers are interested in multicast traffic unless they explicitly request it.
- PIM-SM uses the unicast routing table to perform RPF checks, and it does not care which routing protocol populates the unicast routing table
- PIM-SM uses an explicit join model where the receivers send an IGMP join to their locally connected router (the last-hop router – LHR) and this join causes the LHR to send a PIM join in the direction of the root of the tree, which is either the RP in the case of a shared tree (RPT) or the first-hop router (FHR) where the source transmitting the multicast streams is connected in the case of an SPT.
- A multicast forwarding state is created as the result of these explicit joins; it is very different from the flood and prune behavior of PIM-DM.
PIM Sparse Mode
Figure 13-17 illustrates a multicast source sending multicast traffic to the FHR. The FHR then sends this multicast traffic to the RP, which makes the multicast source known to the RP. It also illustrates a receiver sending an IGMP join to the LHR to join the multicast group.
- The LHR then sends a PIM join (*,G) to the RP, and this forms a shared tree from the RP to the LHR.
- The RP then sends a PIM join (S,G) to the FHR, forming a source tree between the source and the RP.
- In essence, two trees are created: an SPT from the FHR to the RP (S,G) and a shared tree from the RP to the LHR (*,G).
PIM Sparse Switchover Mode
PIM-SM allows the LHR to switch from the shared tree to an SPT for a specific source. In Cisco routers, this is the default behavior, and it happens immediately after the first multicast packet is received from the RP via the shared tree, even if the shortest path to the source is through the RP.
- When the LHR receives the first multicast packet from the RP, it becomes aware of the IP address of the multicast source.
- The shortest path to the source is between R1 and R3; if that link were shut down or not present, the shortest path would be through the RP, in which case an SPT switchover would still take place.
Designated Routers
- When multiple PIM-SM routers exist on a LAN segment, PIM hello messages are used to elect a DR to avoid sending duplicate multicast traffic into the LAN or the RP.
- By default, the DR priority value of all PIM routers is 1, and it can be changed to force a router to become the DR.
- If all routers have the same priority value, the highest IP address in the subnet used as a tiebreaker.
- Without DRs, all LHRs on the same LAN segment would be capable of sending PIM joins upstream, which could result in duplicate multicast traffic arriving on the LAN.
- The default DR hold time is 3.5 times the hello interval, or 105 seconds. If there are no hellos after this interval, a new DR is elected.
- To reduce DR failover time, the hello query interval can be reduced
Reverse Path Forwarding
An algorithm used to prevent loops and ensure that multicast traffic is arriving on the correct interface. RPF functions as follows:
- If a router receives a multicast packet on an interface it uses to send unicast packets to the source, the packet has arrived on the RPF interface.
- If the packet arrives on the RPF interface, a router forwards the packet out the interfaces present in the outgoing interface list (OIL) of a multicast routing table entry.
- If the packet does not arrive on the RPF interface, the packet is discarded to prevent loops.
PIM-SM uses the RPF lookup function to determine where it needs to send joins and prunes.
- (S,G) joins are sent toward the source.
- (*,G) joins (shared tree states) are sent toward the RP.
PIM Forwarder
In Figure 13-20, PIM-DM would send duplicate flows into the LAN.
- For example, assuming that R1 is the RP, when R4 sends a PIM join message upstream toward it, it sends it to the all PIM routers address 224.0.0.13, and R2 and R3 receive it.
- One of the fields of the PIM join message includes the IP address of the upstream neighbor (RPF neighbor).
- Assuming that R3 is the RPF neighbor, R3 is the only one that will send a PIM join to R1.
- R2 will not because the PIM join was not meant for it. At this point, a shared tree exists between R1, R3, and R4, and no traffic duplication exists.
Other useful information: