Skip to content

PIM-SM

Protocol Independent Multicast - Sparse Mode (PIM-SM) is a scalable multicast routing protocol that enables efficient data distribution from senders to receivers spread across multiple network segments. Unlike dense-mode protocols that flood traffic throughout the network, PIM-SM uses a pull-based model where receivers explicitly join multicast groups, making it suitable for wide-area networks and sparse receiver distributions.

PIM-SM is “Protocol Independent” because it does not require a specific unicast routing protocol. It operates on top of any existing unicast routing infrastructure, whether OSPF, BGP, static routes, or any combination thereof. This flexibility allows multicast deployment in networks using any unicast routing strategy.

RouterOS implements PIM-SM to support enterprise multicast applications including video conferencing, IPTV distribution, financial data feeds, and software updates. The implementation supports both IPv4 and IPv6 multicast, enabling deployment in modern dual-stack network environments.

IP Multicast is a technology that allows efficient data distribution to multiple recipients over a network. Senders transmit to a specific multicast IP address, and receivers indicate their interest in receiving data sent to that address. The network infrastructure then replicates and delivers data from senders to interested receivers without requiring the sender to maintain individual connections.

When senders and receivers reside on the same local network segment, routers are not required for multicast delivery. Communication occurs directly between hosts, and this process can be enhanced through IGMP snooping switches that optimize local multicast traffic. However, when senders and receivers are separated by network boundaries, a multicast routing protocol becomes essential to establish paths for data transmission.

PIM-SM addresses the challenges of multicast routing in sparse receiver environments. Sparse mode means that multicast data is delivered only to network segments where receivers have explicitly joined the group, avoiding the flood-and-prune behavior of dense-mode protocols. This approach dramatically reduces unnecessary traffic in networks where few hosts subscribe to multicast groups.

The protocol relies on two key components: First, routers must discover local receivers on their directly connected segments. For IPv4, this function is provided by the Internet Group Management Protocol (IGMP), while IPv6 uses Multicast Listener Discovery (MLD). Second, routers must exchange multicast routing information to build distribution trees connecting senders to receivers across the network.

RouterOS v7 includes PIM-SM configuration in the main system package, simplifying deployment for modern installations. Older RouterOS versions require an additional multicast package to be installed. The feature is not available on SMIPS devices including hAP lite, hAP lite TC, and hAP mini.

Multicast routing presents unique challenges compared to unicast routing. In unicast routing, each destination has a specific path from any source. In multicast routing, a single source may need to reach multiple receivers, potentially through different paths. The network must efficiently replicate packets at branch points while maintaining optimal paths from sources to receivers.

PIM-SM solves these challenges using a shared tree architecture anchored at a Rendezvous Point (RP). All multicast traffic initially flows through the shared tree, which provides a common distribution structure that any sender can use to reach any receiver in the group. As traffic patterns establish themselves, routers can optionally switch to shortest-path trees originating directly from sources, optimizing delivery paths for high-bandwidth or frequent streams.

The shared tree approach offers significant advantages for networks with sporadic multicast sources. Rather than maintaining source-specific state for every potential sender, routers only need to maintain state for active multicast groups. This scales efficiently to support thousands of multicast groups with relatively few active sources.

PIM-SM operates through a series of exchanged messages that build and maintain multicast distribution state throughout the network. The primary message types include Hello messages for neighbor discovery and maintenance, Join/Prune messages for group membership signaling, Bootstrap messages for RP election, and Register messages for initial source registration.

When a PIM-SM router initializes, it discovers neighboring PIM-SM routers through Hello messages exchanged on all configured interfaces. These Hello messages advertise router capabilities including priority values used in DR and BSR elections. Neighbors form adjacencies and maintain them through periodic Hello messages with configurable hold times.

When a host joins a multicast group through IGMP (IPv4) or MLD (IPv6), the local designated router (DR) receives the membership report. The DR becomes responsible for forwarding traffic for that group and initiates PIM Join messages toward the RP. These Join messages travel hop-by-hop toward the RP, creating state in each intermediate router that establishes the shared tree.

When a sender transmits to a multicast group, the local DR encapsulates the first packets in PIM Register messages and unicasts them to the RP. The RP decapsulates these packets and forwards them down the shared tree to all registered receivers. Simultaneously, the RP may trigger Join messages toward the source to establish a shortest-path tree for more efficient delivery.

As traffic flows and receivers join, the network builds state that efficiently routes multicast traffic from sources to receivers. Periodically, traffic patterns may warrant switching from the shared tree to source-specific trees, a process controlled by the SPT-bit threshold configuration.

The Rendezvous Point serves as the root of the shared tree for each multicast group. All multicast sources initially register with the RP, and all multicast receivers join through paths that converge at the RP. This centralized anchoring provides a predictable rendezvous point for sources and receivers to establish connectivity.

RP selection is a critical design decision in PIM-SM networks. The RP must be reachable from all routers in the multicast domain through the unicast routing infrastructure. Network administrators can statically configure RP addresses on all routers, or they can use the Bootstrap Router mechanism for dynamic RP election.

Static RP configuration offers simplicity and predictability. The administrator specifies one or more RP addresses, and all routers use these addresses directly. Static RP requires manual coordination when RP addresses change, making it more suitable for smaller, stable networks.

The Bootstrap Router mechanism provides dynamic RP election among candidate RPs. Routers configured as Candidate RP (C-RP) advertise their willingness to serve as RP, while routers configured as Candidate BSR (C-BSR) participate in BSR election. The elected BSR collects RP advertisements and distributes RP-set information to all PIM-SM routers in the domain.

RP failover is handled gracefully through the RP-set mechanism. When the current RP becomes unreachable, routers automatically switch to the next available RP from the RP-set without requiring manual reconfiguration. This resilience is essential for production networks requiring high availability.

PIM-SM designates specific routers to perform critical functions on each network segment. The Designated Router (DR) serves as the primary PIM router on a multi-access network segment, responsible for sending Join/Prune messages toward the RP and processing Register messages from local sources.

DR election occurs through Hello message priority values. Routers exchange priority values, and the router with the highest priority becomes the DR. In case of priority ties, the router with the highest IP address wins. The DR role provides a single point of responsibility, preventing duplicate multicast traffic from multiple routers on the same segment.

On networks with local multicast sources, the DR additionally serves as the Designated Forwarder (DF) for those sources. The DF is responsible for forwarding traffic from local sources onto the multi-access network. This prevents multiple routers from forwarding identical multicast packets, which would cause duplication and inefficiency.

PIM-SM uses several message types to establish and maintain multicast connectivity. Understanding these messages and their roles is essential for troubleshooting and optimizing PIM-SM deployments.

Hello messages serve multiple purposes in PIM-SM: neighbor discovery, adjacency maintenance, and capability negotiation. Routers transmit Hello messages periodically on all PIM-enabled interfaces at the configured Hello interval, typically 30 seconds by default.

Hello messages contain important parameters including the Hello hold time (advertising how long the sender expects Hellos to continue), DR priority (used for Designated Router election), LAN prune delay (indicating the interface’s capability to delay Join suppression), and T-bit (indicating the router’s capability to track joins for multiple sources).

When a router receives a Hello from a new neighbor, it adds the neighbor to its neighbor table and begins maintaining the adjacency. If Hellos stop arriving within the hold time, the neighbor is considered down, and all PIM state associated with that neighbor is removed.

Join and Prune messages are the primary mechanisms for group membership signaling in PIM-SM. Join messages request that upstream routers add the sending router to the distribution tree for specified multicast groups. Prune messages request removal from distribution trees when receivers leave groups.

Join/Prune messages travel upstream toward the RP for (*,G) joins, or toward the source for (S,G) joins. Each message specifies one or more multicast groups and the interfaces through which traffic should be forwarded or withheld.

On multi-access networks, Join suppression occurs when multiple routers have downstream members for the same group. Only the router with the highest DR priority sends Join messages upstream, and other routers suppress their Joins knowing the designated router will maintain the shared tree.

The Bootstrap Router mechanism provides dynamic RP election in PIM-SM domains. Candidate BSR routers participate in BSR election through Bootstrap messages, with the highest priority BSR eventually elected to collect and distribute RP information.

Candidate RP routers advertise their willingness to serve as RP to the elected BSR through Candidate-RP Advertisement messages. These advertisements include the RP address, the multicast groups for which the router can serve as RP, and the RP priority.

The BSR compiles RP information from all Candidate RPs into an RP-set and distributes this set to all PIM-SM routers in the domain through Bootstrap messages. All routers then use consistent RP selection rules to determine the best RP for each multicast group.

Register messages transport multicast traffic from sources to the RP when sources and receivers are separated by PIM-SM routers. The local DR encapsulates the first multicast packet in a Register message and unicasts it to the RP.

Upon receiving a Register message, the RP decapsulates the packet and forwards it down the shared tree to all interested receivers. The RP also sends a Join message toward the source to establish a source-specific tree for more efficient delivery.

When the RP receives sufficient traffic via the source-specific tree, it sends a Register-Stop message to the source DR, instructing it to stop encapsulating packets. Subsequent traffic flows natively through the source-specific tree without encapsulation overhead.

PIM-SM configuration in RouterOS involves creating instances, defining interfaces, and optionally configuring RP selection mechanisms. This section covers basic and advanced configuration scenarios.

For simple multicast scenarios where a single router connects multicast sources and receivers, basic PIM-SM configuration requires minimal steps. This configuration enables the router to respond to IGMP reports and route multicast traffic between connected networks.

Begin by ensuring IP addresses are configured on router interfaces:

/ip address
add address=192.168.10.1/24 interface=ether1 network=192.168.10.0
add address=192.168.20.1/24 interface=ether2 network=192.168.20.0

Configure a PIM-SM instance using default settings:

/routing pimsm instance
add name=pimsm-instance-1

Add interfaces to the PIM-SM instance using interface templates:

/routing pimsm interface-template
add interfaces=ether1,ether2 instance=pimsm-instance-1

The router now listens for IGMP membership reports on configured interfaces and routes multicast traffic between networks with interested receivers. Use the following commands to verify the configuration:

# View active multicast groups
/routing pimsm uib-g print
# View multicast sources and group state
/routing pimsm uib-sg print

For networks requiring manual RP control, static RP configuration provides predictable RP selection without Bootstrap Router complexity. All routers in the PIM-SM domain must be configured with the same static RP information.

Configure the RP address on the designated RP router:

/routing pimsm static-rp
add address=10.0.0.1 instance=pimsm-instance-1

On all other routers in the domain, configure the same RP address:

/routing pimsm static-rp
add address=10.0.0.1 instance=pimsm-instance-1

Multiple static RPs can be configured for the same multicast group range, providing failover capability:

/routing pimsm static-rp
add address=10.0.0.1 instance=pimsm-instance-1
add address=10.0.0.2 instance=pimsm-instance-1

The RP with the lowest IP address is preferred when multiple RPs serve the same group range. This ordering can be modified by adding RPs with explicit priority values:

/routing pimsm static-rp
add address=10.0.0.1 instance=pimsm-instance-1 priority=200
add address=10.0.0.2 instance=pimsm-instance-1 priority=100

For larger networks where static RP management becomes burdensome, the Bootstrap Router mechanism provides dynamic RP election. Configure Candidate RP and Candidate BSR routers as needed.

Configure a router as Candidate RP:

/routing pimsm instance
set pimsm-instance-1 c-rp=yes

Configure the Candidate RP interface and priority:

/routing pimsm instance
set pimsm-instance-1 c-rp-interface=loopback c-rp-priority=192

Configure Candidate BSR routers to participate in BSR election:

/routing pimsm instance
set pimsm-instance-1 c-bsr=yes
/routing pimsm instance
set pimsm-instance-1 c-bsr-interface=loopback c-bsr-priority=64

Verify BSR and RP election results:

# View elected BSR
/routing pimsm bsr print
# View active RPs
/routing pimsm rp print

Interface templates define how PIM-SM operates on router interfaces. Multiple templates can apply different configurations to different interface sets.

Basic interface template configuration:

/routing pimsm interface-template
add instance=pimsm-instance-1 interfaces=ether1,ether2 priority=1

ConfigureHello and override intervals on specific interfaces:

/routing pimsm interface-template
add instance=pimsm-instance-1 interfaces=ether1 hello-interval=30s hello-holdtime=105s

Disable PIM-SM on specific interfaces within a template range by excluding them:

/routing pimsm interface-template
add instance=pimsm-instance-1 interfaces=ether1,ether2,ether3 exclude-interfaces=ether3

Source-Specific Multicast (SSM) provides simplified multicast where receivers specify both group and source. This eliminates RP dependency for SSM groups and provides sender-specific security.

Configure SSM address range:

/routing pimsm instance
set pimsm-instance-1 ssm-range=232.0.0.0/8

With SSM configured, receivers join specific (S,G) channels rather than (*,G) groups. The router does not require RP configuration for SSM groups.

BSR boundaries restrict Bootstrap message propagation between network segments, limiting RP election scope for administrative purposes.

Configure BSR boundary on an interface:

/routing pimsm interface-template
add interfaces=ether1 instance=pimsm-instance-1 bsr-boundary=yes

BSR messages are not forwarded across boundary interfaces, isolating RP election within the bounded region.

Multicast boundaries control which multicast traffic can cross interface boundaries, implementing access control and traffic engineering policies.

Configure multicast boundary on an interface:

/routing pimsm interface-template
add interfaces=ether1 instance=pimsm-instance-1 multicast-boundary=239.0.0.0/8

Traffic matching the boundary ACL is either permitted or denied based on policy configuration.

ParameterDefaultDescription
name(required)Instance identifier
disablednoDisable instance
c-rpnoEnable Candidate RP
c-rp-interfaceInterface for C-RP advertisements
c-rp-priority192C-RP priority (lower is preferred)
c-rp-holdtime150sC-RP advertisement hold time
c-bsrnoEnable Candidate BSR
c-bsr-interfaceInterface for C-BSR advertisements
c-bsr-priority0C-BSR priority (higher is preferred)
bsr-addressStatic BSR address override
ssm-rangeSSM address range (e.g., 232.0.0.0/8)
ParameterDefaultDescription
interfaces(required)Comma-separated interface list
exclude-interfacesInterfaces to exclude from template
instance(required)PIM-SM instance reference
priority1DR election priority (higher is preferred)
hello-interval30sHello message interval
hello-holdtime105sHello hold time
dr-priority1Designated Router priority
bsr-boundarynoEnable BSR boundary
multicast-boundaryMulticast address boundary
disablednoDisable template
ParameterDefaultDescription
address(required)RP IPv4 address
instance(required)Instance reference
group224.0.0.0/4Multicast group range
priority192RP priority for this group
disablednoDisable static RP entry
CommandDescription
/routing pimsm neighbor printView PIM neighbors
/routing pimsm bsr printView elected BSR
/routing pimsm rp printView active RPs
/routing pimsm uib-g printView (*,G) join state
/routing pimsm uib-sg printView (S,G) join state
/routing pimsm interface-template printView interface templates

When PIM-SM neighbors fail to establish, verify basic connectivity and configuration alignment.

Verify interface configuration - Ensure PIM-SM is enabled on both endpoints:

/routing pimsm interface-template/print

Check connectivity - Verify IP reachability between routers:

ping 10.0.0.2

Verify PIM-SM is running - Check that the instance is enabled and interfaces are active:

/routing pimsm instance/print

Check firewall rules - Ensure PIM protocol (103) and IGMP (2) traffic is permitted:

/ip/firewall/filter/print chain=forward protocol=pim

When multicast traffic fails to reach receivers, trace the distribution tree state.

Verify IGMP membership - Check that receivers have joined groups:

/routing gmp/print

Check join state - Verify (*,G) and (S,G) state exists:

/routing pimsm uib-g print
/routing pimsm uib-sg print

Trace toward RP - Follow Join messages upstream to identify missing state:

/routing pimsm neighbor print

Verify RP reachability - Ensure all routers can reach the RP:

ping 10.0.0.1

Check interface traffic - Use torch to observe multicast packets:

/tool torch interface=ether1 protocol=udp dst-port=any

When Bootstrap Router or RP election fails, verify candidate configuration and message propagation.

Verify Candidate RP configuration - Check that C-RP is properly configured:

/routing pimsm instance/print where c-rp=yes

Check BSR election - Verify C-BSR participation:

/routing pimsm instance/print where c-bsr=yes

View RP cache - Examine learned RP information:

/routing pimsm rp print

Debug BSR messages - Enable PIM-SM debugging:

/system logging add topics=routing,pimsm,debug
# View all PIM-SM neighbors and status
/routing pimsm neighbor print detail
# Monitor neighbor changes in real-time
/routing pimsm neighbor/monitor
# View interface template status
/routing pimsm interface-template/print detail
# Check RP-set information
/routing pimsm rp print detail
# View multicast routing table
/routing multicast print
# Monitor active multicast groups
/routing pimsm uib-g print
/routing pimsm uib-sg print

PIM-SM timer values affect convergence speed and protocol overhead. Hello intervals and hold times should balance responsiveness against protocol traffic. For most deployments, default values provide adequate performance.

Dense networks with many PIM neighbors may benefit from longer Hello intervals to reduce protocol traffic. Increase Hello interval to 60s or 90s on stable networks:

/routing pimsm interface-template
set [find] hello-interval=60s hello-holdtime=180s

Time-sensitive applications may require faster failure detection. Decrease Hello interval to 10s on critical links:

/routing pimsm interface-template
set [find] hello-interval=10s hello-holdtime=30s

PIM-SM maintains state for each multicast group with active receivers. Large-scale multicast deployments require appropriate resources.

Each active multicast group requires memory for (*,G) state on routers along the shared tree. Additional (S,G) state is created for sources on shortest-path trees. Monitor memory usage when deploying thousands of concurrent multicast groups:

/system/resource/print

On routers with limited memory, consider SSM deployment which eliminates (*,G) state and only maintains (S,G) state for actively used source-receiver pairs.

Interface templates with many interfaces increase PIM-SM processing requirements. Consider splitting templates by interface function:

# High-priority interfaces (trunk links)
add interfaces=ether1,ether2 instance=pimsm-instance-1 priority=10
# Standard interfaces (access links)
add interfaces=ether3-ether10 instance=pimsm-instance-1 priority=1

RP routers represent central points of failure and attack in PIM-SM networks. Protect RP routers through physical and logical security measures.

Deploy RPs on secure network segments with restricted access. Use access lists to permit only authorized PIM traffic:

/ip/firewall/filter/add chain=forward protocol=pim action=accept
/ip/firewall/filter/add chain=forward protocol=pim action=drop

Consider deploying multiple RPs to provide redundancy and load distribution across secure infrastructure.

PIM-SM lacks native message authentication in RouterOS. Networks requiring message integrity should deploy authentication at lower layers.

Use IPsec AH or ESP to authenticate all PIM traffic between routers:

/ip/ipsec/policy add src-address=10.0.0.0/24 dst-address=10.0.1.0/24 \
sa-src-address=10.0.0.1 sa-dst-address=10.0.1.1 \
proposal=default authentication=-sha1

Deploy within controlled network boundaries where unauthorized PIM routers cannot inject false messages.

Local receiver management through IGMP and MLD should be protected against spoofing.

Deploy IGMP snooping switches to filter unauthorized IGMP reports on access ports:

/interface/bridge/settings set use-ip-firewall=no
/interface/bridge/port set [find] pvid=1

Use IGMP querier configuration to ensure only authorized routers send queries:

/routing gmp set query-interval=125s
  1. Deploy redundant RPs with appropriate priority separation to ensure rapid failover during RP failures.

  2. Use static RP for small, stable networks to eliminate BSR complexity. Use BSR for larger networks requiring dynamic RP management.

  3. Configure consistent hello and hold times across all PIM-SM routers to ensure predictable neighbor failure detection.

  4. Monitor multicast group membership patterns to appropriately size RP resources and network capacity.

  5. Deploy PIM-SM only on devices with adequate CPU and memory for expected multicast scale.

  6. Use SSM for applications where receivers specify both group and source, eliminating RP dependency and improving security.

  7. Document RP addresses, BSR candidates, and multicast group policies for operational reference.

  8. Test multicast functionality regularly using traffic generators and receivers to verify operational readiness.

  9. Consider multicast boundaries to limit scope of multicast traffic and implement access control.

  10. Deploy IGMP snooping switches on access networks to optimize local multicast traffic distribution.

  • IGMP - Internet Group Management Protocol for IPv4 multicast receiver management
  • MLD - Multicast Listener Discovery for IPv6 multicast receiver management
  • GMP - Group Management Protocol for multicast group configuration
  • OSPF - Unicast routing often used with PIM-SM
  • BGP - BGP multicast address family for inter-domain multicast
  • Multicast Routing - General multicast routing concepts and RouterOS implementation