Christmas Offer - Every Learner Must Check Out - Flat 88% OFF on All Access Pass
PyNet Labs- Network Automation Specialists

What is PIM Protocol?

Author : PyNet Labs
Last Modified: February 19, 2024 
A blog featured image with text - What is PIM Protocol and an image of PIM Protocol Topology containing Source Tree


Multicast is a technique that allows one source to send data to multiple destinations simultaneously without duplicating the data packets. This can save bandwidth and improve network efficiency, especially for applications that involve streaming media, online gaming, video conferencing, or distributed computing. However, multicast routing is a challenging task, as it requires the network devices to maintain information about the multicast groups and their members and to construct optimal paths for delivering the data.

In this blog post, we will learn about PIM protocol, a family of multicast routing protocols, and explain how it operates in different scenarios. Before getting into more details, let’s first understand the PIM routing protocol.

What is the PIM Protocol?

PIM Protocol, which stands for Protocol Independent Multicast, is a multicast routing protocol used in computer networks to route data packets to multiple recipients efficiently. It is an adaptive and scalable protocol that supports multicast routing on a variety of network topologies, including LANs, WANs, and the Internet.

PIM is called protocol-independent because it does not depend on any specific unicast routing protocol for topology discovery. Instead, it uses the existing unicast routing table to perform reverse path forwarding (RPF) checks, which prevent loops and flooding in the network. RPF checks to ensure that a multicast packet is forwarded only if it arrives on the interface with the shortest path to the packet’s source.

PIM Protocol is not a single protocol but a collection of protocols that operate in different modes:

  • PIM Sparse Mode (PIM-SM)
  • PIM Dense Mode (PIM-DM)
  • PIM Bidirectional (Bidir-PIM)
  • PIM Source-Specific Multicast (PIM-SSM)

Now that we have a basic understanding of PIM routing protocol, let’s discuss its functioning.

How Does PIM Protocol Works?

PIM Protocol works by building distribution trees or multicast routing trees that connect the sources and the receivers of a multicast group. A distribution tree is a path through the network used to deliver multicast data. There are two types of distribution trees: source trees and shared trees.

Source Tree

A source tree is a tree that has its root at the source of the multicast data. It represents the shortest path from the source to each receiver and thus minimizes the latency in the network. However, it also requires more state information to be maintained by the routers, as they need to know the addresses of all sources for each group.

A PIM Protocol network topology in source mode of 5 routers, where sender send data to R3 which forwards it to R5 and then to Receiver.

Shared Tree

A shared tree is a tree that has its root at a common point, called a rendezvous point (RP). It does not depend on the location of the sources or the receivers and thus reduces the state information required by the routers. However, it may not provide the optimal path for data delivery, as it may introduce extra hops or detours.

A Network Topology containing 5 routers, a sender and a receiver, where sender sends data to R3, which travels to R4 to R5 and finally Receiver

PIM is a protocol that allows devices to receive multicast data from specific groups. It works in three steps:

  1. Multicast group joining: A device that wants to get data from a group sends a message to nearby routers, saying, “I want to join this group.”
  2. Multicast tree building: Routers use PIM Protocol to decide the best way to send multicast data from the sender to the receiver. This creates a multicast tree.
  3. Data delivery: After the multicast tree is built, data can flow along the tree from the source (sender) to the destination (receiver). This avoids sending data to the whole network and saves bandwidth. PIM has different modes of operation.

Note: PIM Protocol uses both types of trees in different modes. In PIM-SM and PIM-SSM, routers can switch between source trees and shared trees dynamically, depending on the traffic pattern and network conditions. In PIM-DM and Bidir-PIM, routers only use source trees or shared trees respectively.

Let’s now discuss the different modes of PIM protocol.

PIM Protocols

In this section, we will briefly describe each PIM protocol and how it operates.

PIM Dense Mode

PIM Dense Mode (PIM-DM) is a protocol that uses dense multicast routing. It assumes that most nodes in the network are interested in receiving multicast data from any source. It implicitly builds source trees by flooding multicast traffic domain-wide and then pruning back branches of the tree where no receivers are present. This way, it can quickly establish multicast forwarding without requiring any prior knowledge of the sources or the receivers.

For example, if a company’s internal network wants to broadcast live video conference signals to offices across the company, it can use PIM-DM. Since most offices need this service, PIM-DM sends the message everywhere and then cuts off the unnecessary parts to optimize delivery. Below, we have shown it with the help of an image.

A Network Topology of 4 routers, a server and a host. Server sends multicast packet to R1 and finally R4 provides it to the Host.

PIM Sparse Mode

PIM Sparse Mode (PIM-SM) is a protocol that uses sparse multicast routing. It assumes that only a few nodes in the network are interested in receiving multicast data from any source. It explicitly builds unidirectional shared trees rooted at a rendezvous point (RP) per group and optionally creates shortest-path trees per source. This way, it can avoid sending data to nodes that do not want it and reduce the state information required by the routers.

PIM-SM operates in two phases: join and prune. In the join phase, routers that have receivers for a multicast group send join messages to the RP to indicate their interest in receiving data. The RP then discovers the sources for the group and forwards the data to the joined routers along the shared tree. In the pruning phase, routers that do not have receivers for a multicast group send prune messages to the RP to indicate their disinterest in receiving data. The RP then stops forwarding the data to the pruned routers.

A Network Topology Showing PIM Protocol in Sparse Mode where we have 4 routers, a video server and a PC.

PIM-SM also allows routers to switch from the shared tree to a source tree if they want to receive data from a specific source more efficiently. This is done by sending join messages to the source and pruning messages to the RP. This process is called source-specific join or shortest-path tree (SPT) switchover.

Note: PIM-SM generally scales well for wide-area and inter-domain networks, where multicast groups are sparse and sources are distributed.

Bidirectional PIM

Bidirectional PIM (Bidir-PIM) is a protocol that explicitly builds shared bidirectional trees. It does not use source-specific state or RPF checks and thus simplifies multicast routing. It never builds a shortest-path tree so that it may have longer end-to-end delays than PIM-SM, but it scales well because it needs no source-specific state.

Bidir-PIM operates in a similar way as PIM-SM, except that it uses a designated forwarder (DF) election mechanism to select one router per link to forward data on the shared tree. The DF is responsible for sending data from the sources on the link to the RP and receiving data from the RP to the receivers on the link. The DF election is based on the unicast routing metrics and the priority of the routers.

Bidir-PIM is suitable for applications that involve many-to-many communication, such as video conferencing or collaborative work.

A network topology of PIM Protocol in bidirectional mode containing 7 routers, 2 Source, and 2 Receiver

PIM Source-Specific Multicast

PIM Source-Specific Multicast (PIM-SSM) is a variant of PIM-SM that builds trees that are rooted in just one source per group. It offers a more secure and scalable model for a limited number of applications, mostly broadcasting of content. In SSM, an IP datagram is transmitted by a source to an SSM destination address, and receivers can receive this datagram by subscribing to the channel.

A network topology of PIM Protocol in Source specific multicast mode containing 1 server, 5 routers, and 5 PCs.

PIM-SSM operates in a similar way as PIM-SM, except that it does not use an RP or a shared tree. Instead, it uses IGMPv3 or MLDv2 to allow receivers to specify the source address when joining a group. It then builds a source tree from the source to each receiver using join messages.

These are the different PIM Protocols.

Frequently Asked Questions

Q1. What is the difference between IGMP and PIM?

Both IGMP and PIM work together for multicast delivery. The main difference between the two is that, in the case of IGMP, it is used by hosts to join multicast groups, whereas PIM is mainly used by routers to build multicast trees.

Q2. What are 3 modes in which PIM can operate?

The three modes in which PM can operate are:

  • PIM Sparse Mode (PIM-SM)
  • PIM Dense Mode (PIM-DM)
  • PIM Bidirectional (Bidir-PIM)

Q3. What is the PIM mechanism?

The PIM mechanism is a way of routing multicast data over IP networks. It uses other routing protocols to discover the network topology and builds multicast trees based on the receivers’ interests.

Q4. What is a PIM in computer?

PIM in computer stands for Processing In Memory, which is a process that allows computations and processing to be performed within a computer’s memory module.


In this blog post, we have explained PIM protocol, a family of multicast routing protocols. We have explained how PIM operates in different modes: PIM Dense Mode, PIM Sparse Mode, Bidirectional PIM, and PIM Source-Specific Multicast.

If you have any questions or feedback, please feel free to leave a comment below.

Recent Blog Post

Leave a Reply

Your email address will not be published. Required fields are marked *

linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram