Skip to main content

Multicast

·
ccie notes
Hugo
Author
Hugo
DevOps Engineer in London
Table of Contents

PIM Setup
#

Router Configuration:

Enable multicast functionality on the router:

ip multicast-routing

Enable PIM on interfaces that will handle multicast traffic. You can choose between sparse mode and dense mode.

interface GigabitEthernet0/0
ip pim dense-mode

or

interface GigabitEthernet0/0
ip pim sparse-mode

Set IGMP Version (if needed): IGMP version 3 is required for Source-Specific Multicast (SSM).

interface GigabitEthernet0/0
ip igmp version 3

End Device Configuration:

For devices that want to receive multicast traffic:

Join a Multicast Group:

interface GigabitEthernet0/0
ip igmp join-group 239.1.1.1

Set IGMP Version: Ensure the IGMP version matches the network configuration.

interface GigabitEthernet0/0
ip igmp version 3

Switch Configuration:

Enable IGMP snooping on the switch to optimize multicast traffic:

interface Ethernet0/0
ip igmp snooping

PIM-DM (Dense Mode)
#

PIM-DM operates on the assumption that almost every subnet in the network has at least one receiver interested in the multicast traffic. This “dense” assumption leads to its flood-and-prune behavior.

Initial Flooding:

  1. When a source starts sending multicast traffic, routers flood this traffic to all PIM-enabled interfaces.
  2. This flooding occurs regardless of whether there are interested receivers or not.

Pruning :

  1. If a router has no interested receivers (determined by IGMP), it sends a PIM Prune message upstream.
  2. This Prune message tells the upstream router to stop forwarding multicast traffic for that group on that interface.
  3. The pruned state is temporary and will time out, allowing the process to restart.

State Refresh:

  1. PIM-DM uses State Refresh messages to maintain the pruned state without requiring the flood-and-prune cycle to repeat frequently.
  2. The router closest to the source sends these messages periodically (typically every 60 seconds).
  3. When a downstream router receives a State Refresh message:
  • If its state matches the prune flag in the message, it refreshes its prune timer.
  • If its state doesn’t match (e.g., it now has interested receivers), it may send a Graft message to rejoin the distribution tree.

Example:

  1. PC1 pings 239.1.1.1 (acting as a multicast source).
  2. PC2 and PC3 have joined the 239.1.1.1 group.
  3. Initially, all PIM-DM enabled routers flood this traffic.
  4. Routers without interested receivers (those not on paths to PC2 or PC3) send Prune messages upstream.
  5. Periodically, State Refresh messages are sent to maintain the pruned state without full reflooding.

PIM-SM (Sparse Mode)
#

In Sparse Mode, multicast traffic is not flooded throughout the network. Instead, it uses a more efficient approach, leveraging the Rendezvous Point (RP) as a central meeting point for multicast sources and receivers.

There are few way to setup RP:

  1. Static RP: Manually configure a fixed RP.
  2. Auto-RP: Automatically select RP candidates using mapping agent.
  3. BSR (Bootstrap Router): Dynamically select RP candidates using BSR.

The multicast traffic will flow:

  • End devices interested in a multicast group send a PIM (*,G) Join message to the RP. This sets up the shared tree with the RP as the root.
  • From Source to RP: Multicast traffic is encapsulated into unicast packets and sent directly to the RP using PIM Register messages. The RP decapsulates the traffic and forwards it to the downstream receivers.
  • From RP to Destination: Multicast traffic flows from the RP to the destination using the shared tree.
  • To improve efficiency, the RP or the last-hop router may send a PIM (S,G) Join message to the source to build a source-specific tree. This tree uses the source as the root and avoids involving the RP.
  • The RP may send a Register-Stop message to the source, instructing it to send multicast traffic directly instead of encapsulating it into unicast.

These PIM Join Messages will build unidirectional trees:

  • Shared Tree: Multicast traffic flows downstream from the RP to the destination.
  • Source-Specific Tree: Traffic flows directly between the source and the destination, bypassing the RP.

Reverse Path Forwarding (RPF)
#

To ensures that multicast traffic follows the best path back to the source.

Each hop in the shared tree performs an RPF check to verify that the traffic is coming from the correct interface.

RPF is also a crucial mechanism in multicast routing for preventing loops.

For example, in a shared tree, PIM-Join messages are sent from the destination (receiver) towards the RP.

At each hop, the router checks its unicast routing table for the best path to the RP and forwards the message on that interface.

Loop Prevention:

  • The RPF check ensures that multicast traffic is only forwarded if it arrives on the expected incoming interface.

For Example:

Consider a network where Router A is connected to both B and C, forming a potential loop:

A <-> B
   |
   v
   C

If multicast traffic flow the path A -> C -> B, Router B will drop the traffic. This is because RPF check fails - from B’s point of view, the traffic source from A should go via A -> B not from C -> B.

This mechanism ensures that multicast traffic always flows along the most efficient path from the source to the receivers, preventing unnecessary traffic duplication and potential network congestion caused by routing loops.

Static RP
#

In static RP configuration, we manually specify the RP address on each multicast router.

This method is simple but lacks scalability and redundancy. If the RP becomes unavailable, multicast traffic may be disrupted.

Example:

On a multicast router, configure a static RP with the following command:

ip pim rp-address 10.1.34.3

Dynamic RP
#

Dynamic RP selection methods, such as Auto-RP and Bootstrap Router (BSR), provide scalability and redundancy by allowing multiple routers to serve as RPs. These methods automatically distribute RP information to multicast routers, improving the network’s resilience and efficiency.

Auto-RP
#

Auto-RP uses a Mapping Agent to collect and distribute RP information. This method requires configuration on multicast routers, RP candidates, and the Mapping Agent.

On Multicast Routers:

Enable Auto-RP listening with:

ip pim autorp listener

On RP Candidate:

Configure the RP candidate to announce itself with:

ip pim send-rp-announce loopback 0 scope 255

On Mapping Agent:

Set up the Mapping Agent to discover RP candidates with:

ip pim send-rp-discovery loopback 0 scope 255

BSR
#

BSR uses a Bootstrap Router to distribute RP information. This method is more commonly used in modern networks due to its simplicity and efficiency.

On RP Candidate:

Configure the RP candidate with:

ip pim rp-candidate loopback 0

On BSR Candidate:

Set up the BSR candidate with:

ip pim bsr-candidate loopback 0

BIDIR-PIM
#

Bidirectional PIM (BIDIR-PIM) is an enhancement to traditional PIM Sparse Mode, designed to improve efficiency in multicast networks.

  • BIDIR-PIM constructs a single bidirectional shared tree rooted at the RP.
  • Unlike PIM-SM, which uses both shared trees and source-specific trees, BIDIR-PIM only uses shared trees, allowing traffic to flow in both directions.
  • To prevent loops and manage traffic direction, BIDIR-PIM introduces the concept of a Designated Forwarder (DF).
  • On each network segment, a DF is elected based on the best unicast routing metric to the RP, similar to OSPF’s Designated Router (DR).
  • The DF is responsible for forwarding multicast traffic on its segment, ensuring aloop-free topology.
  • By using a single shared tree for both sources and receivers, BIDIR-PIM reduces the amount of state information that routers need to maintain.

When a source starts sending multicast traffic:

Source to RP:

  • The first-hop router receives the traffic.
  • When a router receives multicast traffic on a network segment, it checks whether it is the DF for that segment.
  • If the router is the DF for the incoming interface, it is responsible for forwarding the multicast traffic.
  • The DF forwards the traffic to all other interfaces on which it is also the DF (using its ip route).

RP to Destination:

  • use share tree to forward traffic to the destination

Configuration:

To enable BIDIR-PIM, we just need to add ip pim bidir-enable on all routers in the network.